diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/CHANGELOG.md b/sdk/machinelearning/azure-resourcemanager-machinelearning/CHANGELOG.md index 22cf70d8f2233..e04ebc458f98d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/CHANGELOG.md +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/CHANGELOG.md @@ -1,14 +1,2814 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2024-07-10) -### Features Added +- Azure Resource Manager Machine Learning client library for Java. This package contains Microsoft Azure SDK for Machine Learning Management SDK. These APIs allow end users to operate on Azure Machine Learning Workspace resources. Package tag package-preview-2024-07. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +* `models.AmlOperation` was removed + +* `models.AmlOperationListResult` was removed + +* `models.AmlOperationDisplay` was removed + +#### `models.ComponentContainer$DefinitionStages` was modified + +* `withExistingWorkspace(java.lang.String,java.lang.String)` was removed in stage 1 + +#### `models.DataContainer$DefinitionStages` was modified + +* `withExistingWorkspace(java.lang.String,java.lang.String)` was removed in stage 1 + +#### `models.EnvironmentContainer$DefinitionStages` was modified + +* `withExistingWorkspace(java.lang.String,java.lang.String)` was removed in stage 1 + +#### `models.ModelContainer$DefinitionStages` was modified + +* `withExistingWorkspace(java.lang.String,java.lang.String)` was removed in stage 1 + +#### `models.CodeContainer$DefinitionStages` was modified + +* `withExistingWorkspace(java.lang.String,java.lang.String)` was removed in stage 1 + +#### `models.CodeVersions` was modified + +* `deleteById(java.lang.String)` was removed +* `getByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed +* `getById(java.lang.String)` was removed +* `define(java.lang.String)` was removed +* `deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed +* `list(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.Integer,java.lang.String,com.azure.core.util.Context)` was removed + +#### `models.ComponentContainers` was modified + +* `define(java.lang.String)` was removed +* `getById(java.lang.String)` was removed +* `getByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed +* `deleteById(java.lang.String)` was removed +* `deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed + +#### `models.DataContainer$Definition` was modified + +* `withExistingWorkspace(java.lang.String,java.lang.String)` was removed + +#### `models.DataContainers` was modified + +* `getById(java.lang.String)` was removed +* `deleteById(java.lang.String)` was removed +* `define(java.lang.String)` was removed +* `getByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed +* `deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed + +#### `models.ComputeStartStopSchedule` was modified + +* `models.CronTrigger cron()` -> `models.Cron cron()` +* `models.TriggerType triggerType()` -> `models.ComputeTriggerType triggerType()` +* `withRecurrence(models.RecurrenceTrigger)` was removed +* `models.RecurrenceTrigger recurrence()` -> `models.Recurrence recurrence()` +* `withCron(models.CronTrigger)` was removed +* `withTriggerType(models.TriggerType)` was removed + +#### `models.Workspaces` was modified + +* `deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed +* `deleteByResourceGroup(java.lang.String,java.lang.String)` was removed +* `delete(java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed + +#### `models.EnvironmentContainers` was modified + +* `deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed +* `define(java.lang.String)` was removed +* `deleteById(java.lang.String)` was removed +* `getById(java.lang.String)` was removed +* `getByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed + +#### `models.ModelContainer$Definition` was modified + +* `withExistingWorkspace(java.lang.String,java.lang.String)` was removed + +#### `models.CodeContainer$Definition` was modified + +* `withExistingWorkspace(java.lang.String,java.lang.String)` was removed + +#### `models.Datastores` was modified + +* `listSecretsWithResponse(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed + +#### `models.EnvironmentContainer$Definition` was modified + +* `withExistingWorkspace(java.lang.String,java.lang.String)` was removed + +#### `models.Datastore` was modified + +* `listSecretsWithResponse(com.azure.core.util.Context)` was removed + +#### `models.PrivateEndpoint` was modified + +* `subnetArmId()` was removed + +#### `MachineLearningManager` was modified + +* `fluent.AzureMachineLearningWorkspaces serviceClient()` -> `fluent.AzureMachineLearningServices serviceClient()` + +#### `models.WorkspaceUpdateParameters` was modified + +* `validate()` was removed +* `java.util.Map tags()` -> `java.util.Map tags()` +* `models.Sku sku()` -> `models.Sku sku()` +* `withPrimaryUserAssignedIdentity(java.lang.String)` was removed +* `models.ServiceManagedResourcesSettings serviceManagedResourcesSettings()` -> `models.ServiceManagedResourcesSettings serviceManagedResourcesSettings()` +* `models.ManagedServiceIdentity identity()` -> `models.ManagedServiceIdentity identity()` +* `withImageBuildCompute(java.lang.String)` was removed +* `withContainerRegistry(java.lang.String)` was removed +* `withPublicNetworkAccess(models.PublicNetworkAccess)` was removed +* `java.lang.String primaryUserAssignedIdentity()` -> `java.lang.String primaryUserAssignedIdentity()` +* `withFriendlyName(java.lang.String)` was removed +* `withIdentity(models.ManagedServiceIdentity)` was removed +* `java.lang.String containerRegistry()` -> `java.lang.String containerRegistry()` +* `java.lang.String description()` -> `java.lang.String description()` +* `withDescription(java.lang.String)` was removed +* `withSku(models.Sku)` was removed +* `models.PublicNetworkAccess publicNetworkAccess()` -> `models.PublicNetworkAccess publicNetworkAccess()` +* `withApplicationInsights(java.lang.String)` was removed +* `java.lang.String applicationInsights()` -> `java.lang.String applicationInsights()` +* `java.lang.String friendlyName()` -> `java.lang.String friendlyName()` +* `withServiceManagedResourcesSettings(models.ServiceManagedResourcesSettings)` was removed +* `java.lang.String imageBuildCompute()` -> `java.lang.String imageBuildCompute()` +* `withTags(java.util.Map)` was removed + +#### `models.ComponentVersions` was modified + +* `deleteById(java.lang.String)` was removed +* `deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed +* `getById(java.lang.String)` was removed +* `define(java.lang.String)` was removed +* `getByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed + +#### `models.CodeContainers` was modified + +* `define(java.lang.String)` was removed +* `deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed +* `getByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed +* `getById(java.lang.String)` was removed +* `deleteById(java.lang.String)` was removed + +#### `models.Jobs` was modified + +* `list(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,models.ListViewType,com.azure.core.util.Context)` was removed + +#### `models.DataVersions` was modified + +* `define(java.lang.String)` was removed +* `getById(java.lang.String)` was removed +* `deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed +* `deleteById(java.lang.String)` was removed +* `getByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed + +#### `models.EnvironmentVersions` was modified + +* `getById(java.lang.String)` was removed +* `getByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed +* `deleteById(java.lang.String)` was removed +* `deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed +* `define(java.lang.String)` was removed + +#### `models.ComponentContainer$Definition` was modified + +* `withExistingWorkspace(java.lang.String,java.lang.String)` was removed + +#### `models.ModelVersions` was modified + +* `deleteById(java.lang.String)` was removed +* `getByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed +* `define(java.lang.String)` was removed +* `getById(java.lang.String)` was removed +* `deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed + +#### `models.ModelContainers` was modified + +* `getById(java.lang.String)` was removed +* `deleteById(java.lang.String)` was removed +* `getByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed +* `deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed +* `define(java.lang.String)` was removed + +### Features Added + +* `models.SystemCreatedStorageAccount` was added + +* `models.Registry$Definition` was added + +* `models.NodesValueType` was added + +* `models.MonitoringFeatureFilterType` was added + +* `models.DataAvailabilityStatus` was added + +* `models.FeaturesetVersionBackfillResponse` was added + +* `models.LakeHouseArtifact` was added + +* `models.OperationListResult` was added + +* `models.ServerlessEndpoint$Update` was added + +* `models.NumericalDataDriftMetric` was added + +* `models.ServerlessEndpoint` was added + +* `models.NumericalPredictionDriftMetric` was added + +* `models.WorkspaceConnectionAccessKey` was added + +* `models.DestinationAsset` was added + +* `models.ManagedIdentityCredential` was added + +* `models.ServerlessComputeSettings` was added + +* `models.FeaturestoreEntityVersions` was added + +* `models.MonitoringFeatureFilterBase` was added + +* `models.OutboundRuleBasicResource$Update` was added + +* `models.DataDriftMonitoringSignal` was added + +* `models.MonitorNotificationSettings` was added + +* `models.WorkspaceHubConfig` was added + +* `models.FeaturesetVersionProperties` was added + +* `models.MaterializationComputeResource` was added + +* `models.FeaturestoreEntityVersion$DefinitionStages` was added + +* `models.ManagedComputeIdentity` was added + +* `models.AcrDetails` was added + +* `models.CategoricalPredictionDriftMetric` was added + +* `models.MarketplaceSubscription` was added + +* `models.TmpfsOptions` was added + +* `models.DockerCredential` was added + +* `models.Registry` was added + +* `models.CategoricalPredictionDriftMetricThreshold` was added + +* `models.FeaturesetContainer$Definition` was added + +* `models.CustomMetricThreshold` was added + +* `models.MarketplaceSubscriptionProperties` was added + +* `models.SparkJobScalaEntry` was added + +* `models.FeaturesetVersion$Definition` was added + +* `models.FeatureDataType` was added + +* `models.MarketplaceSubscriptions` was added + +* `models.SparkJobEntry` was added + +* `models.AssetProvisioningState` was added + +* `models.EncryptionUpdateProperties` was added + +* `models.CategoricalDataDriftMetric` was added + +* `models.ServerlessEndpointTrackedResourceArmPaginatedResult` was added + +* `models.Image` was added + +* `models.MonitorComputeConfigurationBase` was added + +* `models.MarketplaceSubscription$Definition` was added + +* `models.FeaturestoreEntityContainerResourceArmPaginatedResult` was added + +* `models.WorkspaceConnectionApiKey` was added + +* `models.Collection` was added + +* `models.PendingUploadCredentialType` was added + +* `models.OperationDisplay` was added + +* `models.PrivateEndpointResource` was added + +* `models.SystemCreatedAcrAccount` was added + +* `models.MonitorDefinition` was added + +* `models.RegistryComponentVersions` was added + +* `models.MarketplacePlan` was added + +* `models.ManagedNetworkSettingsRules` was added + +* `models.OneLakeDatastore` was added + +* `models.ServerlessEndpoint$DefinitionStages` was added + +* `models.FeatureImportanceSettings` was added + +* `models.FeatureResourceArmPaginatedResult` was added + +* `models.FeaturesetSpecification` was added + +* `models.ManagedNetworkProvisions` was added + +* `models.AzureDevOpsWebhook` was added + +* `models.MonitoringSignalType` was added + +* `models.EnvironmentVariableType` was added + +* `models.DataDriftMetricThresholdBase` was added + +* `models.MonitoringSignalBase` was added + +* `models.Docker` was added + +* `models.NumericalPredictionDriftMetricThreshold` was added + +* `models.ArmResourceId` was added + +* `models.RegistryEnvironmentContainers` was added + +* `models.ServicePrincipalAuthTypeWorkspaceConnectionProperties` was added + +* `models.Origin` was added + +* `models.PrivateEndpointOutboundRule` was added + +* `models.MarketplaceSubscriptionResourceArmPaginatedResult` was added + +* `models.DataCollectionMode` was added + +* `models.Nodes` was added + +* `models.BindOptions` was added + +* `models.RegistryCodeContainers` was added + +* `models.AllFeatures` was added + +* `models.RegistryEnvironmentVersions` was added + +* `models.DataReferenceCredential` was added + +* `models.PredictionDriftMonitoringSignal` was added + +* `models.OAuth2AuthTypeWorkspaceConnectionProperties` was added + +* `models.FeatureProperties` was added + +* `models.FeaturesetVersions` was added + +* `models.FeaturesetVersion$Update` was added + +* `models.VolumeDefinitionType` was added + +* `models.Operation` was added + +* `models.DataQualityMonitoringSignal` was added + +* `models.RegistryPartialManagedServiceIdentity` was added + +* `models.TopNFeaturesByAttribution` was added + +* `models.Registries` was added + +* `models.FeaturestoreEntityVersion$Definition` was added + +* `models.MarketplaceSubscription$DefinitionStages` was added + +* `models.Feature` was added + +* `models.RuleAction` was added + +* `models.ContentSafetyStatus` was added + +* `models.ConnectionGroup` was added + +* `models.RegistryPrivateEndpointConnection` was added + +* `models.GetBlobReferenceSasRequestDto` was added + +* `models.BatchDeploymentConfigurationType` was added + +* `models.StorageAccountDetails` was added + +* `models.RegistryRegionArmDetails` was added + +* `models.EncryptionKeyVaultUpdateProperties` was added + +* `models.FeaturesetVersion$DefinitionStages` was added + +* `models.MonitorComputeType` was added + +* `models.StaticInputData` was added + +* `models.JobResources` was added + +* `models.SparkJobEntryType` was added + +* `models.UserCreatedAcrAccount` was added + +* `models.ServerlessEndpoints` was added + +* `models.VolumeOptions` was added + +* `models.FeaturestoreEntityVersionResourceArmPaginatedResult` was added + +* `models.RegistryCodeVersions` was added + +* `models.FeatureImportanceMode` was added + +* `models.MarketplaceSubscriptionProvisioningState` was added + +* `models.MonitoringTarget` was added + +* `models.QueueSettings` was added + +* `models.RegistryDataContainers` was added + +* `models.FeatureAttributionMetricThreshold` was added + +* `models.Protocol` was added + +* `models.ActionType` was added + +* `models.ComputeRecurrenceSchedule` was added + +* `models.Registry$Update` was added + +* `models.MarketplaceSubscriptionStatus` was added + +* `models.MonitorServerlessSparkCompute` was added + +* `models.ApiKeyAuthWorkspaceConnectionProperties` was added + +* `models.AnonymousAccessCredential` was added + +* `models.ManagedNetworkSettings` was added + +* `models.MarketplaceSubscription$Update` was added + +* `models.MaterializationSettings` was added + +* `models.Recurrence` was added + +* `models.FineTuningJob` was added + +* `models.Registry$UpdateStages` was added + +* `models.OutboundRuleListResult` was added + +* `models.WorkspaceConnectionServicePrincipal` was added + +* `models.ModelProvider` was added + +* `models.Webhook` was added + +* `models.DataReferenceCredentialType` was added + +* `models.RegistryDataReferences` was added + +* `models.AzureOpenAiHyperParameters` was added + +* `models.PrivateEndpointDestination` was added + +* `models.MarketplaceSubscription$UpdateStages` was added + +* `models.OneLakeArtifact` was added + +* `models.FineTuningTaskType` was added + +* `models.FeaturestoreEntityContainer$UpdateStages` was added + +* `models.ServerlessEndpointProperties` was added + +* `models.ImageMetadata` was added + +* `models.CustomKeysWorkspaceConnectionProperties` was added + +* `models.FeaturestoreEntityContainer` was added + +* `models.CustomKeys` was added + +* `models.FeatureStoreSettings` was added + +* `models.WebhookType` was added + +* `models.AccountKeyAuthTypeWorkspaceConnectionProperties` was added + +* `models.CustomModelFineTuning` was added + +* `models.ManagedNetworkProvisionOptions` was added + +* `models.SparkJob` was added + +* `models.ServerlessEndpointState` was added + +* `models.WorkspacePropertiesUpdateParameters` was added + +* `models.ComputeRuntimeDto` was added + +* `models.FeatureWindow` was added + +* `models.Cron` was added + +* `models.RuleCategory` was added + +* `models.FeatureSubset` was added + +* `models.PendingUploadRequestDto` was added + +* `models.RuleStatus` was added + +* `models.RegistryComponentContainers` was added + +* `models.DataCollector` was added + +* `models.WorkspaceConnectionAccountKey` was added + +* `models.MonitoringInputDataBase` was added + +* `models.Features` was added + +* `models.AccessKeyAuthTypeWorkspaceConnectionProperties` was added + +* `models.CategoricalDataQualityMetricThreshold` was added + +* `models.MaterializationStoreType` was added + +* `models.CustomService` was added + +* `models.AadAuthTypeWorkspaceConnectionProperties` was added + +* `models.BlobReferenceForConsumptionDto` was added + +* `models.VolumeDefinition` was added + +* `models.ModelTaskType` was added + +* `models.FeaturestoreEntityVersion` was added + +* `models.FeaturestoreEntityContainer$Update` was added + +* `models.ServerlessInferenceEndpoint` was added + +* `models.FeaturesetVersionBackfillRequest` was added + +* `models.ServerlessEndpoint$Definition` was added + +* `models.PendingUploadResponseDto` was added + +* `models.RegistryDataVersions` was added + +* `models.OutboundRule` was added + +* `models.ModelSettings` was added + +* `models.OneLakeArtifactType` was added + +* `models.Endpoint` was added + +* `models.MonitoringThreshold` was added + +* `models.MonitoringInputDataType` was added + +* `models.RollingInputData` was added + +* `models.AzureOpenAiFineTuning` was added + +* `models.GetBlobReferenceSasResponseDto` was added + +* `models.Registry$DefinitionStages` was added + +* `models.FeaturesetVersion$UpdateStages` was added + +* `models.FeaturestoreEntityContainers` was added + +* `models.ComputeRecurrenceFrequency` was added + +* `models.IndexColumn` was added + +* `models.CategoricalDataDriftMetricThreshold` was added + +* `models.NumericalDataQualityMetricThreshold` was added + +* `models.FeaturestoreEntityContainer$DefinitionStages` was added + +* `models.FeaturesetContainers` was added + +* `models.PredictionDriftMetricThresholdBase` was added + +* `models.JobTier` was added + +* `models.GetBlobReferenceForConsumptionDto` was added + +* `models.FeaturestoreEntityVersion$Update` was added + +* `models.MonitorEmailNotificationSettings` was added + +* `models.SasCredential` was added + +* `models.NotificationSetting` was added + +* `models.BatchDeploymentConfiguration` was added + +* `models.SasCredentialDto` was added + +* `models.ServiceTagOutboundRule` was added + +* `models.IsolationMode` was added + +* `models.UserCreatedStorageAccount` was added + +* `models.MonitoringFeatureDataType` was added + +* `models.ServerlessEndpoint$UpdateStages` was added + +* `models.OutboundRuleBasicResource$UpdateStages` was added + +* `models.EnvironmentVariable` was added + +* `models.WorkspaceConnectionOAuth2` was added + +* `models.PartialRegistryPartialTrackedResource` was added + +* `models.PartialMinimalTrackedResourceWithSkuAndIdentity` was added + +* `models.FeaturesetContainer$Update` was added + +* `models.RegistryTrackedResourceArmPaginatedResult` was added + +* `models.FeaturestoreEntityContainerProperties` was added + +* `models.FeaturestoreEntityVersionProperties` was added + +* `models.RuleType` was added + +* `models.NumericalDataDriftMetricThreshold` was added + +* `models.ComputeTriggerType` was added + +* `models.EndpointServiceConnectionStatus` was added + +* `models.FeaturesetContainer$DefinitionStages` was added + +* `models.OutboundRuleBasicResource$Definition` was added + +* `models.EmailNotificationEnableType` was added + +* `models.ServiceTagDestination` was added + +* `models.RequestLogging` was added + +* `models.FeaturestoreEntityContainer$Definition` was added + +* `models.ManagedNetworkStatus` was added + +* `models.FeaturesetContainerProperties` was added + +* `models.FeaturesetContainer$UpdateStages` was added + +* `models.MonitoringNotificationType` was added + +* `models.RollingRateType` was added + +* `models.CustomMonitoringSignal` was added + +* `models.CreateMonitorAction` was added + +* `models.ComputeWeekDay` was added + +* `models.DataQualityMetricThresholdBase` was added + +* `models.OutboundRuleBasicResource$DefinitionStages` was added + +* `models.ServerlessInferenceEndpointAuthMode` was added + +* `models.RegistryModelVersions` was added + +* `models.SparkResourceConfiguration` was added + +* `models.SparkJobPythonEntry` was added + +* `models.FeaturesetContainerResourceArmPaginatedResult` was added + +* `models.FeaturesetVersionResourceArmPaginatedResult` was added + +* `models.MonitorComputeIdentityType` was added + +* `models.OutboundRuleBasicResource` was added + +* `models.AmlTokenComputeIdentity` was added + +* `models.FineTuningVertical` was added + +* `models.FeatureAttributionDriftMonitoringSignal` was added + +* `models.NumericalDataQualityMetric` was added + +* `models.SecretExpiry` was added + +* `models.FeaturesetVersion` was added + +* `models.FeaturesetContainer` was added + +* `models.RegistryModelContainers` was added + +* `models.FeaturestoreEntityVersion$UpdateStages` was added + +* `models.AllNodes` was added + +* `models.MonitorComputeIdentityBase` was added + +* `models.ContentSafety` was added + +* `models.FeatureAttributionMetric` was added + +* `models.CategoricalDataQualityMetric` was added + +* `models.BatchPipelineComponentDeploymentConfiguration` was added + +* `models.PendingUploadType` was added + +* `models.ManagedNetworkProvisionStatus` was added + +* `models.PendingUploadCredentialDto` was added + +* `models.RegistryPrivateLinkServiceConnectionState` was added + +* `models.FixedInputData` was added + +* `models.ImageType` was added + +* `models.AzureDatastore` was added + +* `models.FqdnOutboundRule` was added + +#### `models.DiagnoseRequestProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.NlpVerticalLimitSettings` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.AutoScaleProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.NoneDatastoreCredentials` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `credentialsType()` was added + +#### `models.FqdnEndpointsProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.EstimatedVMPrice` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ScaleSettingsInformation` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.WorkspaceConnectionPropertiesV2` was modified + +* `sharedUserList()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `withExpiryTime(java.time.OffsetDateTime)` was added +* `withMetadata(java.util.Map)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `authType()` was added +* `isSharedToAll()` was added +* `metadata()` was added +* `createdByWorkspaceArmId()` was added +* `withIsSharedToAll(java.lang.Boolean)` was added +* `withSharedUserList(java.util.List)` was added +* `group()` was added +* `expiryTime()` was added + +#### `models.BanditPolicy` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `policyType()` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.JobResourceConfiguration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ImageClassificationMultilabel` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `taskType()` was added + +#### `models.BuildContext` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.CronTrigger` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `triggerType()` was added + +#### `models.MLFlowModelJobOutput` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `jobOutputType()` was added + +#### `models.AzureBlobDatastore` was modified + +* `resourceGroup()` was added +* `subscriptionId()` was added +* `withResourceGroup(java.lang.String)` was added +* `datastoreType()` was added +* `withSubscriptionId(java.lang.String)` was added +* `isDefault()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.AssetContainer` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.CodeVersions` was modified + +* `list(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.Integer,java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `createOrGetStartPendingUploadWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.String,models.PendingUploadRequestDto,com.azure.core.util.Context)` was added +* `publish(java.lang.String,java.lang.String,java.lang.String,java.lang.String,models.DestinationAsset)` was added +* `publish(java.lang.String,java.lang.String,java.lang.String,java.lang.String,models.DestinationAsset,com.azure.core.util.Context)` was added +* `createOrUpdate(java.lang.String,java.lang.String,java.lang.String,java.lang.String,fluent.models.CodeVersionInner)` was added +* `createOrGetStartPendingUpload(java.lang.String,java.lang.String,java.lang.String,java.lang.String,models.PendingUploadRequestDto)` was added +* `createOrUpdateWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.String,fluent.models.CodeVersionInner,com.azure.core.util.Context)` was added + +#### `models.ComponentContainers` was modified + +* `createOrUpdate(java.lang.String,java.lang.String,java.lang.String,fluent.models.ComponentContainerInner)` was added +* `createOrUpdateWithResponse(java.lang.String,java.lang.String,java.lang.String,fluent.models.ComponentContainerInner,com.azure.core.util.Context)` was added + +#### `models.KubernetesProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ImageModelSettingsObjectDetection` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DatabricksComputeSecretsProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.AmlToken` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `identityType()` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.DatabricksSchema` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.SweepJobLimits` was modified + +* `jobLimitsType()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.SynapseSpark` was modified + +* `provisioningState()` was added +* `modifiedOn()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `isAttachedCompute()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `computeType()` was added +* `provisioningErrors()` was added +* `createdOn()` was added + +#### `models.ScheduleProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ComputeInstanceSchema` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.FqdnEndpoints` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DefaultScaleSettings` was modified + +* `scaleType()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.DataContainer$Definition` was modified + +* `withExistingRegistry(java.lang.String,java.lang.String)` was added + +#### `models.ImageSweepSettings` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.SystemService` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.OnlineRequestSettings` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DataVersionBaseProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `dataType()` was added + +#### `models.DataVersionBase` was modified + +* `createOrGetStartPendingUpload(models.PendingUploadRequestDto)` was added +* `createOrGetStartPendingUploadWithResponse(models.PendingUploadRequestDto,com.azure.core.util.Context)` was added + +#### `models.DataContainers` was modified + +* `createOrUpdate(java.lang.String,java.lang.String,java.lang.String,fluent.models.DataContainerInner)` was added +* `createOrUpdateWithResponse(java.lang.String,java.lang.String,java.lang.String,fluent.models.DataContainerInner,com.azure.core.util.Context)` was added + +#### `models.CodeConfiguration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ImageInstanceSegmentation` was modified + +* `taskType()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ForecastHorizon` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `mode()` was added + +#### `models.BatchDeploymentProperties` was modified + +* `deploymentConfiguration()` was added +* `withDeploymentConfiguration(models.BatchDeploymentConfiguration)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.Aks` was modified + +* `createdOn()` was added +* `provisioningState()` was added +* `isAttachedCompute()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `modifiedOn()` was added +* `provisioningErrors()` was added +* `computeType()` was added + +#### `models.PartialMinimalTrackedResourceWithSku` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.TargetRollingWindowSize` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `mode()` was added + +#### `models.DataLakeAnalytics` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `computeType()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `createdOn()` was added +* `provisioningState()` was added +* `modifiedOn()` was added +* `provisioningErrors()` was added +* `isAttachedCompute()` was added + +#### `models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.AutoTargetRollingWindowSize` was modified + +* `mode()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DataVersionBaseResourceArmPaginatedResult` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ClassificationTrainingSettings` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.Workspace$Update` was modified + +* `withManagedNetwork(fluent.models.ManagedNetworkSettingsInner)` was added +* `withV1LegacyMode(java.lang.Boolean)` was added +* `withEnableDataIsolation(java.lang.Boolean)` was added +* `withServerlessComputeSettings(models.ServerlessComputeSettings)` was added +* `withFeatureStoreSettings(models.FeatureStoreSettings)` was added +* `withEncryption(models.EncryptionUpdateProperties)` was added + +#### `models.PartialBatchDeployment` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.DataContainerResourceArmPaginatedResult` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ComputeStartStopSchedule` was modified + +* `withTriggerType(models.ComputeTriggerType)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `withCron(models.Cron)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `withRecurrence(models.Recurrence)` was added + +#### `models.ResourceName` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.VirtualMachineSecrets` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `computeType()` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.AutoPauseProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ComputeInstanceCreatedBy` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ModelVersionProperties` was modified + +* `provisioningState()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `withStage(java.lang.String)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `stage()` was added + +#### `models.BatchEndpointProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `scoringUri()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `swaggerUri()` was added + +#### `models.OnlineDeploymentProperties` was modified + +* `dataCollector()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `endpointComputeType()` was added +* `withDataCollector(models.DataCollector)` was added + +#### `models.TruncationSelectionPolicy` was modified + +* `policyType()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ImageClassificationBase` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.BatchRetrySettings` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.VirtualMachineSshCredentials` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.WorkspaceConnectionUsernamePassword` was modified + +* `withSecurityToken(java.lang.String)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `securityToken()` was added + +#### `models.WorkspaceConnectionPersonalAccessToken` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.QuotaBaseProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.CodeContainerProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `latestVersion()` was added +* `nextVersion()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `provisioningState()` was added + +#### `models.AmlComputeNodeInformation` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ModelContainerProperties` was modified + +* `nextVersion()` was added +* `provisioningState()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `latestVersion()` was added + +#### `models.TableVerticalFeaturizationSettings` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.EarlyTerminationPolicy` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `policyType()` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.AutoNCrossValidations` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `mode()` was added + +#### `models.InferenceContainerProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ClusterUpdateParameters` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.JobLimits` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `jobLimitsType()` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.TargetLags` was modified + +* `mode()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.BatchEndpointDefaults` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ImageModelDistributionSettingsClassification` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ScriptsToExecute` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.AzureDataLakeGen1Datastore` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `withSubscriptionId(java.lang.String)` was added +* `withResourceGroup(java.lang.String)` was added +* `isDefault()` was added +* `resourceGroup()` was added +* `datastoreType()` was added +* `subscriptionId()` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.DatastoreSecrets` was modified + +* `secretsType()` was added + +#### `models.Workspaces` was modified + +* `deleteByIdWithResponse(java.lang.String,java.lang.Boolean,com.azure.core.util.Context)` was added +* `delete(java.lang.String,java.lang.String)` was added +* `delete(java.lang.String,java.lang.String,java.lang.Boolean,com.azure.core.util.Context)` was added + +#### `models.Kubernetes` was modified + +* `computeType()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `createdOn()` was added +* `provisioningErrors()` was added +* `isAttachedCompute()` was added +* `modifiedOn()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `provisioningState()` was added + +#### `models.ManagedOnlineDeployment` was modified + +* `provisioningState()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `endpointComputeType()` was added +* `withDataCollector(models.DataCollector)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.DataLakeAnalyticsSchema` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.NodeStateCounts` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.PrivateLinkServiceConnectionState` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.EnvironmentVersionProperties` was modified + +* `stage()` was added +* `withStage(java.lang.String)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `provisioningState()` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ModelVersionResourceArmPaginatedResult` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.AssignedUser` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.EnvironmentContainerProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `latestVersion()` was added +* `provisioningState()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `nextVersion()` was added + +#### `models.AksSchemaProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.AssetJobOutput` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.PrivateEndpointConnectionListResult` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.CustomModelJobInput` was modified + +* `jobInputType()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.CodeVersionProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `provisioningState()` was added + +#### `models.AmlComputeNodesInformation` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.EnvironmentContainers` was modified + +* `createOrUpdate(java.lang.String,java.lang.String,java.lang.String,fluent.models.EnvironmentContainerInner)` was added +* `createOrUpdateWithResponse(java.lang.String,java.lang.String,java.lang.String,fluent.models.EnvironmentContainerInner,com.azure.core.util.Context)` was added + +#### `models.Objective` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.QuotaUpdateParameters` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.UriFolderDataVersion` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `dataType()` was added + +#### `models.Workspace$Definition` was modified + +* `withServerlessComputeSettings(models.ServerlessComputeSettings)` was added +* `withKind(java.lang.String)` was added +* `withAssociatedWorkspaces(java.util.List)` was added +* `withManagedNetwork(fluent.models.ManagedNetworkSettingsInner)` was added +* `withFeatureStoreSettings(models.FeatureStoreSettings)` was added +* `withEnableDataIsolation(java.lang.Boolean)` was added +* `withHubResourceId(java.lang.String)` was added +* `withWorkspaceHubConfig(models.WorkspaceHubConfig)` was added + +#### `models.DataPathAssetReference` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `referenceType()` was added + +#### `models.ModelContainer$Definition` was modified + +* `withExistingRegistry(java.lang.String,java.lang.String)` was added + +#### `models.CodeContainer$Definition` was modified + +* `withExistingRegistry(java.lang.String,java.lang.String)` was added + +#### `models.SynapseSparkProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.Datastores` was modified + +* `listSecretsWithResponse(java.lang.String,java.lang.String,java.lang.String,models.SecretExpiry,com.azure.core.util.Context)` was added + +#### `models.StackEnsembleSettings` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ComputeInstanceDataDisk` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ListWorkspaceQuotas` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.TargetUtilizationScaleSettings` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `scaleType()` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ComputeInstanceApplication` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.PrivateLinkResource` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `name()` was added +* `id()` was added +* `type()` was added + +#### `models.PipelineJob` was modified + +* `status()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `jobType()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `withNotificationSetting(models.NotificationSetting)` was added + +#### `models.Password` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ColumnTransformer` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.TrainingSettings` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.RecurrenceSchedule` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.PartialMinimalTrackedResource` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.WorkspaceConnectionManagedIdentity` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.CustomTargetLags` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `mode()` was added + +#### `models.DistributionConfiguration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `distributionType()` was added + +#### `models.PaginatedComputeResourcesList` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ScheduleResourceArmPaginatedResult` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.Seasonality` was modified + +* `mode()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.HDInsightProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.Classification` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `taskType()` was added + +#### `models.VirtualMachine` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `provisioningErrors()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `createdOn()` was added +* `computeType()` was added +* `isAttachedCompute()` was added +* `modifiedOn()` was added +* `provisioningState()` was added + +#### `models.RegressionTrainingSettings` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.UpdateWorkspaceQuotas` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.AmlCompute` was modified + +* `computeType()` was added +* `provisioningState()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `isAttachedCompute()` was added +* `createdOn()` was added +* `provisioningErrors()` was added +* `modifiedOn()` was added + +#### `models.AzureDataLakeGen2Datastore` was modified + +* `resourceGroup()` was added +* `withResourceGroup(java.lang.String)` was added +* `withSubscriptionId(java.lang.String)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `datastoreType()` was added +* `isDefault()` was added +* `subscriptionId()` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ImageModelSettingsClassification` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.DatastoreResourceArmPaginatedResult` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.AccountKeyDatastoreCredentials` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `credentialsType()` was added + +#### `models.ContainerResourceRequirements` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ComputeInstanceConnectivityEndpoints` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.Databricks` was modified + +* `createdOn()` was added +* `provisioningErrors()` was added +* `computeType()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `modifiedOn()` was added +* `isAttachedCompute()` was added +* `provisioningState()` was added + +#### `models.ListAmlUserFeatureResult` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.UriFileDataVersion` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `dataType()` was added + +#### `models.EnvironmentContainer$Definition` was modified + +* `withExistingRegistry(java.lang.String,java.lang.String)` was added + +#### `models.UriFileJobInput` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `jobInputType()` was added + +#### `models.ComputeInstance` was modified + +* `createdOn()` was added +* `provisioningErrors()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `computeType()` was added +* `modifiedOn()` was added +* `isAttachedCompute()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `provisioningState()` was added + +#### `models.SkuCapacity` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.WorkspaceConnections` was modified + +* `listSecretsWithResponse(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `listSecrets(java.lang.String,java.lang.String,java.lang.String)` was added + +#### `models.ComponentContainerProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `provisioningState()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `latestVersion()` was added +* `nextVersion()` was added + +#### `models.Workspace` was modified + +* `workspaceHubConfig()` was added +* `hubResourceId()` was added +* `serverlessComputeSettings()` was added +* `featureStoreSettings()` was added +* `enableDataIsolation()` was added +* `kind()` was added +* `associatedWorkspaces()` was added +* `managedNetwork()` was added + +#### `models.ComponentContainerResourceArmPaginatedResult` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ComputeResourceSchema` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.AmlComputeProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.Route` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ComputeInstanceContainer` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.EncryptionKeyVaultProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.NlpVertical` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.UriFileJobOutput` was modified + +* `jobOutputType()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.LiteralJobInput` was modified + +* `jobInputType()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.CodeVersion` was modified + +* `createOrGetStartPendingUploadWithResponse(models.PendingUploadRequestDto,com.azure.core.util.Context)` was added +* `createOrGetStartPendingUpload(models.PendingUploadRequestDto)` was added + +#### `models.TableVerticalLimitSettings` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.UriFolderJobInput` was modified + +* `jobInputType()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.TrialComponent` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ComputeSecrets` was modified + +* `computeType()` was added + +#### `models.SkuResourceArmPaginatedResult` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.MedianStoppingPolicy` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `policyType()` was added + +#### `models.Datastore` was modified + +* `listSecretsWithResponse(models.SecretExpiry,com.azure.core.util.Context)` was added + +#### `models.NoneAuthTypeWorkspaceConnectionProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `withSharedUserList(java.util.List)` was added +* `group()` was added +* `withExpiryTime(java.time.OffsetDateTime)` was added +* `createdByWorkspaceArmId()` was added +* `withMetadata(java.util.Map)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `authType()` was added +* `withIsSharedToAll(java.lang.Boolean)` was added + +#### `models.NotebookPreparationError` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ScaleSettings` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.JobBaseResourceArmPaginatedResult` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.PartialManagedServiceIdentity` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.Regression` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `taskType()` was added + +#### `models.PrivateEndpoint` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `MachineLearningManager` was modified + +* `registryCodeContainers()` was added +* `registryModelVersions()` was added +* `registryDataReferences()` was added +* `featuresetContainers()` was added +* `featurestoreEntityContainers()` was added +* `managedNetworkSettingsRules()` was added +* `registryEnvironmentVersions()` was added +* `featuresetVersions()` was added +* `registries()` was added +* `registryCodeVersions()` was added +* `registryDataContainers()` was added +* `registryModelContainers()` was added +* `features()` was added +* `featurestoreEntityVersions()` was added +* `registryEnvironmentContainers()` was added +* `managedNetworkProvisions()` was added +* `serverlessEndpoints()` was added +* `marketplaceSubscriptions()` was added +* `registryDataVersions()` was added +* `registryComponentContainers()` was added +* `registryComponentVersions()` was added + +#### `models.CodeContainerResourceArmPaginatedResult` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ScheduleActionBase` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `actionType()` was added + +#### `models.ListUsagesResult` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.MLTableData` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `dataType()` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.Forecasting` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `taskType()` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.CertificateDatastoreSecrets` was modified + +* `secretsType()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.CertificateDatastoreCredentials` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `credentialsType()` was added + +#### `models.VirtualMachineSchemaProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.UsernamePasswordAuthTypeWorkspaceConnectionProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `withIsSharedToAll(java.lang.Boolean)` was added +* `authType()` was added +* `withMetadata(java.util.Map)` was added +* `group()` was added +* `withExpiryTime(java.time.OffsetDateTime)` was added +* `withSharedUserList(java.util.List)` was added +* `createdByWorkspaceArmId()` was added + +#### `models.ServiceManagedResourcesSettings` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.GridSamplingAlgorithm` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `samplingAlgorithmType()` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ComponentVersionResourceArmPaginatedResult` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.IdentityForCmk` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.AzureFileDatastore` was modified + +* `resourceGroup()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `withSubscriptionId(java.lang.String)` was added +* `isDefault()` was added +* `withResourceGroup(java.lang.String)` was added +* `datastoreType()` was added +* `subscriptionId()` was added + +#### `models.WorkspaceUpdateParameters` was modified + +* `managedNetwork()` was added +* `enableDataIsolation()` was added +* `encryption()` was added +* `serverlessComputeSettings()` was added +* `v1LegacyMode()` was added +* `innerModel()` was added +* `featureStoreSettings()` was added + +#### `models.NlpVerticalFeaturizationSettings` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.VirtualMachineImage` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.UriFolderJobOutput` was modified + +* `jobOutputType()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.Compute` was modified + +* `computeType()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.OutputPathAssetReference` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `referenceType()` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.EnvironmentVersionResourceArmPaginatedResult` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.TriggerBase` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `triggerType()` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.AssetBase` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.InstanceTypeSchemaResources` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ScriptReference` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.MLTableJobOutput` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `jobOutputType()` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.AutoMLVertical` was modified + +* `taskType()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.Mpi` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `distributionType()` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DiagnoseResponseResultValue` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.SasDatastoreCredentials` was modified + +* `credentialsType()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.AksNetworkingConfiguration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.VirtualMachineSecretsSchema` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.BatchEndpointTrackedResourceArmPaginatedResult` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DatabricksComputeSecrets` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `computeType()` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.OnlineDeploymentTrackedResourceArmPaginatedResult` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ImageModelDistributionSettings` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ImageVertical` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DiagnoseResult` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.TritonModelJobOutput` was modified + +* `jobOutputType()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.WorkspaceConnectionSharedAccessSignature` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.DatastoreCredentials` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `credentialsType()` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.KubernetesSchema` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ProbeSettings` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ResourceBase` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ManagedServiceIdentity` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.WorkspaceConnectionPropertiesV2BasicResource` was modified + +* `listSecretsWithResponse(com.azure.core.util.Context)` was added +* `listSecrets()` was added + +#### `models.EstimatedVMPrices` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.TextClassificationMultilabel` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `taskType()` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ComponentVersions` was modified + +* `createOrUpdate(java.lang.String,java.lang.String,java.lang.String,java.lang.String,fluent.models.ComponentVersionInner)` was added +* `publish(java.lang.String,java.lang.String,java.lang.String,java.lang.String,models.DestinationAsset,com.azure.core.util.Context)` was added +* `publish(java.lang.String,java.lang.String,java.lang.String,java.lang.String,models.DestinationAsset)` was added +* `createOrUpdateWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.String,fluent.models.ComponentVersionInner,com.azure.core.util.Context)` was added + +#### `models.CosmosDbSettings` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.IdAssetReference` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `referenceType()` was added + +#### `models.AksComputeSecrets` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `computeType()` was added + +#### `models.PersonalComputeInstanceSettings` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.WorkspaceProperties` was modified + +* `enableDataIsolation()` was added +* `managedNetwork()` was added +* `hubResourceId()` was added +* `featureStoreSettings()` was added +* `serverlessComputeSettings()` was added +* `associatedWorkspaces()` was added +* `workspaceHubConfig()` was added + +#### `models.CommandJobLimits` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `jobLimitsType()` was added + +#### `models.VirtualMachineSize` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ImageClassification` was modified + +* `taskType()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DatabricksProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.SasDatastoreSecrets` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `secretsType()` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.SharedPrivateLinkResource` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.AksSchema` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.TritonModelJobInput` was modified + +* `jobInputType()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.AssetJobInput` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.CodeContainers` was modified + +* `createOrUpdate(java.lang.String,java.lang.String,java.lang.String,fluent.models.CodeContainerInner)` was added +* `createOrUpdateWithResponse(java.lang.String,java.lang.String,java.lang.String,fluent.models.CodeContainerInner,com.azure.core.util.Context)` was added + +#### `models.ContainerResourceSettings` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.CustomModelJobOutput` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `jobOutputType()` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.FlavorData` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.DatastoreProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `datastoreType()` was added + +#### `models.BayesianSamplingAlgorithm` was modified + +* `samplingAlgorithmType()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.Jobs` was modified + +* `list(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,models.ListViewType,java.lang.String,com.azure.core.util.Context)` was added + +#### `models.DeploymentResourceConfiguration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.TableVertical` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.CustomNCrossValidations` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `mode()` was added + +#### `models.DataVersions` was modified + +* `publish(java.lang.String,java.lang.String,java.lang.String,java.lang.String,models.DestinationAsset,com.azure.core.util.Context)` was added +* `publish(java.lang.String,java.lang.String,java.lang.String,java.lang.String,models.DestinationAsset)` was added +* `createOrUpdate(java.lang.String,java.lang.String,java.lang.String,java.lang.String,fluent.models.DataVersionBaseInner)` was added +* `createOrUpdateWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.String,fluent.models.DataVersionBaseInner,com.azure.core.util.Context)` was added + +#### `models.ComputeInstanceEnvironmentInfo` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.SkuSetting` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ResourceConfiguration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ComputeInstanceSshSettings` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.RegenerateEndpointKeysRequest` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.TensorFlow` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `distributionType()` was added + +#### `models.SasAuthTypeWorkspaceConnectionProperties` was modified + +* `withMetadata(java.util.Map)` was added +* `withExpiryTime(java.time.OffsetDateTime)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `authType()` was added +* `withSharedUserList(java.util.List)` was added +* `createdByWorkspaceArmId()` was added +* `withIsSharedToAll(java.lang.Boolean)` was added +* `group()` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ImageObjectDetectionBase` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.DeploymentLogsRequest` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.TextNer` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `taskType()` was added + +#### `models.FqdnEndpoint` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.EnvironmentVersions` was modified + +* `createOrUpdateWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.String,fluent.models.EnvironmentVersionInner,com.azure.core.util.Context)` was added +* `publish(java.lang.String,java.lang.String,java.lang.String,java.lang.String,models.DestinationAsset)` was added +* `publish(java.lang.String,java.lang.String,java.lang.String,java.lang.String,models.DestinationAsset,com.azure.core.util.Context)` was added +* `createOrUpdate(java.lang.String,java.lang.String,java.lang.String,java.lang.String,fluent.models.EnvironmentVersionInner)` was added + +#### `models.MLTableJobInput` was modified + +* `jobInputType()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.AutoForecastHorizon` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `mode()` was added + +#### `models.WorkspaceListResult` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.EncryptionProperty` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ComponentContainer$Definition` was modified + +* `withExistingRegistry(java.lang.String,java.lang.String)` was added + +#### `models.CommandJob` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `withQueueSettings(models.QueueSettings)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `withNotificationSetting(models.NotificationSetting)` was added +* `status()` was added +* `jobType()` was added +* `queueSettings()` was added + +#### `models.ComputeInstanceVersion` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.IdentityConfiguration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `identityType()` was added + +#### `models.ManagedIdentityAuthTypeWorkspaceConnectionProperties` was modified + +* `withExpiryTime(java.time.OffsetDateTime)` was added +* `withIsSharedToAll(java.lang.Boolean)` was added +* `withSharedUserList(java.util.List)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `authType()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `createdByWorkspaceArmId()` was added +* `withMetadata(java.util.Map)` was added +* `group()` was added + +#### `models.RegistryListCredentialsResult` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.FeaturizationSettings` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ServicePrincipalDatastoreCredentials` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `credentialsType()` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ModelContainerResourceArmPaginatedResult` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.SslConfiguration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DiagnoseWorkspaceParameters` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.EndpointDeploymentPropertiesBase` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DataFactory` was modified + +* `computeType()` was added +* `modifiedOn()` was added +* `isAttachedCompute()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `createdOn()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `provisioningState()` was added +* `provisioningErrors()` was added + +#### `models.CustomTargetRollingWindowSize` was modified + +* `mode()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ImageObjectDetection` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `taskType()` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ModelVersions` was modified + +* `publish(java.lang.String,java.lang.String,java.lang.String,java.lang.String,models.DestinationAsset)` was added +* `createOrUpdateWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.String,fluent.models.ModelVersionInner,com.azure.core.util.Context)` was added +* `publish(java.lang.String,java.lang.String,java.lang.String,java.lang.String,models.DestinationAsset,com.azure.core.util.Context)` was added +* `createOrUpdate(java.lang.String,java.lang.String,java.lang.String,java.lang.String,fluent.models.ModelVersionInner)` was added + +#### `models.Sku` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.InstanceTypeSchema` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.AmlComputeSchema` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.UserIdentity` was modified + +* `identityType()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ImageModelSettings` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.UserAccountCredentials` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.JobOutput` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `jobOutputType()` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.CodeVersionResourceArmPaginatedResult` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.HDInsightSchema` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.EndpointScheduleAction` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `actionType()` was added + +#### `models.ManagedIdentity` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `identityType()` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.SetupScripts` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.MLFlowModelJobInput` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `jobInputType()` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.CustomForecastHorizon` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `mode()` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.AssetReferenceBase` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `referenceType()` was added + +#### `models.ComputeInstanceProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `osImageMetadata()` was added +* `withCustomServices(java.util.List)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `withSchedules(models.ComputeSchedules)` was added +* `customServices()` was added + +#### `models.ModelVersion` was modified + +* `createOrGetStartPendingUpload(models.PendingUploadRequestDto)` was added +* `createOrGetStartPendingUploadWithResponse(models.PendingUploadRequestDto,com.azure.core.util.Context)` was added + +#### `models.UsageName` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.BatchDeploymentTrackedResourceArmPaginatedResult` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.SweepJob` was modified + +* `queueSettings()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `jobType()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `withNotificationSetting(models.NotificationSetting)` was added +* `withQueueSettings(models.QueueSettings)` was added +* `status()` was added + +#### `models.AksComputeSecretsProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ModelContainers` was modified + +* `createOrUpdateWithResponse(java.lang.String,java.lang.String,java.lang.String,fluent.models.ModelContainerInner,com.azure.core.util.Context)` was added +* `createOrUpdate(java.lang.String,java.lang.String,java.lang.String,fluent.models.ModelContainerInner)` was added + +#### `models.AutoSeasonality` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `mode()` was added + +#### `models.NCrossValidations` was modified + +* `mode()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.OnlineEndpointTrackedResourceArmPaginatedResult` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ScheduleBase` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ImageModelDistributionSettingsObjectDetection` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ComputeInstanceDataMount` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ForecastingTrainingSettings` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.TextClassification` was modified + +* `taskType()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.PartialSku` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.AutoTargetLags` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `mode()` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ImageLimitSettings` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.VirtualMachineSchema` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.OnlineScaleSettings` was modified + +* `scaleType()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.DataContainerProperties` was modified + +* `latestVersion()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `nextVersion()` was added + +#### `models.PartialMinimalTrackedResourceWithIdentity` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.AutoMLJob` was modified + +* `jobType()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `queueSettings()` was added +* `withQueueSettings(models.QueueSettings)` was added +* `withNotificationSetting(models.NotificationSetting)` was added +* `status()` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.RandomSamplingAlgorithm` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `samplingAlgorithmType()` was added + +#### `models.JobInput` was modified + +* `jobInputType()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.JobScheduleAction` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `actionType()` was added + +#### `models.JobService` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `withNodes(models.Nodes)` was added +* `nodes()` was added + +#### `models.HDInsight` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `provisioningErrors()` was added +* `modifiedOn()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `provisioningState()` was added +* `computeType()` was added +* `isAttachedCompute()` was added +* `createdOn()` was added + +#### `models.KubernetesOnlineDeployment` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `withDataCollector(models.DataCollector)` was added +* `endpointComputeType()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `provisioningState()` was added + +#### `models.AccountKeyDatastoreSecrets` was modified + +* `secretsType()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ServicePrincipalDatastoreSecrets` was modified + +* `secretsType()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.OnlineEndpointProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `swaggerUri()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `withMirrorTraffic(java.util.Map)` was added +* `mirrorTraffic()` was added +* `scoringUri()` was added + +#### `models.CustomSeasonality` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `mode()` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ResourceId` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.RecurrenceTrigger` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `triggerType()` was added + +#### `models.FqdnEndpointDetail` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ComputeInstanceLastOperation` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ForecastingSettings` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.EnvironmentContainerResourceArmPaginatedResult` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.JobBaseProperties` was modified + +* `withNotificationSetting(models.NotificationSetting)` was added +* `jobType()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `notificationSetting()` was added + +#### `models.PyTorch` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `distributionType()` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.UserAssignedIdentity` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DataLakeAnalyticsSchemaProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ComponentVersionProperties` was modified + +* `provisioningState()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.SamplingAlgorithm` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `samplingAlgorithmType()` was added + +#### `models.PatAuthTypeWorkspaceConnectionProperties` was modified + +* `withExpiryTime(java.time.OffsetDateTime)` was added +* `withSharedUserList(java.util.List)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `withIsSharedToAll(java.lang.Boolean)` was added +* `withMetadata(java.util.Map)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `authType()` was added +* `createdByWorkspaceArmId()` was added +* `group()` was added + +#### `models.ComputeSchedules` was modified -### Other Changes +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added ## 1.0.0 (2023-01-11) diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/README.md b/sdk/machinelearning/azure-resourcemanager-machinelearning/README.md index 1521aeacd892d..dd0077c468fbb 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/README.md +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/README.md @@ -2,7 +2,7 @@ Azure Resource Manager Machine Learning client library for Java. -This package contains Microsoft Azure SDK for Machine Learning Management SDK. These APIs allow end users to operate on Azure Machine Learning Workspace resources. Package tag package-2022-10. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for Machine Learning Management SDK. These APIs allow end users to operate on Azure Machine Learning Workspace resources. Package tag package-preview-2024-07. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-machinelearning - 1.0.0 + 1.1.0-beta.1 ``` [//]: # ({x-version-update-end}) @@ -45,15 +45,11 @@ Azure Management Libraries require a `TokenCredential` implementation for authen ### Authentication -By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables. +Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package. -- `AZURE_CLIENT_ID` for Azure client ID. -- `AZURE_TENANT_ID` for Azure tenant ID. -- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. +Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. -In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. - -With above configuration, `azure` client can be authenticated using the following code: +Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); @@ -74,6 +70,49 @@ See [API design][design] for general introduction on design and key concepts on ## Examples +```java +workspace = machineLearningManager.workspaces() + .define(workspaceName) + .withExistingResourceGroup(resourceGroupName) + .withRegion(REGION) + .withSku(new Sku().withName("Basic").withTier(SkuTier.BASIC)) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED)) + .withFriendlyName(workspaceName) + .withStorageAccount( + storageManager.storageAccounts() + .define(storageName) + .withRegion(REGION) + .withExistingResourceGroup(resourceGroupName) + .withSku(StorageAccountSkuType.STANDARD_LRS) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_0) + .withHnsEnabled(false) + .withAccessFromAzureServices() + .withOnlyHttpsTraffic() + .withBlobStorageAccountKind().withAccessTier(AccessTier.HOT) + .create() + .id()) + .withKeyVault( + keyVaultManager.vaults() + .define(keyVaultName) + .withRegion(REGION) + .withExistingResourceGroup(resourceGroupName) + .withEmptyAccessPolicy() + .withSku(SkuName.STANDARD) + .withDeploymentDisabled() + .withAccessFromAllNetworks() + .create() + .id()) + .withApplicationInsights( + applicationInsightsManager.components() + .define(insightName) + .withRegion(REGION) + .withExistingResourceGroup(resourceGroupName) + .withKind("web") + .withApplicationType(ApplicationType.WEB) + .create() + .id()) + .create(); +``` [Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/machinelearning/azure-resourcemanager-machinelearning/SAMPLE.md) @@ -94,12 +133,15 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS [docs]: https://azure.github.io/azure-sdk-for-java/ -[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ [azure_subscription]: https://azure.microsoft.com/free/ [azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty [authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md [design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fmachinelearning%2Fazure-resourcemanager-machinelearning%2FREADME.png) diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/SAMPLE.md b/sdk/machinelearning/azure-resourcemanager-machinelearning/SAMPLE.md index aace5155fc337..a1538f114de08 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/SAMPLE.md +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/SAMPLE.md @@ -27,10 +27,12 @@ ## CodeVersions +- [CreateOrGetStartPendingUpload](#codeversions_createorgetstartpendingupload) - [CreateOrUpdate](#codeversions_createorupdate) - [Delete](#codeversions_delete) - [Get](#codeversions_get) - [List](#codeversions_list) +- [Publish](#codeversions_publish) ## ComponentContainers @@ -45,6 +47,7 @@ - [Delete](#componentversions_delete) - [Get](#componentversions_get) - [List](#componentversions_list) +- [Publish](#componentversions_publish) ## Compute @@ -72,6 +75,7 @@ - [Delete](#dataversions_delete) - [Get](#dataversions_get) - [List](#dataversions_list) +- [Publish](#dataversions_publish) ## Datastores @@ -94,6 +98,41 @@ - [Delete](#environmentversions_delete) - [Get](#environmentversions_get) - [List](#environmentversions_list) +- [Publish](#environmentversions_publish) + +## Features + +- [Get](#features_get) +- [List](#features_list) + +## FeaturesetContainers + +- [CreateOrUpdate](#featuresetcontainers_createorupdate) +- [Delete](#featuresetcontainers_delete) +- [GetEntity](#featuresetcontainers_getentity) +- [List](#featuresetcontainers_list) + +## FeaturesetVersions + +- [Backfill](#featuresetversions_backfill) +- [CreateOrUpdate](#featuresetversions_createorupdate) +- [Delete](#featuresetversions_delete) +- [Get](#featuresetversions_get) +- [List](#featuresetversions_list) + +## FeaturestoreEntityContainers + +- [CreateOrUpdate](#featurestoreentitycontainers_createorupdate) +- [Delete](#featurestoreentitycontainers_delete) +- [GetEntity](#featurestoreentitycontainers_getentity) +- [List](#featurestoreentitycontainers_list) + +## FeaturestoreEntityVersions + +- [CreateOrUpdate](#featurestoreentityversions_createorupdate) +- [Delete](#featurestoreentityversions_delete) +- [Get](#featurestoreentityversions_get) +- [List](#featurestoreentityversions_list) ## Jobs @@ -103,6 +142,24 @@ - [Get](#jobs_get) - [List](#jobs_list) +## ManagedNetworkProvisions + +- [ProvisionManagedNetwork](#managednetworkprovisions_provisionmanagednetwork) + +## ManagedNetworkSettingsRule + +- [CreateOrUpdate](#managednetworksettingsrule_createorupdate) +- [Delete](#managednetworksettingsrule_delete) +- [Get](#managednetworksettingsrule_get) +- [List](#managednetworksettingsrule_list) + +## MarketplaceSubscriptions + +- [CreateOrUpdate](#marketplacesubscriptions_createorupdate) +- [Delete](#marketplacesubscriptions_delete) +- [Get](#marketplacesubscriptions_get) +- [List](#marketplacesubscriptions_list) + ## ModelContainers - [CreateOrUpdate](#modelcontainers_createorupdate) @@ -116,6 +173,7 @@ - [Delete](#modelversions_delete) - [Get](#modelversions_get) - [List](#modelversions_list) +- [Publish](#modelversions_publish) ## OnlineDeployments @@ -158,6 +216,93 @@ - [List](#quotas_list) - [Update](#quotas_update) +## Registries + +- [CreateOrUpdate](#registries_createorupdate) +- [Delete](#registries_delete) +- [GetByResourceGroup](#registries_getbyresourcegroup) +- [List](#registries_list) +- [ListByResourceGroup](#registries_listbyresourcegroup) +- [RemoveRegions](#registries_removeregions) +- [Update](#registries_update) + +## RegistryCodeContainers + +- [CreateOrUpdate](#registrycodecontainers_createorupdate) +- [Delete](#registrycodecontainers_delete) +- [Get](#registrycodecontainers_get) +- [List](#registrycodecontainers_list) + +## RegistryCodeVersions + +- [CreateOrGetStartPendingUpload](#registrycodeversions_createorgetstartpendingupload) +- [CreateOrUpdate](#registrycodeversions_createorupdate) +- [Delete](#registrycodeversions_delete) +- [Get](#registrycodeversions_get) +- [List](#registrycodeversions_list) + +## RegistryComponentContainers + +- [CreateOrUpdate](#registrycomponentcontainers_createorupdate) +- [Delete](#registrycomponentcontainers_delete) +- [Get](#registrycomponentcontainers_get) +- [List](#registrycomponentcontainers_list) + +## RegistryComponentVersions + +- [CreateOrUpdate](#registrycomponentversions_createorupdate) +- [Delete](#registrycomponentversions_delete) +- [Get](#registrycomponentversions_get) +- [List](#registrycomponentversions_list) + +## RegistryDataContainers + +- [CreateOrUpdate](#registrydatacontainers_createorupdate) +- [Delete](#registrydatacontainers_delete) +- [Get](#registrydatacontainers_get) +- [List](#registrydatacontainers_list) + +## RegistryDataReferences + +- [GetBlobReferenceSas](#registrydatareferences_getblobreferencesas) + +## RegistryDataVersions + +- [CreateOrGetStartPendingUpload](#registrydataversions_createorgetstartpendingupload) +- [CreateOrUpdate](#registrydataversions_createorupdate) +- [Delete](#registrydataversions_delete) +- [Get](#registrydataversions_get) +- [List](#registrydataversions_list) + +## RegistryEnvironmentContainers + +- [CreateOrUpdate](#registryenvironmentcontainers_createorupdate) +- [Delete](#registryenvironmentcontainers_delete) +- [Get](#registryenvironmentcontainers_get) +- [List](#registryenvironmentcontainers_list) + +## RegistryEnvironmentVersions + +- [CreateOrUpdate](#registryenvironmentversions_createorupdate) +- [Delete](#registryenvironmentversions_delete) +- [Get](#registryenvironmentversions_get) +- [List](#registryenvironmentversions_list) + +## RegistryModelContainers + +- [CreateOrUpdate](#registrymodelcontainers_createorupdate) +- [Delete](#registrymodelcontainers_delete) +- [Get](#registrymodelcontainers_get) +- [List](#registrymodelcontainers_list) + +## RegistryModelVersions + +- [CreateOrGetStartPendingUpload](#registrymodelversions_createorgetstartpendingupload) +- [CreateOrUpdate](#registrymodelversions_createorupdate) +- [Delete](#registrymodelversions_delete) +- [Get](#registrymodelversions_get) +- [List](#registrymodelversions_list) + ## Schedules - [CreateOrUpdate](#schedules_createorupdate) @@ -165,6 +310,16 @@ - [Get](#schedules_get) - [List](#schedules_list) +## ServerlessEndpoints + +- [CreateOrUpdate](#serverlessendpoints_createorupdate) +- [Delete](#serverlessendpoints_delete) +- [Get](#serverlessendpoints_get) +- [List](#serverlessendpoints_list) +- [ListKeys](#serverlessendpoints_listkeys) +- [RegenerateKeys](#serverlessendpoints_regeneratekeys) +- [Update](#serverlessendpoints_update) + ## Usages - [List](#usages_list) @@ -179,6 +334,7 @@ - [Delete](#workspaceconnections_delete) - [Get](#workspaceconnections_get) - [List](#workspaceconnections_list) +- [ListSecrets](#workspaceconnections_listsecrets) ## WorkspaceFeatures @@ -222,69 +378,61 @@ import java.time.Duration; import java.util.HashMap; import java.util.Map; -/** Samples for BatchDeployments CreateOrUpdate. */ +/** + * Samples for BatchDeployments CreateOrUpdate. + */ public final class BatchDeploymentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchDeployment/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/BatchDeployment/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Batch Deployment. - * + * Sample code: CreateOrUpdate Workspace Batch Deployment. + * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateBatchDeployment( + public static void createOrUpdateWorkspaceBatchDeployment( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) throws IOException { - manager - .batchDeployments() + manager.batchDeployments() .define("testDeploymentName") .withRegion("string") .withExistingBatchEndpoint("test-rg", "my-aml-workspace", "testEndpointName") - .withProperties( - new BatchDeploymentProperties() - .withCodeConfiguration( - new CodeConfiguration().withCodeId("fakeTokenPlaceholder").withScoringScript("string")) - .withDescription("string") - .withEnvironmentId("string") - .withEnvironmentVariables(mapOf("string", "string")) - .withProperties(mapOf("string", "string")) - .withCompute("string") - .withErrorThreshold(1) - .withLoggingLevel(BatchLoggingLevel.INFO) - .withMaxConcurrencyPerInstance(1) - .withMiniBatchSize(1L) - .withModel(new IdAssetReference().withAssetId("string")) - .withOutputAction(BatchOutputAction.SUMMARY_ONLY) - .withOutputFileName("string") - .withResources( - new DeploymentResourceConfiguration() - .withInstanceCount(1) - .withInstanceType("string") - .withProperties( - mapOf( - "string", - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"cd3c37dc-2876-4ca4-8a54-21bd7619724a\":null}", - Object.class, - SerializerEncoding.JSON)))) - .withRetrySettings(new BatchRetrySettings().withMaxRetries(1).withTimeout(Duration.parse("PT5M")))) + .withProperties(new BatchDeploymentProperties() + .withCodeConfiguration( + new CodeConfiguration().withCodeId("fakeTokenPlaceholder").withScoringScript("string")) + .withDescription("string") + .withEnvironmentId("string") + .withEnvironmentVariables(mapOf("string", "string")) + .withProperties(mapOf("string", "string")) + .withCompute("string") + .withErrorThreshold(1) + .withLoggingLevel(BatchLoggingLevel.INFO) + .withMaxConcurrencyPerInstance(1) + .withMiniBatchSize(1L) + .withModel(new IdAssetReference().withAssetId("string")) + .withOutputAction(BatchOutputAction.SUMMARY_ONLY) + .withOutputFileName("string") + .withResources(new DeploymentResourceConfiguration().withInstanceCount(1) + .withInstanceType("string") + .withProperties(mapOf("string", + SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"cd3c37dc-2876-4ca4-8a54-21bd7619724a\":null}", Object.class, + SerializerEncoding.JSON)))) + .withRetrySettings(new BatchRetrySettings().withMaxRetries(1).withTimeout(Duration.parse("PT5M")))) .withTags(mapOf()) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) .withKind("string") - .withSku( - new Sku() - .withName("string") - .withTier(SkuTier.FREE) - .withSize("string") - .withFamily("string") - .withCapacity(1)) + .withSku(new Sku().withName("string") + .withTier(SkuTier.FREE) + .withSize("string") + .withFamily("string") + .withCapacity(1)) .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -301,24 +449,24 @@ public final class BatchDeploymentsCreateOrUpdateSamples { ### BatchDeployments_Delete ```java -/** Samples for BatchDeployments Delete. */ +/** + * Samples for BatchDeployments Delete. + */ public final class BatchDeploymentsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchDeployment/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/BatchDeployment/delete.json */ /** - * Sample code: Delete Batch Deployment. - * + * Sample code: Delete Workspace Batch Deployment. + * * @param manager Entry point to MachineLearningManager. */ - public static void deleteBatchDeployment(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .batchDeployments() - .delete( - "test-rg", - "my-aml-workspace", - "testEndpointName", - "testDeploymentName", + public static void + deleteWorkspaceBatchDeployment(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.batchDeployments() + .delete("test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", com.azure.core.util.Context.NONE); } } @@ -327,24 +475,24 @@ public final class BatchDeploymentsDeleteSamples { ### BatchDeployments_Get ```java -/** Samples for BatchDeployments Get. */ +/** + * Samples for BatchDeployments Get. + */ public final class BatchDeploymentsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchDeployment/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/BatchDeployment/get.json */ /** - * Sample code: Get Batch Deployment. - * + * Sample code: Get Workspace Batch Deployment. + * * @param manager Entry point to MachineLearningManager. */ - public static void getBatchDeployment(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .batchDeployments() - .getWithResponse( - "test-rg", - "my-aml-workspace", - "testEndpointName", - "testDeploymentName", + public static void + getWorkspaceBatchDeployment(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.batchDeployments() + .getWithResponse("test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", com.azure.core.util.Context.NONE); } } @@ -353,21 +501,25 @@ public final class BatchDeploymentsGetSamples { ### BatchDeployments_List ```java -/** Samples for BatchDeployments List. */ +/** + * Samples for BatchDeployments List. + */ public final class BatchDeploymentsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchDeployment/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/BatchDeployment/list.json */ /** - * Sample code: List Batch Deployment. - * + * Sample code: List Workspace Batch Deployment. + * * @param manager Entry point to MachineLearningManager. */ - public static void listBatchDeployment(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .batchDeployments() - .list( - "test-rg", "my-aml-workspace", "testEndpointName", "string", 1, null, com.azure.core.util.Context.NONE); + public static void + listWorkspaceBatchDeployment(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.batchDeployments() + .list("test-rg", "my-aml-workspace", "testEndpointName", "string", 1, null, + com.azure.core.util.Context.NONE); } } ``` @@ -380,34 +532,33 @@ import com.azure.resourcemanager.machinelearning.models.PartialBatchDeployment; import java.util.HashMap; import java.util.Map; -/** Samples for BatchDeployments Update. */ +/** + * Samples for BatchDeployments Update. + */ public final class BatchDeploymentsUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchDeployment/update.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/BatchDeployment/update.json */ /** - * Sample code: Update Batch Deployment. - * + * Sample code: Update Workspace Batch Deployment. + * * @param manager Entry point to MachineLearningManager. */ - public static void updateBatchDeployment(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - BatchDeployment resource = - manager - .batchDeployments() - .getWithResponse( - "test-rg", - "my-aml-workspace", - "testEndpointName", - "testDeploymentName", - com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + public static void + updateWorkspaceBatchDeployment(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + BatchDeployment resource = manager.batchDeployments() + .getWithResponse("test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf()) .withProperties(new PartialBatchDeployment().withDescription("string")) .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -435,45 +586,43 @@ import com.azure.resourcemanager.machinelearning.models.UserAssignedIdentity; import java.util.HashMap; import java.util.Map; -/** Samples for BatchEndpoints CreateOrUpdate. */ +/** + * Samples for BatchEndpoints CreateOrUpdate. + */ public final class BatchEndpointsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchEndpoint/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/BatchEndpoint/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Batch Endpoint. - * + * Sample code: CreateOrUpdate Workspace Batch Endpoint. + * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateBatchEndpoint( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .batchEndpoints() + public static void + createOrUpdateWorkspaceBatchEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.batchEndpoints() .define("testEndpointName") .withRegion("string") .withExistingWorkspace("test-rg", "my-aml-workspace") - .withProperties( - new BatchEndpointProperties() - .withAuthMode(EndpointAuthMode.AMLTOKEN) - .withDescription("string") - .withProperties(mapOf("string", "string")) - .withDefaults(new BatchEndpointDefaults().withDeploymentName("string"))) + .withProperties(new BatchEndpointProperties().withAuthMode(EndpointAuthMode.AMLTOKEN) + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withDefaults(new BatchEndpointDefaults().withDeploymentName("string"))) .withTags(mapOf()) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) .withKind("string") - .withSku( - new Sku() - .withName("string") - .withTier(SkuTier.FREE) - .withSize("string") - .withFamily("string") - .withCapacity(1)) + .withSku(new Sku().withName("string") + .withTier(SkuTier.FREE) + .withSize("string") + .withFamily("string") + .withCapacity(1)) .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -490,19 +639,23 @@ public final class BatchEndpointsCreateOrUpdateSamples { ### BatchEndpoints_Delete ```java -/** Samples for BatchEndpoints Delete. */ +/** + * Samples for BatchEndpoints Delete. + */ public final class BatchEndpointsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchEndpoint/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/BatchEndpoint/delete.json */ /** - * Sample code: Delete Batch Endpoint. - * + * Sample code: Delete Workspace Batch Endpoint. + * * @param manager Entry point to MachineLearningManager. */ - public static void deleteBatchEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .batchEndpoints() + public static void + deleteWorkspaceBatchEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.batchEndpoints() .delete("resourceGroup-1234", "testworkspace", "testBatchEndpoint", com.azure.core.util.Context.NONE); } } @@ -511,19 +664,23 @@ public final class BatchEndpointsDeleteSamples { ### BatchEndpoints_Get ```java -/** Samples for BatchEndpoints Get. */ +/** + * Samples for BatchEndpoints Get. + */ public final class BatchEndpointsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchEndpoint/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/BatchEndpoint/get.json */ /** - * Sample code: Get Batch Endpoint. - * + * Sample code: Get Workspace Batch Endpoint. + * * @param manager Entry point to MachineLearningManager. */ - public static void getBatchEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .batchEndpoints() + public static void + getWorkspaceBatchEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.batchEndpoints() .getWithResponse("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE); } } @@ -532,17 +689,22 @@ public final class BatchEndpointsGetSamples { ### BatchEndpoints_List ```java -/** Samples for BatchEndpoints List. */ +/** + * Samples for BatchEndpoints List. + */ public final class BatchEndpointsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchEndpoint/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/BatchEndpoint/list.json */ /** - * Sample code: List Batch Endpoint. - * + * Sample code: List Workspace Batch Endpoint. + * * @param manager Entry point to MachineLearningManager. */ - public static void listBatchEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void + listWorkspaceBatchEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager.batchEndpoints().list("test-rg", "my-aml-workspace", 1, null, com.azure.core.util.Context.NONE); } } @@ -551,19 +713,23 @@ public final class BatchEndpointsListSamples { ### BatchEndpoints_ListKeys ```java -/** Samples for BatchEndpoints ListKeys. */ +/** + * Samples for BatchEndpoints ListKeys. + */ public final class BatchEndpointsListKeysSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchEndpoint/listKeys.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/BatchEndpoint/listKeys.json */ /** - * Sample code: ListKeys Batch Endpoint. - * + * Sample code: ListKeys Workspace Batch Endpoint. + * * @param manager Entry point to MachineLearningManager. */ - public static void listKeysBatchEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .batchEndpoints() + public static void + listKeysWorkspaceBatchEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.batchEndpoints() .listKeysWithResponse("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE); } } @@ -581,38 +747,35 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; -/** Samples for BatchEndpoints Update. */ +/** + * Samples for BatchEndpoints Update. + */ public final class BatchEndpointsUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchEndpoint/update.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/BatchEndpoint/update.json */ /** - * Sample code: Update Batch Endpoint. - * + * Sample code: Update Workspace Batch Endpoint. + * * @param manager Entry point to MachineLearningManager. */ - public static void updateBatchEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) - throws IOException { - BatchEndpoint resource = - manager - .batchEndpoints() - .getWithResponse("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + public static void updateWorkspaceBatchEndpoint( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) throws IOException { + BatchEndpoint resource = manager.batchEndpoints() + .getWithResponse("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf()) - .withIdentity( - new PartialManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities( - mapOf( - "string", - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize("{}", Object.class, SerializerEncoding.JSON)))) + .withIdentity(new PartialManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities(mapOf("string", + SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)))) .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -629,33 +792,35 @@ public final class BatchEndpointsUpdateSamples { ### CodeContainers_CreateOrUpdate ```java +import com.azure.resourcemanager.machinelearning.fluent.models.CodeContainerInner; import com.azure.resourcemanager.machinelearning.models.CodeContainerProperties; import java.util.HashMap; import java.util.Map; -/** Samples for CodeContainers CreateOrUpdate. */ +/** + * Samples for CodeContainers CreateOrUpdate. + */ public final class CodeContainersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeContainer/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/CodeContainer/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Code Container. - * + * Sample code: CreateOrUpdate Workspace Code Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateCodeContainer( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .codeContainers() - .define("testContainer") - .withExistingWorkspace("testrg123", "testworkspace") - .withProperties( - new CodeContainerProperties() - .withDescription("string") - .withTags(mapOf("tag1", "value1", "tag2", "value2"))) - .create(); + public static void + createOrUpdateWorkspaceCodeContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.codeContainers() + .createOrUpdateWithResponse("testrg123", "testworkspace", "testContainer", + new CodeContainerInner().withProperties(new CodeContainerProperties().withDescription("string") + .withTags(mapOf("tag1", "value1", "tag2", "value2"))), + com.azure.core.util.Context.NONE); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -672,19 +837,23 @@ public final class CodeContainersCreateOrUpdateSamples { ### CodeContainers_Delete ```java -/** Samples for CodeContainers Delete. */ +/** + * Samples for CodeContainers Delete. + */ public final class CodeContainersDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeContainer/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/CodeContainer/delete.json */ /** - * Sample code: Delete Code Container. - * + * Sample code: Delete Workspace Code Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void deleteCodeContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .codeContainers() + public static void + deleteWorkspaceCodeContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.codeContainers() .deleteWithResponse("testrg123", "testworkspace", "testContainer", com.azure.core.util.Context.NONE); } } @@ -693,19 +862,23 @@ public final class CodeContainersDeleteSamples { ### CodeContainers_Get ```java -/** Samples for CodeContainers Get. */ +/** + * Samples for CodeContainers Get. + */ public final class CodeContainersGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeContainer/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/CodeContainer/get.json */ /** - * Sample code: Get Code Container. - * + * Sample code: Get Workspace Code Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void getCodeContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .codeContainers() + public static void + getWorkspaceCodeContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.codeContainers() .getWithResponse("testrg123", "testworkspace", "testContainer", com.azure.core.util.Context.NONE); } } @@ -714,55 +887,93 @@ public final class CodeContainersGetSamples { ### CodeContainers_List ```java -/** Samples for CodeContainers List. */ +/** + * Samples for CodeContainers List. + */ public final class CodeContainersListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeContainer/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/CodeContainer/list.json */ /** - * Sample code: List Code Container. - * + * Sample code: List Workspace Code Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void listCodeContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void + listWorkspaceCodeContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager.codeContainers().list("testrg123", "testworkspace", null, com.azure.core.util.Context.NONE); } } ``` +### CodeVersions_CreateOrGetStartPendingUpload + +```java +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; +import com.azure.resourcemanager.machinelearning.models.PendingUploadType; + +/** + * Samples for CodeVersions CreateOrGetStartPendingUpload. + */ +public final class CodeVersionsCreateOrGetStartPendingUploadSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/CodeVersion/createOrGetStartPendingUpload.json + */ + /** + * Sample code: CreateOrGetStartPendingUpload Workspace Code Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrGetStartPendingUploadWorkspaceCodeVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.codeVersions() + .createOrGetStartPendingUploadWithResponse("test-rg", "my-aml-workspace", "string", "string", + new PendingUploadRequestDto().withPendingUploadId("string") + .withPendingUploadType(PendingUploadType.NONE), + com.azure.core.util.Context.NONE); + } +} +``` + ### CodeVersions_CreateOrUpdate ```java +import com.azure.resourcemanager.machinelearning.fluent.models.CodeVersionInner; import com.azure.resourcemanager.machinelearning.models.CodeVersionProperties; import java.util.HashMap; import java.util.Map; -/** Samples for CodeVersions CreateOrUpdate. */ +/** + * Samples for CodeVersions CreateOrUpdate. + */ public final class CodeVersionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeVersion/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/CodeVersion/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Code Version. - * + * Sample code: CreateOrUpdate Workspace Code Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateCodeVersion( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .codeVersions() - .define("string") - .withExistingCode("test-rg", "my-aml-workspace", "string") - .withProperties( - new CodeVersionProperties() - .withDescription("string") + public static void + createOrUpdateWorkspaceCodeVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.codeVersions() + .createOrUpdateWithResponse("test-rg", "my-aml-workspace", "string", "string", + new CodeVersionInner().withProperties(new CodeVersionProperties().withDescription("string") .withProperties(mapOf("string", "string")) .withTags(mapOf("string", "string")) .withIsAnonymous(false) - .withCodeUri("fakeTokenPlaceholder")) - .create(); + .withCodeUri("fakeTokenPlaceholder")), + com.azure.core.util.Context.NONE); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -779,19 +990,23 @@ public final class CodeVersionsCreateOrUpdateSamples { ### CodeVersions_Delete ```java -/** Samples for CodeVersions Delete. */ +/** + * Samples for CodeVersions Delete. + */ public final class CodeVersionsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeVersion/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/CodeVersion/delete.json */ /** - * Sample code: Delete Code Version. - * + * Sample code: Delete Workspace Code Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void deleteCodeVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .codeVersions() + public static void + deleteWorkspaceCodeVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.codeVersions() .deleteWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); } } @@ -800,19 +1015,23 @@ public final class CodeVersionsDeleteSamples { ### CodeVersions_Get ```java -/** Samples for CodeVersions Get. */ +/** + * Samples for CodeVersions Get. + */ public final class CodeVersionsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeVersion/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/CodeVersion/get.json */ /** - * Sample code: Get Code Version. - * + * Sample code: Get Workspace Code Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void getCodeVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .codeVersions() + public static void + getWorkspaceCodeVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.codeVersions() .getWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); } } @@ -821,20 +1040,56 @@ public final class CodeVersionsGetSamples { ### CodeVersions_List ```java -/** Samples for CodeVersions List. */ +/** + * Samples for CodeVersions List. + */ public final class CodeVersionsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeVersion/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/CodeVersion/list.json + */ + /** + * Sample code: List Workspace Code Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + listWorkspaceCodeVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.codeVersions() + .list("test-rg", "my-aml-workspace", "string", "string", 1, null, null, null, + com.azure.core.util.Context.NONE); + } +} +``` + +### CodeVersions_Publish + +```java +import com.azure.resourcemanager.machinelearning.models.DestinationAsset; + +/** + * Samples for CodeVersions Publish. + */ +public final class CodeVersionsPublishSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/CodeVersion/publish.json */ /** - * Sample code: List Code Version. - * + * Sample code: Publish Workspace Code Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void listCodeVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .codeVersions() - .list("test-rg", "my-aml-workspace", "string", "string", 1, null, com.azure.core.util.Context.NONE); + public static void + publishWorkspaceCodeVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.codeVersions() + .publish("test-rg", "my-aml-workspace", "string", "string", + new DestinationAsset().withDestinationName("string") + .withDestinationVersion("string") + .withRegistryName("string"), + com.azure.core.util.Context.NONE); } } ``` @@ -842,34 +1097,37 @@ public final class CodeVersionsListSamples { ### ComponentContainers_CreateOrUpdate ```java +import com.azure.resourcemanager.machinelearning.fluent.models.ComponentContainerInner; import com.azure.resourcemanager.machinelearning.models.ComponentContainerProperties; import java.util.HashMap; import java.util.Map; -/** Samples for ComponentContainers CreateOrUpdate. */ +/** + * Samples for ComponentContainers CreateOrUpdate. + */ public final class ComponentContainersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentContainer/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ComponentContainer/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Component Container. - * + * Sample code: CreateOrUpdate Workspace Component Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateComponentContainer( + public static void createOrUpdateWorkspaceComponentContainer( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .componentContainers() - .define("string") - .withExistingWorkspace("test-rg", "my-aml-workspace") - .withProperties( - new ComponentContainerProperties() - .withDescription("string") - .withProperties(mapOf("string", "string")) - .withTags(mapOf("string", "string"))) - .create(); + manager.componentContainers() + .createOrUpdateWithResponse("test-rg", "my-aml-workspace", "string", + new ComponentContainerInner() + .withProperties(new ComponentContainerProperties().withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string"))), + com.azure.core.util.Context.NONE); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -886,20 +1144,23 @@ public final class ComponentContainersCreateOrUpdateSamples { ### ComponentContainers_Delete ```java -/** Samples for ComponentContainers Delete. */ +/** + * Samples for ComponentContainers Delete. + */ public final class ComponentContainersDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentContainer/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ComponentContainer/delete.json */ /** - * Sample code: Delete Component Container. - * + * Sample code: Delete Workspace Component Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void deleteComponentContainer( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .componentContainers() + public static void + deleteWorkspaceComponentContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.componentContainers() .deleteWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); } } @@ -908,19 +1169,23 @@ public final class ComponentContainersDeleteSamples { ### ComponentContainers_Get ```java -/** Samples for ComponentContainers Get. */ +/** + * Samples for ComponentContainers Get. + */ public final class ComponentContainersGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentContainer/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ComponentContainer/get.json */ /** - * Sample code: Get Component Container. - * + * Sample code: Get Workspace Component Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void getComponentContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .componentContainers() + public static void + getWorkspaceComponentContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.componentContainers() .getWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); } } @@ -929,18 +1194,23 @@ public final class ComponentContainersGetSamples { ### ComponentContainers_List ```java -/** Samples for ComponentContainers List. */ + +/** + * Samples for ComponentContainers List. + */ public final class ComponentContainersListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentContainer/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ComponentContainer/list.json */ /** - * Sample code: List Component Container. - * + * Sample code: List Workspace Component Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void listComponentContainer( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void + listWorkspaceComponentContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager.componentContainers().list("test-rg", "my-aml-workspace", null, null, com.azure.core.util.Context.NONE); } } @@ -951,43 +1221,41 @@ public final class ComponentContainersListSamples { ```java import com.azure.core.management.serializer.SerializerFactory; import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.machinelearning.fluent.models.ComponentVersionInner; import com.azure.resourcemanager.machinelearning.models.ComponentVersionProperties; import java.io.IOException; import java.util.HashMap; import java.util.Map; -/** Samples for ComponentVersions CreateOrUpdate. */ +/** + * Samples for ComponentVersions CreateOrUpdate. + */ public final class ComponentVersionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentVersion/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ComponentVersion/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Component Version. - * + * Sample code: CreateOrUpdate Workspace Component Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateComponentVersion( + public static void createOrUpdateWorkspaceComponentVersion( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) throws IOException { - manager - .componentVersions() - .define("string") - .withExistingComponent("test-rg", "my-aml-workspace", "string") - .withProperties( - new ComponentVersionProperties() - .withDescription("string") + manager.componentVersions() + .createOrUpdateWithResponse("test-rg", "my-aml-workspace", "string", "string", + new ComponentVersionInner().withProperties(new ComponentVersionProperties().withDescription("string") .withProperties(mapOf("string", "string")) .withTags(mapOf("string", "string")) .withIsAnonymous(false) - .withComponentSpec( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"8ced901b-d826-477d-bfef-329da9672513\":null}", - Object.class, - SerializerEncoding.JSON))) - .create(); + .withComponentSpec(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"8ced901b-d826-477d-bfef-329da9672513\":null}", Object.class, + SerializerEncoding.JSON))), + com.azure.core.util.Context.NONE); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -1004,20 +1272,23 @@ public final class ComponentVersionsCreateOrUpdateSamples { ### ComponentVersions_Delete ```java -/** Samples for ComponentVersions Delete. */ +/** + * Samples for ComponentVersions Delete. + */ public final class ComponentVersionsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentVersion/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ComponentVersion/delete.json */ /** - * Sample code: Delete Component Version. - * + * Sample code: Delete Workspace Component Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void deleteComponentVersion( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .componentVersions() + public static void + deleteWorkspaceComponentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.componentVersions() .deleteWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); } } @@ -1026,19 +1297,23 @@ public final class ComponentVersionsDeleteSamples { ### ComponentVersions_Get ```java -/** Samples for ComponentVersions Get. */ +/** + * Samples for ComponentVersions Get. + */ public final class ComponentVersionsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentVersion/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ComponentVersion/get.json */ /** - * Sample code: Get Component Version. - * + * Sample code: Get Workspace Component Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void getComponentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .componentVersions() + public static void + getWorkspaceComponentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.componentVersions() .getWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); } } @@ -1047,24 +1322,60 @@ public final class ComponentVersionsGetSamples { ### ComponentVersions_List ```java -/** Samples for ComponentVersions List. */ + +/** + * Samples for ComponentVersions List. + */ public final class ComponentVersionsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentVersion/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ComponentVersion/list.json */ /** - * Sample code: List Component Version. - * + * Sample code: List Workspace Component Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void listComponentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .componentVersions() + public static void + listWorkspaceComponentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.componentVersions() .list("test-rg", "my-aml-workspace", "string", "string", 1, null, null, com.azure.core.util.Context.NONE); } } ``` +### ComponentVersions_Publish + +```java +import com.azure.resourcemanager.machinelearning.models.DestinationAsset; + +/** + * Samples for ComponentVersions Publish. + */ +public final class ComponentVersionsPublishSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ComponentVersion/publish.json + */ + /** + * Sample code: Publish Workspace Component Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + publishWorkspaceComponentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.componentVersions() + .publish("test-rg", "my-aml-workspace", "string", "string", + new DestinationAsset().withDestinationName("string") + .withDestinationVersion("string") + .withRegistryName("string"), + com.azure.core.util.Context.NONE); + } +} +``` + ### Compute_CreateOrUpdate ```java @@ -1078,36 +1389,56 @@ import com.azure.resourcemanager.machinelearning.models.ComputeInstance; import com.azure.resourcemanager.machinelearning.models.ComputeInstanceAuthorizationType; import com.azure.resourcemanager.machinelearning.models.ComputeInstanceProperties; import com.azure.resourcemanager.machinelearning.models.ComputeInstanceSshSettings; +import com.azure.resourcemanager.machinelearning.models.ComputePowerAction; +import com.azure.resourcemanager.machinelearning.models.ComputeSchedules; +import com.azure.resourcemanager.machinelearning.models.ComputeStartStopSchedule; +import com.azure.resourcemanager.machinelearning.models.ComputeTriggerType; +import com.azure.resourcemanager.machinelearning.models.Cron; +import com.azure.resourcemanager.machinelearning.models.CustomService; import com.azure.resourcemanager.machinelearning.models.DataFactory; +import com.azure.resourcemanager.machinelearning.models.Docker; +import com.azure.resourcemanager.machinelearning.models.Endpoint; +import com.azure.resourcemanager.machinelearning.models.EnvironmentVariable; +import com.azure.resourcemanager.machinelearning.models.EnvironmentVariableType; +import com.azure.resourcemanager.machinelearning.models.Image; +import com.azure.resourcemanager.machinelearning.models.ImageType; import com.azure.resourcemanager.machinelearning.models.InstanceTypeSchema; import com.azure.resourcemanager.machinelearning.models.InstanceTypeSchemaResources; import com.azure.resourcemanager.machinelearning.models.Kubernetes; import com.azure.resourcemanager.machinelearning.models.KubernetesProperties; import com.azure.resourcemanager.machinelearning.models.OsType; import com.azure.resourcemanager.machinelearning.models.PersonalComputeInstanceSettings; +import com.azure.resourcemanager.machinelearning.models.Protocol; import com.azure.resourcemanager.machinelearning.models.RemoteLoginPortPublicAccess; import com.azure.resourcemanager.machinelearning.models.ResourceId; import com.azure.resourcemanager.machinelearning.models.ScaleSettings; +import com.azure.resourcemanager.machinelearning.models.ScheduleStatus; import com.azure.resourcemanager.machinelearning.models.SshPublicAccess; import com.azure.resourcemanager.machinelearning.models.VirtualMachineImage; import com.azure.resourcemanager.machinelearning.models.VmPriority; +import com.azure.resourcemanager.machinelearning.models.VolumeDefinition; +import com.azure.resourcemanager.machinelearning.models.VolumeDefinitionType; import java.time.Duration; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for Compute CreateOrUpdate. */ +/** + * Samples for Compute CreateOrUpdate. + */ public final class ComputeCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/BasicAKSCompute.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/createOrUpdate/BasicAKSCompute.json */ /** * Sample code: Create an AKS Compute. - * + * * @param manager Entry point to MachineLearningManager. */ public static void createAnAKSCompute(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .computes() + manager.computes() .define("compute123") .withExistingWorkspace("testrg123", "workspaces123") .withRegion("eastus") @@ -1116,180 +1447,177 @@ public final class ComputeCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/AKSCompute.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/createOrUpdate/AKSCompute.json */ /** * Sample code: Update an AKS Compute. - * + * * @param manager Entry point to MachineLearningManager. */ public static void updateAnAKSCompute(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .computes() + manager.computes() .define("compute123") .withExistingWorkspace("testrg123", "workspaces123") .withRegion("eastus") - .withProperties( - new Aks() - .withDescription("some compute") - .withResourceId( - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/testrg123/providers/Microsoft.ContainerService/managedClusters/compute123-56826-c9b00420020b2") - .withProperties(new AksSchemaProperties().withAgentCount(4))) + .withProperties(new Aks().withDescription("some compute") + .withResourceId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/testrg123/providers/Microsoft.ContainerService/managedClusters/compute123-56826-c9b00420020b2") + .withProperties(new AksSchemaProperties().withAgentCount(4))) .create(); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/KubernetesCompute.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/createOrUpdate/KubernetesCompute.json */ /** * Sample code: Attach a Kubernetes Compute. - * + * * @param manager Entry point to MachineLearningManager. */ - public static void attachAKubernetesCompute( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .computes() + public static void + attachAKubernetesCompute(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.computes() .define("compute123") .withExistingWorkspace("testrg123", "workspaces123") .withRegion("eastus") - .withProperties( - new Kubernetes() - .withDescription("some compute") - .withResourceId( - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/testrg123/providers/Microsoft.ContainerService/managedClusters/compute123-56826-c9b00420020b2") - .withProperties( - new KubernetesProperties() - .withNamespace("default") - .withDefaultInstanceType("defaultInstanceType") - .withInstanceTypes( - mapOf( - "defaultInstanceType", - new InstanceTypeSchema() - .withResources( - new InstanceTypeSchemaResources() - .withRequests( - mapOf("cpu", "1", "memory", "4Gi", "nvidia.com/gpu", null)) - .withLimits( - mapOf("cpu", "1", "memory", "4Gi", "nvidia.com/gpu", null))))))) + .withProperties(new Kubernetes().withDescription("some compute") + .withResourceId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/testrg123/providers/Microsoft.ContainerService/managedClusters/compute123-56826-c9b00420020b2") + .withProperties(new KubernetesProperties().withNamespace("default") + .withDefaultInstanceType("defaultInstanceType") + .withInstanceTypes(mapOf("defaultInstanceType", + new InstanceTypeSchema().withResources(new InstanceTypeSchemaResources() + .withRequests(mapOf("cpu", "1", "memory", "4Gi", "nvidia.com/gpu", null)) + .withLimits(mapOf("cpu", "1", "memory", "4Gi", "nvidia.com/gpu", null))))))) .create(); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/ComputeInstanceWithSchedules.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/createOrUpdate/ComputeInstanceWithSchedules.json */ /** * Sample code: Create an ComputeInstance Compute with Schedules. - * + * * @param manager Entry point to MachineLearningManager. */ public static void createAnComputeInstanceComputeWithSchedules( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .computes() + manager.computes() .define("compute123") .withExistingWorkspace("testrg123", "workspaces123") .withRegion("eastus") .withProperties( - new ComputeInstance() - .withProperties( - new ComputeInstanceProperties() - .withVmSize("STANDARD_NC6") - .withApplicationSharingPolicy(ApplicationSharingPolicy.PERSONAL) - .withSshSettings( - new ComputeInstanceSshSettings().withSshPublicAccess(SshPublicAccess.DISABLED)) - .withComputeInstanceAuthorizationType(ComputeInstanceAuthorizationType.PERSONAL) - .withPersonalComputeInstanceSettings( - new PersonalComputeInstanceSettings() - .withAssignedUser( - new AssignedUser() - .withObjectId("00000000-0000-0000-0000-000000000000") - .withTenantId("00000000-0000-0000-0000-000000000000"))))) + new ComputeInstance().withProperties(new ComputeInstanceProperties().withVmSize("STANDARD_NC6") + .withApplicationSharingPolicy(ApplicationSharingPolicy.PERSONAL) + .withSshSettings(new ComputeInstanceSshSettings().withSshPublicAccess(SshPublicAccess.DISABLED)) + .withComputeInstanceAuthorizationType(ComputeInstanceAuthorizationType.PERSONAL) + .withPersonalComputeInstanceSettings(new PersonalComputeInstanceSettings() + .withAssignedUser(new AssignedUser().withObjectId("00000000-0000-0000-0000-000000000000") + .withTenantId("00000000-0000-0000-0000-000000000000"))) + .withSchedules(new ComputeSchedules().withComputeStartStop( + Arrays.asList(new ComputeStartStopSchedule().withStatus(ScheduleStatus.ENABLED) + .withAction(ComputePowerAction.STOP) + .withTriggerType(ComputeTriggerType.CRON) + .withCron(new Cron().withStartTime("2021-04-23T01:30:00") + .withTimeZone("Pacific Standard Time") + .withExpression("0 18 * * *"))))))) .create(); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/BasicAmlCompute.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/createOrUpdate/BasicAmlCompute.json */ /** * Sample code: Create a AML Compute. - * + * * @param manager Entry point to MachineLearningManager. */ public static void createAAMLCompute(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .computes() + manager.computes() .define("compute123") .withExistingWorkspace("testrg123", "workspaces123") .withRegion("eastus") - .withProperties( - new AmlCompute() - .withProperties( - new AmlComputeProperties() - .withOsType(OsType.WINDOWS) - .withVmSize("STANDARD_NC6") - .withVmPriority(VmPriority.DEDICATED) - .withVirtualMachineImage( - new VirtualMachineImage() - .withId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myImageGallery/images/myImageDefinition/versions/0.0.1")) - .withIsolatedNetwork(false) - .withScaleSettings( - new ScaleSettings() - .withMaxNodeCount(1) - .withMinNodeCount(0) - .withNodeIdleTimeBeforeScaleDown(Duration.parse("PT5M"))) - .withRemoteLoginPortPublicAccess(RemoteLoginPortPublicAccess.NOT_SPECIFIED) - .withEnableNodePublicIp(true))) + .withProperties(new AmlCompute().withProperties(new AmlComputeProperties().withOsType(OsType.WINDOWS) + .withVmSize("STANDARD_NC6") + .withVmPriority(VmPriority.DEDICATED) + .withVirtualMachineImage(new VirtualMachineImage().withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myImageGallery/images/myImageDefinition/versions/0.0.1")) + .withIsolatedNetwork(false) + .withScaleSettings(new ScaleSettings().withMaxNodeCount(1) + .withMinNodeCount(0) + .withNodeIdleTimeBeforeScaleDown(Duration.parse("PT5M"))) + .withRemoteLoginPortPublicAccess(RemoteLoginPortPublicAccess.NOT_SPECIFIED) + .withEnableNodePublicIp(true))) .create(); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/ComputeInstance.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/createOrUpdate/ComputeInstance.json */ /** * Sample code: Create an ComputeInstance Compute. - * + * * @param manager Entry point to MachineLearningManager. */ - public static void createAnComputeInstanceCompute( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .computes() + public static void + createAnComputeInstanceCompute(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.computes() .define("compute123") .withExistingWorkspace("testrg123", "workspaces123") .withRegion("eastus") .withProperties( - new ComputeInstance() - .withProperties( - new ComputeInstanceProperties() - .withVmSize("STANDARD_NC6") - .withSubnet(new ResourceId().withId("test-subnet-resource-id")) - .withApplicationSharingPolicy(ApplicationSharingPolicy.PERSONAL) - .withSshSettings( - new ComputeInstanceSshSettings().withSshPublicAccess(SshPublicAccess.DISABLED)) - .withComputeInstanceAuthorizationType(ComputeInstanceAuthorizationType.PERSONAL) - .withPersonalComputeInstanceSettings( - new PersonalComputeInstanceSettings() - .withAssignedUser( - new AssignedUser() - .withObjectId("00000000-0000-0000-0000-000000000000") - .withTenantId("00000000-0000-0000-0000-000000000000"))))) + new ComputeInstance().withProperties(new ComputeInstanceProperties().withVmSize("STANDARD_NC6") + .withSubnet(new ResourceId().withId("test-subnet-resource-id")) + .withApplicationSharingPolicy(ApplicationSharingPolicy.PERSONAL) + .withSshSettings(new ComputeInstanceSshSettings().withSshPublicAccess(SshPublicAccess.DISABLED)) + .withCustomServices(Arrays.asList(new CustomService().withName("rstudio") + .withImage(new Image().withType(ImageType.DOCKER) + .withReference("ghcr.io/azure/rocker-rstudio-ml-verse:latest") + .withAdditionalProperties(mapOf())) + .withEnvironmentVariables(mapOf("test_variable", + new EnvironmentVariable().withType(EnvironmentVariableType.LOCAL) + .withValue("test_value") + .withAdditionalProperties(mapOf()))) + .withDocker(new Docker().withPrivileged(true).withAdditionalProperties(mapOf())) + .withEndpoints(Arrays.asList(new Endpoint().withProtocol(Protocol.HTTP) + .withName("connect") + .withTarget(8787) + .withPublished(8787))) + .withVolumes(Arrays.asList(new VolumeDefinition().withType(VolumeDefinitionType.BIND) + .withReadOnly(false) + .withSource("/home/azureuser/cloudfiles") + .withTarget("/home/azureuser/cloudfiles"))) + .withAdditionalProperties(mapOf()))) + .withComputeInstanceAuthorizationType(ComputeInstanceAuthorizationType.PERSONAL) + .withPersonalComputeInstanceSettings(new PersonalComputeInstanceSettings() + .withAssignedUser(new AssignedUser().withObjectId("00000000-0000-0000-0000-000000000000") + .withTenantId("00000000-0000-0000-0000-000000000000"))))) .create(); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/ComputeInstanceMinimal.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/createOrUpdate/ComputeInstanceMinimal.json */ /** * Sample code: Create an ComputeInstance Compute with minimal inputs. - * + * * @param manager Entry point to MachineLearningManager. */ public static void createAnComputeInstanceComputeWithMinimalInputs( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .computes() + manager.computes() .define("compute123") .withExistingWorkspace("testrg123", "workspaces123") .withRegion("eastus") @@ -1299,44 +1627,40 @@ public final class ComputeCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/AmlCompute.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/createOrUpdate/AmlCompute.json */ /** * Sample code: Update a AML Compute. - * + * * @param manager Entry point to MachineLearningManager. */ public static void updateAAMLCompute(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .computes() + manager.computes() .define("compute123") .withExistingWorkspace("testrg123", "workspaces123") .withRegion("eastus") - .withProperties( - new AmlCompute() - .withDescription("some compute") - .withProperties( - new AmlComputeProperties() - .withScaleSettings( - new ScaleSettings() - .withMaxNodeCount(4) - .withMinNodeCount(4) - .withNodeIdleTimeBeforeScaleDown(Duration.parse("PT5M"))))) + .withProperties(new AmlCompute().withDescription("some compute") + .withProperties(new AmlComputeProperties().withScaleSettings(new ScaleSettings().withMaxNodeCount(4) + .withMinNodeCount(4) + .withNodeIdleTimeBeforeScaleDown(Duration.parse("PT5M"))))) .create(); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/BasicDataFactoryCompute.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/createOrUpdate/BasicDataFactoryCompute.json */ /** * Sample code: Create a DataFactory Compute. - * + * * @param manager Entry point to MachineLearningManager. */ - public static void createADataFactoryCompute( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .computes() + public static void + createADataFactoryCompute(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.computes() .define("compute123") .withExistingWorkspace("testrg123", "workspaces123") .withRegion("eastus") @@ -1344,6 +1668,7 @@ public final class ComputeCreateOrUpdateSamples { .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -1362,24 +1687,23 @@ public final class ComputeCreateOrUpdateSamples { ```java import com.azure.resourcemanager.machinelearning.models.UnderlyingResourceAction; -/** Samples for Compute Delete. */ +/** + * Samples for Compute Delete. + */ public final class ComputeDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/delete.json */ /** * Sample code: Delete Compute. - * + * * @param manager Entry point to MachineLearningManager. */ public static void deleteCompute(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .computes() - .delete( - "testrg123", - "workspaces123", - "compute123", - UnderlyingResourceAction.DELETE, + manager.computes() + .delete("testrg123", "workspaces123", "compute123", UnderlyingResourceAction.DELETE, com.azure.core.util.Context.NONE); } } @@ -1388,61 +1712,67 @@ public final class ComputeDeleteSamples { ### Compute_Get ```java -/** Samples for Compute Get. */ +/** + * Samples for Compute Get. + */ public final class ComputeGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/get/AKSCompute.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/get/AKSCompute.json */ /** * Sample code: Get a AKS Compute. - * + * * @param manager Entry point to MachineLearningManager. */ public static void getAAKSCompute(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .computes() + manager.computes() .getWithResponse("testrg123", "workspaces123", "compute123", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/get/KubernetesCompute.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/get/KubernetesCompute.json */ /** * Sample code: Get a Kubernetes Compute. - * + * * @param manager Entry point to MachineLearningManager. */ public static void getAKubernetesCompute(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .computes() + manager.computes() .getWithResponse("testrg123", "workspaces123", "compute123", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/get/ComputeInstance.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/get/ComputeInstance.json */ /** * Sample code: Get an ComputeInstance. - * + * * @param manager Entry point to MachineLearningManager. */ public static void getAnComputeInstance(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .computes() + manager.computes() .getWithResponse("testrg123", "workspaces123", "compute123", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/get/AmlCompute.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/get/AmlCompute.json */ /** * Sample code: Get a AML Compute. - * + * * @param manager Entry point to MachineLearningManager. */ public static void getAAMLCompute(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .computes() + manager.computes() .getWithResponse("testrg123", "workspaces123", "compute123", com.azure.core.util.Context.NONE); } } @@ -1451,14 +1781,18 @@ public final class ComputeGetSamples { ### Compute_List ```java -/** Samples for Compute List. */ +/** + * Samples for Compute List. + */ public final class ComputeListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/list.json */ /** * Sample code: Get Computes. - * + * * @param manager Entry point to MachineLearningManager. */ public static void getComputes(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { @@ -1470,19 +1804,22 @@ public final class ComputeListSamples { ### Compute_ListKeys ```java -/** Samples for Compute ListKeys. */ +/** + * Samples for Compute ListKeys. + */ public final class ComputeListKeysSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/listKeys.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/listKeys.json */ /** * Sample code: List AKS Compute Keys. - * + * * @param manager Entry point to MachineLearningManager. */ public static void listAKSComputeKeys(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .computes() + manager.computes() .listKeysWithResponse("testrg123", "workspaces123", "compute123", com.azure.core.util.Context.NONE); } } @@ -1491,14 +1828,18 @@ public final class ComputeListKeysSamples { ### Compute_ListNodes ```java -/** Samples for Compute ListNodes. */ +/** + * Samples for Compute ListNodes. + */ public final class ComputeListNodesSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/listNodes.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/listNodes.json */ /** * Sample code: Get compute nodes information for a compute. - * + * * @param manager Entry point to MachineLearningManager. */ public static void getComputeNodesInformationForACompute( @@ -1511,18 +1852,22 @@ public final class ComputeListNodesSamples { ### Compute_Restart ```java -/** Samples for Compute Restart. */ +/** + * Samples for Compute Restart. + */ public final class ComputeRestartSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/restart.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/restart.json */ /** * Sample code: Restart ComputeInstance Compute. - * + * * @param manager Entry point to MachineLearningManager. */ - public static void restartComputeInstanceCompute( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void + restartComputeInstanceCompute(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager.computes().restart("testrg123", "workspaces123", "compute123", com.azure.core.util.Context.NONE); } } @@ -1531,18 +1876,22 @@ public final class ComputeRestartSamples { ### Compute_Start ```java -/** Samples for Compute Start. */ +/** + * Samples for Compute Start. + */ public final class ComputeStartSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/start.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/start.json */ /** * Sample code: Start ComputeInstance Compute. - * + * * @param manager Entry point to MachineLearningManager. */ - public static void startComputeInstanceCompute( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void + startComputeInstanceCompute(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager.computes().start("testrg123", "workspaces123", "compute123", com.azure.core.util.Context.NONE); } } @@ -1551,18 +1900,22 @@ public final class ComputeStartSamples { ### Compute_Stop ```java -/** Samples for Compute Stop. */ +/** + * Samples for Compute Stop. + */ public final class ComputeStopSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/stop.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/stop.json */ /** * Sample code: Stop ComputeInstance Compute. - * + * * @param manager Entry point to MachineLearningManager. */ - public static void stopComputeInstanceCompute( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void + stopComputeInstanceCompute(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager.computes().stop("testrg123", "workspaces123", "compute123", com.azure.core.util.Context.NONE); } } @@ -1576,32 +1929,29 @@ import com.azure.resourcemanager.machinelearning.models.ScaleSettings; import com.azure.resourcemanager.machinelearning.models.ScaleSettingsInformation; import java.time.Duration; -/** Samples for Compute Update. */ +/** + * Samples for Compute Update. + */ public final class ComputeUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/patch.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/patch.json */ /** * Sample code: Update a AmlCompute Compute. - * - * @param manager Entry point to MachineLearningManager. - */ - public static void updateAAmlComputeCompute( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - ComputeResource resource = - manager - .computes() - .getWithResponse("testrg123", "workspaces123", "compute123", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() - .withProperties( - new ScaleSettingsInformation() - .withScaleSettings( - new ScaleSettings() - .withMaxNodeCount(4) - .withMinNodeCount(4) - .withNodeIdleTimeBeforeScaleDown(Duration.parse("PT5M")))) + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + updateAAmlComputeCompute(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + ComputeResource resource = manager.computes() + .getWithResponse("testrg123", "workspaces123", "compute123", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new ScaleSettingsInformation().withScaleSettings(new ScaleSettings().withMaxNodeCount(4) + .withMinNodeCount(4) + .withNodeIdleTimeBeforeScaleDown(Duration.parse("PT5M")))) .apply(); } } @@ -1610,36 +1960,38 @@ public final class ComputeUpdateSamples { ### DataContainers_CreateOrUpdate ```java +import com.azure.resourcemanager.machinelearning.fluent.models.DataContainerInner; import com.azure.resourcemanager.machinelearning.models.DataContainerProperties; import com.azure.resourcemanager.machinelearning.models.DataType; import java.util.HashMap; import java.util.Map; -/** Samples for DataContainers CreateOrUpdate. */ +/** + * Samples for DataContainers CreateOrUpdate. + */ public final class DataContainersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataContainer/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/DataContainer/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Data Container. - * + * Sample code: CreateOrUpdate Workspace Data Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateDataContainer( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .dataContainers() - .define("datacontainer123") - .withExistingWorkspace("testrg123", "workspace123") - .withProperties( - new DataContainerProperties() - .withDescription("string") + public static void + createOrUpdateWorkspaceDataContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.dataContainers() + .createOrUpdateWithResponse("testrg123", "workspace123", "datacontainer123", + new DataContainerInner().withProperties(new DataContainerProperties().withDescription("string") .withProperties(mapOf("properties1", "value1", "properties2", "value2")) .withTags(mapOf("tag1", "value1", "tag2", "value2")) - .withDataType(DataType.fromString("UriFile"))) - .create(); + .withDataType(DataType.fromString("UriFile"))), + com.azure.core.util.Context.NONE); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -1656,19 +2008,23 @@ public final class DataContainersCreateOrUpdateSamples { ### DataContainers_Delete ```java -/** Samples for DataContainers Delete. */ +/** + * Samples for DataContainers Delete. + */ public final class DataContainersDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataContainer/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/DataContainer/delete.json */ /** - * Sample code: Delete Data Container. - * + * Sample code: Delete Workspace Data Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void deleteDataContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .dataContainers() + public static void + deleteWorkspaceDataContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.dataContainers() .deleteWithResponse("testrg123", "workspace123", "datacontainer123", com.azure.core.util.Context.NONE); } } @@ -1677,19 +2033,23 @@ public final class DataContainersDeleteSamples { ### DataContainers_Get ```java -/** Samples for DataContainers Get. */ +/** + * Samples for DataContainers Get. + */ public final class DataContainersGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataContainer/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/DataContainer/get.json */ /** - * Sample code: Get Data Container. - * + * Sample code: Get Workspace Data Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void getDataContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .dataContainers() + public static void + getWorkspaceDataContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.dataContainers() .getWithResponse("testrg123", "workspace123", "datacontainer123", com.azure.core.util.Context.NONE); } } @@ -1698,17 +2058,23 @@ public final class DataContainersGetSamples { ### DataContainers_List ```java -/** Samples for DataContainers List. */ + +/** + * Samples for DataContainers List. + */ public final class DataContainersListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataContainer/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/DataContainer/list.json */ /** - * Sample code: List Data Container. - * + * Sample code: List Workspace Data Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void listDataContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void + listWorkspaceDataContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager.dataContainers().list("testrg123", "workspace123", null, null, com.azure.core.util.Context.NONE); } } @@ -1717,36 +2083,38 @@ public final class DataContainersListSamples { ### DataVersions_CreateOrUpdate ```java +import com.azure.resourcemanager.machinelearning.fluent.models.DataVersionBaseInner; import com.azure.resourcemanager.machinelearning.models.UriFileDataVersion; import java.util.HashMap; import java.util.Map; -/** Samples for DataVersions CreateOrUpdate. */ +/** + * Samples for DataVersions CreateOrUpdate. + */ public final class DataVersionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataVersionBase/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/DataVersionBase/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Data Version Base. - * + * Sample code: CreateOrUpdate Workspace Data Version Base. + * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateDataVersionBase( + public static void createOrUpdateWorkspaceDataVersionBase( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .dataVersions() - .define("string") - .withExistingData("test-rg", "my-aml-workspace", "string") - .withProperties( - new UriFileDataVersion() - .withDescription("string") + manager.dataVersions() + .createOrUpdateWithResponse("test-rg", "my-aml-workspace", "string", "string", + new DataVersionBaseInner().withProperties(new UriFileDataVersion().withDescription("string") .withProperties(mapOf("string", "string")) .withTags(mapOf("string", "string")) .withIsAnonymous(false) - .withDataUri("string")) - .create(); + .withDataUri("string")), + com.azure.core.util.Context.NONE); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -1763,19 +2131,23 @@ public final class DataVersionsCreateOrUpdateSamples { ### DataVersions_Delete ```java -/** Samples for DataVersions Delete. */ +/** + * Samples for DataVersions Delete. + */ public final class DataVersionsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataVersionBase/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/DataVersionBase/delete.json */ /** - * Sample code: Delete Data Version Base. - * + * Sample code: Delete Workspace Data Version Base. + * * @param manager Entry point to MachineLearningManager. */ - public static void deleteDataVersionBase(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .dataVersions() + public static void + deleteWorkspaceDataVersionBase(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.dataVersions() .deleteWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); } } @@ -1784,19 +2156,23 @@ public final class DataVersionsDeleteSamples { ### DataVersions_Get ```java -/** Samples for DataVersions Get. */ +/** + * Samples for DataVersions Get. + */ public final class DataVersionsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataVersionBase/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/DataVersionBase/get.json */ /** - * Sample code: Get Data Version Base. - * + * Sample code: Get Workspace Data Version Base. + * * @param manager Entry point to MachineLearningManager. */ - public static void getDataVersionBase(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .dataVersions() + public static void + getWorkspaceDataVersionBase(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.dataVersions() .getWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); } } @@ -1805,28 +2181,56 @@ public final class DataVersionsGetSamples { ### DataVersions_List ```java -/** Samples for DataVersions List. */ + +/** + * Samples for DataVersions List. + */ public final class DataVersionsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataVersionBase/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/DataVersionBase/list.json + */ + /** + * Sample code: List Workspace Data Version Base. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + listWorkspaceDataVersionBase(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.dataVersions() + .list("test-rg", "my-aml-workspace", "string", "string", 1, null, "string", null, + com.azure.core.util.Context.NONE); + } +} +``` + +### DataVersions_Publish + +```java +import com.azure.resourcemanager.machinelearning.models.DestinationAsset; + +/** + * Samples for DataVersions Publish. + */ +public final class DataVersionsPublishSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/DataVersionBase/publish.json */ /** - * Sample code: List Data Version Base. - * + * Sample code: Publish Workspace Data Version Base. + * * @param manager Entry point to MachineLearningManager. */ - public static void listDataVersionBase(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .dataVersions() - .list( - "test-rg", - "my-aml-workspace", - "string", - "string", - 1, - null, - "string", - null, + public static void + publishWorkspaceDataVersionBase(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.dataVersions() + .publish("test-rg", "my-aml-workspace", "string", "string", + new DestinationAsset().withDestinationName("string") + .withDestinationVersion("string") + .withRegistryName("string"), com.azure.core.util.Context.NONE); } } @@ -1847,131 +2251,122 @@ import java.util.HashMap; import java.util.Map; import java.util.UUID; -/** Samples for Datastores CreateOrUpdate. */ +/** + * Samples for Datastores CreateOrUpdate. + */ public final class DatastoresCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/AzureDataLakeGen1WServicePrincipal/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Datastore/AzureDataLakeGen1WServicePrincipal/createOrUpdate.json */ /** * Sample code: CreateOrUpdate datastore (Azure Data Lake Gen1 w/ ServicePrincipal). - * + * * @param manager Entry point to MachineLearningManager. */ public static void createOrUpdateDatastoreAzureDataLakeGen1WServicePrincipal( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .datastores() + manager.datastores() .define("string") .withExistingWorkspace("test-rg", "my-aml-workspace") - .withProperties( - new AzureDataLakeGen1Datastore() - .withDescription("string") - .withTags(mapOf("string", "string")) - .withCredentials( - new ServicePrincipalDatastoreCredentials() - .withAuthorityUrl("string") - .withClientId(UUID.fromString("00000000-1111-2222-3333-444444444444")) - .withResourceUrl("string") - .withSecrets( - new ServicePrincipalDatastoreSecrets().withClientSecret("fakeTokenPlaceholder")) - .withTenantId(UUID.fromString("00000000-1111-2222-3333-444444444444"))) - .withStoreName("string")) + .withProperties(new AzureDataLakeGen1Datastore().withDescription("string") + .withTags(mapOf("string", "string")) + .withCredentials(new ServicePrincipalDatastoreCredentials().withAuthorityUrl("string") + .withClientId(UUID.fromString("00000000-1111-2222-3333-444444444444")) + .withResourceUrl("string") + .withSecrets(new ServicePrincipalDatastoreSecrets().withClientSecret("fakeTokenPlaceholder")) + .withTenantId(UUID.fromString("00000000-1111-2222-3333-444444444444"))) + .withStoreName("string")) .withSkipValidation(false) .create(); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/AzureDataLakeGen2WServicePrincipal/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Datastore/AzureDataLakeGen2WServicePrincipal/createOrUpdate.json */ /** * Sample code: CreateOrUpdate datastore (Azure Data Lake Gen2 w/ Service Principal). - * + * * @param manager Entry point to MachineLearningManager. */ public static void createOrUpdateDatastoreAzureDataLakeGen2WServicePrincipal( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .datastores() + manager.datastores() .define("string") .withExistingWorkspace("test-rg", "my-aml-workspace") - .withProperties( - new AzureDataLakeGen2Datastore() - .withDescription("string") - .withTags(mapOf("string", "string")) - .withCredentials( - new ServicePrincipalDatastoreCredentials() - .withAuthorityUrl("string") - .withClientId(UUID.fromString("00000000-1111-2222-3333-444444444444")) - .withResourceUrl("string") - .withSecrets( - new ServicePrincipalDatastoreSecrets().withClientSecret("fakeTokenPlaceholder")) - .withTenantId(UUID.fromString("00000000-1111-2222-3333-444444444444"))) - .withAccountName("string") - .withEndpoint("string") - .withFilesystem("string") - .withProtocol("string")) + .withProperties(new AzureDataLakeGen2Datastore().withDescription("string") + .withTags(mapOf("string", "string")) + .withCredentials(new ServicePrincipalDatastoreCredentials().withAuthorityUrl("string") + .withClientId(UUID.fromString("00000000-1111-2222-3333-444444444444")) + .withResourceUrl("string") + .withSecrets(new ServicePrincipalDatastoreSecrets().withClientSecret("fakeTokenPlaceholder")) + .withTenantId(UUID.fromString("00000000-1111-2222-3333-444444444444"))) + .withAccountName("string") + .withEndpoint("string") + .withFilesystem("string") + .withProtocol("string")) .withSkipValidation(false) .create(); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/AzureBlobWAccountKey/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Datastore/AzureBlobWAccountKey/createOrUpdate.json */ /** * Sample code: CreateOrUpdate datastore (AzureBlob w/ AccountKey). - * + * * @param manager Entry point to MachineLearningManager. */ public static void createOrUpdateDatastoreAzureBlobWAccountKey( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .datastores() + manager.datastores() .define("string") .withExistingWorkspace("test-rg", "my-aml-workspace") - .withProperties( - new AzureBlobDatastore() - .withDescription("string") - .withTags(mapOf("string", "string")) - .withCredentials( - new AccountKeyDatastoreCredentials() - .withSecrets(new AccountKeyDatastoreSecrets().withKey("fakeTokenPlaceholder"))) - .withAccountName("string") - .withContainerName("string") - .withEndpoint("core.windows.net") - .withProtocol("https")) + .withProperties(new AzureBlobDatastore().withDescription("string") + .withTags(mapOf("string", "string")) + .withCredentials(new AccountKeyDatastoreCredentials() + .withSecrets(new AccountKeyDatastoreSecrets().withKey("fakeTokenPlaceholder"))) + .withAccountName("string") + .withContainerName("string") + .withEndpoint("core.windows.net") + .withProtocol("https")) .withSkipValidation(false) .create(); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/AzureFileWAccountKey/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Datastore/AzureFileWAccountKey/createOrUpdate.json */ /** * Sample code: CreateOrUpdate datastore (Azure File store w/ AccountKey). - * + * * @param manager Entry point to MachineLearningManager. */ public static void createOrUpdateDatastoreAzureFileStoreWAccountKey( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .datastores() + manager.datastores() .define("string") .withExistingWorkspace("test-rg", "my-aml-workspace") - .withProperties( - new AzureFileDatastore() - .withDescription("string") - .withTags(mapOf("string", "string")) - .withCredentials( - new AccountKeyDatastoreCredentials() - .withSecrets(new AccountKeyDatastoreSecrets().withKey("fakeTokenPlaceholder"))) - .withAccountName("string") - .withEndpoint("string") - .withFileShareName("string") - .withProtocol("string")) + .withProperties(new AzureFileDatastore().withDescription("string") + .withTags(mapOf("string", "string")) + .withCredentials(new AccountKeyDatastoreCredentials() + .withSecrets(new AccountKeyDatastoreSecrets().withKey("fakeTokenPlaceholder"))) + .withAccountName("string") + .withEndpoint("string") + .withFileShareName("string") + .withProtocol("string")) .withSkipValidation(false) .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -1988,19 +2383,22 @@ public final class DatastoresCreateOrUpdateSamples { ### Datastores_Delete ```java -/** Samples for Datastores Delete. */ +/** + * Samples for Datastores Delete. + */ public final class DatastoresDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Datastore/delete.json */ /** * Sample code: Delete datastore. - * + * * @param manager Entry point to MachineLearningManager. */ public static void deleteDatastore(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .datastores() + manager.datastores() .deleteWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); } } @@ -2009,14 +2407,18 @@ public final class DatastoresDeleteSamples { ### Datastores_Get ```java -/** Samples for Datastores Get. */ +/** + * Samples for Datastores Get. + */ public final class DatastoresGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Datastore/get.json */ /** * Sample code: Get datastore. - * + * * @param manager Entry point to MachineLearningManager. */ public static void getDatastore(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { @@ -2030,29 +2432,23 @@ public final class DatastoresGetSamples { ```java import java.util.Arrays; -/** Samples for Datastores List. */ +/** + * Samples for Datastores List. + */ public final class DatastoresListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Datastore/list.json */ /** * Sample code: List datastores. - * + * * @param manager Entry point to MachineLearningManager. */ public static void listDatastores(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .datastores() - .list( - "test-rg", - "my-aml-workspace", - null, - 1, - false, - Arrays.asList("string"), - "string", - "string", - false, + manager.datastores() + .list("test-rg", "my-aml-workspace", null, 1, false, Arrays.asList("string"), "string", "string", false, com.azure.core.util.Context.NONE); } } @@ -2061,20 +2457,27 @@ public final class DatastoresListSamples { ### Datastores_ListSecrets ```java -/** Samples for Datastores ListSecrets. */ +import com.azure.resourcemanager.machinelearning.models.SecretExpiry; + +/** + * Samples for Datastores ListSecrets. + */ public final class DatastoresListSecretsSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/listSecrets.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Datastore/listSecrets.json */ /** * Sample code: Get datastore secrets. - * + * * @param manager Entry point to MachineLearningManager. */ public static void getDatastoreSecrets(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .datastores() - .listSecretsWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + manager.datastores() + .listSecretsWithResponse("test-rg", "my-aml-workspace", "string", + new SecretExpiry().withExpirableSecret(false).withExpireAfterHours(1), + com.azure.core.util.Context.NONE); } } ``` @@ -2082,36 +2485,39 @@ public final class DatastoresListSecretsSamples { ### EnvironmentContainers_CreateOrUpdate ```java +import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentContainerInner; import com.azure.resourcemanager.machinelearning.models.EnvironmentContainerProperties; import java.util.HashMap; import java.util.Map; -/** Samples for EnvironmentContainers CreateOrUpdate. */ +/** + * Samples for EnvironmentContainers CreateOrUpdate. + */ public final class EnvironmentContainersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentContainer/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/EnvironmentContainer/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Environment Container. - * + * Sample code: CreateOrUpdate Workspace Environment Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateEnvironmentContainer( + public static void createOrUpdateWorkspaceEnvironmentContainer( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .environmentContainers() - .define("testEnvironment") - .withExistingWorkspace("testrg123", "testworkspace") - .withProperties( - new EnvironmentContainerProperties() + manager.environmentContainers() + .createOrUpdateWithResponse("testrg123", "testworkspace", "testEnvironment", + new EnvironmentContainerInner().withProperties(new EnvironmentContainerProperties() .withDescription("string") .withProperties( mapOf("additionalProp1", "string", "additionalProp2", "string", "additionalProp3", "string")) .withTags( - mapOf("additionalProp1", "string", "additionalProp2", "string", "additionalProp3", "string"))) - .create(); + mapOf("additionalProp1", "string", "additionalProp2", "string", "additionalProp3", "string"))), + com.azure.core.util.Context.NONE); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -2128,20 +2534,23 @@ public final class EnvironmentContainersCreateOrUpdateSamples { ### EnvironmentContainers_Delete ```java -/** Samples for EnvironmentContainers Delete. */ +/** + * Samples for EnvironmentContainers Delete. + */ public final class EnvironmentContainersDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentContainer/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/EnvironmentContainer/delete.json */ /** - * Sample code: Delete Environment Container. - * + * Sample code: Delete Workspace Environment Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void deleteEnvironmentContainer( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .environmentContainers() + public static void + deleteWorkspaceEnvironmentContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.environmentContainers() .deleteWithResponse("testrg123", "testworkspace", "testContainer", com.azure.core.util.Context.NONE); } } @@ -2150,20 +2559,23 @@ public final class EnvironmentContainersDeleteSamples { ### EnvironmentContainers_Get ```java -/** Samples for EnvironmentContainers Get. */ +/** + * Samples for EnvironmentContainers Get. + */ public final class EnvironmentContainersGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentContainer/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/EnvironmentContainer/get.json */ /** - * Sample code: Get Environment Container. - * + * Sample code: Get Workspace Environment Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void getEnvironmentContainer( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .environmentContainers() + public static void + getWorkspaceEnvironmentContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.environmentContainers() .getWithResponse("testrg123", "testworkspace", "testEnvironment", com.azure.core.util.Context.NONE); } } @@ -2172,20 +2584,24 @@ public final class EnvironmentContainersGetSamples { ### EnvironmentContainers_List ```java -/** Samples for EnvironmentContainers List. */ + +/** + * Samples for EnvironmentContainers List. + */ public final class EnvironmentContainersListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentContainer/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/EnvironmentContainer/list.json */ /** - * Sample code: List Environment Container. - * + * Sample code: List Workspace Environment Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void listEnvironmentContainer( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .environmentContainers() + public static void + listWorkspaceEnvironmentContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.environmentContainers() .list("testrg123", "testworkspace", null, null, com.azure.core.util.Context.NONE); } } @@ -2194,6 +2610,7 @@ public final class EnvironmentContainersListSamples { ### EnvironmentVersions_CreateOrUpdate ```java +import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentVersionInner; import com.azure.resourcemanager.machinelearning.models.BuildContext; import com.azure.resourcemanager.machinelearning.models.EnvironmentVersionProperties; import com.azure.resourcemanager.machinelearning.models.InferenceContainerProperties; @@ -2201,43 +2618,42 @@ import com.azure.resourcemanager.machinelearning.models.Route; import java.util.HashMap; import java.util.Map; -/** Samples for EnvironmentVersions CreateOrUpdate. */ +/** + * Samples for EnvironmentVersions CreateOrUpdate. + */ public final class EnvironmentVersionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentVersion/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/EnvironmentVersion/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Environment Version. - * + * Sample code: CreateOrUpdate Workspace Environment Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateEnvironmentVersion( + public static void createOrUpdateWorkspaceEnvironmentVersion( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .environmentVersions() - .define("string") - .withExistingEnvironment("test-rg", "my-aml-workspace", "string") - .withProperties( - new EnvironmentVersionProperties() + manager.environmentVersions() + .createOrUpdateWithResponse("test-rg", "my-aml-workspace", "string", "string", + new EnvironmentVersionInner().withProperties(new EnvironmentVersionProperties() .withDescription("string") .withProperties(mapOf("string", "string")) .withTags(mapOf("string", "string")) .withIsAnonymous(false) - .withBuild( - new BuildContext() - .withContextUri( - "https://storage-account.blob.core.windows.net/azureml/DockerBuildContext/95ddede6b9b8c4e90472db3acd0a8d28/") - .withDockerfilePath("prod/Dockerfile")) + .withBuild(new BuildContext().withContextUri( + "https://storage-account.blob.core.windows.net/azureml/DockerBuildContext/95ddede6b9b8c4e90472db3acd0a8d28/") + .withDockerfilePath("prod/Dockerfile")) .withCondaFile("string") .withImage("docker.io/tensorflow/serving:latest") .withInferenceConfig( - new InferenceContainerProperties() - .withLivenessRoute(new Route().withPath("string").withPort(1)) + new InferenceContainerProperties().withLivenessRoute(new Route().withPath("string").withPort(1)) .withReadinessRoute(new Route().withPath("string").withPort(1)) - .withScoringRoute(new Route().withPath("string").withPort(1)))) - .create(); + .withScoringRoute(new Route().withPath("string").withPort(1)))), + com.azure.core.util.Context.NONE); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -2254,20 +2670,23 @@ public final class EnvironmentVersionsCreateOrUpdateSamples { ### EnvironmentVersions_Delete ```java -/** Samples for EnvironmentVersions Delete. */ +/** + * Samples for EnvironmentVersions Delete. + */ public final class EnvironmentVersionsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentVersion/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/EnvironmentVersion/delete.json */ /** - * Sample code: Delete Environment Version. - * + * Sample code: Delete Workspace Environment Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void deleteEnvironmentVersion( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .environmentVersions() + public static void + deleteWorkspaceEnvironmentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.environmentVersions() .deleteWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); } } @@ -2276,19 +2695,23 @@ public final class EnvironmentVersionsDeleteSamples { ### EnvironmentVersions_Get ```java -/** Samples for EnvironmentVersions Get. */ +/** + * Samples for EnvironmentVersions Get. + */ public final class EnvironmentVersionsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentVersion/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/EnvironmentVersion/get.json */ /** - * Sample code: Get Environment Version. - * + * Sample code: Get Workspace Environment Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void getEnvironmentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .environmentVersions() + public static void + getWorkspaceEnvironmentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.environmentVersions() .getWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); } } @@ -2297,320 +2720,2960 @@ public final class EnvironmentVersionsGetSamples { ### EnvironmentVersions_List ```java -/** Samples for EnvironmentVersions List. */ + +/** + * Samples for EnvironmentVersions List. + */ public final class EnvironmentVersionsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentVersion/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/EnvironmentVersion/list.json */ /** - * Sample code: List Environment Version. - * + * Sample code: List Workspace Environment Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void listEnvironmentVersion( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .environmentVersions() + public static void + listWorkspaceEnvironmentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.environmentVersions() .list("test-rg", "my-aml-workspace", "string", "string", 1, null, null, com.azure.core.util.Context.NONE); } } ``` -### Jobs_Cancel +### EnvironmentVersions_Publish ```java -/** Samples for Jobs Cancel. */ -public final class JobsCancelSamples { +import com.azure.resourcemanager.machinelearning.models.DestinationAsset; + +/** + * Samples for EnvironmentVersions Publish. + */ +public final class EnvironmentVersionsPublishSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/cancel.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/EnvironmentVersion/publish.json */ /** - * Sample code: Cancel Job. - * + * Sample code: Publish Workspace Environment Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void cancelJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager.jobs().cancel("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + public static void + publishWorkspaceEnvironmentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.environmentVersions() + .publish("test-rg", "my-aml-workspace", "string", "string", + new DestinationAsset().withDestinationName("string") + .withDestinationVersion("string") + .withRegistryName("string"), + com.azure.core.util.Context.NONE); } } ``` -### Jobs_CreateOrUpdate +### Features_Get ```java -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.machinelearning.models.AmlToken; -import com.azure.resourcemanager.machinelearning.models.AutoMLJob; -import com.azure.resourcemanager.machinelearning.models.CommandJob; -import com.azure.resourcemanager.machinelearning.models.CommandJobLimits; -import com.azure.resourcemanager.machinelearning.models.Goal; -import com.azure.resourcemanager.machinelearning.models.GridSamplingAlgorithm; -import com.azure.resourcemanager.machinelearning.models.ImageClassification; -import com.azure.resourcemanager.machinelearning.models.ImageLimitSettings; -import com.azure.resourcemanager.machinelearning.models.ImageModelDistributionSettingsClassification; -import com.azure.resourcemanager.machinelearning.models.ImageModelSettingsClassification; -import com.azure.resourcemanager.machinelearning.models.JobResourceConfiguration; -import com.azure.resourcemanager.machinelearning.models.JobService; -import com.azure.resourcemanager.machinelearning.models.LiteralJobInput; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import com.azure.resourcemanager.machinelearning.models.MedianStoppingPolicy; -import com.azure.resourcemanager.machinelearning.models.Mpi; -import com.azure.resourcemanager.machinelearning.models.Objective; -import com.azure.resourcemanager.machinelearning.models.OutputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.PipelineJob; -import com.azure.resourcemanager.machinelearning.models.SweepJob; -import com.azure.resourcemanager.machinelearning.models.SweepJobLimits; -import com.azure.resourcemanager.machinelearning.models.TensorFlow; -import com.azure.resourcemanager.machinelearning.models.TrialComponent; -import com.azure.resourcemanager.machinelearning.models.UriFileJobOutput; -import java.io.IOException; -import java.time.Duration; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** Samples for Jobs CreateOrUpdate. */ -public final class JobsCreateOrUpdateSamples { +/** + * Samples for Features Get. + */ +public final class FeaturesGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/AutoMLJob/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Feature/get.json */ /** - * Sample code: CreateOrUpdate AutoML Job. - * + * Sample code: Get Feature. + * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateAutoMLJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) - throws IOException { - manager - .jobs() - .define("string") - .withExistingWorkspace("test-rg", "my-aml-workspace") - .withProperties( - new AutoMLJob() - .withDescription("string") - .withProperties(mapOf("string", "string")) - .withTags(mapOf("string", "string")) - .withComputeId("string") - .withDisplayName("string") - .withExperimentName("string") - .withIdentity(new AmlToken()) - .withIsArchived(false) - .withServices( - mapOf( - "string", - new JobService() - .withEndpoint("string") - .withJobServiceType("string") - .withPort(1) - .withProperties(mapOf("string", "string")))) + public static void getFeature(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.features() + .getWithResponse("test-rg", "my-aml-workspace", "string", "string", "string", + com.azure.core.util.Context.NONE); + } +} +``` + +### Features_List + +```java + +/** + * Samples for Features List. + */ +public final class FeaturesListSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Feature/list.json + */ + /** + * Sample code: List Feature. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listFeature(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.features() + .list("test-rg", "my-aml-workspace", "string", "string", null, "string", "string", "string", null, null, + com.azure.core.util.Context.NONE); + } +} +``` + +### FeaturesetContainers_CreateOrUpdate + +```java +import com.azure.resourcemanager.machinelearning.models.FeaturesetContainerProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for FeaturesetContainers CreateOrUpdate. + */ +public final class FeaturesetContainersCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/FeaturesetContainer/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Workspace Featureset Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateWorkspaceFeaturesetContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.featuresetContainers() + .define("string") + .withExistingWorkspace("test-rg", "my-aml-workspace") + .withProperties(new FeaturesetContainerProperties().withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsArchived(false)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### FeaturesetContainers_Delete + +```java +/** + * Samples for FeaturesetContainers Delete. + */ +public final class FeaturesetContainersDeleteSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/FeaturesetContainer/delete.json + */ + /** + * Sample code: Delete Workspace Featureset Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + deleteWorkspaceFeaturesetContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.featuresetContainers() + .delete("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + } +} +``` + +### FeaturesetContainers_GetEntity + +```java +/** + * Samples for FeaturesetContainers GetEntity. + */ +public final class FeaturesetContainersGetEntitySamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/FeaturesetContainer/getEntity.json + */ + /** + * Sample code: GetEntity Workspace Featureset Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getEntityWorkspaceFeaturesetContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.featuresetContainers() + .getEntityWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + } +} +``` + +### FeaturesetContainers_List + +```java +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** + * Samples for FeaturesetContainers List. + */ +public final class FeaturesetContainersListSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/FeaturesetContainer/list.json + */ + /** + * Sample code: List Workspace Featureset Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + listWorkspaceFeaturesetContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.featuresetContainers() + .list("test-rg", "my-aml-workspace", null, "string", ListViewType.ARCHIVED_ONLY, null, null, null, null, + com.azure.core.util.Context.NONE); + } +} +``` + +### FeaturesetVersions_Backfill + +```java +import com.azure.resourcemanager.machinelearning.models.DataAvailabilityStatus; +import com.azure.resourcemanager.machinelearning.models.FeaturesetVersionBackfillRequest; +import com.azure.resourcemanager.machinelearning.models.FeatureWindow; +import com.azure.resourcemanager.machinelearning.models.MaterializationComputeResource; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for FeaturesetVersions Backfill. + */ +public final class FeaturesetVersionsBackfillSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/FeaturesetVersion/backfill.json + */ + /** + * Sample code: Backfill Workspace Featureset Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + backfillWorkspaceFeaturesetVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.featuresetVersions() + .backfill("test-rg", "my-aml-workspace", "string", "string", + new FeaturesetVersionBackfillRequest() + .withDataAvailabilityStatus(Arrays.asList(DataAvailabilityStatus.NONE)) + .withDescription("string") + .withDisplayName("string") + .withFeatureWindow( + new FeatureWindow().withFeatureWindowEnd(OffsetDateTime.parse("2020-01-01T12:34:56.999+00:51")) + .withFeatureWindowStart(OffsetDateTime.parse("2020-01-01T12:34:56.999+00:51"))) + .withJobId("string") + .withResource(new MaterializationComputeResource().withInstanceType("string")) + .withSparkConfiguration(mapOf("string", "string")) + .withTags(mapOf("string", "string")), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### FeaturesetVersions_CreateOrUpdate + +```java +import com.azure.resourcemanager.machinelearning.models.EmailNotificationEnableType; +import com.azure.resourcemanager.machinelearning.models.FeaturesetSpecification; +import com.azure.resourcemanager.machinelearning.models.FeaturesetVersionProperties; +import com.azure.resourcemanager.machinelearning.models.MaterializationComputeResource; +import com.azure.resourcemanager.machinelearning.models.MaterializationSettings; +import com.azure.resourcemanager.machinelearning.models.MaterializationStoreType; +import com.azure.resourcemanager.machinelearning.models.NotificationSetting; +import com.azure.resourcemanager.machinelearning.models.RecurrenceFrequency; +import com.azure.resourcemanager.machinelearning.models.RecurrenceSchedule; +import com.azure.resourcemanager.machinelearning.models.RecurrenceTrigger; +import com.azure.resourcemanager.machinelearning.models.WeekDay; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for FeaturesetVersions CreateOrUpdate. + */ +public final class FeaturesetVersionsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/FeaturesetVersion/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Workspace Featureset Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateWorkspaceFeaturesetVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.featuresetVersions() + .define("string") + .withExistingFeatureset("test-rg", "my-aml-workspace", "string") + .withProperties(new FeaturesetVersionProperties().withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsAnonymous(false) + .withIsArchived(false) + .withEntities(Arrays.asList("string")) + .withMaterializationSettings(new MaterializationSettings() + .withNotification( + new NotificationSetting().withEmailOn(Arrays.asList(EmailNotificationEnableType.JOB_FAILED)) + .withEmails(Arrays.asList("string"))) + .withResource(new MaterializationComputeResource().withInstanceType("string")) + .withSchedule(new RecurrenceTrigger().withEndTime("string") + .withStartTime("string") + .withTimeZone("string") + .withFrequency(RecurrenceFrequency.DAY) + .withInterval(1) + .withSchedule(new RecurrenceSchedule().withHours(Arrays.asList(1)) + .withMinutes(Arrays.asList(1)) + .withMonthDays(Arrays.asList(1)) + .withWeekDays(Arrays.asList(WeekDay.MONDAY)))) + .withSparkConfiguration(mapOf("string", "string")) + .withStoreType(MaterializationStoreType.ONLINE)) + .withSpecification(new FeaturesetSpecification().withPath("string")) + .withStage("string")) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### FeaturesetVersions_Delete + +```java +/** + * Samples for FeaturesetVersions Delete. + */ +public final class FeaturesetVersionsDeleteSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/FeaturesetVersion/delete.json + */ + /** + * Sample code: Delete Workspace Featureset Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + deleteWorkspaceFeaturesetVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.featuresetVersions() + .delete("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); + } +} +``` + +### FeaturesetVersions_Get + +```java +/** + * Samples for FeaturesetVersions Get. + */ +public final class FeaturesetVersionsGetSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/FeaturesetVersion/get.json + */ + /** + * Sample code: Get Workspace Featureset Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + getWorkspaceFeaturesetVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.featuresetVersions() + .getWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); + } +} +``` + +### FeaturesetVersions_List + +```java +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** + * Samples for FeaturesetVersions List. + */ +public final class FeaturesetVersionsListSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/FeaturesetVersion/list.json + */ + /** + * Sample code: List Workspace Featureset Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + listWorkspaceFeaturesetVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.featuresetVersions() + .list("test-rg", "my-aml-workspace", "string", null, "string", ListViewType.ALL, null, null, null, null, + null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### FeaturestoreEntityContainers_CreateOrUpdate + +```java +import com.azure.resourcemanager.machinelearning.models.FeaturestoreEntityContainerProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for FeaturestoreEntityContainers CreateOrUpdate. + */ +public final class FeaturestoreEntityContainersCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/FeaturestoreEntityContainer/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Workspace Featurestore Entity Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateWorkspaceFeaturestoreEntityContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.featurestoreEntityContainers() + .define("string") + .withExistingWorkspace("test-rg", "my-aml-workspace") + .withProperties(new FeaturestoreEntityContainerProperties().withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsArchived(false)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### FeaturestoreEntityContainers_Delete + +```java +/** + * Samples for FeaturestoreEntityContainers Delete. + */ +public final class FeaturestoreEntityContainersDeleteSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/FeaturestoreEntityContainer/delete.json + */ + /** + * Sample code: Delete Workspace Featurestore Entity Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void deleteWorkspaceFeaturestoreEntityContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.featurestoreEntityContainers() + .delete("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + } +} +``` + +### FeaturestoreEntityContainers_GetEntity + +```java +/** + * Samples for FeaturestoreEntityContainers GetEntity. + */ +public final class FeaturestoreEntityContainersGetEntitySamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/FeaturestoreEntityContainer/getEntity.json + */ + /** + * Sample code: GetEntity Workspace Featurestore Entity Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getEntityWorkspaceFeaturestoreEntityContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.featurestoreEntityContainers() + .getEntityWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + } +} +``` + +### FeaturestoreEntityContainers_List + +```java +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** + * Samples for FeaturestoreEntityContainers List. + */ +public final class FeaturestoreEntityContainersListSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/FeaturestoreEntityContainer/list.json + */ + /** + * Sample code: List Workspace Featurestore Entity Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listWorkspaceFeaturestoreEntityContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.featurestoreEntityContainers() + .list("test-rg", "my-aml-workspace", null, "string", ListViewType.ALL, null, null, null, null, + com.azure.core.util.Context.NONE); + } +} +``` + +### FeaturestoreEntityVersions_CreateOrUpdate + +```java +import com.azure.resourcemanager.machinelearning.models.FeatureDataType; +import com.azure.resourcemanager.machinelearning.models.FeaturestoreEntityVersionProperties; +import com.azure.resourcemanager.machinelearning.models.IndexColumn; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for FeaturestoreEntityVersions CreateOrUpdate. + */ +public final class FeaturestoreEntityVersionsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/FeaturestoreEntityVersion/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Workspace Featurestore Entity Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateWorkspaceFeaturestoreEntityVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.featurestoreEntityVersions() + .define("string") + .withExistingFeaturestoreEntity("test-rg", "my-aml-workspace", "string") + .withProperties( + new FeaturestoreEntityVersionProperties().withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsAnonymous(false) + .withIsArchived(false) + .withIndexColumns(Arrays + .asList(new IndexColumn().withColumnName("string").withDataType(FeatureDataType.DATETIME)))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### FeaturestoreEntityVersions_Delete + +```java +/** + * Samples for FeaturestoreEntityVersions Delete. + */ +public final class FeaturestoreEntityVersionsDeleteSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/FeaturestoreEntityVersion/delete.json + */ + /** + * Sample code: Delete Workspace Featurestore Entity Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void deleteWorkspaceFeaturestoreEntityVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.featurestoreEntityVersions() + .delete("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); + } +} +``` + +### FeaturestoreEntityVersions_Get + +```java +/** + * Samples for FeaturestoreEntityVersions Get. + */ +public final class FeaturestoreEntityVersionsGetSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/FeaturestoreEntityVersion/get.json + */ + /** + * Sample code: Get Workspace Featurestore Entity Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getWorkspaceFeaturestoreEntityVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.featurestoreEntityVersions() + .getWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); + } +} +``` + +### FeaturestoreEntityVersions_List + +```java +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** + * Samples for FeaturestoreEntityVersions List. + */ +public final class FeaturestoreEntityVersionsListSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/FeaturestoreEntityVersion/list.json + */ + /** + * Sample code: List Workspace Featurestore Entity Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listWorkspaceFeaturestoreEntityVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.featurestoreEntityVersions() + .list("test-rg", "my-aml-workspace", "string", null, "string", ListViewType.ACTIVE_ONLY, null, null, null, + null, null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### Jobs_Cancel + +```java +/** + * Samples for Jobs Cancel. + */ +public final class JobsCancelSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Job/cancel.json + */ + /** + * Sample code: Cancel Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void cancelJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.jobs().cancel("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + } +} +``` + +### Jobs_CreateOrUpdate + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.machinelearning.models.AmlToken; +import com.azure.resourcemanager.machinelearning.models.AutoMLJob; +import com.azure.resourcemanager.machinelearning.models.CommandJob; +import com.azure.resourcemanager.machinelearning.models.CommandJobLimits; +import com.azure.resourcemanager.machinelearning.models.CustomModelFineTuning; +import com.azure.resourcemanager.machinelearning.models.FineTuningJob; +import com.azure.resourcemanager.machinelearning.models.FineTuningTaskType; +import com.azure.resourcemanager.machinelearning.models.Goal; +import com.azure.resourcemanager.machinelearning.models.GridSamplingAlgorithm; +import com.azure.resourcemanager.machinelearning.models.ImageClassification; +import com.azure.resourcemanager.machinelearning.models.ImageLimitSettings; +import com.azure.resourcemanager.machinelearning.models.ImageModelDistributionSettingsClassification; +import com.azure.resourcemanager.machinelearning.models.ImageModelSettingsClassification; +import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; +import com.azure.resourcemanager.machinelearning.models.JobResourceConfiguration; +import com.azure.resourcemanager.machinelearning.models.JobService; +import com.azure.resourcemanager.machinelearning.models.LiteralJobInput; +import com.azure.resourcemanager.machinelearning.models.MedianStoppingPolicy; +import com.azure.resourcemanager.machinelearning.models.MLFlowModelJobInput; +import com.azure.resourcemanager.machinelearning.models.MLFlowModelJobOutput; +import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; +import com.azure.resourcemanager.machinelearning.models.Mpi; +import com.azure.resourcemanager.machinelearning.models.Objective; +import com.azure.resourcemanager.machinelearning.models.OutputDeliveryMode; +import com.azure.resourcemanager.machinelearning.models.PipelineJob; +import com.azure.resourcemanager.machinelearning.models.SweepJob; +import com.azure.resourcemanager.machinelearning.models.SweepJobLimits; +import com.azure.resourcemanager.machinelearning.models.TensorFlow; +import com.azure.resourcemanager.machinelearning.models.TrialComponent; +import com.azure.resourcemanager.machinelearning.models.UriFileJobInput; +import com.azure.resourcemanager.machinelearning.models.UriFileJobOutput; +import java.io.IOException; +import java.time.Duration; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Jobs CreateOrUpdate. + */ +public final class JobsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Job/AutoMLJob/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate AutoML Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateAutoMLJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) + throws IOException { + manager.jobs() + .define("string") + .withExistingWorkspace("test-rg", "my-aml-workspace") + .withProperties(new AutoMLJob().withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withComputeId("string") + .withDisplayName("string") + .withExperimentName("string") + .withIdentity(new AmlToken()) + .withIsArchived(false) + .withServices(mapOf("string", + new JobService().withEndpoint("string") + .withJobServiceType("string") + .withPort(1) + .withProperties(mapOf("string", "string")))) + .withEnvironmentId("string") + .withEnvironmentVariables(mapOf("string", "string")) + .withOutputs(mapOf("string", + new UriFileJobOutput().withDescription("string") + .withMode(OutputDeliveryMode.READ_WRITE_MOUNT) + .withUri("string"))) + .withResources(new JobResourceConfiguration().withInstanceCount(1) + .withInstanceType("string") + .withProperties(mapOf("string", + SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"9bec0ab0-c62f-4fa9-a97c-7b24bbcc90ad\":null}", Object.class, + SerializerEncoding.JSON)))) + .withTaskDetails(new ImageClassification().withTargetColumnName("string") + .withTrainingData(new MLTableJobInput().withUri("string")) + .withModelSettings(new ImageModelSettingsClassification().withValidationCropSize(2)) + .withSearchSpace(Arrays.asList( + new ImageModelDistributionSettingsClassification().withValidationCropSize("choice(2, 360)"))) + .withLimitSettings(new ImageLimitSettings().withMaxTrials(2)))) + .create(); + } + + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Job/SweepJob/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Sweep Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateSweepJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) + throws IOException { + manager.jobs() + .define("string") + .withExistingWorkspace("test-rg", "my-aml-workspace") + .withProperties(new SweepJob().withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withComputeId("string") + .withDisplayName("string") + .withExperimentName("string") + .withServices(mapOf("string", + new JobService().withEndpoint("string") + .withJobServiceType("string") + .withPort(1) + .withProperties(mapOf("string", "string")))) + .withEarlyTermination(new MedianStoppingPolicy().withDelayEvaluation(1).withEvaluationInterval(1)) + .withLimits(new SweepJobLimits().withMaxConcurrentTrials(1) + .withMaxTotalTrials(1) + .withTrialTimeout(Duration.parse("PT1S"))) + .withObjective(new Objective().withGoal(Goal.MINIMIZE).withPrimaryMetric("string")) + .withSamplingAlgorithm(new GridSamplingAlgorithm()) + .withSearchSpace(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"string\":{}}", Object.class, SerializerEncoding.JSON)) + .withTrial(new TrialComponent().withCodeId("fakeTokenPlaceholder") + .withCommand("string") + .withDistribution(new Mpi().withProcessCountPerInstance(1)) .withEnvironmentId("string") .withEnvironmentVariables(mapOf("string", "string")) - .withOutputs( - mapOf( - "string", - new UriFileJobOutput() - .withDescription("string") - .withMode(OutputDeliveryMode.READ_WRITE_MOUNT) - .withUri("string"))) - .withResources( - new JobResourceConfiguration() - .withInstanceCount(1) - .withInstanceType("string") - .withProperties( - mapOf( - "string", - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"9bec0ab0-c62f-4fa9-a97c-7b24bbcc90ad\":null}", - Object.class, - SerializerEncoding.JSON)))) - .withTaskDetails( - new ImageClassification() - .withTargetColumnName("string") - .withTrainingData(new MLTableJobInput().withUri("string")) - .withModelSettings(new ImageModelSettingsClassification().withValidationCropSize(2)) - .withSearchSpace( - Arrays - .asList( - new ImageModelDistributionSettingsClassification() - .withValidationCropSize("choice(2, 360)"))) - .withLimitSettings(new ImageLimitSettings().withMaxTrials(2)))) + .withResources(new JobResourceConfiguration().withInstanceCount(1) + .withInstanceType("string") + .withProperties(mapOf("string", + SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"e6b6493e-7d5e-4db3-be1e-306ec641327e\":null}", Object.class, + SerializerEncoding.JSON)))))) + .create(); + } + + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Job/PipelineJob/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Pipeline Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdatePipelineJob( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) throws IOException { + manager.jobs() + .define("string") + .withExistingWorkspace("test-rg", "my-aml-workspace") + .withProperties(new PipelineJob().withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withComputeId("string") + .withDisplayName("string") + .withExperimentName("string") + .withServices(mapOf("string", + new JobService().withEndpoint("string") + .withJobServiceType("string") + .withPort(1) + .withProperties(mapOf("string", "string")))) + .withInputs(mapOf("string", new LiteralJobInput().withDescription("string").withValue("string"))) + .withOutputs(mapOf("string", + new UriFileJobOutput().withDescription("string") + .withMode(OutputDeliveryMode.UPLOAD) + .withUri("string"))) + .withSettings(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON))) + .create(); + } + + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Job/FineTuningJob/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate FineTuning Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + createOrUpdateFineTuningJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.jobs() + .define("string") + .withExistingWorkspace("test-rg", "my-aml-workspace") + .withProperties(new FineTuningJob().withExperimentName("llm-finetuning") + .withFineTuningDetails(new CustomModelFineTuning().withTaskType(FineTuningTaskType.TEXT_COMPLETION) + .withTrainingData(new UriFileJobInput().withMode(InputDeliveryMode.READ_ONLY_MOUNT) + .withUri("azureml://registries/azureml-meta/models/Llama-2-7b/versions/11")) + .withModel(new MLFlowModelJobInput().withMode(InputDeliveryMode.READ_ONLY_MOUNT) + .withUri("azureml://registries/azureml-meta/models/Llama-2-7b/versions/11"))) + .withOutputs(mapOf("string", + new MLFlowModelJobOutput().withDescription("string") + .withMode(OutputDeliveryMode.READ_WRITE_MOUNT) + .withUri("string")))) + .create(); + } + + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Job/CommandJob/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Command Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateCommandJob( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) throws IOException { + manager.jobs() + .define("string") + .withExistingWorkspace("test-rg", "my-aml-workspace") + .withProperties(new CommandJob().withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withComputeId("string") + .withDisplayName("string") + .withExperimentName("string") + .withIdentity(new AmlToken()) + .withServices(mapOf("string", + new JobService().withEndpoint("string") + .withJobServiceType("string") + .withPort(1) + .withProperties(mapOf("string", "string")))) + .withCodeId("fakeTokenPlaceholder") + .withCommand("string") + .withDistribution(new TensorFlow().withParameterServerCount(1).withWorkerCount(1)) + .withEnvironmentId("string") + .withEnvironmentVariables(mapOf("string", "string")) + .withInputs(mapOf("string", new LiteralJobInput().withDescription("string").withValue("string"))) + .withLimits(new CommandJobLimits().withTimeout(Duration.parse("PT5M"))) + .withOutputs(mapOf("string", + new UriFileJobOutput().withDescription("string") + .withMode(OutputDeliveryMode.READ_WRITE_MOUNT) + .withUri("string"))) + .withResources(new JobResourceConfiguration().withInstanceCount(1) + .withInstanceType("string") + .withProperties(mapOf("string", + SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"e6b6493e-7d5e-4db3-be1e-306ec641327e\":null}", Object.class, + SerializerEncoding.JSON))))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Jobs_Delete + +```java +/** + * Samples for Jobs Delete. + */ +public final class JobsDeleteSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Job/delete.json + */ + /** + * Sample code: Delete Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void deleteJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.jobs() + .delete("test-rg", "my-aml-workspace", + "http://subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/my-favorite-aml-job", + com.azure.core.util.Context.NONE); + } +} +``` + +### Jobs_Get + +```java +/** + * Samples for Jobs Get. + */ +public final class JobsGetSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Job/CommandJob/get.json + */ + /** + * Sample code: Get Command Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getCommandJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.jobs().getWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Job/AutoMLJob/get.json + */ + /** + * Sample code: Get AutoML Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getAutoMLJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.jobs().getWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Job/SweepJob/get.json + */ + /** + * Sample code: Get Sweep Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getSweepJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.jobs().getWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Job/PipelineJob/get.json + */ + /** + * Sample code: Get Pipeline Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getPipelineJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.jobs().getWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Job/FineTuningJob/get.json + */ + /** + * Sample code: Get FineTuning Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getFineTuningJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.jobs().getWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + } +} +``` + +### Jobs_List + +```java +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** + * Samples for Jobs List. + */ +public final class JobsListSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Job/CommandJob/list.json + */ + /** + * Sample code: List Command Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listCommandJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.jobs() + .list("test-rg", "my-aml-workspace", null, "string", "string", null, null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Job/PipelineJob/list.json + */ + /** + * Sample code: List Pipeline Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listPipelineJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.jobs() + .list("test-rg", "my-aml-workspace", null, "string", "string", null, null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Job/FineTuningJob/list.json + */ + /** + * Sample code: List FineTuning Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listFineTuningJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.jobs() + .list("test-rg", "my-aml-workspace", null, "string", "string", ListViewType.ALL, null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Job/SweepJob/list.json + */ + /** + * Sample code: List Sweep Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listSweepJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.jobs() + .list("test-rg", "my-aml-workspace", null, "string", "string", null, null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Job/AutoMLJob/list.json + */ + /** + * Sample code: List AutoML Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listAutoMLJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.jobs() + .list("test-rg", "my-aml-workspace", null, null, null, null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedNetworkProvisions_ProvisionManagedNetwork + +```java +import com.azure.resourcemanager.machinelearning.models.ManagedNetworkProvisionOptions; + +/** + * Samples for ManagedNetworkProvisions ProvisionManagedNetwork. + */ +public final class ManagedNetworkProvisionsProvisionManagedNetworkSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/ManagedNetwork/provision.json + */ + /** + * Sample code: Provision ManagedNetwork. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + provisionManagedNetwork(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.managedNetworkProvisions() + .provisionManagedNetwork("test-rg", "aml-workspace-name", + new ManagedNetworkProvisionOptions().withIncludeSpark(false), com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedNetworkSettingsRule_CreateOrUpdate + +```java +import com.azure.resourcemanager.machinelearning.models.FqdnOutboundRule; +import com.azure.resourcemanager.machinelearning.models.RuleCategory; +import com.azure.resourcemanager.machinelearning.models.RuleStatus; + +/** + * Samples for ManagedNetworkSettingsRule CreateOrUpdate. + */ +public final class ManagedNetworkSettingsRuleCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/ManagedNetwork/createOrUpdateRule.json + */ + /** + * Sample code: CreateOrUpdate ManagedNetworkSettingsRule. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateManagedNetworkSettingsRule( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.managedNetworkSettingsRules() + .define("rule_name_1") + .withExistingWorkspace("test-rg", "aml-workspace-name") + .withProperties(new FqdnOutboundRule().withCategory(RuleCategory.USER_DEFINED) + .withStatus(RuleStatus.ACTIVE) + .withDestination("destination_endpoint")) + .create(); + } +} +``` + +### ManagedNetworkSettingsRule_Delete + +```java +/** + * Samples for ManagedNetworkSettingsRule Delete. + */ +public final class ManagedNetworkSettingsRuleDeleteSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/ManagedNetwork/deleteRule.json + */ + /** + * Sample code: Delete ManagedNetworkSettingsRule. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + deleteManagedNetworkSettingsRule(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.managedNetworkSettingsRules() + .delete("test-rg", "aml-workspace-name", "rule-name", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedNetworkSettingsRule_Get + +```java +/** + * Samples for ManagedNetworkSettingsRule Get. + */ +public final class ManagedNetworkSettingsRuleGetSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/ManagedNetwork/getRule.json + */ + /** + * Sample code: Get ManagedNetworkSettingsRule. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + getManagedNetworkSettingsRule(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.managedNetworkSettingsRules() + .getWithResponse("test-rg", "aml-workspace-name", "name_of_the_fqdn_rule", + com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedNetworkSettingsRule_List + +```java +/** + * Samples for ManagedNetworkSettingsRule List. + */ +public final class ManagedNetworkSettingsRuleListSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/ManagedNetwork/listRule.json + */ + /** + * Sample code: List ManagedNetworkSettingsRule. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + listManagedNetworkSettingsRule(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.managedNetworkSettingsRules().list("test-rg", "aml-workspace-name", com.azure.core.util.Context.NONE); + } +} +``` + +### MarketplaceSubscriptions_CreateOrUpdate + +```java +import com.azure.resourcemanager.machinelearning.models.MarketplaceSubscriptionProperties; + +/** + * Samples for MarketplaceSubscriptions CreateOrUpdate. + */ +public final class MarketplaceSubscriptionsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/MarketplaceSubscription/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Workspace Marketplace Subscription. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateWorkspaceMarketplaceSubscription( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.marketplaceSubscriptions() + .define("string") + .withExistingWorkspace("test-rg", "my-aml-workspace") + .withProperties(new MarketplaceSubscriptionProperties().withModelId("string")) + .create(); + } +} +``` + +### MarketplaceSubscriptions_Delete + +```java +/** + * Samples for MarketplaceSubscriptions Delete. + */ +public final class MarketplaceSubscriptionsDeleteSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/MarketplaceSubscription/delete.json + */ + /** + * Sample code: Delete Workspace Marketplace Subscription. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void deleteWorkspaceMarketplaceSubscription( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.marketplaceSubscriptions() + .delete("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + } +} +``` + +### MarketplaceSubscriptions_Get + +```java +/** + * Samples for MarketplaceSubscriptions Get. + */ +public final class MarketplaceSubscriptionsGetSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/MarketplaceSubscription/get.json + */ + /** + * Sample code: Get Workspace Marketplace Subscription. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + getWorkspaceMarketplaceSubscription(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.marketplaceSubscriptions() + .getWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + } +} +``` + +### MarketplaceSubscriptions_List + +```java +/** + * Samples for MarketplaceSubscriptions List. + */ +public final class MarketplaceSubscriptionsListSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/MarketplaceSubscription/list.json + */ + /** + * Sample code: List Workspace Marketplace Subscription. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + listWorkspaceMarketplaceSubscription(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.marketplaceSubscriptions().list("test-rg", "my-aml-workspace", null, com.azure.core.util.Context.NONE); + } +} +``` + +### ModelContainers_CreateOrUpdate + +```java +import com.azure.resourcemanager.machinelearning.fluent.models.ModelContainerInner; +import com.azure.resourcemanager.machinelearning.models.ModelContainerProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ModelContainers CreateOrUpdate. + */ +public final class ModelContainersCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ModelContainer/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Workspace Model Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateWorkspaceModelContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.modelContainers() + .createOrUpdateWithResponse("testrg123", "workspace123", "testContainer", + new ModelContainerInner() + .withProperties(new ModelContainerProperties().withDescription("Model container description") + .withTags(mapOf("tag1", "value1", "tag2", "value2"))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ModelContainers_Delete + +```java +/** + * Samples for ModelContainers Delete. + */ +public final class ModelContainersDeleteSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ModelContainer/delete.json + */ + /** + * Sample code: Delete Workspace Model Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + deleteWorkspaceModelContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.modelContainers() + .deleteWithResponse("testrg123", "workspace123", "testContainer", com.azure.core.util.Context.NONE); + } +} +``` + +### ModelContainers_Get + +```java +/** + * Samples for ModelContainers Get. + */ +public final class ModelContainersGetSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ModelContainer/get.json + */ + /** + * Sample code: Get Workspace Model Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + getWorkspaceModelContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.modelContainers() + .getWithResponse("testrg123", "workspace123", "testContainer", com.azure.core.util.Context.NONE); + } +} +``` + +### ModelContainers_List + +```java + +/** + * Samples for ModelContainers List. + */ +public final class ModelContainersListSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ModelContainer/list.json + */ + /** + * Sample code: List Workspace Model Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + listWorkspaceModelContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.modelContainers().list("testrg123", "workspace123", null, null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### ModelVersions_CreateOrUpdate + +```java +import com.azure.resourcemanager.machinelearning.fluent.models.ModelVersionInner; +import com.azure.resourcemanager.machinelearning.models.FlavorData; +import com.azure.resourcemanager.machinelearning.models.ModelVersionProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ModelVersions CreateOrUpdate. + */ +public final class ModelVersionsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ModelVersion/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Workspace Model Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + createOrUpdateWorkspaceModelVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.modelVersions() + .createOrUpdateWithResponse("test-rg", "my-aml-workspace", "string", "string", + new ModelVersionInner().withProperties(new ModelVersionProperties().withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsAnonymous(false) + .withFlavors(mapOf("string", new FlavorData().withData(mapOf("string", "string")))) + .withModelType("CustomModel") + .withModelUri("string")), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ModelVersions_Delete + +```java +/** + * Samples for ModelVersions Delete. + */ +public final class ModelVersionsDeleteSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ModelVersion/delete.json + */ + /** + * Sample code: Delete Workspace Model Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + deleteWorkspaceModelVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.modelVersions() + .deleteWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); + } +} +``` + +### ModelVersions_Get + +```java +/** + * Samples for ModelVersions Get. + */ +public final class ModelVersionsGetSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ModelVersion/get.json + */ + /** + * Sample code: Get Workspace Model Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + getWorkspaceModelVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.modelVersions() + .getWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); + } +} +``` + +### ModelVersions_List + +```java + +/** + * Samples for ModelVersions List. + */ +public final class ModelVersionsListSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ModelVersion/list.json + */ + /** + * Sample code: List Workspace Model Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + listWorkspaceModelVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.modelVersions() + .list("test-rg", "my-aml-workspace", "string", null, "string", 1, "string", "string", 1, "string", "string", + null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### ModelVersions_Publish + +```java +import com.azure.resourcemanager.machinelearning.models.DestinationAsset; + +/** + * Samples for ModelVersions Publish. + */ +public final class ModelVersionsPublishSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ModelVersion/publish.json + */ + /** + * Sample code: Publish Workspace Model Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + publishWorkspaceModelVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.modelVersions() + .publish("test-rg", "my-aml-workspace", "string", "string", + new DestinationAsset().withDestinationName("string") + .withDestinationVersion("string") + .withRegistryName("string"), + com.azure.core.util.Context.NONE); + } +} +``` + +### OnlineDeployments_CreateOrUpdate + +```java +import com.azure.resourcemanager.machinelearning.models.CodeConfiguration; +import com.azure.resourcemanager.machinelearning.models.ContainerResourceRequirements; +import com.azure.resourcemanager.machinelearning.models.ContainerResourceSettings; +import com.azure.resourcemanager.machinelearning.models.DefaultScaleSettings; +import com.azure.resourcemanager.machinelearning.models.KubernetesOnlineDeployment; +import com.azure.resourcemanager.machinelearning.models.ManagedOnlineDeployment; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.machinelearning.models.OnlineRequestSettings; +import com.azure.resourcemanager.machinelearning.models.ProbeSettings; +import com.azure.resourcemanager.machinelearning.models.Sku; +import com.azure.resourcemanager.machinelearning.models.SkuTier; +import com.azure.resourcemanager.machinelearning.models.UserAssignedIdentity; +import java.time.Duration; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for OnlineDeployments CreateOrUpdate. + */ +public final class OnlineDeploymentsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/OnlineDeployment/KubernetesOnlineDeployment/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Kubernetes Online Deployment. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateKubernetesOnlineDeployment( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.onlineDeployments() + .define("testDeploymentName") + .withRegion("string") + .withExistingOnlineEndpoint("test-rg", "my-aml-workspace", "testEndpointName") + .withProperties(new KubernetesOnlineDeployment() + .withCodeConfiguration( + new CodeConfiguration().withCodeId("fakeTokenPlaceholder").withScoringScript("string")) + .withDescription("string") + .withEnvironmentId("string") + .withEnvironmentVariables(mapOf("string", "string")) + .withProperties(mapOf("string", "string")) + .withAppInsightsEnabled(false) + .withInstanceType("string") + .withLivenessProbe(new ProbeSettings().withFailureThreshold(1) + .withInitialDelay(Duration.parse("PT5M")) + .withPeriod(Duration.parse("PT5M")) + .withSuccessThreshold(1) + .withTimeout(Duration.parse("PT5M"))) + .withModel("string") + .withModelMountPath("string") + .withRequestSettings(new OnlineRequestSettings().withMaxConcurrentRequestsPerInstance(1) + .withMaxQueueWait(Duration.parse("PT5M")) + .withRequestTimeout(Duration.parse("PT5M"))) + .withScaleSettings(new DefaultScaleSettings()) + .withContainerResourceRequirements(new ContainerResourceRequirements() + .withContainerResourceLimits( + new ContainerResourceSettings().withCpu("\"1\"").withGpu("\"1\"").withMemory("\"2Gi\"")) + .withContainerResourceRequests( + new ContainerResourceSettings().withCpu("\"1\"").withGpu("\"1\"").withMemory("\"2Gi\"")))) + .withTags(mapOf()) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) + .withKind("string") + .withSku(new Sku().withName("string") + .withTier(SkuTier.FREE) + .withSize("string") + .withFamily("string") + .withCapacity(1)) + .create(); + } + + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/OnlineDeployment/ManagedOnlineDeployment/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Managed Online Deployment. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateManagedOnlineDeployment( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.onlineDeployments() + .define("testDeploymentName") + .withRegion("string") + .withExistingOnlineEndpoint("test-rg", "my-aml-workspace", "testEndpointName") + .withProperties(new ManagedOnlineDeployment() + .withCodeConfiguration( + new CodeConfiguration().withCodeId("fakeTokenPlaceholder").withScoringScript("string")) + .withDescription("string") + .withEnvironmentId("string") + .withEnvironmentVariables(mapOf("string", "string")) + .withProperties(mapOf("string", "string")) + .withAppInsightsEnabled(false) + .withInstanceType("string") + .withLivenessProbe(new ProbeSettings().withFailureThreshold(1) + .withInitialDelay(Duration.parse("PT5M")) + .withPeriod(Duration.parse("PT5M")) + .withSuccessThreshold(1) + .withTimeout(Duration.parse("PT5M"))) + .withModel("string") + .withModelMountPath("string") + .withReadinessProbe(new ProbeSettings().withFailureThreshold(30) + .withInitialDelay(Duration.parse("PT1S")) + .withPeriod(Duration.parse("PT10S")) + .withSuccessThreshold(1) + .withTimeout(Duration.parse("PT2S"))) + .withRequestSettings(new OnlineRequestSettings().withMaxConcurrentRequestsPerInstance(1) + .withMaxQueueWait(Duration.parse("PT5M")) + .withRequestTimeout(Duration.parse("PT5M"))) + .withScaleSettings(new DefaultScaleSettings())) + .withTags(mapOf()) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) + .withKind("string") + .withSku(new Sku().withName("string") + .withTier(SkuTier.FREE) + .withSize("string") + .withFamily("string") + .withCapacity(1)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### OnlineDeployments_Delete + +```java +/** + * Samples for OnlineDeployments Delete. + */ +public final class OnlineDeploymentsDeleteSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/OnlineDeployment/delete.json + */ + /** + * Sample code: Delete Workspace Online Deployment. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + deleteWorkspaceOnlineDeployment(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.onlineDeployments() + .delete("testrg123", "workspace123", "testEndpoint", "testDeployment", com.azure.core.util.Context.NONE); + } +} +``` + +### OnlineDeployments_Get + +```java +/** + * Samples for OnlineDeployments Get. + */ +public final class OnlineDeploymentsGetSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/OnlineDeployment/KubernetesOnlineDeployment/get.json + */ + /** + * Sample code: Get Kubernetes Online Deployment. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + getKubernetesOnlineDeployment(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.onlineDeployments() + .getWithResponse("test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/OnlineDeployment/ManagedOnlineDeployment/get.json + */ + /** + * Sample code: Get Managed Online Deployment. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + getManagedOnlineDeployment(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.onlineDeployments() + .getWithResponse("test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", + com.azure.core.util.Context.NONE); + } +} +``` + +### OnlineDeployments_GetLogs + +```java +import com.azure.resourcemanager.machinelearning.models.ContainerType; +import com.azure.resourcemanager.machinelearning.models.DeploymentLogsRequest; + +/** + * Samples for OnlineDeployments GetLogs. + */ +public final class OnlineDeploymentsGetLogsSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/OnlineDeployment/getLogs.json + */ + /** + * Sample code: Get Online Deployment Logs. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + getOnlineDeploymentLogs(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.onlineDeployments() + .getLogsWithResponse("testrg123", "workspace123", "testEndpoint", "testDeployment", + new DeploymentLogsRequest().withContainerType(ContainerType.STORAGE_INITIALIZER).withTail(0), + com.azure.core.util.Context.NONE); + } +} +``` + +### OnlineDeployments_List + +```java +/** + * Samples for OnlineDeployments List. + */ +public final class OnlineDeploymentsListSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/OnlineDeployment/list.json + */ + /** + * Sample code: List Online Deployments. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listOnlineDeployments(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.onlineDeployments() + .list("test-rg", "my-aml-workspace", "testEndpointName", "string", 1, null, + com.azure.core.util.Context.NONE); + } +} +``` + +### OnlineDeployments_ListSkus + +```java +/** + * Samples for OnlineDeployments ListSkus. + */ +public final class OnlineDeploymentsListSkusSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/OnlineDeployment/ManagedOnlineDeployment/listSkus.json + */ + /** + * Sample code: List Managed Online Deployment Skus. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + listManagedOnlineDeploymentSkus(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.onlineDeployments() + .listSkus("test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", 1, null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/OnlineDeployment/KubernetesOnlineDeployment/listSkus.json + */ + /** + * Sample code: List Kubernetes Online Deployment Skus. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + listKubernetesOnlineDeploymentSkus(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.onlineDeployments() + .listSkus("test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", 1, null, + com.azure.core.util.Context.NONE); + } +} +``` + +### OnlineDeployments_Update + +```java +import com.azure.resourcemanager.machinelearning.models.OnlineDeployment; +import com.azure.resourcemanager.machinelearning.models.PartialSku; +import com.azure.resourcemanager.machinelearning.models.SkuTier; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for OnlineDeployments Update. + */ +public final class OnlineDeploymentsUpdateSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/OnlineDeployment/ManagedOnlineDeployment/update.json + */ + /** + * Sample code: Update Managed Online Deployment. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + updateManagedOnlineDeployment(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + OnlineDeployment resource = manager.onlineDeployments() + .getWithResponse("test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf()) + .withSku(new PartialSku().withCapacity(1) + .withFamily("string") + .withName("string") + .withSize("string") + .withTier(SkuTier.FREE)) + .apply(); + } + + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/OnlineDeployment/KubernetesOnlineDeployment/update.json + */ + /** + * Sample code: Update Kubernetes Online Deployment. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + updateKubernetesOnlineDeployment(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + OnlineDeployment resource = manager.onlineDeployments() + .getWithResponse("test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf()) + .withSku(new PartialSku().withCapacity(1) + .withFamily("string") + .withName("string") + .withSize("string") + .withTier(SkuTier.FREE)) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### OnlineEndpoints_CreateOrUpdate + +```java +import com.azure.resourcemanager.machinelearning.models.EndpointAuthMode; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.machinelearning.models.OnlineEndpointProperties; +import com.azure.resourcemanager.machinelearning.models.Sku; +import com.azure.resourcemanager.machinelearning.models.SkuTier; +import com.azure.resourcemanager.machinelearning.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for OnlineEndpoints CreateOrUpdate. + */ +public final class OnlineEndpointsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/OnlineEndpoint/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Workspace Online Endpoint. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateWorkspaceOnlineEndpoint( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.onlineEndpoints() + .define("testEndpointName") + .withRegion("string") + .withExistingWorkspace("test-rg", "my-aml-workspace") + .withProperties(new OnlineEndpointProperties().withAuthMode(EndpointAuthMode.AMLTOKEN) + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withCompute("string") + .withTraffic(mapOf("string", 1))) + .withTags(mapOf()) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) + .withKind("string") + .withSku(new Sku().withName("string") + .withTier(SkuTier.FREE) + .withSize("string") + .withFamily("string") + .withCapacity(1)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### OnlineEndpoints_Delete + +```java +/** + * Samples for OnlineEndpoints Delete. + */ +public final class OnlineEndpointsDeleteSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/OnlineEndpoint/delete.json + */ + /** + * Sample code: Delete Workspace Online Endpoint. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + deleteWorkspaceOnlineEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.onlineEndpoints() + .delete("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE); + } +} +``` + +### OnlineEndpoints_Get + +```java +/** + * Samples for OnlineEndpoints Get. + */ +public final class OnlineEndpointsGetSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/OnlineEndpoint/get.json + */ + /** + * Sample code: Get Workspace Online Endpoint. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + getWorkspaceOnlineEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.onlineEndpoints() + .getWithResponse("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE); + } +} +``` + +### OnlineEndpoints_GetToken + +```java +/** + * Samples for OnlineEndpoints GetToken. + */ +public final class OnlineEndpointsGetTokenSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/OnlineEndpoint/getToken.json + */ + /** + * Sample code: GetToken Workspace Online Endpoint. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + getTokenWorkspaceOnlineEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.onlineEndpoints() + .getTokenWithResponse("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE); + } +} +``` + +### OnlineEndpoints_List + +```java +import com.azure.resourcemanager.machinelearning.models.EndpointComputeType; +import com.azure.resourcemanager.machinelearning.models.OrderString; + +/** + * Samples for OnlineEndpoints List. + */ +public final class OnlineEndpointsListSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/OnlineEndpoint/list.json + */ + /** + * Sample code: List Workspace Online Endpoint. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + listWorkspaceOnlineEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.onlineEndpoints() + .list("test-rg", "my-aml-workspace", "string", 1, EndpointComputeType.MANAGED, null, "string", "string", + OrderString.CREATED_AT_DESC, com.azure.core.util.Context.NONE); + } +} +``` + +### OnlineEndpoints_ListKeys + +```java +/** + * Samples for OnlineEndpoints ListKeys. + */ +public final class OnlineEndpointsListKeysSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/OnlineEndpoint/listKeys.json + */ + /** + * Sample code: ListKeys Workspace Online Endpoint. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + listKeysWorkspaceOnlineEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.onlineEndpoints() + .listKeysWithResponse("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE); + } +} +``` + +### OnlineEndpoints_RegenerateKeys + +```java +import com.azure.resourcemanager.machinelearning.models.KeyType; +import com.azure.resourcemanager.machinelearning.models.RegenerateEndpointKeysRequest; + +/** + * Samples for OnlineEndpoints RegenerateKeys. + */ +public final class OnlineEndpointsRegenerateKeysSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/OnlineEndpoint/regenerateKeys.json + */ + /** + * Sample code: RegenerateKeys Workspace Online Endpoint. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void regenerateKeysWorkspaceOnlineEndpoint( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.onlineEndpoints() + .regenerateKeys("test-rg", "my-aml-workspace", "testEndpointName", + new RegenerateEndpointKeysRequest().withKeyType(KeyType.PRIMARY).withKeyValue("fakeTokenPlaceholder"), + com.azure.core.util.Context.NONE); + } +} +``` + +### OnlineEndpoints_Update + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.machinelearning.models.OnlineEndpoint; +import com.azure.resourcemanager.machinelearning.models.PartialManagedServiceIdentity; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for OnlineEndpoints Update. + */ +public final class OnlineEndpointsUpdateSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/OnlineEndpoint/update.json + */ + /** + * Sample code: Update Workspace Online Endpoint. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void updateWorkspaceOnlineEndpoint( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) throws IOException { + OnlineEndpoint resource = manager.onlineEndpoints() + .getWithResponse("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf()) + .withIdentity(new PartialManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities(mapOf("string", + SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)))) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Operations_List + +```java +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/operationsList.json + */ + /** + * Sample code: OperationsList. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void operationsList(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnections_CreateOrUpdate + +```java +import com.azure.resourcemanager.machinelearning.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.machinelearning.models.PrivateLinkServiceConnectionState; + +/** + * Samples for PrivateEndpointConnections CreateOrUpdate. + */ +public final class PrivateEndpointConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/PrivateEndpointConnection/createOrUpdate.json + */ + /** + * Sample code: WorkspacePutPrivateEndpointConnection. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void workspacePutPrivateEndpointConnection( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.privateEndpointConnections() + .define("{privateEndpointConnectionName}") + .withExistingWorkspace("rg-1234", "testworkspace") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Auto-Approved")) + .create(); + } +} +``` + +### PrivateEndpointConnections_Delete + +```java +/** + * Samples for PrivateEndpointConnections Delete. + */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/PrivateEndpointConnection/delete.json + */ + /** + * Sample code: WorkspaceDeletePrivateEndpointConnection. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void workspaceDeletePrivateEndpointConnection( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.privateEndpointConnections() + .deleteWithResponse("rg-1234", "testworkspace", "{privateEndpointConnectionName}", + com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Get + +```java +/** + * Samples for PrivateEndpointConnections Get. + */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/PrivateEndpointConnection/get.json + */ + /** + * Sample code: WorkspaceGetPrivateEndpointConnection. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void workspaceGetPrivateEndpointConnection( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.privateEndpointConnections() + .getWithResponse("rg-1234", "testworkspace", "{privateEndpointConnectionName}", + com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnections_List + +```java +/** + * Samples for PrivateEndpointConnections List. + */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/PrivateEndpointConnection/list.json + */ + /** + * Sample code: StorageAccountListPrivateEndpointConnections. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void storageAccountListPrivateEndpointConnections( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.privateEndpointConnections().list("rg-1234", "testworkspace", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateLinkResources_List + +```java +/** + * Samples for PrivateLinkResources List. + */ +public final class PrivateLinkResourcesListSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/PrivateLinkResource/list.json + */ + /** + * Sample code: WorkspaceListPrivateLinkResources. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + workspaceListPrivateLinkResources(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.privateLinkResources().listWithResponse("rg-1234", "testworkspace", com.azure.core.util.Context.NONE); + } +} +``` + +### Quotas_List + +```java +/** + * Samples for Quotas List. + */ +public final class QuotasListSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Quota/list.json + */ + /** + * Sample code: List workspace quotas by VMFamily. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + listWorkspaceQuotasByVMFamily(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.quotas().list("eastus", com.azure.core.util.Context.NONE); + } +} +``` + +### Quotas_Update + +```java +import com.azure.resourcemanager.machinelearning.models.QuotaBaseProperties; +import com.azure.resourcemanager.machinelearning.models.QuotaUnit; +import com.azure.resourcemanager.machinelearning.models.QuotaUpdateParameters; +import java.util.Arrays; + +/** + * Samples for Quotas Update. + */ +public final class QuotasUpdateSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Quota/update.json + */ + /** + * Sample code: update quotas. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void updateQuotas(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.quotas() + .updateWithResponse("eastus", new QuotaUpdateParameters().withValue(Arrays.asList( + new QuotaBaseProperties().withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace1/quotas/Standard_DSv2_Family_Cluster_Dedicated_vCPUs") + .withType("Microsoft.MachineLearningServices/workspaces/quotas") + .withLimit(100L) + .withUnit(QuotaUnit.COUNT), + new QuotaBaseProperties().withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace2/quotas/Standard_DSv2_Family_Cluster_Dedicated_vCPUs") + .withType("Microsoft.MachineLearningServices/workspaces/quotas") + .withLimit(200L) + .withUnit(QuotaUnit.COUNT))), + com.azure.core.util.Context.NONE); + } +} +``` + +### Registries_CreateOrUpdate + +```java +import com.azure.resourcemanager.machinelearning.models.AcrDetails; +import com.azure.resourcemanager.machinelearning.models.ArmResourceId; +import com.azure.resourcemanager.machinelearning.models.EndpointServiceConnectionStatus; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.machinelearning.models.PrivateEndpointResource; +import com.azure.resourcemanager.machinelearning.models.RegistryPrivateEndpointConnection; +import com.azure.resourcemanager.machinelearning.models.RegistryPrivateLinkServiceConnectionState; +import com.azure.resourcemanager.machinelearning.models.RegistryRegionArmDetails; +import com.azure.resourcemanager.machinelearning.models.Sku; +import com.azure.resourcemanager.machinelearning.models.SkuTier; +import com.azure.resourcemanager.machinelearning.models.StorageAccountDetails; +import com.azure.resourcemanager.machinelearning.models.SystemCreatedAcrAccount; +import com.azure.resourcemanager.machinelearning.models.SystemCreatedStorageAccount; +import com.azure.resourcemanager.machinelearning.models.UserAssignedIdentity; +import com.azure.resourcemanager.machinelearning.models.UserCreatedAcrAccount; +import com.azure.resourcemanager.machinelearning.models.UserCreatedStorageAccount; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Registries CreateOrUpdate. + */ +public final class RegistriesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registries/createOrUpdate-SystemCreated.json + */ + /** + * Sample code: CreateOrUpdate Registry with system created accounts. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateRegistryWithSystemCreatedAccounts( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registries() + .define("string") + .withRegion("string") + .withExistingResourceGroup("test-rg") + .withTags(mapOf()) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) + .withKind("string") + .withSku(new Sku().withName("string") + .withTier(SkuTier.FREE) + .withSize("string") + .withFamily("string") + .withCapacity(1)) + .withDiscoveryUrl("string") + .withIntellectualPropertyPublisher("string") + .withManagedResourceGroup(new ArmResourceId().withResourceId("string")) + .withMlFlowRegistryUri("string") + .withRegistryPrivateEndpointConnections( + Arrays.asList(new RegistryPrivateEndpointConnection().withId("string") + .withLocation("string") + .withGroupIds(Arrays.asList("string")) + .withPrivateEndpoint(new PrivateEndpointResource().withSubnetArmId("string")) + .withRegistryPrivateLinkServiceConnectionState( + new RegistryPrivateLinkServiceConnectionState().withActionsRequired("string") + .withDescription("string") + .withStatus(EndpointServiceConnectionStatus.APPROVED)) + .withProvisioningState("string"))) + .withPublicNetworkAccess("string") + .withRegionDetails(Arrays.asList(new RegistryRegionArmDetails() + .withAcrDetails(Arrays.asList(new AcrDetails() + .withSystemCreatedAcrAccount(new SystemCreatedAcrAccount().withAcrAccountName("string") + .withAcrAccountSku("string") + .withArmResourceId(new ArmResourceId().withResourceId("string"))))) + .withLocation("string") + .withStorageAccountDetails(Arrays.asList(new StorageAccountDetails() + .withSystemCreatedStorageAccount(new SystemCreatedStorageAccount().withAllowBlobPublicAccess(false) + .withArmResourceId(new ArmResourceId().withResourceId("string")) + .withStorageAccountHnsEnabled(false) + .withStorageAccountName("string") + .withStorageAccountType("string")))))) .create(); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/SweepJob/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registries/createOrUpdate-UserCreated.json */ /** - * Sample code: CreateOrUpdate Sweep Job. - * + * Sample code: CreateOrUpdate Registry with user created accounts. + * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateSweepJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) - throws IOException { - manager - .jobs() + public static void createOrUpdateRegistryWithUserCreatedAccounts( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registries() .define("string") - .withExistingWorkspace("test-rg", "my-aml-workspace") - .withProperties( - new SweepJob() - .withDescription("string") - .withProperties(mapOf("string", "string")) - .withTags(mapOf("string", "string")) - .withComputeId("string") - .withDisplayName("string") - .withExperimentName("string") - .withServices( - mapOf( - "string", - new JobService() - .withEndpoint("string") - .withJobServiceType("string") - .withPort(1) - .withProperties(mapOf("string", "string")))) - .withEarlyTermination(new MedianStoppingPolicy().withDelayEvaluation(1).withEvaluationInterval(1)) - .withLimits( - new SweepJobLimits() - .withMaxConcurrentTrials(1) - .withMaxTotalTrials(1) - .withTrialTimeout(Duration.parse("PT1S"))) - .withObjective(new Objective().withGoal(Goal.MINIMIZE).withPrimaryMetric("string")) - .withSamplingAlgorithm(new GridSamplingAlgorithm()) - .withSearchSpace( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize("{\"string\":{}}", Object.class, SerializerEncoding.JSON)) - .withTrial( - new TrialComponent() - .withCodeId("fakeTokenPlaceholder") - .withCommand("string") - .withDistribution(new Mpi().withProcessCountPerInstance(1)) - .withEnvironmentId("string") - .withEnvironmentVariables(mapOf("string", "string")) - .withResources( - new JobResourceConfiguration() - .withInstanceCount(1) - .withInstanceType("string") - .withProperties( - mapOf( - "string", - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"e6b6493e-7d5e-4db3-be1e-306ec641327e\":null}", - Object.class, - SerializerEncoding.JSON)))))) + .withRegion("string") + .withExistingResourceGroup("test-rg") + .withTags(mapOf()) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) + .withKind("string") + .withSku(new Sku().withName("string") + .withTier(SkuTier.FREE) + .withSize("string") + .withFamily("string") + .withCapacity(1)) + .withDiscoveryUrl("string") + .withIntellectualPropertyPublisher("string") + .withManagedResourceGroup(new ArmResourceId().withResourceId("string")) + .withMlFlowRegistryUri("string") + .withRegistryPrivateEndpointConnections( + Arrays.asList(new RegistryPrivateEndpointConnection().withId("string") + .withLocation("string") + .withGroupIds(Arrays.asList("string")) + .withPrivateEndpoint(new PrivateEndpointResource().withSubnetArmId("string")) + .withRegistryPrivateLinkServiceConnectionState( + new RegistryPrivateLinkServiceConnectionState().withActionsRequired("string") + .withDescription("string") + .withStatus(EndpointServiceConnectionStatus.APPROVED)) + .withProvisioningState("string"))) + .withPublicNetworkAccess("string") + .withRegionDetails(Arrays.asList(new RegistryRegionArmDetails() + .withAcrDetails(Arrays.asList(new AcrDetails().withUserCreatedAcrAccount( + new UserCreatedAcrAccount().withArmResourceId(new ArmResourceId().withResourceId("string"))))) + .withLocation("string") + .withStorageAccountDetails(Arrays.asList(new StorageAccountDetails().withUserCreatedStorageAccount( + new UserCreatedStorageAccount().withArmResourceId(new ArmResourceId().withResourceId("string"))))))) .create(); } + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Registries_Delete + +```java +/** + * Samples for Registries Delete. + */ +public final class RegistriesDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/PipelineJob/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registries/delete.json */ /** - * Sample code: CreateOrUpdate Pipeline Job. - * + * Sample code: Delete Registry. + * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdatePipelineJob( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) throws IOException { - manager - .jobs() - .define("string") - .withExistingWorkspace("test-rg", "my-aml-workspace") - .withProperties( - new PipelineJob() - .withDescription("string") - .withProperties(mapOf("string", "string")) - .withTags(mapOf("string", "string")) - .withComputeId("string") - .withDisplayName("string") - .withExperimentName("string") - .withServices( - mapOf( - "string", - new JobService() - .withEndpoint("string") - .withJobServiceType("string") - .withPort(1) - .withProperties(mapOf("string", "string")))) - .withInputs(mapOf("string", new LiteralJobInput().withDescription("string").withValue("string"))) - .withOutputs( - mapOf( - "string", - new UriFileJobOutput() - .withDescription("string") - .withMode(OutputDeliveryMode.UPLOAD) - .withUri("string"))) - .withSettings( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize("{}", Object.class, SerializerEncoding.JSON))) - .create(); + public static void deleteRegistry(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registries().delete("test-rg", "string", com.azure.core.util.Context.NONE); } +} +``` + +### Registries_GetByResourceGroup +```java +/** + * Samples for Registries GetByResourceGroup. + */ +public final class RegistriesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/CommandJob/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registries/get-UserCreated.json */ /** - * Sample code: CreateOrUpdate Command Job. - * + * Sample code: Get Registry with user created accounts. + * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateCommandJob( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) throws IOException { - manager - .jobs() - .define("string") - .withExistingWorkspace("test-rg", "my-aml-workspace") - .withProperties( - new CommandJob() - .withDescription("string") - .withProperties(mapOf("string", "string")) - .withTags(mapOf("string", "string")) - .withComputeId("string") - .withDisplayName("string") - .withExperimentName("string") - .withIdentity(new AmlToken()) - .withServices( - mapOf( - "string", - new JobService() - .withEndpoint("string") - .withJobServiceType("string") - .withPort(1) - .withProperties(mapOf("string", "string")))) - .withCodeId("fakeTokenPlaceholder") - .withCommand("string") - .withDistribution(new TensorFlow().withParameterServerCount(1).withWorkerCount(1)) - .withEnvironmentId("string") - .withEnvironmentVariables(mapOf("string", "string")) - .withInputs(mapOf("string", new LiteralJobInput().withDescription("string").withValue("string"))) - .withLimits(new CommandJobLimits().withTimeout(Duration.parse("PT5M"))) - .withOutputs( - mapOf( - "string", - new UriFileJobOutput() - .withDescription("string") - .withMode(OutputDeliveryMode.READ_WRITE_MOUNT) - .withUri("string"))) - .withResources( - new JobResourceConfiguration() - .withInstanceCount(1) - .withInstanceType("string") - .withProperties( - mapOf( - "string", - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"e6b6493e-7d5e-4db3-be1e-306ec641327e\":null}", - Object.class, - SerializerEncoding.JSON))))) - .create(); + public static void + getRegistryWithUserCreatedAccounts(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registries().getByResourceGroupWithResponse("test-rg", "string", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registries/get-SystemCreated.json + */ + /** + * Sample code: Get Registry with system created accounts. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + getRegistryWithSystemCreatedAccounts(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registries().getByResourceGroupWithResponse("test-rg", "string", com.azure.core.util.Context.NONE); } +} +``` + +### Registries_List + +```java +/** + * Samples for Registries List. + */ +public final class RegistriesListSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registries/listBySubscription.json + */ + /** + * Sample code: List registries by subscription. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + listRegistriesBySubscription(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registries().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Registries_ListByResourceGroup + +```java +/** + * Samples for Registries ListByResourceGroup. + */ +public final class RegistriesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registries/list-UserCreated.json + */ + /** + * Sample code: List registries with user created accounts. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listRegistriesWithUserCreatedAccounts( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registries().listByResourceGroup("test-rg", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registries/list-SystemCreated.json + */ + /** + * Sample code: List registries with system created accounts. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listRegistriesWithSystemCreatedAccounts( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registries().listByResourceGroup("test-rg", com.azure.core.util.Context.NONE); + } +} +``` + +### Registries_RemoveRegions + +```java +import com.azure.resourcemanager.machinelearning.fluent.models.RegistryInner; +import com.azure.resourcemanager.machinelearning.models.AcrDetails; +import com.azure.resourcemanager.machinelearning.models.ArmResourceId; +import com.azure.resourcemanager.machinelearning.models.EndpointServiceConnectionStatus; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.machinelearning.models.PrivateEndpointResource; +import com.azure.resourcemanager.machinelearning.models.RegistryPrivateEndpointConnection; +import com.azure.resourcemanager.machinelearning.models.RegistryPrivateLinkServiceConnectionState; +import com.azure.resourcemanager.machinelearning.models.RegistryRegionArmDetails; +import com.azure.resourcemanager.machinelearning.models.Sku; +import com.azure.resourcemanager.machinelearning.models.SkuTier; +import com.azure.resourcemanager.machinelearning.models.StorageAccountDetails; +import com.azure.resourcemanager.machinelearning.models.SystemCreatedAcrAccount; +import com.azure.resourcemanager.machinelearning.models.SystemCreatedStorageAccount; +import com.azure.resourcemanager.machinelearning.models.UserAssignedIdentity; +import com.azure.resourcemanager.machinelearning.models.UserCreatedAcrAccount; +import com.azure.resourcemanager.machinelearning.models.UserCreatedStorageAccount; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +/** + * Samples for Registries RemoveRegions. + */ +public final class RegistriesRemoveRegionsSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registries/removeRegions.json + */ + /** + * Sample code: Remove regions from registry. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + removeRegionsFromRegistry(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registries() + .removeRegions("test-rg", "string", + new RegistryInner().withLocation("string") + .withTags(mapOf()) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) + .withKind("string") + .withSku(new Sku().withName("string") + .withTier(SkuTier.FREE) + .withSize("string") + .withFamily("string") + .withCapacity(1)) + .withDiscoveryUrl("string") + .withIntellectualPropertyPublisher("string") + .withManagedResourceGroup(new ArmResourceId().withResourceId("string")) + .withMlFlowRegistryUri("string") + .withRegistryPrivateEndpointConnections( + Arrays.asList(new RegistryPrivateEndpointConnection().withId("string") + .withLocation("string") + .withGroupIds(Arrays.asList("string")) + .withPrivateEndpoint(new PrivateEndpointResource().withSubnetArmId("string")) + .withRegistryPrivateLinkServiceConnectionState( + new RegistryPrivateLinkServiceConnectionState().withActionsRequired("string") + .withDescription("string") + .withStatus(EndpointServiceConnectionStatus.APPROVED)) + .withProvisioningState("string"))) + .withPublicNetworkAccess("string") + .withRegionDetails(Arrays.asList(new RegistryRegionArmDetails() + .withAcrDetails(Arrays.asList(new AcrDetails() + .withSystemCreatedAcrAccount(new SystemCreatedAcrAccount().withAcrAccountName("string") + .withAcrAccountSku("string") + .withArmResourceId(new ArmResourceId().withResourceId("string"))) + .withUserCreatedAcrAccount(new UserCreatedAcrAccount() + .withArmResourceId(new ArmResourceId().withResourceId("string"))))) + .withLocation("string") + .withStorageAccountDetails(Arrays.asList(new StorageAccountDetails() + .withSystemCreatedStorageAccount( + new SystemCreatedStorageAccount().withAllowBlobPublicAccess(false) + .withArmResourceId(new ArmResourceId().withResourceId("string")) + .withStorageAccountHnsEnabled(false) + .withStorageAccountName("string") + .withStorageAccountType("string")) + .withUserCreatedStorageAccount(new UserCreatedStorageAccount() + .withArmResourceId(new ArmResourceId().withResourceId("string"))))))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -2624,171 +5687,397 @@ public final class JobsCreateOrUpdateSamples { } ``` -### Jobs_Delete +### Registries_Update ```java -/** Samples for Jobs Delete. */ -public final class JobsDeleteSamples { +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.machinelearning.models.PartialSku; +import com.azure.resourcemanager.machinelearning.models.Registry; +import com.azure.resourcemanager.machinelearning.models.RegistryPartialManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.SkuTier; +import com.azure.resourcemanager.machinelearning.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Registries Update. + */ +public final class RegistriesUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registries/update-UserCreated.json */ /** - * Sample code: Delete Job. - * + * Sample code: Update Registry with user created accounts. + * * @param manager Entry point to MachineLearningManager. */ - public static void deleteJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager.jobs().delete("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + public static void updateRegistryWithUserCreatedAccounts( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + Registry resource = manager.registries() + .getByResourceGroupWithResponse("test-rg", "string", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf()) + .withIdentity(new RegistryPartialManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) + .withSku(new PartialSku().withCapacity(1) + .withFamily("string") + .withName("string") + .withSize("string") + .withTier(SkuTier.BASIC)) + .apply(); + } + + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registries/update-SystemCreated.json + */ + /** + * Sample code: Update Registry with system created accounts. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void updateRegistryWithSystemCreatedAccounts( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + Registry resource = manager.registries() + .getByResourceGroupWithResponse("test-rg", "string", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf()) + .withIdentity( + new RegistryPartialManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) + .withSku(new PartialSku().withCapacity(1) + .withFamily("string") + .withName("string") + .withSize("string") + .withTier(SkuTier.BASIC)) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } } ``` -### Jobs_Get +### RegistryCodeContainers_CreateOrUpdate ```java -/** Samples for Jobs Get. */ -public final class JobsGetSamples { +import com.azure.resourcemanager.machinelearning.models.CodeContainerProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RegistryCodeContainers CreateOrUpdate. + */ +public final class RegistryCodeContainersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/CommandJob/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/CodeContainer/createOrUpdate.json */ /** - * Sample code: Get Command Job. - * + * Sample code: CreateOrUpdate Registry Code Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void getCommandJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager.jobs().getWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + public static void + createOrUpdateRegistryCodeContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryCodeContainers() + .define("testContainer") + .withExistingRegistry("testrg123", "testregistry") + .withProperties(new CodeContainerProperties().withDescription("string") + .withTags(mapOf("tag1", "value1", "tag2", "value2"))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } +} +``` +### RegistryCodeContainers_Delete + +```java +/** + * Samples for RegistryCodeContainers Delete. + */ +public final class RegistryCodeContainersDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/AutoMLJob/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/CodeContainer/delete.json */ /** - * Sample code: Get AutoML Job. - * + * Sample code: Delete Registry Code Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void getAutoMLJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager.jobs().getWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + public static void + deleteRegistryCodeContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryCodeContainers() + .delete("testrg123", "testregistry", "testContainer", com.azure.core.util.Context.NONE); } +} +``` + +### RegistryCodeContainers_Get +```java +/** + * Samples for RegistryCodeContainers Get. + */ +public final class RegistryCodeContainersGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/SweepJob/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/CodeContainer/get.json */ /** - * Sample code: Get Sweep Job. - * + * Sample code: Get Registry Code Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void getSweepJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager.jobs().getWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + public static void + getRegistryCodeContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryCodeContainers() + .getWithResponse("testrg123", "testregistry", "testContainer", com.azure.core.util.Context.NONE); } +} +``` +### RegistryCodeContainers_List + +```java +/** + * Samples for RegistryCodeContainers List. + */ +public final class RegistryCodeContainersListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/PipelineJob/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/CodeContainer/list.json */ /** - * Sample code: Get Pipeline Job. - * + * Sample code: List Registry Code Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void getPipelineJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager.jobs().getWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + public static void + listRegistryCodeContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryCodeContainers().list("testrg123", "testregistry", null, com.azure.core.util.Context.NONE); } } ``` -### Jobs_List +### RegistryCodeVersions_CreateOrGetStartPendingUpload ```java -/** Samples for Jobs List. */ -public final class JobsListSamples { +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; +import com.azure.resourcemanager.machinelearning.models.PendingUploadType; + +/** + * Samples for RegistryCodeVersions CreateOrGetStartPendingUpload. + */ +public final class RegistryCodeVersionsCreateOrGetStartPendingUploadSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/CommandJob/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/CodeVersion/createOrGetStartPendingUpload.json */ /** - * Sample code: List Command Job. - * + * Sample code: CreateOrGetStartPendingUpload Registry Code Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void listCommandJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .jobs() - .list("test-rg", "my-aml-workspace", null, "string", "string", null, com.azure.core.util.Context.NONE); + public static void createOrGetStartPendingUploadRegistryCodeVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryCodeVersions() + .createOrGetStartPendingUploadWithResponse("test-rg", "registryName", "string", "string", + new PendingUploadRequestDto().withPendingUploadId("string") + .withPendingUploadType(PendingUploadType.TEMPORARY_BLOB_REFERENCE), + com.azure.core.util.Context.NONE); } +} +``` +### RegistryCodeVersions_CreateOrUpdate + +```java +import com.azure.resourcemanager.machinelearning.models.CodeVersionProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RegistryCodeVersions CreateOrUpdate. + */ +public final class RegistryCodeVersionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/PipelineJob/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/CodeVersion/createOrUpdate.json */ /** - * Sample code: List Pipeline Job. - * + * Sample code: CreateOrUpdate Registry Code Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void listPipelineJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .jobs() - .list("test-rg", "my-aml-workspace", null, "string", "string", null, com.azure.core.util.Context.NONE); + public static void + createOrUpdateRegistryCodeVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryCodeVersions() + .define("string") + .withExistingCode("test-rg", "my-aml-registry", "string") + .withProperties(new CodeVersionProperties().withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsAnonymous(false) + .withCodeUri("fakeTokenPlaceholder")) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### RegistryCodeVersions_Delete + +```java +/** + * Samples for RegistryCodeVersions Delete. + */ +public final class RegistryCodeVersionsDeleteSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/CodeVersion/delete.json + */ + /** + * Sample code: Delete Registry Code Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + deleteRegistryCodeVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryCodeVersions() + .delete("test-rg", "my-aml-registry", "string", "string", com.azure.core.util.Context.NONE); } +} +``` +### RegistryCodeVersions_Get + +```java +/** + * Samples for RegistryCodeVersions Get. + */ +public final class RegistryCodeVersionsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/SweepJob/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/CodeVersion/get.json */ /** - * Sample code: List Sweep Job. - * + * Sample code: Get Registry Code Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void listSweepJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .jobs() - .list("test-rg", "my-aml-workspace", null, "string", "string", null, com.azure.core.util.Context.NONE); + public static void + getRegistryCodeVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryCodeVersions() + .getWithResponse("test-rg", "my-aml-registry", "string", "string", com.azure.core.util.Context.NONE); } +} +``` +### RegistryCodeVersions_List + +```java +/** + * Samples for RegistryCodeVersions List. + */ +public final class RegistryCodeVersionsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/AutoMLJob/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/CodeVersion/list.json */ /** - * Sample code: List AutoML Job. - * + * Sample code: List Registry Code Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void listAutoMLJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager.jobs().list("test-rg", "my-aml-workspace", null, null, null, null, com.azure.core.util.Context.NONE); + public static void + listRegistryCodeVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryCodeVersions() + .list("test-rg", "my-aml-registry", "string", "string", 1, null, com.azure.core.util.Context.NONE); } } ``` -### ModelContainers_CreateOrUpdate +### RegistryComponentContainers_CreateOrUpdate ```java -import com.azure.resourcemanager.machinelearning.models.ModelContainerProperties; +import com.azure.resourcemanager.machinelearning.models.ComponentContainerProperties; import java.util.HashMap; import java.util.Map; -/** Samples for ModelContainers CreateOrUpdate. */ -public final class ModelContainersCreateOrUpdateSamples { +/** + * Samples for RegistryComponentContainers CreateOrUpdate. + */ +public final class RegistryComponentContainersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelContainer/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/ComponentContainer/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Model Container. - * + * Sample code: CreateOrUpdate Registry Component Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateModelContainer( + public static void createOrUpdateRegistryComponentContainer( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .modelContainers() - .define("testContainer") - .withExistingWorkspace("testrg123", "workspace123") - .withProperties( - new ModelContainerProperties() - .withDescription("Model container description") - .withTags(mapOf("tag1", "value1", "tag2", "value2"))) + manager.registryComponentContainers() + .define("string") + .withExistingRegistry("test-rg", "my-aml-registry") + .withProperties(new ComponentContainerProperties().withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string"))) .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -2802,103 +6091,121 @@ public final class ModelContainersCreateOrUpdateSamples { } ``` -### ModelContainers_Delete +### RegistryComponentContainers_Delete ```java -/** Samples for ModelContainers Delete. */ -public final class ModelContainersDeleteSamples { +/** + * Samples for RegistryComponentContainers Delete. + */ +public final class RegistryComponentContainersDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelContainer/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/ComponentContainer/delete.json */ /** - * Sample code: Delete Model Container. - * + * Sample code: Delete Registry Component Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void deleteModelContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .modelContainers() - .deleteWithResponse("testrg123", "workspace123", "testContainer", com.azure.core.util.Context.NONE); + public static void + deleteRegistryComponentContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryComponentContainers() + .delete("test-rg", "my-aml-registry", "string", com.azure.core.util.Context.NONE); } } ``` -### ModelContainers_Get +### RegistryComponentContainers_Get ```java -/** Samples for ModelContainers Get. */ -public final class ModelContainersGetSamples { +/** + * Samples for RegistryComponentContainers Get. + */ +public final class RegistryComponentContainersGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelContainer/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/ComponentContainer/get.json */ /** - * Sample code: Get Model Container. - * + * Sample code: Get Registry Component Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void getModelContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .modelContainers() - .getWithResponse("testrg123", "workspace123", "testContainer", com.azure.core.util.Context.NONE); + public static void + getRegistryComponentContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryComponentContainers() + .getWithResponse("test-rg", "my-aml-registry", "string", com.azure.core.util.Context.NONE); } } ``` -### ModelContainers_List +### RegistryComponentContainers_List ```java -/** Samples for ModelContainers List. */ -public final class ModelContainersListSamples { +/** + * Samples for RegistryComponentContainers List. + */ +public final class RegistryComponentContainersListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelContainer/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/ComponentContainer/list.json */ /** - * Sample code: List Model Container. - * + * Sample code: List Registry Component Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void listModelContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager.modelContainers().list("testrg123", "workspace123", null, null, null, com.azure.core.util.Context.NONE); + public static void + listRegistryComponentContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryComponentContainers() + .list("test-rg", "my-aml-registry", null, com.azure.core.util.Context.NONE); } } ``` -### ModelVersions_CreateOrUpdate +### RegistryComponentVersions_CreateOrUpdate ```java -import com.azure.resourcemanager.machinelearning.models.FlavorData; -import com.azure.resourcemanager.machinelearning.models.ModelVersionProperties; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.machinelearning.models.ComponentVersionProperties; +import java.io.IOException; import java.util.HashMap; import java.util.Map; -/** Samples for ModelVersions CreateOrUpdate. */ -public final class ModelVersionsCreateOrUpdateSamples { +/** + * Samples for RegistryComponentVersions CreateOrUpdate. + */ +public final class RegistryComponentVersionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelVersion/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/ComponentVersion/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Model Version. - * + * Sample code: CreateOrUpdate Registry Component Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateModelVersion( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .modelVersions() + public static void createOrUpdateRegistryComponentVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) throws IOException { + manager.registryComponentVersions() .define("string") - .withExistingModel("test-rg", "my-aml-workspace", "string") - .withProperties( - new ModelVersionProperties() - .withDescription("string") - .withProperties(mapOf("string", "string")) - .withTags(mapOf("string", "string")) - .withIsAnonymous(false) - .withFlavors(mapOf("string", new FlavorData().withData(mapOf("string", "string")))) - .withModelType("CustomModel") - .withModelUri("string")) + .withExistingComponent("test-rg", "my-aml-registry", "string") + .withProperties(new ComponentVersionProperties().withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsAnonymous(false) + .withComponentSpec(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"8ced901b-d826-477d-bfef-329da9672513\":null}", Object.class, + SerializerEncoding.JSON))) .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -2912,233 +6219,117 @@ public final class ModelVersionsCreateOrUpdateSamples { } ``` -### ModelVersions_Delete +### RegistryComponentVersions_Delete ```java -/** Samples for ModelVersions Delete. */ -public final class ModelVersionsDeleteSamples { +/** + * Samples for RegistryComponentVersions Delete. + */ +public final class RegistryComponentVersionsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelVersion/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/ComponentVersion/delete.json */ /** - * Sample code: Delete Model Version. - * + * Sample code: Delete Registry Component Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void deleteModelVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .modelVersions() - .deleteWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); + public static void + deleteRegistryComponentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryComponentVersions() + .delete("test-rg", "my-aml-registry", "string", "string", com.azure.core.util.Context.NONE); } } ``` -### ModelVersions_Get +### RegistryComponentVersions_Get ```java -/** Samples for ModelVersions Get. */ -public final class ModelVersionsGetSamples { +/** + * Samples for RegistryComponentVersions Get. + */ +public final class RegistryComponentVersionsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelVersion/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/ComponentVersion/get.json */ /** - * Sample code: Get Model Version. - * + * Sample code: Get Registry Component Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void getModelVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .modelVersions() - .getWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); + public static void + getRegistryComponentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryComponentVersions() + .getWithResponse("test-rg", "my-aml-registry", "string", "string", com.azure.core.util.Context.NONE); } } ``` -### ModelVersions_List +### RegistryComponentVersions_List ```java -/** Samples for ModelVersions List. */ -public final class ModelVersionsListSamples { +/** + * Samples for RegistryComponentVersions List. + */ +public final class RegistryComponentVersionsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelVersion/list.json - */ - /** - * Sample code: List Model Version. - * - * @param manager Entry point to MachineLearningManager. - */ - public static void listModelVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .modelVersions() - .list( - "test-rg", - "my-aml-workspace", - "string", - null, - "string", - 1, - "string", - "string", - 1, - "string", - "string", - null, - null, - com.azure.core.util.Context.NONE); + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/ComponentVersion/list.json + */ + /** + * Sample code: List Registry Component Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + listRegistryComponentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryComponentVersions() + .list("test-rg", "my-aml-registry", "string", "string", 1, null, com.azure.core.util.Context.NONE); } } ``` -### OnlineDeployments_CreateOrUpdate +### RegistryDataContainers_CreateOrUpdate ```java -import com.azure.resourcemanager.machinelearning.models.CodeConfiguration; -import com.azure.resourcemanager.machinelearning.models.ContainerResourceRequirements; -import com.azure.resourcemanager.machinelearning.models.ContainerResourceSettings; -import com.azure.resourcemanager.machinelearning.models.DefaultScaleSettings; -import com.azure.resourcemanager.machinelearning.models.KubernetesOnlineDeployment; -import com.azure.resourcemanager.machinelearning.models.ManagedOnlineDeployment; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.OnlineRequestSettings; -import com.azure.resourcemanager.machinelearning.models.ProbeSettings; -import com.azure.resourcemanager.machinelearning.models.Sku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import com.azure.resourcemanager.machinelearning.models.UserAssignedIdentity; -import java.time.Duration; +import com.azure.resourcemanager.machinelearning.models.DataContainerProperties; +import com.azure.resourcemanager.machinelearning.models.DataType; import java.util.HashMap; import java.util.Map; -/** Samples for OnlineDeployments CreateOrUpdate. */ -public final class OnlineDeploymentsCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/KubernetesOnlineDeployment/createOrUpdate.json - */ - /** - * Sample code: CreateOrUpdate Kubernetes Online Deployment. - * - * @param manager Entry point to MachineLearningManager. - */ - public static void createOrUpdateKubernetesOnlineDeployment( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .onlineDeployments() - .define("testDeploymentName") - .withRegion("string") - .withExistingOnlineEndpoint("test-rg", "my-aml-workspace", "testEndpointName") - .withProperties( - new KubernetesOnlineDeployment() - .withCodeConfiguration( - new CodeConfiguration().withCodeId("fakeTokenPlaceholder").withScoringScript("string")) - .withDescription("string") - .withEnvironmentId("string") - .withEnvironmentVariables(mapOf("string", "string")) - .withProperties(mapOf("string", "string")) - .withAppInsightsEnabled(false) - .withInstanceType("string") - .withLivenessProbe( - new ProbeSettings() - .withFailureThreshold(1) - .withInitialDelay(Duration.parse("PT5M")) - .withPeriod(Duration.parse("PT5M")) - .withSuccessThreshold(1) - .withTimeout(Duration.parse("PT5M"))) - .withModel("string") - .withModelMountPath("string") - .withRequestSettings( - new OnlineRequestSettings() - .withMaxConcurrentRequestsPerInstance(1) - .withMaxQueueWait(Duration.parse("PT5M")) - .withRequestTimeout(Duration.parse("PT5M"))) - .withScaleSettings(new DefaultScaleSettings()) - .withContainerResourceRequirements( - new ContainerResourceRequirements() - .withContainerResourceLimits( - new ContainerResourceSettings().withCpu("\"1\"").withGpu("\"1\"").withMemory("\"2Gi\"")) - .withContainerResourceRequests( - new ContainerResourceSettings() - .withCpu("\"1\"") - .withGpu("\"1\"") - .withMemory("\"2Gi\"")))) - .withTags(mapOf()) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) - .withKind("string") - .withSku( - new Sku() - .withName("string") - .withTier(SkuTier.FREE) - .withSize("string") - .withFamily("string") - .withCapacity(1)) - .create(); - } - +/** + * Samples for RegistryDataContainers CreateOrUpdate. + */ +public final class RegistryDataContainersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/ManagedOnlineDeployment/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/DataContainer/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Managed Online Deployment. - * + * Sample code: CreateOrUpdate Registry Data Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateManagedOnlineDeployment( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .onlineDeployments() - .define("testDeploymentName") - .withRegion("string") - .withExistingOnlineEndpoint("test-rg", "my-aml-workspace", "testEndpointName") - .withProperties( - new ManagedOnlineDeployment() - .withCodeConfiguration( - new CodeConfiguration().withCodeId("fakeTokenPlaceholder").withScoringScript("string")) - .withDescription("string") - .withEnvironmentId("string") - .withEnvironmentVariables(mapOf("string", "string")) - .withProperties(mapOf("string", "string")) - .withAppInsightsEnabled(false) - .withInstanceType("string") - .withLivenessProbe( - new ProbeSettings() - .withFailureThreshold(1) - .withInitialDelay(Duration.parse("PT5M")) - .withPeriod(Duration.parse("PT5M")) - .withSuccessThreshold(1) - .withTimeout(Duration.parse("PT5M"))) - .withModel("string") - .withModelMountPath("string") - .withReadinessProbe( - new ProbeSettings() - .withFailureThreshold(30) - .withInitialDelay(Duration.parse("PT1S")) - .withPeriod(Duration.parse("PT10S")) - .withSuccessThreshold(1) - .withTimeout(Duration.parse("PT2S"))) - .withRequestSettings( - new OnlineRequestSettings() - .withMaxConcurrentRequestsPerInstance(1) - .withMaxQueueWait(Duration.parse("PT5M")) - .withRequestTimeout(Duration.parse("PT5M"))) - .withScaleSettings(new DefaultScaleSettings())) - .withTags(mapOf()) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) - .withKind("string") - .withSku( - new Sku() - .withName("string") - .withTier(SkuTier.FREE) - .withSize("string") - .withFamily("string") - .withCapacity(1)) + public static void + createOrUpdateRegistryDataContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryDataContainers() + .define("string") + .withExistingRegistry("test-rg", "registryName") + .withProperties(new DataContainerProperties().withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsArchived(false) + .withDataType(DataType.URI_FOLDER)) .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -3152,322 +6343,306 @@ public final class OnlineDeploymentsCreateOrUpdateSamples { } ``` -### OnlineDeployments_Delete +### RegistryDataContainers_Delete ```java -/** Samples for OnlineDeployments Delete. */ -public final class OnlineDeploymentsDeleteSamples { +/** + * Samples for RegistryDataContainers Delete. + */ +public final class RegistryDataContainersDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/DataContainer/delete.json */ /** - * Sample code: Delete Online Deployment. - * + * Sample code: Delete Registry Data Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void deleteOnlineDeployment( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .onlineDeployments() - .delete("testrg123", "workspace123", "testEndpoint", "testDeployment", com.azure.core.util.Context.NONE); + public static void + deleteRegistryDataContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryDataContainers().delete("test-rg", "registryName", "string", com.azure.core.util.Context.NONE); } } ``` -### OnlineDeployments_Get +### RegistryDataContainers_Get ```java -/** Samples for OnlineDeployments Get. */ -public final class OnlineDeploymentsGetSamples { +/** + * Samples for RegistryDataContainers Get. + */ +public final class RegistryDataContainersGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/KubernetesOnlineDeployment/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/DataContainer/get.json */ /** - * Sample code: Get Kubernetes Online Deployment. - * + * Sample code: Get Registry Data Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void getKubernetesOnlineDeployment( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .onlineDeployments() - .getWithResponse( - "test-rg", - "my-aml-workspace", - "testEndpointName", - "testDeploymentName", - com.azure.core.util.Context.NONE); + public static void + getRegistryDataContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryDataContainers() + .getWithResponse("test-rg", "registryName", "string", com.azure.core.util.Context.NONE); } +} +``` +### RegistryDataContainers_List + +```java +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** + * Samples for RegistryDataContainers List. + */ +public final class RegistryDataContainersListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/ManagedOnlineDeployment/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/DataContainer/registryList.json */ /** - * Sample code: Get Managed Online Deployment. - * + * Sample code: RegistryList Registry Data Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void getManagedOnlineDeployment( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .onlineDeployments() - .getWithResponse( - "test-rg", - "my-aml-workspace", - "testEndpointName", - "testDeploymentName", - com.azure.core.util.Context.NONE); + public static void + registryListRegistryDataContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryDataContainers() + .list("test-rg", "registryName", null, ListViewType.ALL, com.azure.core.util.Context.NONE); } } ``` -### OnlineDeployments_GetLogs +### RegistryDataReferences_GetBlobReferenceSas ```java -import com.azure.resourcemanager.machinelearning.models.ContainerType; -import com.azure.resourcemanager.machinelearning.models.DeploymentLogsRequest; +import com.azure.resourcemanager.machinelearning.models.GetBlobReferenceSasRequestDto; -/** Samples for OnlineDeployments GetLogs. */ -public final class OnlineDeploymentsGetLogsSamples { +/** + * Samples for RegistryDataReferences GetBlobReferenceSas. + */ +public final class RegistryDataReferencesGetBlobReferenceSasSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/getLogs.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/DataReference/getBlobReferenceSAS.json */ /** - * Sample code: Get Online Deployment Logs. - * + * Sample code: GetBlobReferenceSAS Data Reference. + * * @param manager Entry point to MachineLearningManager. */ - public static void getOnlineDeploymentLogs( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .onlineDeployments() - .getLogsWithResponse( - "testrg123", - "workspace123", - "testEndpoint", - "testDeployment", - new DeploymentLogsRequest().withContainerType(ContainerType.STORAGE_INITIALIZER).withTail(0), + public static void + getBlobReferenceSASDataReference(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryDataReferences() + .getBlobReferenceSasWithResponse("test-rg", "registryName", "string", "string", + new GetBlobReferenceSasRequestDto().withAssetId("string") + .withBlobUri("https://www.contoso.com/example"), com.azure.core.util.Context.NONE); } } ``` -### OnlineDeployments_List +### RegistryDataVersions_CreateOrGetStartPendingUpload ```java -/** Samples for OnlineDeployments List. */ -public final class OnlineDeploymentsListSamples { +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; +import com.azure.resourcemanager.machinelearning.models.PendingUploadType; + +/** + * Samples for RegistryDataVersions CreateOrGetStartPendingUpload. + */ +public final class RegistryDataVersionsCreateOrGetStartPendingUploadSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/DataVersionBase/createOrGetStartPendingUpload.json */ /** - * Sample code: List Online Deployments. - * + * Sample code: CreateOrGetStartPendingUpload Registry Data Version Base. + * * @param manager Entry point to MachineLearningManager. */ - public static void listOnlineDeployments(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .onlineDeployments() - .list( - "test-rg", "my-aml-workspace", "testEndpointName", "string", 1, null, com.azure.core.util.Context.NONE); + public static void createOrGetStartPendingUploadRegistryDataVersionBase( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryDataVersions() + .createOrGetStartPendingUploadWithResponse("test-rg", "registryName", "string", "string", + new PendingUploadRequestDto().withPendingUploadId("string") + .withPendingUploadType(PendingUploadType.NONE), + com.azure.core.util.Context.NONE); } } ``` -### OnlineDeployments_ListSkus +### RegistryDataVersions_CreateOrUpdate ```java -/** Samples for OnlineDeployments ListSkus. */ -public final class OnlineDeploymentsListSkusSamples { +import com.azure.resourcemanager.machinelearning.models.MLTableData; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RegistryDataVersions CreateOrUpdate. + */ +public final class RegistryDataVersionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/ManagedOnlineDeployment/listSkus.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/DataVersionBase/createOrUpdate.json */ /** - * Sample code: List Managed Online Deployment Skus. - * + * Sample code: CreateOrUpdate Registry Data Version Base. + * * @param manager Entry point to MachineLearningManager. */ - public static void listManagedOnlineDeploymentSkus( + public static void createOrUpdateRegistryDataVersionBase( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .onlineDeployments() - .listSkus( - "test-rg", - "my-aml-workspace", - "testEndpointName", - "testDeploymentName", - 1, - null, - com.azure.core.util.Context.NONE); + manager.registryDataVersions() + .define("string") + .withExistingData("test-rg", "registryName", "string") + .withProperties(new MLTableData().withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsAnonymous(false) + .withIsArchived(false) + .withDataUri("string") + .withReferencedUris(Arrays.asList("string"))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } +} +``` + +### RegistryDataVersions_Delete +```java +/** + * Samples for RegistryDataVersions Delete. + */ +public final class RegistryDataVersionsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/KubernetesOnlineDeployment/listSkus.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/DataVersionBase/delete.json */ /** - * Sample code: List Kubernetes Online Deployment Skus. - * + * Sample code: Delete Registry Data Version Base. + * * @param manager Entry point to MachineLearningManager. */ - public static void listKubernetesOnlineDeploymentSkus( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .onlineDeployments() - .listSkus( - "test-rg", - "my-aml-workspace", - "testEndpointName", - "testDeploymentName", - 1, - null, - com.azure.core.util.Context.NONE); + public static void + deleteRegistryDataVersionBase(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryDataVersions() + .delete("test-rg", "registryName", "string", "string", com.azure.core.util.Context.NONE); } } ``` -### OnlineDeployments_Update +### RegistryDataVersions_Get ```java -import com.azure.resourcemanager.machinelearning.models.OnlineDeployment; -import com.azure.resourcemanager.machinelearning.models.PartialSku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import java.util.HashMap; -import java.util.Map; - -/** Samples for OnlineDeployments Update. */ -public final class OnlineDeploymentsUpdateSamples { +/** + * Samples for RegistryDataVersions Get. + */ +public final class RegistryDataVersionsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/ManagedOnlineDeployment/update.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/DataVersionBase/get.json */ /** - * Sample code: Update Managed Online Deployment. - * + * Sample code: Get Registry Data Version Base. + * * @param manager Entry point to MachineLearningManager. */ - public static void updateManagedOnlineDeployment( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - OnlineDeployment resource = - manager - .onlineDeployments() - .getWithResponse( - "test-rg", - "my-aml-workspace", - "testEndpointName", - "testDeploymentName", - com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() - .withTags(mapOf()) - .withSku( - new PartialSku() - .withCapacity(1) - .withFamily("string") - .withName("string") - .withSize("string") - .withTier(SkuTier.FREE)) - .apply(); + public static void + getRegistryDataVersionBase(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryDataVersions() + .getWithResponse("test-rg", "registryName", "string", "string", com.azure.core.util.Context.NONE); } +} +``` + +### RegistryDataVersions_List + +```java +import com.azure.resourcemanager.machinelearning.models.ListViewType; +/** + * Samples for RegistryDataVersions List. + */ +public final class RegistryDataVersionsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/KubernetesOnlineDeployment/update.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/DataVersionBase/registryList.json */ /** - * Sample code: Update Kubernetes Online Deployment. - * + * Sample code: RegistryList Registry Data Version Base. + * * @param manager Entry point to MachineLearningManager. */ - public static void updateKubernetesOnlineDeployment( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - OnlineDeployment resource = - manager - .onlineDeployments() - .getWithResponse( - "test-rg", - "my-aml-workspace", - "testEndpointName", - "testDeploymentName", - com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() - .withTags(mapOf()) - .withSku( - new PartialSku() - .withCapacity(1) - .withFamily("string") - .withName("string") - .withSize("string") - .withTier(SkuTier.FREE)) - .apply(); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + public static void + registryListRegistryDataVersionBase(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryDataVersions() + .list("test-rg", "registryName", "string", "string", 1, null, "string", ListViewType.ARCHIVED_ONLY, + com.azure.core.util.Context.NONE); } } ``` -### OnlineEndpoints_CreateOrUpdate +### RegistryEnvironmentContainers_CreateOrUpdate ```java -import com.azure.resourcemanager.machinelearning.models.EndpointAuthMode; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.OnlineEndpointProperties; -import com.azure.resourcemanager.machinelearning.models.Sku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import com.azure.resourcemanager.machinelearning.models.UserAssignedIdentity; +import com.azure.resourcemanager.machinelearning.models.EnvironmentContainerProperties; import java.util.HashMap; import java.util.Map; -/** Samples for OnlineEndpoints CreateOrUpdate. */ -public final class OnlineEndpointsCreateOrUpdateSamples { +/** + * Samples for RegistryEnvironmentContainers CreateOrUpdate. + */ +public final class RegistryEnvironmentContainersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/EnvironmentContainer/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Online Endpoint. - * + * Sample code: CreateOrUpdate Registry Environment Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateOnlineEndpoint( + public static void createOrUpdateRegistryEnvironmentContainer( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .onlineEndpoints() - .define("testEndpointName") - .withRegion("string") - .withExistingWorkspace("test-rg", "my-aml-workspace") - .withProperties( - new OnlineEndpointProperties() - .withAuthMode(EndpointAuthMode.AMLTOKEN) - .withDescription("string") - .withProperties(mapOf("string", "string")) - .withCompute("string") - .withTraffic(mapOf("string", 1))) - .withTags(mapOf()) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) - .withKind("string") - .withSku( - new Sku() - .withName("string") - .withTier(SkuTier.FREE) - .withSize("string") - .withFamily("string") - .withCapacity(1)) + manager.registryEnvironmentContainers() + .define("testEnvironment") + .withExistingRegistry("testrg123", "testregistry") + .withProperties(new EnvironmentContainerProperties().withDescription("string") + .withProperties( + mapOf("additionalProp1", "string", "additionalProp2", "string", "additionalProp3", "string")) + .withTags(mapOf("additionalProp1", "string", "additionalProp2", "string", "additionalProp3", "string"))) .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -3481,200 +6656,249 @@ public final class OnlineEndpointsCreateOrUpdateSamples { } ``` -### OnlineEndpoints_Delete +### RegistryEnvironmentContainers_Delete ```java -/** Samples for OnlineEndpoints Delete. */ -public final class OnlineEndpointsDeleteSamples { +/** + * Samples for RegistryEnvironmentContainers Delete. + */ +public final class RegistryEnvironmentContainersDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/EnvironmentContainer/delete.json */ /** - * Sample code: Delete Online Endpoint. - * + * Sample code: Delete Registry Environment Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void deleteOnlineEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .onlineEndpoints() - .delete("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE); + public static void + deleteRegistryEnvironmentContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryEnvironmentContainers() + .delete("testrg123", "testregistry", "testContainer", com.azure.core.util.Context.NONE); } } ``` -### OnlineEndpoints_Get +### RegistryEnvironmentContainers_Get ```java -/** Samples for OnlineEndpoints Get. */ -public final class OnlineEndpointsGetSamples { +/** + * Samples for RegistryEnvironmentContainers Get. + */ +public final class RegistryEnvironmentContainersGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/EnvironmentContainer/get.json */ /** - * Sample code: Get Online Endpoint. - * + * Sample code: Get Registry Environment Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void getOnlineEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .onlineEndpoints() - .getWithResponse("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE); + public static void + getRegistryEnvironmentContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryEnvironmentContainers() + .getWithResponse("testrg123", "testregistry", "testEnvironment", com.azure.core.util.Context.NONE); } } ``` -### OnlineEndpoints_GetToken +### RegistryEnvironmentContainers_List ```java -/** Samples for OnlineEndpoints GetToken. */ -public final class OnlineEndpointsGetTokenSamples { + +/** + * Samples for RegistryEnvironmentContainers List. + */ +public final class RegistryEnvironmentContainersListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/getToken.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/EnvironmentContainer/list.json */ /** - * Sample code: GetToken Online Endpoint. - * + * Sample code: List Registry Environment Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void getTokenOnlineEndpoint( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .onlineEndpoints() - .getTokenWithResponse("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE); + public static void + listRegistryEnvironmentContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryEnvironmentContainers() + .list("testrg123", "testregistry", null, null, com.azure.core.util.Context.NONE); } } ``` -### OnlineEndpoints_List +### RegistryEnvironmentVersions_CreateOrUpdate ```java -import com.azure.resourcemanager.machinelearning.models.EndpointComputeType; -import com.azure.resourcemanager.machinelearning.models.OrderString; +import com.azure.resourcemanager.machinelearning.models.BuildContext; +import com.azure.resourcemanager.machinelearning.models.EnvironmentVersionProperties; +import com.azure.resourcemanager.machinelearning.models.InferenceContainerProperties; +import com.azure.resourcemanager.machinelearning.models.Route; +import java.util.HashMap; +import java.util.Map; -/** Samples for OnlineEndpoints List. */ -public final class OnlineEndpointsListSamples { +/** + * Samples for RegistryEnvironmentVersions CreateOrUpdate. + */ +public final class RegistryEnvironmentVersionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/EnvironmentVersion/createOrUpdate.json */ /** - * Sample code: List Online Endpoint. - * + * Sample code: CreateOrUpdate Registry Environment Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void listOnlineEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .onlineEndpoints() - .list( - "test-rg", - "my-aml-workspace", - "string", - 1, - EndpointComputeType.MANAGED, - null, - "string", - "string", - OrderString.CREATED_AT_DESC, - com.azure.core.util.Context.NONE); + public static void createOrUpdateRegistryEnvironmentVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryEnvironmentVersions() + .define("string") + .withExistingEnvironment("test-rg", "my-aml-registry", "string") + .withProperties(new EnvironmentVersionProperties().withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsAnonymous(false) + .withBuild(new BuildContext().withContextUri( + "https://storage-account.blob.core.windows.net/azureml/DockerBuildContext/95ddede6b9b8c4e90472db3acd0a8d28/") + .withDockerfilePath("prod/Dockerfile")) + .withCondaFile("string") + .withImage("docker.io/tensorflow/serving:latest") + .withInferenceConfig( + new InferenceContainerProperties().withLivenessRoute(new Route().withPath("string").withPort(1)) + .withReadinessRoute(new Route().withPath("string").withPort(1)) + .withScoringRoute(new Route().withPath("string").withPort(1)))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } } ``` -### OnlineEndpoints_ListKeys +### RegistryEnvironmentVersions_Delete ```java -/** Samples for OnlineEndpoints ListKeys. */ -public final class OnlineEndpointsListKeysSamples { +/** + * Samples for RegistryEnvironmentVersions Delete. + */ +public final class RegistryEnvironmentVersionsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/listKeys.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/EnvironmentVersion/delete.json */ /** - * Sample code: ListKeys Online Endpoint. - * + * Sample code: Delete Registry Environment Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void listKeysOnlineEndpoint( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .onlineEndpoints() - .listKeysWithResponse("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE); + public static void + deleteRegistryEnvironmentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryEnvironmentVersions() + .delete("test-rg", "my-aml-registry", "string", "string", com.azure.core.util.Context.NONE); + } +} +``` + +### RegistryEnvironmentVersions_Get + +```java +/** + * Samples for RegistryEnvironmentVersions Get. + */ +public final class RegistryEnvironmentVersionsGetSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/EnvironmentVersion/get.json + */ + /** + * Sample code: Get Registry Environment Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + getRegistryEnvironmentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryEnvironmentVersions() + .getWithResponse("test-rg", "my-aml-registry", "string", "string", com.azure.core.util.Context.NONE); } } ``` -### OnlineEndpoints_RegenerateKeys +### RegistryEnvironmentVersions_List ```java -import com.azure.resourcemanager.machinelearning.models.KeyType; -import com.azure.resourcemanager.machinelearning.models.RegenerateEndpointKeysRequest; -/** Samples for OnlineEndpoints RegenerateKeys. */ -public final class OnlineEndpointsRegenerateKeysSamples { +/** + * Samples for RegistryEnvironmentVersions List. + */ +public final class RegistryEnvironmentVersionsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/regenerateKeys.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/EnvironmentVersion/list.json */ /** - * Sample code: RegenerateKeys Online Endpoint. - * + * Sample code: List Registry Environment Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void regenerateKeysOnlineEndpoint( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .onlineEndpoints() - .regenerateKeys( - "test-rg", - "my-aml-workspace", - "testEndpointName", - new RegenerateEndpointKeysRequest().withKeyType(KeyType.PRIMARY).withKeyValue("fakeTokenPlaceholder"), - com.azure.core.util.Context.NONE); + public static void + listRegistryEnvironmentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryEnvironmentVersions() + .list("test-rg", "my-aml-regsitry", "string", "string", 1, null, null, com.azure.core.util.Context.NONE); } } ``` -### OnlineEndpoints_Update +### RegistryModelContainers_CreateOrUpdate ```java -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.OnlineEndpoint; -import com.azure.resourcemanager.machinelearning.models.PartialManagedServiceIdentity; -import java.io.IOException; +import com.azure.resourcemanager.machinelearning.models.ModelContainerProperties; import java.util.HashMap; import java.util.Map; -/** Samples for OnlineEndpoints Update. */ -public final class OnlineEndpointsUpdateSamples { +/** + * Samples for RegistryModelContainers CreateOrUpdate. + */ +public final class RegistryModelContainersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/update.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/ModelContainer/createOrUpdate.json */ /** - * Sample code: Update Online Endpoint. - * + * Sample code: CreateOrUpdate Registry Model Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void updateOnlineEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) - throws IOException { - OnlineEndpoint resource = - manager - .onlineEndpoints() - .getWithResponse("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() - .withTags(mapOf()) - .withIdentity( - new PartialManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities( - mapOf( - "string", - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize("{}", Object.class, SerializerEncoding.JSON)))) - .apply(); + public static void + createOrUpdateRegistryModelContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryModelContainers() + .define("testContainer") + .withExistingRegistry("testrg123", "registry123") + .withProperties(new ModelContainerProperties().withDescription("Model container description") + .withTags(mapOf("tag1", "value1", "tag2", "value2"))) + .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -3688,202 +6912,237 @@ public final class OnlineEndpointsUpdateSamples { } ``` -### Operations_List +### RegistryModelContainers_Delete ```java -/** Samples for Operations List. */ -public final class OperationsListSamples { +/** + * Samples for RegistryModelContainers Delete. + */ +public final class RegistryModelContainersDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/operationsList.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/ModelContainer/delete.json */ /** - * Sample code: OperationsList. - * + * Sample code: Delete Registry Model Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void operationsList(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager.operations().list(com.azure.core.util.Context.NONE); + public static void + deleteRegistryModelContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryModelContainers() + .delete("testrg123", "registry123", "testContainer", com.azure.core.util.Context.NONE); } } ``` -### PrivateEndpointConnections_CreateOrUpdate +### RegistryModelContainers_Get ```java -import com.azure.resourcemanager.machinelearning.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.machinelearning.models.PrivateLinkServiceConnectionState; - -/** Samples for PrivateEndpointConnections CreateOrUpdate. */ -public final class PrivateEndpointConnectionsCreateOrUpdateSamples { +/** + * Samples for RegistryModelContainers Get. + */ +public final class RegistryModelContainersGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/PrivateEndpointConnection/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/ModelContainer/get.json */ /** - * Sample code: WorkspacePutPrivateEndpointConnection. - * + * Sample code: Get Registry Model Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void workspacePutPrivateEndpointConnection( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .privateEndpointConnections() - .define("{privateEndpointConnectionName}") - .withExistingWorkspace("rg-1234", "testworkspace") - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("Auto-Approved")) - .create(); + public static void + getRegistryModelContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryModelContainers() + .getWithResponse("testrg123", "registry123", "testContainer", com.azure.core.util.Context.NONE); } } ``` -### PrivateEndpointConnections_Delete +### RegistryModelContainers_List ```java -/** Samples for PrivateEndpointConnections Delete. */ -public final class PrivateEndpointConnectionsDeleteSamples { + +/** + * Samples for RegistryModelContainers List. + */ +public final class RegistryModelContainersListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/PrivateEndpointConnection/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/ModelContainer/list.json */ /** - * Sample code: WorkspaceDeletePrivateEndpointConnection. - * + * Sample code: List Registry Model Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void workspaceDeletePrivateEndpointConnection( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .privateEndpointConnections() - .deleteWithResponse( - "rg-1234", "testworkspace", "{privateEndpointConnectionName}", com.azure.core.util.Context.NONE); + public static void + listRegistryModelContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryModelContainers() + .list("testrg123", "registry123", null, null, com.azure.core.util.Context.NONE); } } ``` -### PrivateEndpointConnections_Get +### RegistryModelVersions_CreateOrGetStartPendingUpload ```java -/** Samples for PrivateEndpointConnections Get. */ -public final class PrivateEndpointConnectionsGetSamples { +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; +import com.azure.resourcemanager.machinelearning.models.PendingUploadType; + +/** + * Samples for RegistryModelVersions CreateOrGetStartPendingUpload. + */ +public final class RegistryModelVersionsCreateOrGetStartPendingUploadSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/PrivateEndpointConnection/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/ModelVersion/createOrGetStartPendingUpload.json */ /** - * Sample code: WorkspaceGetPrivateEndpointConnection. - * + * Sample code: CreateOrGetStartPendingUpload Registry Model Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void workspaceGetPrivateEndpointConnection( + public static void createOrGetStartPendingUploadRegistryModelVersion( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .privateEndpointConnections() - .getWithResponse( - "rg-1234", "testworkspace", "{privateEndpointConnectionName}", com.azure.core.util.Context.NONE); + manager.registryModelVersions() + .createOrGetStartPendingUploadWithResponse("test-rg", "registryName", "string", "string", + new PendingUploadRequestDto().withPendingUploadId("string") + .withPendingUploadType(PendingUploadType.TEMPORARY_BLOB_REFERENCE), + com.azure.core.util.Context.NONE); } } ``` -### PrivateEndpointConnections_List +### RegistryModelVersions_CreateOrUpdate ```java -/** Samples for PrivateEndpointConnections List. */ -public final class PrivateEndpointConnectionsListSamples { +import com.azure.resourcemanager.machinelearning.models.FlavorData; +import com.azure.resourcemanager.machinelearning.models.ModelVersionProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RegistryModelVersions CreateOrUpdate. + */ +public final class RegistryModelVersionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/PrivateEndpointConnection/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/ModelVersion/createOrUpdate.json */ /** - * Sample code: StorageAccountListPrivateEndpointConnections. - * + * Sample code: CreateOrUpdate Registry Model Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void storageAccountListPrivateEndpointConnections( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager.privateEndpointConnections().list("rg-1234", "testworkspace", com.azure.core.util.Context.NONE); + public static void + createOrUpdateRegistryModelVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryModelVersions() + .define("string") + .withExistingModel("test-rg", "my-aml-registry", "string") + .withProperties(new ModelVersionProperties().withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsAnonymous(false) + .withFlavors(mapOf("string", new FlavorData().withData(mapOf("string", "string")))) + .withModelType("CustomModel") + .withModelUri("string")) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } } ``` -### PrivateLinkResources_List +### RegistryModelVersions_Delete ```java -/** Samples for PrivateLinkResources List. */ -public final class PrivateLinkResourcesListSamples { +/** + * Samples for RegistryModelVersions Delete. + */ +public final class RegistryModelVersionsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/PrivateLinkResource/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/ModelVersion/delete.json */ /** - * Sample code: WorkspaceListPrivateLinkResources. - * + * Sample code: Delete Registry Model Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void workspaceListPrivateLinkResources( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager.privateLinkResources().listWithResponse("rg-1234", "testworkspace", com.azure.core.util.Context.NONE); + public static void + deleteRegistryModelVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryModelVersions() + .delete("test-rg", "my-aml-registry", "string", "string", com.azure.core.util.Context.NONE); } } ``` -### Quotas_List +### RegistryModelVersions_Get ```java -/** Samples for Quotas List. */ -public final class QuotasListSamples { +/** + * Samples for RegistryModelVersions Get. + */ +public final class RegistryModelVersionsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Quota/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/ModelVersion/get.json */ /** - * Sample code: List workspace quotas by VMFamily. - * + * Sample code: Get Registry Model Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void listWorkspaceQuotasByVMFamily( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager.quotas().list("eastus", com.azure.core.util.Context.NONE); + public static void + getRegistryModelVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryModelVersions() + .getWithResponse("test-rg", "my-aml-registry", "string", "string", com.azure.core.util.Context.NONE); } } ``` -### Quotas_Update +### RegistryModelVersions_List ```java -import com.azure.resourcemanager.machinelearning.models.QuotaBaseProperties; -import com.azure.resourcemanager.machinelearning.models.QuotaUnit; -import com.azure.resourcemanager.machinelearning.models.QuotaUpdateParameters; -import java.util.Arrays; -/** Samples for Quotas Update. */ -public final class QuotasUpdateSamples { +/** + * Samples for RegistryModelVersions List. + */ +public final class RegistryModelVersionsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Quota/update.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/ModelVersion/list.json */ /** - * Sample code: update quotas. - * + * Sample code: List Registry Model Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void updateQuotas(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .quotas() - .updateWithResponse( - "eastus", - new QuotaUpdateParameters() - .withValue( - Arrays - .asList( - new QuotaBaseProperties() - .withId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace1/quotas/Standard_DSv2_Family_Cluster_Dedicated_vCPUs") - .withType("Microsoft.MachineLearningServices/workspaces/quotas") - .withLimit(100L) - .withUnit(QuotaUnit.COUNT), - new QuotaBaseProperties() - .withId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace2/quotas/Standard_DSv2_Family_Cluster_Dedicated_vCPUs") - .withType("Microsoft.MachineLearningServices/workspaces/quotas") - .withLimit(200L) - .withUnit(QuotaUnit.COUNT))), - com.azure.core.util.Context.NONE); + public static void + listRegistryModelVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryModelVersions() + .list("test-rg", "my-aml-registry", "string", null, "string", 1, "string", "string", "string", "string", + null, com.azure.core.util.Context.NONE); } } ``` @@ -3900,47 +7159,42 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; -/** Samples for Schedules CreateOrUpdate. */ +/** + * Samples for Schedules CreateOrUpdate. + */ public final class SchedulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Schedule/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Schedule/createOrUpdate.json */ /** * Sample code: CreateOrUpdate Schedule. - * + * * @param manager Entry point to MachineLearningManager. */ public static void createOrUpdateSchedule(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) throws IOException { - manager - .schedules() + manager.schedules() .define("string") .withExistingWorkspace("test-rg", "my-aml-workspace") - .withProperties( - new ScheduleProperties() - .withDescription("string") - .withProperties(mapOf("string", "string")) - .withTags(mapOf("string", "string")) - .withAction( - new EndpointScheduleAction() - .withEndpointInvocationDefinition( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"9965593e-526f-4b89-bb36-761138cf2794\":null}", - Object.class, - SerializerEncoding.JSON))) - .withDisplayName("string") - .withIsEnabled(false) - .withTrigger( - new CronTrigger() - .withEndTime("string") - .withStartTime("string") - .withTimeZone("string") - .withExpression("string"))) + .withProperties(new ScheduleProperties().withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withAction(new EndpointScheduleAction() + .withEndpointInvocationDefinition(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"9965593e-526f-4b89-bb36-761138cf2794\":null}", Object.class, + SerializerEncoding.JSON))) + .withDisplayName("string") + .withIsEnabled(false) + .withTrigger(new CronTrigger().withEndTime("string") + .withStartTime("string") + .withTimeZone("string") + .withExpression("string"))) .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -3957,14 +7211,18 @@ public final class SchedulesCreateOrUpdateSamples { ### Schedules_Delete ```java -/** Samples for Schedules Delete. */ +/** + * Samples for Schedules Delete. + */ public final class SchedulesDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Schedule/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Schedule/delete.json */ /** * Sample code: Delete Schedule. - * + * * @param manager Entry point to MachineLearningManager. */ public static void deleteSchedule(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { @@ -3976,14 +7234,18 @@ public final class SchedulesDeleteSamples { ### Schedules_Get ```java -/** Samples for Schedules Get. */ +/** + * Samples for Schedules Get. + */ public final class SchedulesGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Schedule/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Schedule/get.json */ /** * Sample code: Get Schedule. - * + * * @param manager Entry point to MachineLearningManager. */ public static void getSchedule(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { @@ -3995,14 +7257,19 @@ public final class SchedulesGetSamples { ### Schedules_List ```java -/** Samples for Schedules List. */ + +/** + * Samples for Schedules List. + */ public final class SchedulesListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Schedule/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Schedule/list.json */ /** * Sample code: List Schedules. - * + * * @param manager Entry point to MachineLearningManager. */ public static void listSchedules(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { @@ -4011,17 +7278,275 @@ public final class SchedulesListSamples { } ``` +### ServerlessEndpoints_CreateOrUpdate + +```java +import com.azure.resourcemanager.machinelearning.models.ContentSafety; +import com.azure.resourcemanager.machinelearning.models.ContentSafetyStatus; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.machinelearning.models.ModelSettings; +import com.azure.resourcemanager.machinelearning.models.ServerlessEndpointProperties; +import com.azure.resourcemanager.machinelearning.models.ServerlessInferenceEndpointAuthMode; +import com.azure.resourcemanager.machinelearning.models.Sku; +import com.azure.resourcemanager.machinelearning.models.SkuTier; +import com.azure.resourcemanager.machinelearning.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ServerlessEndpoints CreateOrUpdate. + */ +public final class ServerlessEndpointsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ServerlessEndpoint/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Workspace Serverless Endpoint. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateWorkspaceServerlessEndpoint( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.serverlessEndpoints() + .define("string") + .withRegion("string") + .withExistingWorkspace("test-rg", "my-aml-workspace") + .withProperties(new ServerlessEndpointProperties().withAuthMode(ServerlessInferenceEndpointAuthMode.KEY) + .withContentSafety(new ContentSafety().withContentSafetyStatus(ContentSafetyStatus.ENABLED)) + .withModelSettings(new ModelSettings().withModelId("string"))) + .withTags(mapOf()) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) + .withKind("string") + .withSku(new Sku().withName("string") + .withTier(SkuTier.STANDARD) + .withSize("string") + .withFamily("string") + .withCapacity(1)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ServerlessEndpoints_Delete + +```java +/** + * Samples for ServerlessEndpoints Delete. + */ +public final class ServerlessEndpointsDeleteSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ServerlessEndpoint/delete.json + */ + /** + * Sample code: Delete Workspace Serverless Endpoint. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + deleteWorkspaceServerlessEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.serverlessEndpoints().delete("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + } +} +``` + +### ServerlessEndpoints_Get + +```java +/** + * Samples for ServerlessEndpoints Get. + */ +public final class ServerlessEndpointsGetSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ServerlessEndpoint/get.json + */ + /** + * Sample code: Get Workspace Serverless Endpoint. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + getWorkspaceServerlessEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.serverlessEndpoints() + .getWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + } +} +``` + +### ServerlessEndpoints_List + +```java +/** + * Samples for ServerlessEndpoints List. + */ +public final class ServerlessEndpointsListSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ServerlessEndpoint/list.json + */ + /** + * Sample code: List Workspace Serverless Endpoint. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + listWorkspaceServerlessEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.serverlessEndpoints().list("test-rg", "my-aml-workspace", null, com.azure.core.util.Context.NONE); + } +} +``` + +### ServerlessEndpoints_ListKeys + +```java +/** + * Samples for ServerlessEndpoints ListKeys. + */ +public final class ServerlessEndpointsListKeysSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ServerlessEndpoint/listKeys.json + */ + /** + * Sample code: ListKeys Workspace Serverless Endpoint. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + listKeysWorkspaceServerlessEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.serverlessEndpoints() + .listKeysWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + } +} +``` + +### ServerlessEndpoints_RegenerateKeys + +```java +import com.azure.resourcemanager.machinelearning.models.KeyType; +import com.azure.resourcemanager.machinelearning.models.RegenerateEndpointKeysRequest; + +/** + * Samples for ServerlessEndpoints RegenerateKeys. + */ +public final class ServerlessEndpointsRegenerateKeysSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ServerlessEndpoint/regenerateKeys.json + */ + /** + * Sample code: RegenerateKeys Workspace Serverless Endpoint. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void regenerateKeysWorkspaceServerlessEndpoint( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.serverlessEndpoints() + .regenerateKeys("test-rg", "my-aml-workspace", "string", + new RegenerateEndpointKeysRequest().withKeyType(KeyType.PRIMARY).withKeyValue("fakeTokenPlaceholder"), + com.azure.core.util.Context.NONE); + } +} +``` + +### ServerlessEndpoints_Update + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.machinelearning.models.PartialManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.PartialSku; +import com.azure.resourcemanager.machinelearning.models.ServerlessEndpoint; +import com.azure.resourcemanager.machinelearning.models.SkuTier; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ServerlessEndpoints Update. + */ +public final class ServerlessEndpointsUpdateSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ServerlessEndpoint/update.json + */ + /** + * Sample code: Update Workspace Serverless Endpoint. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void updateWorkspaceServerlessEndpoint( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) throws IOException { + ServerlessEndpoint resource = manager.serverlessEndpoints() + .getWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf()) + .withIdentity(new PartialManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf("string", + SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)))) + .withSku(new PartialSku().withCapacity(1) + .withFamily("string") + .withName("string") + .withSize("string") + .withTier(SkuTier.PREMIUM)) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + ### Usages_List ```java -/** Samples for Usages List. */ +/** + * Samples for Usages List. + */ public final class UsagesListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Usage/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Usage/list.json */ /** * Sample code: List Usages. - * + * * @param manager Entry point to MachineLearningManager. */ public static void listUsages(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { @@ -4033,14 +7558,18 @@ public final class UsagesListSamples { ### VirtualMachineSizes_List ```java -/** Samples for VirtualMachineSizes List. */ +/** + * Samples for VirtualMachineSizes List. + */ public final class VirtualMachineSizesListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/VirtualMachineSize/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/VirtualMachineSize/list.json */ /** * Sample code: List VM Sizes. - * + * * @param manager Entry point to MachineLearningManager. */ public static void listVMSizes(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { @@ -4055,25 +7584,27 @@ public final class VirtualMachineSizesListSamples { import com.azure.resourcemanager.machinelearning.models.ConnectionCategory; import com.azure.resourcemanager.machinelearning.models.NoneAuthTypeWorkspaceConnectionProperties; -/** Samples for WorkspaceConnections Create. */ +/** + * Samples for WorkspaceConnections Create. + */ public final class WorkspaceConnectionsCreateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/WorkspaceConnection/create.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/WorkspaceConnection/create.json */ /** * Sample code: CreateWorkspaceConnection. - * + * * @param manager Entry point to MachineLearningManager. */ - public static void createWorkspaceConnection( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .workspaceConnections() + public static void + createWorkspaceConnection(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.workspaceConnections() .define("connection-1") .withExistingWorkspace("resourceGroup-1", "workspace-1") .withProperties( - new NoneAuthTypeWorkspaceConnectionProperties() - .withCategory(ConnectionCategory.CONTAINER_REGISTRY) + new NoneAuthTypeWorkspaceConnectionProperties().withCategory(ConnectionCategory.CONTAINER_REGISTRY) .withTarget("www.facebook.com")) .create(); } @@ -4083,20 +7614,23 @@ public final class WorkspaceConnectionsCreateSamples { ### WorkspaceConnections_Delete ```java -/** Samples for WorkspaceConnections Delete. */ +/** + * Samples for WorkspaceConnections Delete. + */ public final class WorkspaceConnectionsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/WorkspaceConnection/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/WorkspaceConnection/delete.json */ /** * Sample code: DeleteWorkspaceConnection. - * + * * @param manager Entry point to MachineLearningManager. */ - public static void deleteWorkspaceConnection( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .workspaceConnections() + public static void + deleteWorkspaceConnection(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.workspaceConnections() .deleteWithResponse("resourceGroup-1", "workspace-1", "connection-1", com.azure.core.util.Context.NONE); } } @@ -4105,20 +7639,23 @@ public final class WorkspaceConnectionsDeleteSamples { ### WorkspaceConnections_Get ```java -/** Samples for WorkspaceConnections Get. */ +/** + * Samples for WorkspaceConnections Get. + */ public final class WorkspaceConnectionsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/WorkspaceConnection/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/WorkspaceConnection/get.json */ /** * Sample code: GetWorkspaceConnection. - * + * * @param manager Entry point to MachineLearningManager. */ - public static void getWorkspaceConnection( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .workspaceConnections() + public static void + getWorkspaceConnection(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.workspaceConnections() .getWithResponse("resourceGroup-1", "workspace-1", "connection-1", com.azure.core.util.Context.NONE); } } @@ -4127,41 +7664,69 @@ public final class WorkspaceConnectionsGetSamples { ### WorkspaceConnections_List ```java -/** Samples for WorkspaceConnections List. */ +/** + * Samples for WorkspaceConnections List. + */ public final class WorkspaceConnectionsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/WorkspaceConnection/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/WorkspaceConnection/list.json */ /** * Sample code: ListWorkspaceConnections. - * + * * @param manager Entry point to MachineLearningManager. */ - public static void listWorkspaceConnections( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .workspaceConnections() - .list( - "resourceGroup-1", - "workspace-1", - "www.facebook.com", - "ContainerRegistry", + public static void + listWorkspaceConnections(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.workspaceConnections() + .list("resourceGroup-1", "workspace-1", "www.facebook.com", "ContainerRegistry", com.azure.core.util.Context.NONE); } } ``` +### WorkspaceConnections_ListSecrets + +```java +/** + * Samples for WorkspaceConnections ListSecrets. + */ +public final class WorkspaceConnectionsListSecretsSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/WorkspaceConnection/listSecrets.json + */ + /** + * Sample code: GetWorkspaceConnection. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + getWorkspaceConnection(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.workspaceConnections() + .listSecretsWithResponse("test-rg", "workspace-1", "connection-1", com.azure.core.util.Context.NONE); + } +} +``` + ### WorkspaceFeatures_List ```java -/** Samples for WorkspaceFeatures List. */ +/** + * Samples for WorkspaceFeatures List. + */ public final class WorkspaceFeaturesListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/WorkspaceFeature/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/WorkspaceFeature/list.json */ /** * Sample code: List Workspace features. - * + * * @param manager Entry point to MachineLearningManager. */ public static void listWorkspaceFeatures(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { @@ -4186,29 +7751,30 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for Workspaces CreateOrUpdate. */ +/** + * Samples for Workspaces CreateOrUpdate. + */ public final class WorkspacesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/create.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/create.json */ /** * Sample code: Create Workspace. - * + * * @param manager Entry point to MachineLearningManager. */ public static void createWorkspace(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .workspaces() + manager.workspaces() .define("testworkspace") .withExistingResourceGroup("workspace-1234") .withRegion("eastus2euap") - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf( - "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testuai", - new UserAssignedIdentity()))) + .withIdentity(new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testuai", + new UserAssignedIdentity()))) .withDescription("test description") .withFriendlyName("HelloName") .withKeyVault( @@ -4219,32 +7785,23 @@ public final class WorkspacesCreateOrUpdateSamples { "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.ContainerRegistry/registries/testRegistry") .withStorageAccount( "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/accountcrud-1234/providers/Microsoft.Storage/storageAccounts/testStorageAccount") - .withEncryption( - new EncryptionProperty() - .withStatus(EncryptionStatus.ENABLED) - .withIdentity( - new IdentityForCmk() - .withUserAssignedIdentity( - "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testuai")) - .withKeyVaultProperties( - new EncryptionKeyVaultProperties() - .withKeyVaultArmId("fakeTokenPlaceholder") - .withKeyIdentifier("fakeTokenPlaceholder") - .withIdentityClientId(""))) + .withEncryption(new EncryptionProperty().withStatus(EncryptionStatus.ENABLED) + .withIdentity(new IdentityForCmk().withUserAssignedIdentity( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testuai")) + .withKeyVaultProperties(new EncryptionKeyVaultProperties().withKeyVaultArmId("fakeTokenPlaceholder") + .withKeyIdentifier("fakeTokenPlaceholder") + .withIdentityClientId(""))) .withHbiWorkspace(false) - .withSharedPrivateLinkResources( - Arrays - .asList( - new SharedPrivateLinkResource() - .withName("testdbresource") - .withPrivateLinkResourceId( - "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.DocumentDB/databaseAccounts/testdbresource/privateLinkResources/Sql") - .withGroupId("Sql") - .withRequestMessage("Please approve") - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED))) + .withSharedPrivateLinkResources(Arrays.asList(new SharedPrivateLinkResource().withName("testdbresource") + .withPrivateLinkResourceId( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.DocumentDB/databaseAccounts/testdbresource/privateLinkResources/Sql") + .withGroupId("Sql") + .withRequestMessage("Please approve") + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED))) .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -4261,18 +7818,22 @@ public final class WorkspacesCreateOrUpdateSamples { ### Workspaces_Delete ```java -/** Samples for Workspaces Delete. */ +/** + * Samples for Workspaces Delete. + */ public final class WorkspacesDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/delete.json */ /** * Sample code: Delete Workspace. - * + * * @param manager Entry point to MachineLearningManager. */ public static void deleteWorkspace(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager.workspaces().delete("workspace-1234", "testworkspace", com.azure.core.util.Context.NONE); + manager.workspaces().delete("workspace-1234", "testworkspace", null, com.azure.core.util.Context.NONE); } } ``` @@ -4285,37 +7846,36 @@ import com.azure.resourcemanager.machinelearning.models.DiagnoseWorkspaceParamet import java.util.HashMap; import java.util.Map; -/** Samples for Workspaces Diagnose. */ +/** + * Samples for Workspaces Diagnose. + */ public final class WorkspacesDiagnoseSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/diagnose.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/diagnose.json */ /** * Sample code: Diagnose Workspace. - * + * * @param manager Entry point to MachineLearningManager. */ public static void diagnoseWorkspace(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .workspaces() - .diagnose( - "workspace-1234", - "testworkspace", - new DiagnoseWorkspaceParameters() - .withValue( - new DiagnoseRequestProperties() - .withUdr(mapOf()) - .withNsg(mapOf()) - .withResourceLock(mapOf()) - .withDnsResolution(mapOf()) - .withStorageAccount(mapOf()) - .withKeyVault(mapOf()) - .withContainerRegistry(mapOf()) - .withApplicationInsights(mapOf()) - .withOthers(mapOf())), + manager.workspaces() + .diagnose("workspace-1234", "testworkspace", + new DiagnoseWorkspaceParameters().withValue(new DiagnoseRequestProperties().withUdr(mapOf()) + .withNsg(mapOf()) + .withResourceLock(mapOf()) + .withDnsResolution(mapOf()) + .withStorageAccount(mapOf()) + .withKeyVault(mapOf()) + .withContainerRegistry(mapOf()) + .withApplicationInsights(mapOf()) + .withOthers(mapOf())), com.azure.core.util.Context.NONE); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -4332,19 +7892,22 @@ public final class WorkspacesDiagnoseSamples { ### Workspaces_GetByResourceGroup ```java -/** Samples for Workspaces GetByResourceGroup. */ +/** + * Samples for Workspaces GetByResourceGroup. + */ public final class WorkspacesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/get.json */ /** * Sample code: Get Workspace. - * + * * @param manager Entry point to MachineLearningManager. */ public static void getWorkspace(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .workspaces() + manager.workspaces() .getByResourceGroupWithResponse("workspace-1234", "testworkspace", com.azure.core.util.Context.NONE); } } @@ -4353,18 +7916,22 @@ public final class WorkspacesGetByResourceGroupSamples { ### Workspaces_List ```java -/** Samples for Workspaces List. */ +/** + * Samples for Workspaces List. + */ public final class WorkspacesListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/listBySubscription.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/listBySubscription.json */ /** * Sample code: Get Workspaces by subscription. - * + * * @param manager Entry point to MachineLearningManager. */ - public static void getWorkspacesBySubscription( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void + getWorkspacesBySubscription(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager.workspaces().list(null, com.azure.core.util.Context.NONE); } } @@ -4373,18 +7940,22 @@ public final class WorkspacesListSamples { ### Workspaces_ListByResourceGroup ```java -/** Samples for Workspaces ListByResourceGroup. */ +/** + * Samples for Workspaces ListByResourceGroup. + */ public final class WorkspacesListByResourceGroupSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/listByResourceGroup.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/listByResourceGroup.json */ /** * Sample code: Get Workspaces by Resource Group. - * + * * @param manager Entry point to MachineLearningManager. */ - public static void getWorkspacesByResourceGroup( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void + getWorkspacesByResourceGroup(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager.workspaces().listByResourceGroup("workspace-1234", null, com.azure.core.util.Context.NONE); } } @@ -4393,14 +7964,18 @@ public final class WorkspacesListByResourceGroupSamples { ### Workspaces_ListKeys ```java -/** Samples for Workspaces ListKeys. */ +/** + * Samples for Workspaces ListKeys. + */ public final class WorkspacesListKeysSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/listKeys.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/listKeys.json */ /** * Sample code: List Workspace Keys. - * + * * @param manager Entry point to MachineLearningManager. */ public static void listWorkspaceKeys(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { @@ -4412,19 +7987,22 @@ public final class WorkspacesListKeysSamples { ### Workspaces_ListNotebookAccessToken ```java -/** Samples for Workspaces ListNotebookAccessToken. */ +/** + * Samples for Workspaces ListNotebookAccessToken. + */ public final class WorkspacesListNotebookAccessTokenSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/listNotebookAccessToken.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/listNotebookAccessToken.json */ /** * Sample code: List Workspace Keys. - * + * * @param manager Entry point to MachineLearningManager. */ public static void listWorkspaceKeys(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .workspaces() + manager.workspaces() .listNotebookAccessTokenWithResponse("workspace-1234", "testworkspace", com.azure.core.util.Context.NONE); } } @@ -4433,19 +8011,22 @@ public final class WorkspacesListNotebookAccessTokenSamples { ### Workspaces_ListNotebookKeys ```java -/** Samples for Workspaces ListNotebookKeys. */ +/** + * Samples for Workspaces ListNotebookKeys. + */ public final class WorkspacesListNotebookKeysSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Notebook/listKeys.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Notebook/listKeys.json */ /** * Sample code: List Workspace Keys. - * + * * @param manager Entry point to MachineLearningManager. */ public static void listWorkspaceKeys(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .workspaces() + manager.workspaces() .listNotebookKeysWithResponse("testrg123", "workspaces123", com.azure.core.util.Context.NONE); } } @@ -4454,22 +8035,25 @@ public final class WorkspacesListNotebookKeysSamples { ### Workspaces_ListOutboundNetworkDependenciesEndpoints ```java -/** Samples for Workspaces ListOutboundNetworkDependenciesEndpoints. */ +/** + * Samples for Workspaces ListOutboundNetworkDependenciesEndpoints. + */ public final class WorkspacesListOutboundNetworkDependenciesEndpointsSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ExternalFQDN/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/ExternalFQDN/get.json */ /** * Sample code: ListOutboundNetworkDependenciesEndpoints. - * + * * @param manager Entry point to MachineLearningManager. */ public static void listOutboundNetworkDependenciesEndpoints( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .workspaces() - .listOutboundNetworkDependenciesEndpointsWithResponse( - "workspace-1234", "testworkspace", com.azure.core.util.Context.NONE); + manager.workspaces() + .listOutboundNetworkDependenciesEndpointsWithResponse("workspace-1234", "testworkspace", + com.azure.core.util.Context.NONE); } } ``` @@ -4477,19 +8061,22 @@ public final class WorkspacesListOutboundNetworkDependenciesEndpointsSamples { ### Workspaces_ListStorageAccountKeys ```java -/** Samples for Workspaces ListStorageAccountKeys. */ +/** + * Samples for Workspaces ListStorageAccountKeys. + */ public final class WorkspacesListStorageAccountKeysSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/listStorageAccountKeys.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/listStorageAccountKeys.json */ /** * Sample code: List Workspace Keys. - * + * * @param manager Entry point to MachineLearningManager. */ public static void listWorkspaceKeys(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .workspaces() + manager.workspaces() .listStorageAccountKeysWithResponse("testrg123", "workspaces123", com.azure.core.util.Context.NONE); } } @@ -4498,14 +8085,18 @@ public final class WorkspacesListStorageAccountKeysSamples { ### Workspaces_PrepareNotebook ```java -/** Samples for Workspaces PrepareNotebook. */ +/** + * Samples for Workspaces PrepareNotebook. + */ public final class WorkspacesPrepareNotebookSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Notebook/prepare.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Notebook/prepare.json */ /** * Sample code: Prepare Notebook. - * + * * @param manager Entry point to MachineLearningManager. */ public static void prepareNotebook(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { @@ -4517,14 +8108,18 @@ public final class WorkspacesPrepareNotebookSamples { ### Workspaces_ResyncKeys ```java -/** Samples for Workspaces ResyncKeys. */ +/** + * Samples for Workspaces ResyncKeys. + */ public final class WorkspacesResyncKeysSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/resyncKeys.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/resyncKeys.json */ /** * Sample code: Resync Workspace Keys. - * + * * @param manager Entry point to MachineLearningManager. */ public static void resyncWorkspaceKeys(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { @@ -4539,24 +8134,25 @@ public final class WorkspacesResyncKeysSamples { import com.azure.resourcemanager.machinelearning.models.PublicNetworkAccess; import com.azure.resourcemanager.machinelearning.models.Workspace; -/** Samples for Workspaces Update. */ +/** + * Samples for Workspaces Update. + */ public final class WorkspacesUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/update.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/update.json */ /** * Sample code: Update Workspace. - * + * * @param manager Entry point to MachineLearningManager. */ public static void updateWorkspace(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - Workspace resource = - manager - .workspaces() - .getByResourceGroupWithResponse("workspace-1234", "testworkspace", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + Workspace resource = manager.workspaces() + .getByResourceGroupWithResponse("workspace-1234", "testworkspace", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withDescription("new description") .withFriendlyName("New friendly name") .withPublicNetworkAccess(PublicNetworkAccess.DISABLED) diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/pom.xml b/sdk/machinelearning/azure-resourcemanager-machinelearning/pom.xml index da91b7bb95d02..b33aa80ecbef9 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/pom.xml +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/pom.xml @@ -1,3 +1,8 @@ + 4.0.0 @@ -13,7 +18,7 @@ jar Microsoft Azure SDK for Machine Learning Management - This package contains Microsoft Azure SDK for Machine Learning Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. These APIs allow end users to operate on Azure Machine Learning Workspace resources. Package tag package-2022-10. + This package contains Microsoft Azure SDK for Machine Learning Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. These APIs allow end users to operate on Azure Machine Learning Workspace resources. Package tag package-preview-2024-07. https://github.com/Azure/azure-sdk-for-java @@ -38,9 +43,16 @@ UTF-8 - true + 0 + 0 + true + + com.azure + azure-json + 1.1.0 + com.azure azure-core @@ -105,8 +117,6 @@ 4.11.0 test - - net.bytebuddy byte-buddy diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/MachineLearningManager.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/MachineLearningManager.java index a212fe3e6c4a3..2e3713d39766d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/MachineLearningManager.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/MachineLearningManager.java @@ -11,8 +11,8 @@ import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.HttpPolicyProviders; import com.azure.core.http.policy.RequestIdPolicy; @@ -23,8 +23,8 @@ import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.machinelearning.fluent.AzureMachineLearningWorkspaces; -import com.azure.resourcemanager.machinelearning.implementation.AzureMachineLearningWorkspacesBuilder; +import com.azure.resourcemanager.machinelearning.fluent.AzureMachineLearningServices; +import com.azure.resourcemanager.machinelearning.implementation.AzureMachineLearningServicesBuilder; import com.azure.resourcemanager.machinelearning.implementation.BatchDeploymentsImpl; import com.azure.resourcemanager.machinelearning.implementation.BatchEndpointsImpl; import com.azure.resourcemanager.machinelearning.implementation.CodeContainersImpl; @@ -33,11 +33,19 @@ import com.azure.resourcemanager.machinelearning.implementation.ComponentVersionsImpl; import com.azure.resourcemanager.machinelearning.implementation.ComputesImpl; import com.azure.resourcemanager.machinelearning.implementation.DataContainersImpl; -import com.azure.resourcemanager.machinelearning.implementation.DataVersionsImpl; import com.azure.resourcemanager.machinelearning.implementation.DatastoresImpl; +import com.azure.resourcemanager.machinelearning.implementation.DataVersionsImpl; import com.azure.resourcemanager.machinelearning.implementation.EnvironmentContainersImpl; import com.azure.resourcemanager.machinelearning.implementation.EnvironmentVersionsImpl; +import com.azure.resourcemanager.machinelearning.implementation.FeaturesetContainersImpl; +import com.azure.resourcemanager.machinelearning.implementation.FeaturesetVersionsImpl; +import com.azure.resourcemanager.machinelearning.implementation.FeaturesImpl; +import com.azure.resourcemanager.machinelearning.implementation.FeaturestoreEntityContainersImpl; +import com.azure.resourcemanager.machinelearning.implementation.FeaturestoreEntityVersionsImpl; import com.azure.resourcemanager.machinelearning.implementation.JobsImpl; +import com.azure.resourcemanager.machinelearning.implementation.ManagedNetworkProvisionsImpl; +import com.azure.resourcemanager.machinelearning.implementation.ManagedNetworkSettingsRulesImpl; +import com.azure.resourcemanager.machinelearning.implementation.MarketplaceSubscriptionsImpl; import com.azure.resourcemanager.machinelearning.implementation.ModelContainersImpl; import com.azure.resourcemanager.machinelearning.implementation.ModelVersionsImpl; import com.azure.resourcemanager.machinelearning.implementation.OnlineDeploymentsImpl; @@ -46,7 +54,20 @@ import com.azure.resourcemanager.machinelearning.implementation.PrivateEndpointConnectionsImpl; import com.azure.resourcemanager.machinelearning.implementation.PrivateLinkResourcesImpl; import com.azure.resourcemanager.machinelearning.implementation.QuotasImpl; +import com.azure.resourcemanager.machinelearning.implementation.RegistriesImpl; +import com.azure.resourcemanager.machinelearning.implementation.RegistryCodeContainersImpl; +import com.azure.resourcemanager.machinelearning.implementation.RegistryCodeVersionsImpl; +import com.azure.resourcemanager.machinelearning.implementation.RegistryComponentContainersImpl; +import com.azure.resourcemanager.machinelearning.implementation.RegistryComponentVersionsImpl; +import com.azure.resourcemanager.machinelearning.implementation.RegistryDataContainersImpl; +import com.azure.resourcemanager.machinelearning.implementation.RegistryDataReferencesImpl; +import com.azure.resourcemanager.machinelearning.implementation.RegistryDataVersionsImpl; +import com.azure.resourcemanager.machinelearning.implementation.RegistryEnvironmentContainersImpl; +import com.azure.resourcemanager.machinelearning.implementation.RegistryEnvironmentVersionsImpl; +import com.azure.resourcemanager.machinelearning.implementation.RegistryModelContainersImpl; +import com.azure.resourcemanager.machinelearning.implementation.RegistryModelVersionsImpl; import com.azure.resourcemanager.machinelearning.implementation.SchedulesImpl; +import com.azure.resourcemanager.machinelearning.implementation.ServerlessEndpointsImpl; import com.azure.resourcemanager.machinelearning.implementation.UsagesImpl; import com.azure.resourcemanager.machinelearning.implementation.VirtualMachineSizesImpl; import com.azure.resourcemanager.machinelearning.implementation.WorkspaceConnectionsImpl; @@ -60,11 +81,19 @@ import com.azure.resourcemanager.machinelearning.models.ComponentVersions; import com.azure.resourcemanager.machinelearning.models.Computes; import com.azure.resourcemanager.machinelearning.models.DataContainers; -import com.azure.resourcemanager.machinelearning.models.DataVersions; import com.azure.resourcemanager.machinelearning.models.Datastores; +import com.azure.resourcemanager.machinelearning.models.DataVersions; import com.azure.resourcemanager.machinelearning.models.EnvironmentContainers; import com.azure.resourcemanager.machinelearning.models.EnvironmentVersions; +import com.azure.resourcemanager.machinelearning.models.Features; +import com.azure.resourcemanager.machinelearning.models.FeaturesetContainers; +import com.azure.resourcemanager.machinelearning.models.FeaturesetVersions; +import com.azure.resourcemanager.machinelearning.models.FeaturestoreEntityContainers; +import com.azure.resourcemanager.machinelearning.models.FeaturestoreEntityVersions; import com.azure.resourcemanager.machinelearning.models.Jobs; +import com.azure.resourcemanager.machinelearning.models.ManagedNetworkProvisions; +import com.azure.resourcemanager.machinelearning.models.ManagedNetworkSettingsRules; +import com.azure.resourcemanager.machinelearning.models.MarketplaceSubscriptions; import com.azure.resourcemanager.machinelearning.models.ModelContainers; import com.azure.resourcemanager.machinelearning.models.ModelVersions; import com.azure.resourcemanager.machinelearning.models.OnlineDeployments; @@ -73,7 +102,20 @@ import com.azure.resourcemanager.machinelearning.models.PrivateEndpointConnections; import com.azure.resourcemanager.machinelearning.models.PrivateLinkResources; import com.azure.resourcemanager.machinelearning.models.Quotas; +import com.azure.resourcemanager.machinelearning.models.Registries; +import com.azure.resourcemanager.machinelearning.models.RegistryCodeContainers; +import com.azure.resourcemanager.machinelearning.models.RegistryCodeVersions; +import com.azure.resourcemanager.machinelearning.models.RegistryComponentContainers; +import com.azure.resourcemanager.machinelearning.models.RegistryComponentVersions; +import com.azure.resourcemanager.machinelearning.models.RegistryDataContainers; +import com.azure.resourcemanager.machinelearning.models.RegistryDataReferences; +import com.azure.resourcemanager.machinelearning.models.RegistryDataVersions; +import com.azure.resourcemanager.machinelearning.models.RegistryEnvironmentContainers; +import com.azure.resourcemanager.machinelearning.models.RegistryEnvironmentVersions; +import com.azure.resourcemanager.machinelearning.models.RegistryModelContainers; +import com.azure.resourcemanager.machinelearning.models.RegistryModelVersions; import com.azure.resourcemanager.machinelearning.models.Schedules; +import com.azure.resourcemanager.machinelearning.models.ServerlessEndpoints; import com.azure.resourcemanager.machinelearning.models.Usages; import com.azure.resourcemanager.machinelearning.models.VirtualMachineSizes; import com.azure.resourcemanager.machinelearning.models.WorkspaceConnections; @@ -87,8 +129,8 @@ import java.util.stream.Collectors; /** - * Entry point to MachineLearningManager. These APIs allow end users to operate on Azure Machine Learning Workspace - * resources. + * Entry point to MachineLearningManager. + * These APIs allow end users to operate on Azure Machine Learning Workspace resources. */ public final class MachineLearningManager { private Operations operations; @@ -109,6 +151,34 @@ public final class MachineLearningManager { private WorkspaceConnections workspaceConnections; + private ManagedNetworkSettingsRules managedNetworkSettingsRules; + + private ManagedNetworkProvisions managedNetworkProvisions; + + private RegistryCodeContainers registryCodeContainers; + + private RegistryCodeVersions registryCodeVersions; + + private RegistryComponentContainers registryComponentContainers; + + private RegistryComponentVersions registryComponentVersions; + + private RegistryDataContainers registryDataContainers; + + private RegistryDataVersions registryDataVersions; + + private RegistryDataReferences registryDataReferences; + + private RegistryEnvironmentContainers registryEnvironmentContainers; + + private RegistryEnvironmentVersions registryEnvironmentVersions; + + private MarketplaceSubscriptions marketplaceSubscriptions; + + private RegistryModelContainers registryModelContainers; + + private RegistryModelVersions registryModelVersions; + private BatchEndpoints batchEndpoints; private BatchDeployments batchDeployments; @@ -131,6 +201,16 @@ public final class MachineLearningManager { private EnvironmentVersions environmentVersions; + private FeaturesetContainers featuresetContainers; + + private Features features; + + private FeaturesetVersions featuresetVersions; + + private FeaturestoreEntityContainers featurestoreEntityContainers; + + private FeaturestoreEntityVersions featurestoreEntityVersions; + private Jobs jobs; private ModelContainers modelContainers; @@ -143,25 +223,27 @@ public final class MachineLearningManager { private Schedules schedules; + private ServerlessEndpoints serverlessEndpoints; + + private Registries registries; + private WorkspaceFeatures workspaceFeatures; - private final AzureMachineLearningWorkspaces clientObject; + private final AzureMachineLearningServices clientObject; private MachineLearningManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = - new AzureMachineLearningWorkspacesBuilder() - .pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .defaultPollInterval(defaultPollInterval) - .buildClient(); + this.clientObject = new AzureMachineLearningServicesBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); } /** * Creates an instance of Machine Learning service API entry point. - * + * * @param credential the credential to use. * @param profile the Azure profile for client. * @return the Machine Learning service API instance. @@ -174,7 +256,7 @@ public static MachineLearningManager authenticate(TokenCredential credential, Az /** * Creates an instance of Machine Learning service API entry point. - * + * * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. * @param profile the Azure profile for client. * @return the Machine Learning service API instance. @@ -187,14 +269,16 @@ public static MachineLearningManager authenticate(HttpPipeline httpPipeline, Azu /** * Gets a Configurable instance that can be used to create MachineLearningManager with optional configuration. - * + * * @return the Configurable instance allowing configurations. */ public static Configurable configure() { return new MachineLearningManager.Configurable(); } - /** The Configurable allowing configurations to be set. */ + /** + * The Configurable allowing configurations to be set. + */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); @@ -266,8 +350,8 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { /** * Sets the retry options for the HTTP pipeline retry policy. - * - *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + *

+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. * * @param retryOptions the retry options for the HTTP pipeline retry policy. * @return the configurable object itself. @@ -284,8 +368,8 @@ public Configurable withRetryOptions(RetryOptions retryOptions) { * @return the configurable object itself. */ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = - Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + this.defaultPollInterval + = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); if (this.defaultPollInterval.isNegative()) { throw LOGGER .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); @@ -305,15 +389,13 @@ public MachineLearningManager authenticate(TokenCredential credential, AzureProf Objects.requireNonNull(profile, "'profile' cannot be null."); StringBuilder userAgentBuilder = new StringBuilder(); - userAgentBuilder - .append("azsdk-java") + userAgentBuilder.append("azsdk-java") .append("-") .append("com.azure.resourcemanager.machinelearning") .append("/") - .append("1.0.0"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { - userAgentBuilder - .append(" (") + userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) .append("; ") .append(Configuration.getGlobalConfiguration().get("os.name")) @@ -338,38 +420,28 @@ public MachineLearningManager authenticate(TokenCredential credential, AzureProf policies.add(new UserAgentPolicy(userAgentBuilder.toString())); policies.add(new AddHeadersFromContextPolicy()); policies.add(new RequestIdPolicy()); - policies - .addAll( - this - .policies - .stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); - policies - .addAll( - this - .policies - .stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = - new HttpPipelineBuilder() - .httpClient(httpClient) - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .build(); + HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); return new MachineLearningManager(httpPipeline, profile, defaultPollInterval); } } /** * Gets the resource collection API of Operations. - * + * * @return Resource collection API of Operations. */ public Operations operations() { @@ -381,7 +453,7 @@ public Operations operations() { /** * Gets the resource collection API of Workspaces. It manages Workspace. - * + * * @return Resource collection API of Workspaces. */ public Workspaces workspaces() { @@ -393,7 +465,7 @@ public Workspaces workspaces() { /** * Gets the resource collection API of Usages. - * + * * @return Resource collection API of Usages. */ public Usages usages() { @@ -405,7 +477,7 @@ public Usages usages() { /** * Gets the resource collection API of VirtualMachineSizes. - * + * * @return Resource collection API of VirtualMachineSizes. */ public VirtualMachineSizes virtualMachineSizes() { @@ -417,7 +489,7 @@ public VirtualMachineSizes virtualMachineSizes() { /** * Gets the resource collection API of Quotas. - * + * * @return Resource collection API of Quotas. */ public Quotas quotas() { @@ -429,7 +501,7 @@ public Quotas quotas() { /** * Gets the resource collection API of Computes. It manages ComputeResource. - * + * * @return Resource collection API of Computes. */ public Computes computes() { @@ -441,20 +513,20 @@ public Computes computes() { /** * Gets the resource collection API of PrivateEndpointConnections. It manages PrivateEndpointConnection. - * + * * @return Resource collection API of PrivateEndpointConnections. */ public PrivateEndpointConnections privateEndpointConnections() { if (this.privateEndpointConnections == null) { - this.privateEndpointConnections = - new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + this.privateEndpointConnections + = new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); } return privateEndpointConnections; } /** * Gets the resource collection API of PrivateLinkResources. - * + * * @return Resource collection API of PrivateLinkResources. */ public PrivateLinkResources privateLinkResources() { @@ -467,7 +539,7 @@ public PrivateLinkResources privateLinkResources() { /** * Gets the resource collection API of WorkspaceConnections. It manages * WorkspaceConnectionPropertiesV2BasicResource. - * + * * @return Resource collection API of WorkspaceConnections. */ public WorkspaceConnections workspaceConnections() { @@ -477,9 +549,188 @@ public WorkspaceConnections workspaceConnections() { return workspaceConnections; } + /** + * Gets the resource collection API of ManagedNetworkSettingsRules. It manages OutboundRuleBasicResource. + * + * @return Resource collection API of ManagedNetworkSettingsRules. + */ + public ManagedNetworkSettingsRules managedNetworkSettingsRules() { + if (this.managedNetworkSettingsRules == null) { + this.managedNetworkSettingsRules + = new ManagedNetworkSettingsRulesImpl(clientObject.getManagedNetworkSettingsRules(), this); + } + return managedNetworkSettingsRules; + } + + /** + * Gets the resource collection API of ManagedNetworkProvisions. + * + * @return Resource collection API of ManagedNetworkProvisions. + */ + public ManagedNetworkProvisions managedNetworkProvisions() { + if (this.managedNetworkProvisions == null) { + this.managedNetworkProvisions + = new ManagedNetworkProvisionsImpl(clientObject.getManagedNetworkProvisions(), this); + } + return managedNetworkProvisions; + } + + /** + * Gets the resource collection API of RegistryCodeContainers. It manages CodeContainer. + * + * @return Resource collection API of RegistryCodeContainers. + */ + public RegistryCodeContainers registryCodeContainers() { + if (this.registryCodeContainers == null) { + this.registryCodeContainers + = new RegistryCodeContainersImpl(clientObject.getRegistryCodeContainers(), this); + } + return registryCodeContainers; + } + + /** + * Gets the resource collection API of RegistryCodeVersions. It manages CodeVersion. + * + * @return Resource collection API of RegistryCodeVersions. + */ + public RegistryCodeVersions registryCodeVersions() { + if (this.registryCodeVersions == null) { + this.registryCodeVersions = new RegistryCodeVersionsImpl(clientObject.getRegistryCodeVersions(), this); + } + return registryCodeVersions; + } + + /** + * Gets the resource collection API of RegistryComponentContainers. It manages ComponentContainer. + * + * @return Resource collection API of RegistryComponentContainers. + */ + public RegistryComponentContainers registryComponentContainers() { + if (this.registryComponentContainers == null) { + this.registryComponentContainers + = new RegistryComponentContainersImpl(clientObject.getRegistryComponentContainers(), this); + } + return registryComponentContainers; + } + + /** + * Gets the resource collection API of RegistryComponentVersions. It manages ComponentVersion. + * + * @return Resource collection API of RegistryComponentVersions. + */ + public RegistryComponentVersions registryComponentVersions() { + if (this.registryComponentVersions == null) { + this.registryComponentVersions + = new RegistryComponentVersionsImpl(clientObject.getRegistryComponentVersions(), this); + } + return registryComponentVersions; + } + + /** + * Gets the resource collection API of RegistryDataContainers. It manages DataContainer. + * + * @return Resource collection API of RegistryDataContainers. + */ + public RegistryDataContainers registryDataContainers() { + if (this.registryDataContainers == null) { + this.registryDataContainers + = new RegistryDataContainersImpl(clientObject.getRegistryDataContainers(), this); + } + return registryDataContainers; + } + + /** + * Gets the resource collection API of RegistryDataVersions. It manages DataVersionBase. + * + * @return Resource collection API of RegistryDataVersions. + */ + public RegistryDataVersions registryDataVersions() { + if (this.registryDataVersions == null) { + this.registryDataVersions = new RegistryDataVersionsImpl(clientObject.getRegistryDataVersions(), this); + } + return registryDataVersions; + } + + /** + * Gets the resource collection API of RegistryDataReferences. + * + * @return Resource collection API of RegistryDataReferences. + */ + public RegistryDataReferences registryDataReferences() { + if (this.registryDataReferences == null) { + this.registryDataReferences + = new RegistryDataReferencesImpl(clientObject.getRegistryDataReferences(), this); + } + return registryDataReferences; + } + + /** + * Gets the resource collection API of RegistryEnvironmentContainers. It manages EnvironmentContainer. + * + * @return Resource collection API of RegistryEnvironmentContainers. + */ + public RegistryEnvironmentContainers registryEnvironmentContainers() { + if (this.registryEnvironmentContainers == null) { + this.registryEnvironmentContainers + = new RegistryEnvironmentContainersImpl(clientObject.getRegistryEnvironmentContainers(), this); + } + return registryEnvironmentContainers; + } + + /** + * Gets the resource collection API of RegistryEnvironmentVersions. It manages EnvironmentVersion. + * + * @return Resource collection API of RegistryEnvironmentVersions. + */ + public RegistryEnvironmentVersions registryEnvironmentVersions() { + if (this.registryEnvironmentVersions == null) { + this.registryEnvironmentVersions + = new RegistryEnvironmentVersionsImpl(clientObject.getRegistryEnvironmentVersions(), this); + } + return registryEnvironmentVersions; + } + + /** + * Gets the resource collection API of MarketplaceSubscriptions. It manages MarketplaceSubscription. + * + * @return Resource collection API of MarketplaceSubscriptions. + */ + public MarketplaceSubscriptions marketplaceSubscriptions() { + if (this.marketplaceSubscriptions == null) { + this.marketplaceSubscriptions + = new MarketplaceSubscriptionsImpl(clientObject.getMarketplaceSubscriptions(), this); + } + return marketplaceSubscriptions; + } + + /** + * Gets the resource collection API of RegistryModelContainers. It manages ModelContainer. + * + * @return Resource collection API of RegistryModelContainers. + */ + public RegistryModelContainers registryModelContainers() { + if (this.registryModelContainers == null) { + this.registryModelContainers + = new RegistryModelContainersImpl(clientObject.getRegistryModelContainers(), this); + } + return registryModelContainers; + } + + /** + * Gets the resource collection API of RegistryModelVersions. It manages ModelVersion. + * + * @return Resource collection API of RegistryModelVersions. + */ + public RegistryModelVersions registryModelVersions() { + if (this.registryModelVersions == null) { + this.registryModelVersions = new RegistryModelVersionsImpl(clientObject.getRegistryModelVersions(), this); + } + return registryModelVersions; + } + /** * Gets the resource collection API of BatchEndpoints. It manages BatchEndpoint. - * + * * @return Resource collection API of BatchEndpoints. */ public BatchEndpoints batchEndpoints() { @@ -491,7 +742,7 @@ public BatchEndpoints batchEndpoints() { /** * Gets the resource collection API of BatchDeployments. It manages BatchDeployment. - * + * * @return Resource collection API of BatchDeployments. */ public BatchDeployments batchDeployments() { @@ -502,8 +753,8 @@ public BatchDeployments batchDeployments() { } /** - * Gets the resource collection API of CodeContainers. It manages CodeContainer. - * + * Gets the resource collection API of CodeContainers. + * * @return Resource collection API of CodeContainers. */ public CodeContainers codeContainers() { @@ -514,8 +765,8 @@ public CodeContainers codeContainers() { } /** - * Gets the resource collection API of CodeVersions. It manages CodeVersion. - * + * Gets the resource collection API of CodeVersions. + * * @return Resource collection API of CodeVersions. */ public CodeVersions codeVersions() { @@ -526,8 +777,8 @@ public CodeVersions codeVersions() { } /** - * Gets the resource collection API of ComponentContainers. It manages ComponentContainer. - * + * Gets the resource collection API of ComponentContainers. + * * @return Resource collection API of ComponentContainers. */ public ComponentContainers componentContainers() { @@ -538,8 +789,8 @@ public ComponentContainers componentContainers() { } /** - * Gets the resource collection API of ComponentVersions. It manages ComponentVersion. - * + * Gets the resource collection API of ComponentVersions. + * * @return Resource collection API of ComponentVersions. */ public ComponentVersions componentVersions() { @@ -550,8 +801,8 @@ public ComponentVersions componentVersions() { } /** - * Gets the resource collection API of DataContainers. It manages DataContainer. - * + * Gets the resource collection API of DataContainers. + * * @return Resource collection API of DataContainers. */ public DataContainers dataContainers() { @@ -562,8 +813,8 @@ public DataContainers dataContainers() { } /** - * Gets the resource collection API of DataVersions. It manages DataVersionBase. - * + * Gets the resource collection API of DataVersions. + * * @return Resource collection API of DataVersions. */ public DataVersions dataVersions() { @@ -575,7 +826,7 @@ public DataVersions dataVersions() { /** * Gets the resource collection API of Datastores. It manages Datastore. - * + * * @return Resource collection API of Datastores. */ public Datastores datastores() { @@ -586,8 +837,8 @@ public Datastores datastores() { } /** - * Gets the resource collection API of EnvironmentContainers. It manages EnvironmentContainer. - * + * Gets the resource collection API of EnvironmentContainers. + * * @return Resource collection API of EnvironmentContainers. */ public EnvironmentContainers environmentContainers() { @@ -598,8 +849,8 @@ public EnvironmentContainers environmentContainers() { } /** - * Gets the resource collection API of EnvironmentVersions. It manages EnvironmentVersion. - * + * Gets the resource collection API of EnvironmentVersions. + * * @return Resource collection API of EnvironmentVersions. */ public EnvironmentVersions environmentVersions() { @@ -609,9 +860,71 @@ public EnvironmentVersions environmentVersions() { return environmentVersions; } + /** + * Gets the resource collection API of FeaturesetContainers. It manages FeaturesetContainer. + * + * @return Resource collection API of FeaturesetContainers. + */ + public FeaturesetContainers featuresetContainers() { + if (this.featuresetContainers == null) { + this.featuresetContainers = new FeaturesetContainersImpl(clientObject.getFeaturesetContainers(), this); + } + return featuresetContainers; + } + + /** + * Gets the resource collection API of Features. + * + * @return Resource collection API of Features. + */ + public Features features() { + if (this.features == null) { + this.features = new FeaturesImpl(clientObject.getFeatures(), this); + } + return features; + } + + /** + * Gets the resource collection API of FeaturesetVersions. It manages FeaturesetVersion. + * + * @return Resource collection API of FeaturesetVersions. + */ + public FeaturesetVersions featuresetVersions() { + if (this.featuresetVersions == null) { + this.featuresetVersions = new FeaturesetVersionsImpl(clientObject.getFeaturesetVersions(), this); + } + return featuresetVersions; + } + + /** + * Gets the resource collection API of FeaturestoreEntityContainers. It manages FeaturestoreEntityContainer. + * + * @return Resource collection API of FeaturestoreEntityContainers. + */ + public FeaturestoreEntityContainers featurestoreEntityContainers() { + if (this.featurestoreEntityContainers == null) { + this.featurestoreEntityContainers + = new FeaturestoreEntityContainersImpl(clientObject.getFeaturestoreEntityContainers(), this); + } + return featurestoreEntityContainers; + } + + /** + * Gets the resource collection API of FeaturestoreEntityVersions. It manages FeaturestoreEntityVersion. + * + * @return Resource collection API of FeaturestoreEntityVersions. + */ + public FeaturestoreEntityVersions featurestoreEntityVersions() { + if (this.featurestoreEntityVersions == null) { + this.featurestoreEntityVersions + = new FeaturestoreEntityVersionsImpl(clientObject.getFeaturestoreEntityVersions(), this); + } + return featurestoreEntityVersions; + } + /** * Gets the resource collection API of Jobs. It manages JobBase. - * + * * @return Resource collection API of Jobs. */ public Jobs jobs() { @@ -622,8 +935,8 @@ public Jobs jobs() { } /** - * Gets the resource collection API of ModelContainers. It manages ModelContainer. - * + * Gets the resource collection API of ModelContainers. + * * @return Resource collection API of ModelContainers. */ public ModelContainers modelContainers() { @@ -634,8 +947,8 @@ public ModelContainers modelContainers() { } /** - * Gets the resource collection API of ModelVersions. It manages ModelVersion. - * + * Gets the resource collection API of ModelVersions. + * * @return Resource collection API of ModelVersions. */ public ModelVersions modelVersions() { @@ -647,7 +960,7 @@ public ModelVersions modelVersions() { /** * Gets the resource collection API of OnlineEndpoints. It manages OnlineEndpoint. - * + * * @return Resource collection API of OnlineEndpoints. */ public OnlineEndpoints onlineEndpoints() { @@ -659,7 +972,7 @@ public OnlineEndpoints onlineEndpoints() { /** * Gets the resource collection API of OnlineDeployments. It manages OnlineDeployment. - * + * * @return Resource collection API of OnlineDeployments. */ public OnlineDeployments onlineDeployments() { @@ -671,7 +984,7 @@ public OnlineDeployments onlineDeployments() { /** * Gets the resource collection API of Schedules. It manages Schedule. - * + * * @return Resource collection API of Schedules. */ public Schedules schedules() { @@ -681,9 +994,33 @@ public Schedules schedules() { return schedules; } + /** + * Gets the resource collection API of ServerlessEndpoints. It manages ServerlessEndpoint. + * + * @return Resource collection API of ServerlessEndpoints. + */ + public ServerlessEndpoints serverlessEndpoints() { + if (this.serverlessEndpoints == null) { + this.serverlessEndpoints = new ServerlessEndpointsImpl(clientObject.getServerlessEndpoints(), this); + } + return serverlessEndpoints; + } + + /** + * Gets the resource collection API of Registries. It manages Registry. + * + * @return Resource collection API of Registries. + */ + public Registries registries() { + if (this.registries == null) { + this.registries = new RegistriesImpl(clientObject.getRegistries(), this); + } + return registries; + } + /** * Gets the resource collection API of WorkspaceFeatures. - * + * * @return Resource collection API of WorkspaceFeatures. */ public WorkspaceFeatures workspaceFeatures() { @@ -694,10 +1031,12 @@ public WorkspaceFeatures workspaceFeatures() { } /** - * @return Wrapped service client AzureMachineLearningWorkspaces providing direct access to the underlying - * auto-generated API implementation, based on Azure REST API. + * Gets wrapped service client AzureMachineLearningServices providing direct access to the underlying auto-generated + * API implementation, based on Azure REST API. + * + * @return Wrapped service client AzureMachineLearningServices. */ - public AzureMachineLearningWorkspaces serviceClient() { + public AzureMachineLearningServices serviceClient() { return this.clientObject; } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/AzureMachineLearningServices.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/AzureMachineLearningServices.java new file mode 100644 index 0000000000000..04dc939b4e0f5 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/AzureMachineLearningServices.java @@ -0,0 +1,384 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** + * The interface for AzureMachineLearningServices class. + */ +public interface AzureMachineLearningServices { + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the WorkspacesClient object to access its operations. + * + * @return the WorkspacesClient object. + */ + WorkspacesClient getWorkspaces(); + + /** + * Gets the UsagesClient object to access its operations. + * + * @return the UsagesClient object. + */ + UsagesClient getUsages(); + + /** + * Gets the VirtualMachineSizesClient object to access its operations. + * + * @return the VirtualMachineSizesClient object. + */ + VirtualMachineSizesClient getVirtualMachineSizes(); + + /** + * Gets the QuotasClient object to access its operations. + * + * @return the QuotasClient object. + */ + QuotasClient getQuotas(); + + /** + * Gets the ComputesClient object to access its operations. + * + * @return the ComputesClient object. + */ + ComputesClient getComputes(); + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + PrivateEndpointConnectionsClient getPrivateEndpointConnections(); + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + PrivateLinkResourcesClient getPrivateLinkResources(); + + /** + * Gets the WorkspaceConnectionsClient object to access its operations. + * + * @return the WorkspaceConnectionsClient object. + */ + WorkspaceConnectionsClient getWorkspaceConnections(); + + /** + * Gets the ManagedNetworkSettingsRulesClient object to access its operations. + * + * @return the ManagedNetworkSettingsRulesClient object. + */ + ManagedNetworkSettingsRulesClient getManagedNetworkSettingsRules(); + + /** + * Gets the ManagedNetworkProvisionsClient object to access its operations. + * + * @return the ManagedNetworkProvisionsClient object. + */ + ManagedNetworkProvisionsClient getManagedNetworkProvisions(); + + /** + * Gets the RegistryCodeContainersClient object to access its operations. + * + * @return the RegistryCodeContainersClient object. + */ + RegistryCodeContainersClient getRegistryCodeContainers(); + + /** + * Gets the RegistryCodeVersionsClient object to access its operations. + * + * @return the RegistryCodeVersionsClient object. + */ + RegistryCodeVersionsClient getRegistryCodeVersions(); + + /** + * Gets the RegistryComponentContainersClient object to access its operations. + * + * @return the RegistryComponentContainersClient object. + */ + RegistryComponentContainersClient getRegistryComponentContainers(); + + /** + * Gets the RegistryComponentVersionsClient object to access its operations. + * + * @return the RegistryComponentVersionsClient object. + */ + RegistryComponentVersionsClient getRegistryComponentVersions(); + + /** + * Gets the RegistryDataContainersClient object to access its operations. + * + * @return the RegistryDataContainersClient object. + */ + RegistryDataContainersClient getRegistryDataContainers(); + + /** + * Gets the RegistryDataVersionsClient object to access its operations. + * + * @return the RegistryDataVersionsClient object. + */ + RegistryDataVersionsClient getRegistryDataVersions(); + + /** + * Gets the RegistryDataReferencesClient object to access its operations. + * + * @return the RegistryDataReferencesClient object. + */ + RegistryDataReferencesClient getRegistryDataReferences(); + + /** + * Gets the RegistryEnvironmentContainersClient object to access its operations. + * + * @return the RegistryEnvironmentContainersClient object. + */ + RegistryEnvironmentContainersClient getRegistryEnvironmentContainers(); + + /** + * Gets the RegistryEnvironmentVersionsClient object to access its operations. + * + * @return the RegistryEnvironmentVersionsClient object. + */ + RegistryEnvironmentVersionsClient getRegistryEnvironmentVersions(); + + /** + * Gets the MarketplaceSubscriptionsClient object to access its operations. + * + * @return the MarketplaceSubscriptionsClient object. + */ + MarketplaceSubscriptionsClient getMarketplaceSubscriptions(); + + /** + * Gets the RegistryModelContainersClient object to access its operations. + * + * @return the RegistryModelContainersClient object. + */ + RegistryModelContainersClient getRegistryModelContainers(); + + /** + * Gets the RegistryModelVersionsClient object to access its operations. + * + * @return the RegistryModelVersionsClient object. + */ + RegistryModelVersionsClient getRegistryModelVersions(); + + /** + * Gets the BatchEndpointsClient object to access its operations. + * + * @return the BatchEndpointsClient object. + */ + BatchEndpointsClient getBatchEndpoints(); + + /** + * Gets the BatchDeploymentsClient object to access its operations. + * + * @return the BatchDeploymentsClient object. + */ + BatchDeploymentsClient getBatchDeployments(); + + /** + * Gets the CodeContainersClient object to access its operations. + * + * @return the CodeContainersClient object. + */ + CodeContainersClient getCodeContainers(); + + /** + * Gets the CodeVersionsClient object to access its operations. + * + * @return the CodeVersionsClient object. + */ + CodeVersionsClient getCodeVersions(); + + /** + * Gets the ComponentContainersClient object to access its operations. + * + * @return the ComponentContainersClient object. + */ + ComponentContainersClient getComponentContainers(); + + /** + * Gets the ComponentVersionsClient object to access its operations. + * + * @return the ComponentVersionsClient object. + */ + ComponentVersionsClient getComponentVersions(); + + /** + * Gets the DataContainersClient object to access its operations. + * + * @return the DataContainersClient object. + */ + DataContainersClient getDataContainers(); + + /** + * Gets the DataVersionsClient object to access its operations. + * + * @return the DataVersionsClient object. + */ + DataVersionsClient getDataVersions(); + + /** + * Gets the DatastoresClient object to access its operations. + * + * @return the DatastoresClient object. + */ + DatastoresClient getDatastores(); + + /** + * Gets the EnvironmentContainersClient object to access its operations. + * + * @return the EnvironmentContainersClient object. + */ + EnvironmentContainersClient getEnvironmentContainers(); + + /** + * Gets the EnvironmentVersionsClient object to access its operations. + * + * @return the EnvironmentVersionsClient object. + */ + EnvironmentVersionsClient getEnvironmentVersions(); + + /** + * Gets the FeaturesetContainersClient object to access its operations. + * + * @return the FeaturesetContainersClient object. + */ + FeaturesetContainersClient getFeaturesetContainers(); + + /** + * Gets the FeaturesClient object to access its operations. + * + * @return the FeaturesClient object. + */ + FeaturesClient getFeatures(); + + /** + * Gets the FeaturesetVersionsClient object to access its operations. + * + * @return the FeaturesetVersionsClient object. + */ + FeaturesetVersionsClient getFeaturesetVersions(); + + /** + * Gets the FeaturestoreEntityContainersClient object to access its operations. + * + * @return the FeaturestoreEntityContainersClient object. + */ + FeaturestoreEntityContainersClient getFeaturestoreEntityContainers(); + + /** + * Gets the FeaturestoreEntityVersionsClient object to access its operations. + * + * @return the FeaturestoreEntityVersionsClient object. + */ + FeaturestoreEntityVersionsClient getFeaturestoreEntityVersions(); + + /** + * Gets the JobsClient object to access its operations. + * + * @return the JobsClient object. + */ + JobsClient getJobs(); + + /** + * Gets the ModelContainersClient object to access its operations. + * + * @return the ModelContainersClient object. + */ + ModelContainersClient getModelContainers(); + + /** + * Gets the ModelVersionsClient object to access its operations. + * + * @return the ModelVersionsClient object. + */ + ModelVersionsClient getModelVersions(); + + /** + * Gets the OnlineEndpointsClient object to access its operations. + * + * @return the OnlineEndpointsClient object. + */ + OnlineEndpointsClient getOnlineEndpoints(); + + /** + * Gets the OnlineDeploymentsClient object to access its operations. + * + * @return the OnlineDeploymentsClient object. + */ + OnlineDeploymentsClient getOnlineDeployments(); + + /** + * Gets the SchedulesClient object to access its operations. + * + * @return the SchedulesClient object. + */ + SchedulesClient getSchedules(); + + /** + * Gets the ServerlessEndpointsClient object to access its operations. + * + * @return the ServerlessEndpointsClient object. + */ + ServerlessEndpointsClient getServerlessEndpoints(); + + /** + * Gets the RegistriesClient object to access its operations. + * + * @return the RegistriesClient object. + */ + RegistriesClient getRegistries(); + + /** + * Gets the WorkspaceFeaturesClient object to access its operations. + * + * @return the WorkspaceFeaturesClient object. + */ + WorkspaceFeaturesClient getWorkspaceFeatures(); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/AzureMachineLearningWorkspaces.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/AzureMachineLearningWorkspaces.java deleted file mode 100644 index e8a40ef9b43c9..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/AzureMachineLearningWorkspaces.java +++ /dev/null @@ -1,235 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.fluent; - -import com.azure.core.http.HttpPipeline; -import java.time.Duration; - -/** The interface for AzureMachineLearningWorkspaces class. */ -public interface AzureMachineLearningWorkspaces { - /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - String getEndpoint(); - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - String getApiVersion(); - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - HttpPipeline getHttpPipeline(); - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - Duration getDefaultPollInterval(); - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - OperationsClient getOperations(); - - /** - * Gets the WorkspacesClient object to access its operations. - * - * @return the WorkspacesClient object. - */ - WorkspacesClient getWorkspaces(); - - /** - * Gets the UsagesClient object to access its operations. - * - * @return the UsagesClient object. - */ - UsagesClient getUsages(); - - /** - * Gets the VirtualMachineSizesClient object to access its operations. - * - * @return the VirtualMachineSizesClient object. - */ - VirtualMachineSizesClient getVirtualMachineSizes(); - - /** - * Gets the QuotasClient object to access its operations. - * - * @return the QuotasClient object. - */ - QuotasClient getQuotas(); - - /** - * Gets the ComputesClient object to access its operations. - * - * @return the ComputesClient object. - */ - ComputesClient getComputes(); - - /** - * Gets the PrivateEndpointConnectionsClient object to access its operations. - * - * @return the PrivateEndpointConnectionsClient object. - */ - PrivateEndpointConnectionsClient getPrivateEndpointConnections(); - - /** - * Gets the PrivateLinkResourcesClient object to access its operations. - * - * @return the PrivateLinkResourcesClient object. - */ - PrivateLinkResourcesClient getPrivateLinkResources(); - - /** - * Gets the WorkspaceConnectionsClient object to access its operations. - * - * @return the WorkspaceConnectionsClient object. - */ - WorkspaceConnectionsClient getWorkspaceConnections(); - - /** - * Gets the BatchEndpointsClient object to access its operations. - * - * @return the BatchEndpointsClient object. - */ - BatchEndpointsClient getBatchEndpoints(); - - /** - * Gets the BatchDeploymentsClient object to access its operations. - * - * @return the BatchDeploymentsClient object. - */ - BatchDeploymentsClient getBatchDeployments(); - - /** - * Gets the CodeContainersClient object to access its operations. - * - * @return the CodeContainersClient object. - */ - CodeContainersClient getCodeContainers(); - - /** - * Gets the CodeVersionsClient object to access its operations. - * - * @return the CodeVersionsClient object. - */ - CodeVersionsClient getCodeVersions(); - - /** - * Gets the ComponentContainersClient object to access its operations. - * - * @return the ComponentContainersClient object. - */ - ComponentContainersClient getComponentContainers(); - - /** - * Gets the ComponentVersionsClient object to access its operations. - * - * @return the ComponentVersionsClient object. - */ - ComponentVersionsClient getComponentVersions(); - - /** - * Gets the DataContainersClient object to access its operations. - * - * @return the DataContainersClient object. - */ - DataContainersClient getDataContainers(); - - /** - * Gets the DataVersionsClient object to access its operations. - * - * @return the DataVersionsClient object. - */ - DataVersionsClient getDataVersions(); - - /** - * Gets the DatastoresClient object to access its operations. - * - * @return the DatastoresClient object. - */ - DatastoresClient getDatastores(); - - /** - * Gets the EnvironmentContainersClient object to access its operations. - * - * @return the EnvironmentContainersClient object. - */ - EnvironmentContainersClient getEnvironmentContainers(); - - /** - * Gets the EnvironmentVersionsClient object to access its operations. - * - * @return the EnvironmentVersionsClient object. - */ - EnvironmentVersionsClient getEnvironmentVersions(); - - /** - * Gets the JobsClient object to access its operations. - * - * @return the JobsClient object. - */ - JobsClient getJobs(); - - /** - * Gets the ModelContainersClient object to access its operations. - * - * @return the ModelContainersClient object. - */ - ModelContainersClient getModelContainers(); - - /** - * Gets the ModelVersionsClient object to access its operations. - * - * @return the ModelVersionsClient object. - */ - ModelVersionsClient getModelVersions(); - - /** - * Gets the OnlineEndpointsClient object to access its operations. - * - * @return the OnlineEndpointsClient object. - */ - OnlineEndpointsClient getOnlineEndpoints(); - - /** - * Gets the OnlineDeploymentsClient object to access its operations. - * - * @return the OnlineDeploymentsClient object. - */ - OnlineDeploymentsClient getOnlineDeployments(); - - /** - * Gets the SchedulesClient object to access its operations. - * - * @return the SchedulesClient object. - */ - SchedulesClient getSchedules(); - - /** - * Gets the WorkspaceFeaturesClient object to access its operations. - * - * @return the WorkspaceFeaturesClient object. - */ - WorkspaceFeaturesClient getWorkspaceFeatures(); -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/BatchDeploymentsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/BatchDeploymentsClient.java index f2ba7f59facb4..8ef782e7a521b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/BatchDeploymentsClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/BatchDeploymentsClient.java @@ -14,11 +14,13 @@ import com.azure.resourcemanager.machinelearning.fluent.models.BatchDeploymentInner; import com.azure.resourcemanager.machinelearning.models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties; -/** An instance of this class provides access to all the operations defined in BatchDeploymentsClient. */ +/** + * An instance of this class provides access to all the operations defined in BatchDeploymentsClient. + */ public interface BatchDeploymentsClient { /** * Lists Batch inference deployments in the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Endpoint name. @@ -32,7 +34,7 @@ public interface BatchDeploymentsClient { /** * Lists Batch inference deployments in the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Endpoint name. @@ -46,18 +48,12 @@ public interface BatchDeploymentsClient { * @return a paginated list of BatchDeployment entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, - String workspaceName, - String endpointName, - String orderBy, - Integer top, - String skip, - Context context); + PagedIterable list(String resourceGroupName, String workspaceName, String endpointName, + String orderBy, Integer top, String skip, Context context); /** * Delete Batch Inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Endpoint name. @@ -68,12 +64,12 @@ PagedIterable list( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName); + SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName); /** * Delete Batch Inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Endpoint name. @@ -85,12 +81,12 @@ SyncPoller, Void> beginDelete( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName, Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName, Context context); /** * Delete Batch Inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Endpoint name. @@ -104,7 +100,7 @@ SyncPoller, Void> beginDelete( /** * Delete Batch Inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Endpoint name. @@ -115,12 +111,12 @@ SyncPoller, Void> beginDelete( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName, Context context); + void delete(String resourceGroupName, String workspaceName, String endpointName, String deploymentName, + Context context); /** * Gets a batch inference deployment by id. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Endpoint name. @@ -132,12 +128,12 @@ void delete( * @return a batch inference deployment by id along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName, Context context); + Response getWithResponse(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName, Context context); /** * Gets a batch inference deployment by id. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Endpoint name. @@ -148,12 +144,12 @@ Response getWithResponse( * @return a batch inference deployment by id. */ @ServiceMethod(returns = ReturnType.SINGLE) - BatchDeploymentInner get( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName); + BatchDeploymentInner get(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName); /** * Update a batch inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -165,16 +161,13 @@ BatchDeploymentInner get( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, BatchDeploymentInner> beginUpdate( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, + SyncPoller, BatchDeploymentInner> beginUpdate(String resourceGroupName, + String workspaceName, String endpointName, String deploymentName, PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties body); /** * Update a batch inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -187,17 +180,13 @@ SyncPoller, BatchDeploymentInner> beginUpdate( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, BatchDeploymentInner> beginUpdate( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties body, - Context context); + SyncPoller, BatchDeploymentInner> beginUpdate(String resourceGroupName, + String workspaceName, String endpointName, String deploymentName, + PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties body, Context context); /** * Update a batch inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -209,16 +198,12 @@ SyncPoller, BatchDeploymentInner> beginUpdate( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - BatchDeploymentInner update( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties body); + BatchDeploymentInner update(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName, PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties body); /** * Update a batch inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -231,17 +216,12 @@ BatchDeploymentInner update( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - BatchDeploymentInner update( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties body, - Context context); + BatchDeploymentInner update(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName, PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties body, Context context); /** * Creates/updates a batch inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -253,16 +233,12 @@ BatchDeploymentInner update( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, BatchDeploymentInner> beginCreateOrUpdate( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - BatchDeploymentInner body); + SyncPoller, BatchDeploymentInner> beginCreateOrUpdate(String resourceGroupName, + String workspaceName, String endpointName, String deploymentName, BatchDeploymentInner body); /** * Creates/updates a batch inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -275,17 +251,12 @@ SyncPoller, BatchDeploymentInner> beginCreateOr * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, BatchDeploymentInner> beginCreateOrUpdate( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - BatchDeploymentInner body, - Context context); + SyncPoller, BatchDeploymentInner> beginCreateOrUpdate(String resourceGroupName, + String workspaceName, String endpointName, String deploymentName, BatchDeploymentInner body, Context context); /** * Creates/updates a batch inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -297,16 +268,12 @@ SyncPoller, BatchDeploymentInner> beginCreateOr * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - BatchDeploymentInner createOrUpdate( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - BatchDeploymentInner body); + BatchDeploymentInner createOrUpdate(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName, BatchDeploymentInner body); /** * Creates/updates a batch inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -319,11 +286,6 @@ BatchDeploymentInner createOrUpdate( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - BatchDeploymentInner createOrUpdate( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - BatchDeploymentInner body, - Context context); + BatchDeploymentInner createOrUpdate(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName, BatchDeploymentInner body, Context context); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/BatchEndpointsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/BatchEndpointsClient.java index 4f335ddcec443..ad9d816bd2755 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/BatchEndpointsClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/BatchEndpointsClient.java @@ -15,11 +15,13 @@ import com.azure.resourcemanager.machinelearning.fluent.models.EndpointAuthKeysInner; import com.azure.resourcemanager.machinelearning.models.PartialMinimalTrackedResourceWithIdentity; -/** An instance of this class provides access to all the operations defined in BatchEndpointsClient. */ +/** + * An instance of this class provides access to all the operations defined in BatchEndpointsClient. + */ public interface BatchEndpointsClient { /** * Lists Batch inference endpoint in the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -32,7 +34,7 @@ public interface BatchEndpointsClient { /** * Lists Batch inference endpoint in the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param count Number of endpoints to be retrieved in a page of results. @@ -44,12 +46,12 @@ public interface BatchEndpointsClient { * @return a paginated list of BatchEndpoint entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, String workspaceName, Integer count, String skip, Context context); + PagedIterable list(String resourceGroupName, String workspaceName, Integer count, String skip, + Context context); /** * Delete Batch Inference Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference Endpoint name. @@ -63,7 +65,7 @@ PagedIterable list( /** * Delete Batch Inference Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference Endpoint name. @@ -74,12 +76,12 @@ PagedIterable list( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String workspaceName, String endpointName, Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String endpointName, + Context context); /** * Delete Batch Inference Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference Endpoint name. @@ -92,7 +94,7 @@ SyncPoller, Void> beginDelete( /** * Delete Batch Inference Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference Endpoint name. @@ -106,7 +108,7 @@ SyncPoller, Void> beginDelete( /** * Gets a batch inference endpoint by name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Name for the Batch Endpoint. @@ -117,12 +119,12 @@ SyncPoller, Void> beginDelete( * @return a batch inference endpoint by name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String endpointName, Context context); + Response getWithResponse(String resourceGroupName, String workspaceName, String endpointName, + Context context); /** * Gets a batch inference endpoint by name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Name for the Batch Endpoint. @@ -136,7 +138,7 @@ Response getWithResponse( /** * Update a batch inference endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Name for the Batch inference endpoint. @@ -147,15 +149,12 @@ Response getWithResponse( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, BatchEndpointInner> beginUpdate( - String resourceGroupName, - String workspaceName, - String endpointName, - PartialMinimalTrackedResourceWithIdentity body); + SyncPoller, BatchEndpointInner> beginUpdate(String resourceGroupName, + String workspaceName, String endpointName, PartialMinimalTrackedResourceWithIdentity body); /** * Update a batch inference endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Name for the Batch inference endpoint. @@ -167,16 +166,12 @@ SyncPoller, BatchEndpointInner> beginUpdate( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, BatchEndpointInner> beginUpdate( - String resourceGroupName, - String workspaceName, - String endpointName, - PartialMinimalTrackedResourceWithIdentity body, - Context context); + SyncPoller, BatchEndpointInner> beginUpdate(String resourceGroupName, + String workspaceName, String endpointName, PartialMinimalTrackedResourceWithIdentity body, Context context); /** * Update a batch inference endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Name for the Batch inference endpoint. @@ -187,15 +182,12 @@ SyncPoller, BatchEndpointInner> beginUpdate( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - BatchEndpointInner update( - String resourceGroupName, - String workspaceName, - String endpointName, + BatchEndpointInner update(String resourceGroupName, String workspaceName, String endpointName, PartialMinimalTrackedResourceWithIdentity body); /** * Update a batch inference endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Name for the Batch inference endpoint. @@ -207,16 +199,12 @@ BatchEndpointInner update( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - BatchEndpointInner update( - String resourceGroupName, - String workspaceName, - String endpointName, - PartialMinimalTrackedResourceWithIdentity body, - Context context); + BatchEndpointInner update(String resourceGroupName, String workspaceName, String endpointName, + PartialMinimalTrackedResourceWithIdentity body, Context context); /** * Creates a batch inference endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Name for the Batch inference endpoint. @@ -227,12 +215,12 @@ BatchEndpointInner update( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, BatchEndpointInner> beginCreateOrUpdate( - String resourceGroupName, String workspaceName, String endpointName, BatchEndpointInner body); + SyncPoller, BatchEndpointInner> beginCreateOrUpdate(String resourceGroupName, + String workspaceName, String endpointName, BatchEndpointInner body); /** * Creates a batch inference endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Name for the Batch inference endpoint. @@ -244,12 +232,12 @@ SyncPoller, BatchEndpointInner> beginCreateOrUpda * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, BatchEndpointInner> beginCreateOrUpdate( - String resourceGroupName, String workspaceName, String endpointName, BatchEndpointInner body, Context context); + SyncPoller, BatchEndpointInner> beginCreateOrUpdate(String resourceGroupName, + String workspaceName, String endpointName, BatchEndpointInner body, Context context); /** * Creates a batch inference endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Name for the Batch inference endpoint. @@ -260,12 +248,12 @@ SyncPoller, BatchEndpointInner> beginCreateOrUpda * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - BatchEndpointInner createOrUpdate( - String resourceGroupName, String workspaceName, String endpointName, BatchEndpointInner body); + BatchEndpointInner createOrUpdate(String resourceGroupName, String workspaceName, String endpointName, + BatchEndpointInner body); /** * Creates a batch inference endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Name for the Batch inference endpoint. @@ -277,12 +265,12 @@ BatchEndpointInner createOrUpdate( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - BatchEndpointInner createOrUpdate( - String resourceGroupName, String workspaceName, String endpointName, BatchEndpointInner body, Context context); + BatchEndpointInner createOrUpdate(String resourceGroupName, String workspaceName, String endpointName, + BatchEndpointInner body, Context context); /** * Lists batch Inference Endpoint keys. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference Endpoint name. @@ -293,12 +281,12 @@ BatchEndpointInner createOrUpdate( * @return keys for endpoint authentication along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listKeysWithResponse( - String resourceGroupName, String workspaceName, String endpointName, Context context); + Response listKeysWithResponse(String resourceGroupName, String workspaceName, + String endpointName, Context context); /** * Lists batch Inference Endpoint keys. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference Endpoint name. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/CodeContainersClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/CodeContainersClient.java index 04fdda11a5779..de4baa9510dda 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/CodeContainersClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/CodeContainersClient.java @@ -11,11 +11,13 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.machinelearning.fluent.models.CodeContainerInner; -/** An instance of this class provides access to all the operations defined in CodeContainersClient. */ +/** + * An instance of this class provides access to all the operations defined in CodeContainersClient. + */ public interface CodeContainersClient { /** * List containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -28,7 +30,7 @@ public interface CodeContainersClient { /** * List containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -39,12 +41,12 @@ public interface CodeContainersClient { * @return a paginated list of CodeContainer entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, String workspaceName, String skip, Context context); + PagedIterable list(String resourceGroupName, String workspaceName, String skip, + Context context); /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -59,7 +61,7 @@ PagedIterable list( /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -72,7 +74,7 @@ PagedIterable list( /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -83,12 +85,12 @@ PagedIterable list( * @return container along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String name, Context context); + Response getWithResponse(String resourceGroupName, String workspaceName, String name, + Context context); /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -102,7 +104,7 @@ Response getWithResponse( /** * Create or update container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -114,12 +116,12 @@ Response getWithResponse( * @return azure Resource Manager resource envelope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, String workspaceName, String name, CodeContainerInner body, Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, String name, + CodeContainerInner body, Context context); /** * Create or update container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -130,6 +132,6 @@ Response createOrUpdateWithResponse( * @return azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - CodeContainerInner createOrUpdate( - String resourceGroupName, String workspaceName, String name, CodeContainerInner body); + CodeContainerInner createOrUpdate(String resourceGroupName, String workspaceName, String name, + CodeContainerInner body); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/CodeVersionsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/CodeVersionsClient.java index fa5b5e3a44693..abfbf9d071d69 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/CodeVersionsClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/CodeVersionsClient.java @@ -8,14 +8,21 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.machinelearning.fluent.models.CodeVersionInner; +import com.azure.resourcemanager.machinelearning.fluent.models.PendingUploadResponseDtoInner; +import com.azure.resourcemanager.machinelearning.models.DestinationAsset; +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; -/** An instance of this class provides access to all the operations defined in CodeVersionsClient. */ +/** + * An instance of this class provides access to all the operations defined in CodeVersionsClient. + */ public interface CodeVersionsClient { /** * List versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -29,13 +36,15 @@ public interface CodeVersionsClient { /** * List versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. * @param orderBy Ordering of list. * @param top Maximum number of records to return. * @param skip Continuation token for pagination. + * @param hash If specified, return CodeVersion assets with specified content hash value, regardless of name. + * @param hashVersion Hash algorithm version when listing by hash. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -43,18 +52,12 @@ public interface CodeVersionsClient { * @return a paginated list of CodeVersion entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, - String workspaceName, - String name, - String orderBy, - Integer top, - String skip, - Context context); + PagedIterable list(String resourceGroupName, String workspaceName, String name, String orderBy, + Integer top, String skip, String hash, String hashVersion, Context context); /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -66,12 +69,12 @@ PagedIterable list( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context); + Response deleteWithResponse(String resourceGroupName, String workspaceName, String name, String version, + Context context); /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -85,7 +88,7 @@ Response deleteWithResponse( /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -97,12 +100,12 @@ Response deleteWithResponse( * @return version along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context); + Response getWithResponse(String resourceGroupName, String workspaceName, String name, + String version, Context context); /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -117,7 +120,7 @@ Response getWithResponse( /** * Create or update version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -130,17 +133,12 @@ Response getWithResponse( * @return azure Resource Manager resource envelope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String name, - String version, - CodeVersionInner body, - Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, String name, + String version, CodeVersionInner body, Context context); /** * Create or update version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -152,6 +150,108 @@ Response createOrUpdateWithResponse( * @return azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - CodeVersionInner createOrUpdate( - String resourceGroupName, String workspaceName, String name, String version, CodeVersionInner body); + CodeVersionInner createOrUpdate(String resourceGroupName, String workspaceName, String name, String version, + CodeVersionInner body); + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginPublish(String resourceGroupName, String workspaceName, String name, + String version, DestinationAsset body); + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginPublish(String resourceGroupName, String workspaceName, String name, + String version, DestinationAsset body, Context context); + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void publish(String resourceGroupName, String workspaceName, String name, String version, DestinationAsset body); + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void publish(String resourceGroupName, String workspaceName, String name, String version, DestinationAsset body, + Context context); + + /** + * Generate a storage location and credential for the client to upload a code asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrGetStartPendingUploadWithResponse(String resourceGroupName, + String workspaceName, String name, String version, PendingUploadRequestDto body, Context context); + + /** + * Generate a storage location and credential for the client to upload a code asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PendingUploadResponseDtoInner createOrGetStartPendingUpload(String resourceGroupName, String workspaceName, + String name, String version, PendingUploadRequestDto body); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ComponentContainersClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ComponentContainersClient.java index 0f44fde086c8e..9758c6b03bcf6 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ComponentContainersClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ComponentContainersClient.java @@ -12,11 +12,13 @@ import com.azure.resourcemanager.machinelearning.fluent.models.ComponentContainerInner; import com.azure.resourcemanager.machinelearning.models.ListViewType; -/** An instance of this class provides access to all the operations defined in ComponentContainersClient. */ +/** + * An instance of this class provides access to all the operations defined in ComponentContainersClient. + */ public interface ComponentContainersClient { /** * List component containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -29,7 +31,7 @@ public interface ComponentContainersClient { /** * List component containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -41,12 +43,12 @@ public interface ComponentContainersClient { * @return a paginated list of ComponentContainer entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, String workspaceName, String skip, ListViewType listViewType, Context context); + PagedIterable list(String resourceGroupName, String workspaceName, String skip, + ListViewType listViewType, Context context); /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -61,7 +63,7 @@ PagedIterable list( /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -74,7 +76,7 @@ PagedIterable list( /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -85,12 +87,12 @@ PagedIterable list( * @return container along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String name, Context context); + Response getWithResponse(String resourceGroupName, String workspaceName, String name, + Context context); /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -104,7 +106,7 @@ Response getWithResponse( /** * Create or update container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -116,12 +118,12 @@ Response getWithResponse( * @return azure Resource Manager resource envelope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, String workspaceName, String name, ComponentContainerInner body, Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String name, ComponentContainerInner body, Context context); /** * Create or update container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -132,6 +134,6 @@ Response createOrUpdateWithResponse( * @return azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - ComponentContainerInner createOrUpdate( - String resourceGroupName, String workspaceName, String name, ComponentContainerInner body); + ComponentContainerInner createOrUpdate(String resourceGroupName, String workspaceName, String name, + ComponentContainerInner body); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ComponentVersionsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ComponentVersionsClient.java index c1374059eaa05..b5c5be3c55a09 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ComponentVersionsClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ComponentVersionsClient.java @@ -8,15 +8,20 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.machinelearning.fluent.models.ComponentVersionInner; +import com.azure.resourcemanager.machinelearning.models.DestinationAsset; import com.azure.resourcemanager.machinelearning.models.ListViewType; -/** An instance of this class provides access to all the operations defined in ComponentVersionsClient. */ +/** + * An instance of this class provides access to all the operations defined in ComponentVersionsClient. + */ public interface ComponentVersionsClient { /** * List component versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Component name. @@ -30,7 +35,7 @@ public interface ComponentVersionsClient { /** * List component versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Component name. @@ -45,19 +50,12 @@ public interface ComponentVersionsClient { * @return a paginated list of ComponentVersion entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, - String workspaceName, - String name, - String orderBy, - Integer top, - String skip, - ListViewType listViewType, - Context context); + PagedIterable list(String resourceGroupName, String workspaceName, String name, + String orderBy, Integer top, String skip, ListViewType listViewType, Context context); /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -69,12 +67,12 @@ PagedIterable list( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context); + Response deleteWithResponse(String resourceGroupName, String workspaceName, String name, String version, + Context context); /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -88,7 +86,7 @@ Response deleteWithResponse( /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -100,12 +98,12 @@ Response deleteWithResponse( * @return version along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context); + Response getWithResponse(String resourceGroupName, String workspaceName, String name, + String version, Context context); /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -120,7 +118,7 @@ Response getWithResponse( /** * Create or update version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -133,17 +131,12 @@ Response getWithResponse( * @return azure Resource Manager resource envelope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String name, - String version, - ComponentVersionInner body, - Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String name, String version, ComponentVersionInner body, Context context); /** * Create or update version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -155,6 +148,73 @@ Response createOrUpdateWithResponse( * @return azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - ComponentVersionInner createOrUpdate( - String resourceGroupName, String workspaceName, String name, String version, ComponentVersionInner body); + ComponentVersionInner createOrUpdate(String resourceGroupName, String workspaceName, String name, String version, + ComponentVersionInner body); + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginPublish(String resourceGroupName, String workspaceName, String name, + String version, DestinationAsset body); + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginPublish(String resourceGroupName, String workspaceName, String name, + String version, DestinationAsset body, Context context); + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void publish(String resourceGroupName, String workspaceName, String name, String version, DestinationAsset body); + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void publish(String resourceGroupName, String workspaceName, String name, String version, DestinationAsset body, + Context context); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ComputesClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ComputesClient.java index 5676a642b1704..2acd533571d4f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ComputesClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ComputesClient.java @@ -17,11 +17,13 @@ import com.azure.resourcemanager.machinelearning.models.ClusterUpdateParameters; import com.azure.resourcemanager.machinelearning.models.UnderlyingResourceAction; -/** An instance of this class provides access to all the operations defined in ComputesClient. */ +/** + * An instance of this class provides access to all the operations defined in ComputesClient. + */ public interface ComputesClient { /** * Gets computes in specified workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -34,7 +36,7 @@ public interface ComputesClient { /** * Gets computes in specified workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -45,13 +47,13 @@ public interface ComputesClient { * @return computes in specified workspace as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, String workspaceName, String skip, Context context); + PagedIterable list(String resourceGroupName, String workspaceName, String skip, + Context context); /** * Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are not returned - use * 'keys' nested resource to get them. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -62,13 +64,13 @@ PagedIterable list( * @return compute definition by its name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String computeName, Context context); + Response getWithResponse(String resourceGroupName, String workspaceName, String computeName, + Context context); /** * Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are not returned - use * 'keys' nested resource to get them. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -83,7 +85,7 @@ Response getWithResponse( /** * Creates or updates compute. This call will overwrite a compute if it exists. This is a nonrecoverable operation. * If your intent is to create a new compute, do a GET first to verify that it does not exist yet. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -94,13 +96,13 @@ Response getWithResponse( * @return the {@link SyncPoller} for polling of machine Learning compute object wrapped into ARM resource envelope. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ComputeResourceInner> beginCreateOrUpdate( - String resourceGroupName, String workspaceName, String computeName, ComputeResourceInner parameters); + SyncPoller, ComputeResourceInner> beginCreateOrUpdate(String resourceGroupName, + String workspaceName, String computeName, ComputeResourceInner parameters); /** * Creates or updates compute. This call will overwrite a compute if it exists. This is a nonrecoverable operation. * If your intent is to create a new compute, do a GET first to verify that it does not exist yet. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -112,17 +114,13 @@ SyncPoller, ComputeResourceInner> beginCreateOr * @return the {@link SyncPoller} for polling of machine Learning compute object wrapped into ARM resource envelope. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ComputeResourceInner> beginCreateOrUpdate( - String resourceGroupName, - String workspaceName, - String computeName, - ComputeResourceInner parameters, - Context context); + SyncPoller, ComputeResourceInner> beginCreateOrUpdate(String resourceGroupName, + String workspaceName, String computeName, ComputeResourceInner parameters, Context context); /** * Creates or updates compute. This call will overwrite a compute if it exists. This is a nonrecoverable operation. * If your intent is to create a new compute, do a GET first to verify that it does not exist yet. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -133,13 +131,13 @@ SyncPoller, ComputeResourceInner> beginCreateOr * @return machine Learning compute object wrapped into ARM resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - ComputeResourceInner createOrUpdate( - String resourceGroupName, String workspaceName, String computeName, ComputeResourceInner parameters); + ComputeResourceInner createOrUpdate(String resourceGroupName, String workspaceName, String computeName, + ComputeResourceInner parameters); /** * Creates or updates compute. This call will overwrite a compute if it exists. This is a nonrecoverable operation. * If your intent is to create a new compute, do a GET first to verify that it does not exist yet. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -151,17 +149,13 @@ ComputeResourceInner createOrUpdate( * @return machine Learning compute object wrapped into ARM resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - ComputeResourceInner createOrUpdate( - String resourceGroupName, - String workspaceName, - String computeName, - ComputeResourceInner parameters, - Context context); + ComputeResourceInner createOrUpdate(String resourceGroupName, String workspaceName, String computeName, + ComputeResourceInner parameters, Context context); /** * Updates properties of a compute. This call will overwrite a compute if it exists. This is a nonrecoverable * operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -172,13 +166,13 @@ ComputeResourceInner createOrUpdate( * @return the {@link SyncPoller} for polling of machine Learning compute object wrapped into ARM resource envelope. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ComputeResourceInner> beginUpdate( - String resourceGroupName, String workspaceName, String computeName, ClusterUpdateParameters parameters); + SyncPoller, ComputeResourceInner> beginUpdate(String resourceGroupName, + String workspaceName, String computeName, ClusterUpdateParameters parameters); /** * Updates properties of a compute. This call will overwrite a compute if it exists. This is a nonrecoverable * operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -190,17 +184,13 @@ SyncPoller, ComputeResourceInner> beginUpdate( * @return the {@link SyncPoller} for polling of machine Learning compute object wrapped into ARM resource envelope. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ComputeResourceInner> beginUpdate( - String resourceGroupName, - String workspaceName, - String computeName, - ClusterUpdateParameters parameters, - Context context); + SyncPoller, ComputeResourceInner> beginUpdate(String resourceGroupName, + String workspaceName, String computeName, ClusterUpdateParameters parameters, Context context); /** * Updates properties of a compute. This call will overwrite a compute if it exists. This is a nonrecoverable * operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -211,13 +201,13 @@ SyncPoller, ComputeResourceInner> beginUpdate( * @return machine Learning compute object wrapped into ARM resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - ComputeResourceInner update( - String resourceGroupName, String workspaceName, String computeName, ClusterUpdateParameters parameters); + ComputeResourceInner update(String resourceGroupName, String workspaceName, String computeName, + ClusterUpdateParameters parameters); /** * Updates properties of a compute. This call will overwrite a compute if it exists. This is a nonrecoverable * operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -229,41 +219,34 @@ ComputeResourceInner update( * @return machine Learning compute object wrapped into ARM resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - ComputeResourceInner update( - String resourceGroupName, - String workspaceName, - String computeName, - ClusterUpdateParameters parameters, - Context context); + ComputeResourceInner update(String resourceGroupName, String workspaceName, String computeName, + ClusterUpdateParameters parameters, Context context); /** * Deletes specified Machine Learning compute. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. * @param underlyingResourceAction Delete the underlying compute if 'Delete', or detach the underlying compute from - * workspace if 'Detach'. + * workspace if 'Detach'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, - String workspaceName, - String computeName, + SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String computeName, UnderlyingResourceAction underlyingResourceAction); /** * Deletes specified Machine Learning compute. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. * @param underlyingResourceAction Delete the underlying compute if 'Delete', or detach the underlying compute from - * workspace if 'Detach'. + * workspace if 'Detach'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -271,56 +254,45 @@ SyncPoller, Void> beginDelete( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, - String workspaceName, - String computeName, - UnderlyingResourceAction underlyingResourceAction, - Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String computeName, + UnderlyingResourceAction underlyingResourceAction, Context context); /** * Deletes specified Machine Learning compute. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. * @param underlyingResourceAction Delete the underlying compute if 'Delete', or detach the underlying compute from - * workspace if 'Detach'. + * workspace if 'Detach'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete( - String resourceGroupName, - String workspaceName, - String computeName, + void delete(String resourceGroupName, String workspaceName, String computeName, UnderlyingResourceAction underlyingResourceAction); /** * Deletes specified Machine Learning compute. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. * @param underlyingResourceAction Delete the underlying compute if 'Delete', or detach the underlying compute from - * workspace if 'Detach'. + * workspace if 'Detach'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete( - String resourceGroupName, - String workspaceName, - String computeName, - UnderlyingResourceAction underlyingResourceAction, - Context context); + void delete(String resourceGroupName, String workspaceName, String computeName, + UnderlyingResourceAction underlyingResourceAction, Context context); /** * Get the details (e.g IP address, port etc) of all the compute nodes in the compute. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -328,15 +300,15 @@ void delete( * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the details (e.g IP address, port etc) of all the compute nodes in the compute as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listNodes( - String resourceGroupName, String workspaceName, String computeName); + PagedIterable listNodes(String resourceGroupName, String workspaceName, + String computeName); /** * Get the details (e.g IP address, port etc) of all the compute nodes in the compute. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -345,15 +317,15 @@ PagedIterable listNodes( * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the details (e.g IP address, port etc) of all the compute nodes in the compute as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listNodes( - String resourceGroupName, String workspaceName, String computeName, Context context); + PagedIterable listNodes(String resourceGroupName, String workspaceName, + String computeName, Context context); /** * Gets secrets related to Machine Learning compute (storage keys, service credentials, etc). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -361,16 +333,16 @@ PagedIterable listNodes( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secrets related to Machine Learning compute (storage keys, service credentials, etc) along with {@link - * Response}. + * @return secrets related to Machine Learning compute (storage keys, service credentials, etc) along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listKeysWithResponse( - String resourceGroupName, String workspaceName, String computeName, Context context); + Response listKeysWithResponse(String resourceGroupName, String workspaceName, + String computeName, Context context); /** * Gets secrets related to Machine Learning compute (storage keys, service credentials, etc). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -384,7 +356,7 @@ Response listKeysWithResponse( /** * Posts a start action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -398,7 +370,7 @@ Response listKeysWithResponse( /** * Posts a start action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -409,12 +381,12 @@ Response listKeysWithResponse( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginStart( - String resourceGroupName, String workspaceName, String computeName, Context context); + SyncPoller, Void> beginStart(String resourceGroupName, String workspaceName, String computeName, + Context context); /** * Posts a start action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -427,7 +399,7 @@ SyncPoller, Void> beginStart( /** * Posts a start action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -441,7 +413,7 @@ SyncPoller, Void> beginStart( /** * Posts a stop action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -455,7 +427,7 @@ SyncPoller, Void> beginStart( /** * Posts a stop action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -466,12 +438,12 @@ SyncPoller, Void> beginStart( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginStop( - String resourceGroupName, String workspaceName, String computeName, Context context); + SyncPoller, Void> beginStop(String resourceGroupName, String workspaceName, String computeName, + Context context); /** * Posts a stop action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -484,7 +456,7 @@ SyncPoller, Void> beginStop( /** * Posts a stop action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -498,7 +470,7 @@ SyncPoller, Void> beginStop( /** * Posts a restart action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -512,7 +484,7 @@ SyncPoller, Void> beginStop( /** * Posts a restart action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -523,12 +495,12 @@ SyncPoller, Void> beginStop( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginRestart( - String resourceGroupName, String workspaceName, String computeName, Context context); + SyncPoller, Void> beginRestart(String resourceGroupName, String workspaceName, String computeName, + Context context); /** * Posts a restart action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -541,7 +513,7 @@ SyncPoller, Void> beginRestart( /** * Posts a restart action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/DataContainersClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/DataContainersClient.java index ac1a5e3331934..27ae140fa88d1 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/DataContainersClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/DataContainersClient.java @@ -12,11 +12,13 @@ import com.azure.resourcemanager.machinelearning.fluent.models.DataContainerInner; import com.azure.resourcemanager.machinelearning.models.ListViewType; -/** An instance of this class provides access to all the operations defined in DataContainersClient. */ +/** + * An instance of this class provides access to all the operations defined in DataContainersClient. + */ public interface DataContainersClient { /** * List data containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -29,7 +31,7 @@ public interface DataContainersClient { /** * List data containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -41,12 +43,12 @@ public interface DataContainersClient { * @return a paginated list of DataContainer entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, String workspaceName, String skip, ListViewType listViewType, Context context); + PagedIterable list(String resourceGroupName, String workspaceName, String skip, + ListViewType listViewType, Context context); /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -61,7 +63,7 @@ PagedIterable list( /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -74,7 +76,7 @@ PagedIterable list( /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -85,12 +87,12 @@ PagedIterable list( * @return container along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String name, Context context); + Response getWithResponse(String resourceGroupName, String workspaceName, String name, + Context context); /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -104,7 +106,7 @@ Response getWithResponse( /** * Create or update container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -116,12 +118,12 @@ Response getWithResponse( * @return azure Resource Manager resource envelope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, String workspaceName, String name, DataContainerInner body, Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, String name, + DataContainerInner body, Context context); /** * Create or update container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -132,6 +134,6 @@ Response createOrUpdateWithResponse( * @return azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - DataContainerInner createOrUpdate( - String resourceGroupName, String workspaceName, String name, DataContainerInner body); + DataContainerInner createOrUpdate(String resourceGroupName, String workspaceName, String name, + DataContainerInner body); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/DataVersionsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/DataVersionsClient.java index bf43827ba11f0..ae284eec114fe 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/DataVersionsClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/DataVersionsClient.java @@ -8,15 +8,20 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.machinelearning.fluent.models.DataVersionBaseInner; +import com.azure.resourcemanager.machinelearning.models.DestinationAsset; import com.azure.resourcemanager.machinelearning.models.ListViewType; -/** An instance of this class provides access to all the operations defined in DataVersionsClient. */ +/** + * An instance of this class provides access to all the operations defined in DataVersionsClient. + */ public interface DataVersionsClient { /** * List data versions in the data container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Data container's name. @@ -30,17 +35,17 @@ public interface DataVersionsClient { /** * List data versions in the data container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Data container's name. * @param orderBy Please choose OrderBy value from ['createdtime', 'modifiedtime']. - * @param top 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. + * @param top 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. * @param skip Continuation token for pagination. * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for - * including/excluding (for example) archived entities. + * including/excluding (for example) archived entities. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -48,20 +53,12 @@ public interface DataVersionsClient { * @return a paginated list of DataVersionBase entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, - String workspaceName, - String name, - String orderBy, - Integer top, - String skip, - String tags, - ListViewType listViewType, - Context context); + PagedIterable list(String resourceGroupName, String workspaceName, String name, + String orderBy, Integer top, String skip, String tags, ListViewType listViewType, Context context); /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -73,12 +70,12 @@ PagedIterable list( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context); + Response deleteWithResponse(String resourceGroupName, String workspaceName, String name, String version, + Context context); /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -92,7 +89,7 @@ Response deleteWithResponse( /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -104,12 +101,12 @@ Response deleteWithResponse( * @return version along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context); + Response getWithResponse(String resourceGroupName, String workspaceName, String name, + String version, Context context); /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -124,7 +121,7 @@ Response getWithResponse( /** * Create or update version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -137,17 +134,12 @@ Response getWithResponse( * @return azure Resource Manager resource envelope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String name, - String version, - DataVersionBaseInner body, - Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String name, String version, DataVersionBaseInner body, Context context); /** * Create or update version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -159,6 +151,73 @@ Response createOrUpdateWithResponse( * @return azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - DataVersionBaseInner createOrUpdate( - String resourceGroupName, String workspaceName, String name, String version, DataVersionBaseInner body); + DataVersionBaseInner createOrUpdate(String resourceGroupName, String workspaceName, String name, String version, + DataVersionBaseInner body); + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginPublish(String resourceGroupName, String workspaceName, String name, + String version, DestinationAsset body); + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginPublish(String resourceGroupName, String workspaceName, String name, + String version, DestinationAsset body, Context context); + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void publish(String resourceGroupName, String workspaceName, String name, String version, DestinationAsset body); + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void publish(String resourceGroupName, String workspaceName, String name, String version, DestinationAsset body, + Context context); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/DatastoresClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/DatastoresClient.java index ca474d283aa20..4b27708c65d20 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/DatastoresClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/DatastoresClient.java @@ -11,13 +11,16 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.machinelearning.fluent.models.DatastoreInner; import com.azure.resourcemanager.machinelearning.fluent.models.DatastoreSecretsInner; +import com.azure.resourcemanager.machinelearning.models.SecretExpiry; import java.util.List; -/** An instance of this class provides access to all the operations defined in DatastoresClient. */ +/** + * An instance of this class provides access to all the operations defined in DatastoresClient. + */ public interface DatastoresClient { /** * List datastores. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -30,7 +33,7 @@ public interface DatastoresClient { /** * List datastores. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -47,21 +50,12 @@ public interface DatastoresClient { * @return a paginated list of Datastore entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, - String workspaceName, - String skip, - Integer count, - Boolean isDefault, - List names, - String searchText, - String orderBy, - Boolean orderByAsc, - Context context); + PagedIterable list(String resourceGroupName, String workspaceName, String skip, Integer count, + Boolean isDefault, List names, String searchText, String orderBy, Boolean orderByAsc, Context context); /** * Delete datastore. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Datastore name. @@ -76,7 +70,7 @@ PagedIterable list( /** * Delete datastore. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Datastore name. @@ -89,7 +83,7 @@ PagedIterable list( /** * Get datastore. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Datastore name. @@ -100,12 +94,12 @@ PagedIterable list( * @return datastore along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String name, Context context); + Response getWithResponse(String resourceGroupName, String workspaceName, String name, + Context context); /** * Get datastore. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Datastore name. @@ -119,7 +113,7 @@ Response getWithResponse( /** * Create or update datastore. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Datastore name. @@ -132,17 +126,12 @@ Response getWithResponse( * @return azure Resource Manager resource envelope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String name, - DatastoreInner body, - Boolean skipValidation, - Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, String name, + DatastoreInner body, Boolean skipValidation, Context context); /** * Create or update datastore. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Datastore name. @@ -157,10 +146,11 @@ Response createOrUpdateWithResponse( /** * Get datastore secrets. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Datastore name. + * @param body Secret expiry information. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -168,12 +158,12 @@ Response createOrUpdateWithResponse( * @return datastore secrets along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listSecretsWithResponse( - String resourceGroupName, String workspaceName, String name, Context context); + Response listSecretsWithResponse(String resourceGroupName, String workspaceName, String name, + SecretExpiry body, Context context); /** * Get datastore secrets. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Datastore name. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/EnvironmentContainersClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/EnvironmentContainersClient.java index 1719267cb0ca5..ab219d8a088c0 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/EnvironmentContainersClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/EnvironmentContainersClient.java @@ -12,11 +12,13 @@ import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentContainerInner; import com.azure.resourcemanager.machinelearning.models.ListViewType; -/** An instance of this class provides access to all the operations defined in EnvironmentContainersClient. */ +/** + * An instance of this class provides access to all the operations defined in EnvironmentContainersClient. + */ public interface EnvironmentContainersClient { /** * List environment containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -29,7 +31,7 @@ public interface EnvironmentContainersClient { /** * List environment containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -41,12 +43,12 @@ public interface EnvironmentContainersClient { * @return a paginated list of EnvironmentContainer entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, String workspaceName, String skip, ListViewType listViewType, Context context); + PagedIterable list(String resourceGroupName, String workspaceName, String skip, + ListViewType listViewType, Context context); /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -61,7 +63,7 @@ PagedIterable list( /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -74,7 +76,7 @@ PagedIterable list( /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -85,12 +87,12 @@ PagedIterable list( * @return container along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String name, Context context); + Response getWithResponse(String resourceGroupName, String workspaceName, String name, + Context context); /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -104,7 +106,7 @@ Response getWithResponse( /** * Create or update container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -116,12 +118,12 @@ Response getWithResponse( * @return azure Resource Manager resource envelope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, String workspaceName, String name, EnvironmentContainerInner body, Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String name, EnvironmentContainerInner body, Context context); /** * Create or update container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -132,6 +134,6 @@ Response createOrUpdateWithResponse( * @return azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - EnvironmentContainerInner createOrUpdate( - String resourceGroupName, String workspaceName, String name, EnvironmentContainerInner body); + EnvironmentContainerInner createOrUpdate(String resourceGroupName, String workspaceName, String name, + EnvironmentContainerInner body); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/EnvironmentVersionsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/EnvironmentVersionsClient.java index 9b6667f2237ec..761e1ea8a32b9 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/EnvironmentVersionsClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/EnvironmentVersionsClient.java @@ -8,15 +8,20 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentVersionInner; +import com.azure.resourcemanager.machinelearning.models.DestinationAsset; import com.azure.resourcemanager.machinelearning.models.ListViewType; -/** An instance of this class provides access to all the operations defined in EnvironmentVersionsClient. */ +/** + * An instance of this class provides access to all the operations defined in EnvironmentVersionsClient. + */ public interface EnvironmentVersionsClient { /** * List versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -30,7 +35,7 @@ public interface EnvironmentVersionsClient { /** * List versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -45,19 +50,12 @@ public interface EnvironmentVersionsClient { * @return a paginated list of EnvironmentVersion entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, - String workspaceName, - String name, - String orderBy, - Integer top, - String skip, - ListViewType listViewType, - Context context); + PagedIterable list(String resourceGroupName, String workspaceName, String name, + String orderBy, Integer top, String skip, ListViewType listViewType, Context context); /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -69,12 +67,12 @@ PagedIterable list( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context); + Response deleteWithResponse(String resourceGroupName, String workspaceName, String name, String version, + Context context); /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -88,7 +86,7 @@ Response deleteWithResponse( /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -100,12 +98,12 @@ Response deleteWithResponse( * @return version along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context); + Response getWithResponse(String resourceGroupName, String workspaceName, String name, + String version, Context context); /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -120,7 +118,7 @@ Response getWithResponse( /** * Creates or updates an EnvironmentVersion. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Name of EnvironmentVersion. This is case-sensitive. @@ -133,17 +131,12 @@ Response getWithResponse( * @return azure Resource Manager resource envelope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String name, - String version, - EnvironmentVersionInner body, - Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String name, String version, EnvironmentVersionInner body, Context context); /** * Creates or updates an EnvironmentVersion. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Name of EnvironmentVersion. This is case-sensitive. @@ -155,6 +148,73 @@ Response createOrUpdateWithResponse( * @return azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - EnvironmentVersionInner createOrUpdate( - String resourceGroupName, String workspaceName, String name, String version, EnvironmentVersionInner body); + EnvironmentVersionInner createOrUpdate(String resourceGroupName, String workspaceName, String name, String version, + EnvironmentVersionInner body); + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginPublish(String resourceGroupName, String workspaceName, String name, + String version, DestinationAsset body); + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginPublish(String resourceGroupName, String workspaceName, String name, + String version, DestinationAsset body, Context context); + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void publish(String resourceGroupName, String workspaceName, String name, String version, DestinationAsset body); + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void publish(String resourceGroupName, String workspaceName, String name, String version, DestinationAsset body, + Context context); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/FeaturesClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/FeaturesClient.java new file mode 100644 index 0000000000000..ed237ab0ca7cd --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/FeaturesClient.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.FeatureInner; +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** + * An instance of this class provides access to all the operations defined in FeaturesClient. + */ +public interface FeaturesClient { + /** + * List Features. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Featureset name. This is case-sensitive. + * @param featuresetVersion Featureset Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Feature entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String featuresetName, + String featuresetVersion); + + /** + * List Features. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Featureset name. This is case-sensitive. + * @param featuresetVersion Featureset Version identifier. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param featureName feature name. + * @param description Description of the featureset. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize Page size. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Feature entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String featuresetName, + String featuresetVersion, String skip, String tags, String featureName, String description, + ListViewType listViewType, Integer pageSize, Context context); + + /** + * Get feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Feature set name. This is case-sensitive. + * @param featuresetVersion Feature set version identifier. This is case-sensitive. + * @param featureName Feature Name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return feature along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String workspaceName, String featuresetName, + String featuresetVersion, String featureName, Context context); + + /** + * Get feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Feature set name. This is case-sensitive. + * @param featuresetVersion Feature set version identifier. This is case-sensitive. + * @param featureName Feature Name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return feature. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FeatureInner get(String resourceGroupName, String workspaceName, String featuresetName, String featuresetVersion, + String featureName); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/FeaturesetContainersClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/FeaturesetContainersClient.java new file mode 100644 index 0000000000000..0ced038e3d205 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/FeaturesetContainersClient.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetContainerInner; +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** + * An instance of this class provides access to all the operations defined in FeaturesetContainersClient. + */ +public interface FeaturesetContainersClient { + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param name name for the featureset. + * @param description description for the feature set. + * @param createdBy createdBy user name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String skip, + String tags, ListViewType listViewType, Integer pageSize, String name, String description, String createdBy, + Context context); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String name); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String name, + Context context); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String name); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String name, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityWithResponse(String resourceGroupName, String workspaceName, + String name, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FeaturesetContainerInner getEntity(String resourceGroupName, String workspaceName, String name); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FeaturesetContainerInner> + beginCreateOrUpdate(String resourceGroupName, String workspaceName, String name, FeaturesetContainerInner body); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FeaturesetContainerInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String name, FeaturesetContainerInner body, Context context); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FeaturesetContainerInner createOrUpdate(String resourceGroupName, String workspaceName, String name, + FeaturesetContainerInner body); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FeaturesetContainerInner createOrUpdate(String resourceGroupName, String workspaceName, String name, + FeaturesetContainerInner body, Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/FeaturesetVersionsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/FeaturesetVersionsClient.java new file mode 100644 index 0000000000000..86b8128c91afd --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/FeaturesetVersionsClient.java @@ -0,0 +1,301 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetVersionBackfillResponseInner; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetVersionInner; +import com.azure.resourcemanager.machinelearning.models.FeaturesetVersionBackfillRequest; +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** + * An instance of this class provides access to all the operations defined in FeaturesetVersionsClient. + */ +public interface FeaturesetVersionsClient { + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Featureset name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String name); + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Featureset name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param versionName name for the featureset version. + * @param version featureset version. + * @param description description for the feature set version. + * @param createdBy createdBy user name. + * @param stage Specifies the featurestore stage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String name, String skip, + String tags, ListViewType listViewType, Integer pageSize, String versionName, String version, + String description, String createdBy, String stage, Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String name, + String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String name, + String version, Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String name, String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String name, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String workspaceName, String name, + String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FeaturesetVersionInner get(String resourceGroupName, String workspaceName, String name, String version); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FeaturesetVersionInner> beginCreateOrUpdate(String resourceGroupName, + String workspaceName, String name, String version, FeaturesetVersionInner body); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FeaturesetVersionInner> beginCreateOrUpdate(String resourceGroupName, + String workspaceName, String name, String version, FeaturesetVersionInner body, Context context); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FeaturesetVersionInner createOrUpdate(String resourceGroupName, String workspaceName, String name, String version, + FeaturesetVersionInner body); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FeaturesetVersionInner createOrUpdate(String resourceGroupName, String workspaceName, String name, String version, + FeaturesetVersionInner body, Context context); + + /** + * Backfill. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Feature set version backfill request entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of response payload for creating a backfill request for a given + * feature set version. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FeaturesetVersionBackfillResponseInner> + beginBackfill(String resourceGroupName, String workspaceName, String name, String version, + FeaturesetVersionBackfillRequest body); + + /** + * Backfill. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Feature set version backfill request entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of response payload for creating a backfill request for a given + * feature set version. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FeaturesetVersionBackfillResponseInner> + beginBackfill(String resourceGroupName, String workspaceName, String name, String version, + FeaturesetVersionBackfillRequest body, Context context); + + /** + * Backfill. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Feature set version backfill request entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response payload for creating a backfill request for a given feature set version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FeaturesetVersionBackfillResponseInner backfill(String resourceGroupName, String workspaceName, String name, + String version, FeaturesetVersionBackfillRequest body); + + /** + * Backfill. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Feature set version backfill request entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response payload for creating a backfill request for a given feature set version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FeaturesetVersionBackfillResponseInner backfill(String resourceGroupName, String workspaceName, String name, + String version, FeaturesetVersionBackfillRequest body, Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/FeaturestoreEntityContainersClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/FeaturestoreEntityContainersClient.java new file mode 100644 index 0000000000000..dee9cb58f7205 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/FeaturestoreEntityContainersClient.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturestoreEntityContainerInner; +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** + * An instance of this class provides access to all the operations defined in FeaturestoreEntityContainersClient. + */ +public interface FeaturestoreEntityContainersClient { + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityContainer entities as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param name name for the featurestore entity. + * @param description description for the featurestore entity. + * @param createdBy createdBy user name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityContainer entities as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String skip, + String tags, ListViewType listViewType, Integer pageSize, String name, String description, String createdBy, + Context context); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String name); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String name, + Context context); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String name); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String name, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityWithResponse(String resourceGroupName, String workspaceName, + String name, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FeaturestoreEntityContainerInner getEntity(String resourceGroupName, String workspaceName, String name); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FeaturestoreEntityContainerInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String name, FeaturestoreEntityContainerInner body); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FeaturestoreEntityContainerInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String name, FeaturestoreEntityContainerInner body, + Context context); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FeaturestoreEntityContainerInner createOrUpdate(String resourceGroupName, String workspaceName, String name, + FeaturestoreEntityContainerInner body); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FeaturestoreEntityContainerInner createOrUpdate(String resourceGroupName, String workspaceName, String name, + FeaturestoreEntityContainerInner body, Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/FeaturestoreEntityVersionsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/FeaturestoreEntityVersionsClient.java new file mode 100644 index 0000000000000..aa9d4b1c549b9 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/FeaturestoreEntityVersionsClient.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturestoreEntityVersionInner; +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** + * An instance of this class provides access to all the operations defined in FeaturestoreEntityVersionsClient. + */ +public interface FeaturestoreEntityVersionsClient { + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Feature entity name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String name); + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Feature entity name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param versionName name for the featurestore entity version. + * @param version featurestore entity version. + * @param description description for the feature entity version. + * @param createdBy createdBy user name. + * @param stage Specifies the featurestore stage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String name, + String skip, String tags, ListViewType listViewType, Integer pageSize, String versionName, String version, + String description, String createdBy, String stage, Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String name, + String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String name, + String version, Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String name, String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String name, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String workspaceName, + String name, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FeaturestoreEntityVersionInner get(String resourceGroupName, String workspaceName, String name, String version); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FeaturestoreEntityVersionInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String name, String version, + FeaturestoreEntityVersionInner body); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FeaturestoreEntityVersionInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String name, String version, + FeaturestoreEntityVersionInner body, Context context); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FeaturestoreEntityVersionInner createOrUpdate(String resourceGroupName, String workspaceName, String name, + String version, FeaturestoreEntityVersionInner body); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FeaturestoreEntityVersionInner createOrUpdate(String resourceGroupName, String workspaceName, String name, + String version, FeaturestoreEntityVersionInner body, Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/JobsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/JobsClient.java index c4660d91fa818..68a22330dae08 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/JobsClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/JobsClient.java @@ -14,11 +14,13 @@ import com.azure.resourcemanager.machinelearning.fluent.models.JobBaseInner; import com.azure.resourcemanager.machinelearning.models.ListViewType; -/** An instance of this class provides access to all the operations defined in JobsClient. */ +/** + * An instance of this class provides access to all the operations defined in JobsClient. + */ public interface JobsClient { /** * Lists Jobs in the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -31,13 +33,15 @@ public interface JobsClient { /** * Lists Jobs in the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. * @param jobType Type of job to be returned. * @param tag Jobs returned will have this tag key. * @param listViewType View type for including/excluding (for example) archived entities. + * @param properties Comma-separated list of user property names (and optionally values). Example: + * prop1,prop2=value2. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -45,18 +49,12 @@ public interface JobsClient { * @return a paginated list of JobBase entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, - String workspaceName, - String skip, - String jobType, - String tag, - ListViewType listViewType, - Context context); + PagedIterable list(String resourceGroupName, String workspaceName, String skip, String jobType, + String tag, ListViewType listViewType, String properties, Context context); /** * Deletes a Job (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -70,7 +68,7 @@ PagedIterable list( /** * Deletes a Job (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -81,12 +79,12 @@ PagedIterable list( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String workspaceName, String id, Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String id, + Context context); /** * Deletes a Job (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -99,7 +97,7 @@ SyncPoller, Void> beginDelete( /** * Deletes a Job (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -113,7 +111,7 @@ SyncPoller, Void> beginDelete( /** * Gets a Job by name/id. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -128,7 +126,7 @@ SyncPoller, Void> beginDelete( /** * Gets a Job by name/id. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -142,7 +140,8 @@ SyncPoller, Void> beginDelete( /** * Creates and executes a Job. - * + * For update case, the Tags in the definition passed in will replace Tags in the existing job. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -154,12 +153,13 @@ SyncPoller, Void> beginDelete( * @return azure Resource Manager resource envelope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, String workspaceName, String id, JobBaseInner body, Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, String id, + JobBaseInner body, Context context); /** * Creates and executes a Job. - * + * For update case, the Tags in the definition passed in will replace Tags in the existing job. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -174,7 +174,7 @@ Response createOrUpdateWithResponse( /** * Cancels a Job (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -188,7 +188,7 @@ Response createOrUpdateWithResponse( /** * Cancels a Job (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -199,12 +199,12 @@ Response createOrUpdateWithResponse( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginCancel( - String resourceGroupName, String workspaceName, String id, Context context); + SyncPoller, Void> beginCancel(String resourceGroupName, String workspaceName, String id, + Context context); /** * Cancels a Job (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -217,7 +217,7 @@ SyncPoller, Void> beginCancel( /** * Cancels a Job (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ManagedNetworkProvisionsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ManagedNetworkProvisionsClient.java new file mode 100644 index 0000000000000..1d352bc171417 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ManagedNetworkProvisionsClient.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.models.ManagedNetworkProvisionStatusInner; +import com.azure.resourcemanager.machinelearning.models.ManagedNetworkProvisionOptions; + +/** + * An instance of this class provides access to all the operations defined in ManagedNetworkProvisionsClient. + */ +public interface ManagedNetworkProvisionsClient { + /** + * Provisions the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of status of the Provisioning for the managed network of a machine + * learning workspace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ManagedNetworkProvisionStatusInner> + beginProvisionManagedNetwork(String resourceGroupName, String workspaceName); + + /** + * Provisions the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param body Managed Network Provisioning Options for a machine learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of status of the Provisioning for the managed network of a machine + * learning workspace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ManagedNetworkProvisionStatusInner> + beginProvisionManagedNetwork(String resourceGroupName, String workspaceName, + ManagedNetworkProvisionOptions body, Context context); + + /** + * Provisions the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of the Provisioning for the managed network of a machine learning workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedNetworkProvisionStatusInner provisionManagedNetwork(String resourceGroupName, String workspaceName); + + /** + * Provisions the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param body Managed Network Provisioning Options for a machine learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of the Provisioning for the managed network of a machine learning workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedNetworkProvisionStatusInner provisionManagedNetwork(String resourceGroupName, String workspaceName, + ManagedNetworkProvisionOptions body, Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ManagedNetworkSettingsRulesClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ManagedNetworkSettingsRulesClient.java new file mode 100644 index 0000000000000..e092cd4e3ab95 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ManagedNetworkSettingsRulesClient.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.models.OutboundRuleBasicResourceInner; + +/** + * An instance of this class provides access to all the operations defined in ManagedNetworkSettingsRulesClient. + */ +public interface ManagedNetworkSettingsRulesClient { + /** + * Lists the managed network outbound rules for a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of outbound rules for the managed network of a machine learning workspace as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Lists the managed network outbound rules for a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of outbound rules for the managed network of a machine learning workspace as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, Context context); + + /** + * Deletes an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String ruleName); + + /** + * Deletes an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String ruleName, + Context context); + + /** + * Deletes an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String ruleName); + + /** + * Deletes an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String ruleName, Context context); + + /** + * Gets an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an outbound rule from the managed network of a machine learning workspace along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String workspaceName, + String ruleName, Context context); + + /** + * Gets an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an outbound rule from the managed network of a machine learning workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OutboundRuleBasicResourceInner get(String resourceGroupName, String workspaceName, String ruleName); + + /** + * Creates or updates an outbound rule in the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param body Outbound Rule to be created or updated in the managed network of a machine learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of outbound Rule Basic Resource for the managed network of a machine + * learning workspace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OutboundRuleBasicResourceInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String ruleName, OutboundRuleBasicResourceInner body); + + /** + * Creates or updates an outbound rule in the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param body Outbound Rule to be created or updated in the managed network of a machine learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of outbound Rule Basic Resource for the managed network of a machine + * learning workspace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OutboundRuleBasicResourceInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String ruleName, OutboundRuleBasicResourceInner body, + Context context); + + /** + * Creates or updates an outbound rule in the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param body Outbound Rule to be created or updated in the managed network of a machine learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return outbound Rule Basic Resource for the managed network of a machine learning workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OutboundRuleBasicResourceInner createOrUpdate(String resourceGroupName, String workspaceName, String ruleName, + OutboundRuleBasicResourceInner body); + + /** + * Creates or updates an outbound rule in the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param body Outbound Rule to be created or updated in the managed network of a machine learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return outbound Rule Basic Resource for the managed network of a machine learning workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OutboundRuleBasicResourceInner createOrUpdate(String resourceGroupName, String workspaceName, String ruleName, + OutboundRuleBasicResourceInner body, Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/MarketplaceSubscriptionsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/MarketplaceSubscriptionsClient.java new file mode 100644 index 0000000000000..33ef9a340bac5 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/MarketplaceSubscriptionsClient.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.models.MarketplaceSubscriptionInner; + +/** + * An instance of this class provides access to all the operations defined in MarketplaceSubscriptionsClient. + */ +public interface MarketplaceSubscriptionsClient { + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of MarketplaceSubscription entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of MarketplaceSubscription entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String skip, + Context context); + + /** + * Delete Marketplace Subscription (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Marketplace Subscription name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String name); + + /** + * Delete Marketplace Subscription (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Marketplace Subscription name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String name, + Context context); + + /** + * Delete Marketplace Subscription (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Marketplace Subscription name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String name); + + /** + * Delete Marketplace Subscription (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Marketplace Subscription name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String name, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String workspaceName, String name, + Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MarketplaceSubscriptionInner get(String resourceGroupName, String workspaceName, String name); + + /** + * Create or update Marketplace Subscription (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Marketplace Subscription name. + * @param body Marketplace Subscription entity to apply during operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MarketplaceSubscriptionInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String name, MarketplaceSubscriptionInner body); + + /** + * Create or update Marketplace Subscription (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Marketplace Subscription name. + * @param body Marketplace Subscription entity to apply during operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MarketplaceSubscriptionInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String name, MarketplaceSubscriptionInner body, + Context context); + + /** + * Create or update Marketplace Subscription (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Marketplace Subscription name. + * @param body Marketplace Subscription entity to apply during operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MarketplaceSubscriptionInner createOrUpdate(String resourceGroupName, String workspaceName, String name, + MarketplaceSubscriptionInner body); + + /** + * Create or update Marketplace Subscription (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Marketplace Subscription name. + * @param body Marketplace Subscription entity to apply during operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MarketplaceSubscriptionInner createOrUpdate(String resourceGroupName, String workspaceName, String name, + MarketplaceSubscriptionInner body, Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ModelContainersClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ModelContainersClient.java index 980ec45c56a38..847e25e1e82a9 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ModelContainersClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ModelContainersClient.java @@ -12,11 +12,13 @@ import com.azure.resourcemanager.machinelearning.fluent.models.ModelContainerInner; import com.azure.resourcemanager.machinelearning.models.ListViewType; -/** An instance of this class provides access to all the operations defined in ModelContainersClient. */ +/** + * An instance of this class provides access to all the operations defined in ModelContainersClient. + */ public interface ModelContainersClient { /** * List model containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -29,7 +31,7 @@ public interface ModelContainersClient { /** * List model containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -42,17 +44,12 @@ public interface ModelContainersClient { * @return a paginated list of ModelContainer entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, - String workspaceName, - String skip, - Integer count, - ListViewType listViewType, - Context context); + PagedIterable list(String resourceGroupName, String workspaceName, String skip, Integer count, + ListViewType listViewType, Context context); /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -67,7 +64,7 @@ PagedIterable list( /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -80,7 +77,7 @@ PagedIterable list( /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -91,12 +88,12 @@ PagedIterable list( * @return container along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String name, Context context); + Response getWithResponse(String resourceGroupName, String workspaceName, String name, + Context context); /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -110,7 +107,7 @@ Response getWithResponse( /** * Create or update container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -122,12 +119,12 @@ Response getWithResponse( * @return azure Resource Manager resource envelope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, String workspaceName, String name, ModelContainerInner body, Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String name, ModelContainerInner body, Context context); /** * Create or update container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -138,6 +135,6 @@ Response createOrUpdateWithResponse( * @return azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - ModelContainerInner createOrUpdate( - String resourceGroupName, String workspaceName, String name, ModelContainerInner body); + ModelContainerInner createOrUpdate(String resourceGroupName, String workspaceName, String name, + ModelContainerInner body); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ModelVersionsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ModelVersionsClient.java index 92582d819da13..f331fba8cb0cb 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ModelVersionsClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ModelVersionsClient.java @@ -8,15 +8,20 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.machinelearning.fluent.models.ModelVersionInner; +import com.azure.resourcemanager.machinelearning.models.DestinationAsset; import com.azure.resourcemanager.machinelearning.models.ListViewType; -/** An instance of this class provides access to all the operations defined in ModelVersionsClient. */ +/** + * An instance of this class provides access to all the operations defined in ModelVersionsClient. + */ public interface ModelVersionsClient { /** * List model versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Model name. This is case-sensitive. @@ -30,7 +35,7 @@ public interface ModelVersionsClient { /** * List model versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Model name. This is case-sensitive. @@ -51,25 +56,13 @@ public interface ModelVersionsClient { * @return a paginated list of ModelVersion entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, - String workspaceName, - String name, - String skip, - String orderBy, - Integer top, - String version, - String description, - Integer offset, - String tags, - String properties, - String feed, - ListViewType listViewType, - Context context); + PagedIterable list(String resourceGroupName, String workspaceName, String name, String skip, + String orderBy, Integer top, String version, String description, Integer offset, String tags, String properties, + String feed, ListViewType listViewType, Context context); /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -81,12 +74,12 @@ PagedIterable list( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context); + Response deleteWithResponse(String resourceGroupName, String workspaceName, String name, String version, + Context context); /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -100,7 +93,7 @@ Response deleteWithResponse( /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -112,12 +105,12 @@ Response deleteWithResponse( * @return version along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context); + Response getWithResponse(String resourceGroupName, String workspaceName, String name, + String version, Context context); /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -132,7 +125,7 @@ Response getWithResponse( /** * Create or update version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -145,17 +138,12 @@ Response getWithResponse( * @return azure Resource Manager resource envelope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String name, - String version, - ModelVersionInner body, - Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, String name, + String version, ModelVersionInner body, Context context); /** * Create or update version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -167,6 +155,73 @@ Response createOrUpdateWithResponse( * @return azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - ModelVersionInner createOrUpdate( - String resourceGroupName, String workspaceName, String name, String version, ModelVersionInner body); + ModelVersionInner createOrUpdate(String resourceGroupName, String workspaceName, String name, String version, + ModelVersionInner body); + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginPublish(String resourceGroupName, String workspaceName, String name, + String version, DestinationAsset body); + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginPublish(String resourceGroupName, String workspaceName, String name, + String version, DestinationAsset body, Context context); + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void publish(String resourceGroupName, String workspaceName, String name, String version, DestinationAsset body); + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void publish(String resourceGroupName, String workspaceName, String name, String version, DestinationAsset body, + Context context); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/OnlineDeploymentsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/OnlineDeploymentsClient.java index 8b20629178a8b..0f4e1a6102b29 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/OnlineDeploymentsClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/OnlineDeploymentsClient.java @@ -17,11 +17,13 @@ import com.azure.resourcemanager.machinelearning.models.DeploymentLogsRequest; import com.azure.resourcemanager.machinelearning.models.PartialMinimalTrackedResourceWithSku; -/** An instance of this class provides access to all the operations defined in OnlineDeploymentsClient. */ +/** + * An instance of this class provides access to all the operations defined in OnlineDeploymentsClient. + */ public interface OnlineDeploymentsClient { /** * List Inference Endpoint Deployments. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -35,7 +37,7 @@ public interface OnlineDeploymentsClient { /** * List Inference Endpoint Deployments. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -49,18 +51,12 @@ public interface OnlineDeploymentsClient { * @return a paginated list of OnlineDeployment entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, - String workspaceName, - String endpointName, - String orderBy, - Integer top, - String skip, - Context context); + PagedIterable list(String resourceGroupName, String workspaceName, String endpointName, + String orderBy, Integer top, String skip, Context context); /** * Delete Inference Endpoint Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -71,12 +67,12 @@ PagedIterable list( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName); + SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName); /** * Delete Inference Endpoint Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -88,12 +84,12 @@ SyncPoller, Void> beginDelete( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName, Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName, Context context); /** * Delete Inference Endpoint Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -107,7 +103,7 @@ SyncPoller, Void> beginDelete( /** * Delete Inference Endpoint Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -118,12 +114,12 @@ SyncPoller, Void> beginDelete( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName, Context context); + void delete(String resourceGroupName, String workspaceName, String endpointName, String deploymentName, + Context context); /** * Get Inference Deployment Deployment. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -135,12 +131,12 @@ void delete( * @return inference Deployment Deployment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName, Context context); + Response getWithResponse(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName, Context context); /** * Get Inference Deployment Deployment. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -151,12 +147,12 @@ Response getWithResponse( * @return inference Deployment Deployment. */ @ServiceMethod(returns = ReturnType.SINGLE) - OnlineDeploymentInner get( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName); + OnlineDeploymentInner get(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName); /** * Update Online Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -168,16 +164,12 @@ OnlineDeploymentInner get( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OnlineDeploymentInner> beginUpdate( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - PartialMinimalTrackedResourceWithSku body); + SyncPoller, OnlineDeploymentInner> beginUpdate(String resourceGroupName, + String workspaceName, String endpointName, String deploymentName, PartialMinimalTrackedResourceWithSku body); /** * Update Online Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -190,17 +182,13 @@ SyncPoller, OnlineDeploymentInner> beginUpdate * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OnlineDeploymentInner> beginUpdate( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - PartialMinimalTrackedResourceWithSku body, + SyncPoller, OnlineDeploymentInner> beginUpdate(String resourceGroupName, + String workspaceName, String endpointName, String deploymentName, PartialMinimalTrackedResourceWithSku body, Context context); /** * Update Online Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -212,16 +200,12 @@ SyncPoller, OnlineDeploymentInner> beginUpdate * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - OnlineDeploymentInner update( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - PartialMinimalTrackedResourceWithSku body); + OnlineDeploymentInner update(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName, PartialMinimalTrackedResourceWithSku body); /** * Update Online Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -234,17 +218,12 @@ OnlineDeploymentInner update( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - OnlineDeploymentInner update( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - PartialMinimalTrackedResourceWithSku body, - Context context); + OnlineDeploymentInner update(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName, PartialMinimalTrackedResourceWithSku body, Context context); /** * Create or update Inference Endpoint Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -256,16 +235,12 @@ OnlineDeploymentInner update( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OnlineDeploymentInner> beginCreateOrUpdate( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - OnlineDeploymentInner body); + SyncPoller, OnlineDeploymentInner> beginCreateOrUpdate(String resourceGroupName, + String workspaceName, String endpointName, String deploymentName, OnlineDeploymentInner body); /** * Create or update Inference Endpoint Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -278,17 +253,12 @@ SyncPoller, OnlineDeploymentInner> beginCreate * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OnlineDeploymentInner> beginCreateOrUpdate( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - OnlineDeploymentInner body, - Context context); + SyncPoller, OnlineDeploymentInner> beginCreateOrUpdate(String resourceGroupName, + String workspaceName, String endpointName, String deploymentName, OnlineDeploymentInner body, Context context); /** * Create or update Inference Endpoint Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -300,16 +270,12 @@ SyncPoller, OnlineDeploymentInner> beginCreate * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - OnlineDeploymentInner createOrUpdate( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - OnlineDeploymentInner body); + OnlineDeploymentInner createOrUpdate(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName, OnlineDeploymentInner body); /** * Create or update Inference Endpoint Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -322,17 +288,12 @@ OnlineDeploymentInner createOrUpdate( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - OnlineDeploymentInner createOrUpdate( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - OnlineDeploymentInner body, - Context context); + OnlineDeploymentInner createOrUpdate(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName, OnlineDeploymentInner body, Context context); /** * Polls an Endpoint operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -345,17 +306,12 @@ OnlineDeploymentInner createOrUpdate( * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getLogsWithResponse( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - DeploymentLogsRequest body, - Context context); + Response getLogsWithResponse(String resourceGroupName, String workspaceName, + String endpointName, String deploymentName, DeploymentLogsRequest body, Context context); /** * Polls an Endpoint operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -367,16 +323,12 @@ Response getLogsWithResponse( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentLogsInner getLogs( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - DeploymentLogsRequest body); + DeploymentLogsInner getLogs(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName, DeploymentLogsRequest body); /** * List Inference Endpoint Deployment Skus. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -387,12 +339,12 @@ DeploymentLogsInner getLogs( * @return a paginated list of SkuResource entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSkus( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName); + PagedIterable listSkus(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName); /** * List Inference Endpoint Deployment Skus. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -406,12 +358,6 @@ PagedIterable listSkus( * @return a paginated list of SkuResource entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSkus( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - Integer count, - String skip, - Context context); + PagedIterable listSkus(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName, Integer count, String skip, Context context); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/OnlineEndpointsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/OnlineEndpointsClient.java index 8b04958fc924d..0eb371edea142 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/OnlineEndpointsClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/OnlineEndpointsClient.java @@ -19,11 +19,13 @@ import com.azure.resourcemanager.machinelearning.models.PartialMinimalTrackedResourceWithIdentity; import com.azure.resourcemanager.machinelearning.models.RegenerateEndpointKeysRequest; -/** An instance of this class provides access to all the operations defined in OnlineEndpointsClient. */ +/** + * An instance of this class provides access to all the operations defined in OnlineEndpointsClient. + */ public interface OnlineEndpointsClient { /** * List Online Endpoints. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -36,7 +38,7 @@ public interface OnlineEndpointsClient { /** * List Online Endpoints. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Name of the endpoint. @@ -44,9 +46,9 @@ public interface OnlineEndpointsClient { * @param computeType EndpointComputeType to be filtered by. * @param skip Continuation token for pagination. * @param tags A set of tags with which to filter the returned models. It is a comma separated string of tags key or - * tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . + * tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . * @param properties A set of properties with which to filter the returned models. It is a comma separated string of - * properties key and/or properties key=value Example: propKey1,propKey2,propKey3=value3 . + * properties key and/or properties key=value Example: propKey1,propKey2,propKey3=value3 . * @param orderBy The option to order the response. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -55,21 +57,13 @@ public interface OnlineEndpointsClient { * @return a paginated list of OnlineEndpoint entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, - String workspaceName, - String name, - Integer count, - EndpointComputeType computeType, - String skip, - String tags, - String properties, - OrderString orderBy, + PagedIterable list(String resourceGroupName, String workspaceName, String name, Integer count, + EndpointComputeType computeType, String skip, String tags, String properties, OrderString orderBy, Context context); /** * Delete Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -83,7 +77,7 @@ PagedIterable list( /** * Delete Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -94,12 +88,12 @@ PagedIterable list( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String workspaceName, String endpointName, Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String endpointName, + Context context); /** * Delete Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -112,7 +106,7 @@ SyncPoller, Void> beginDelete( /** * Delete Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -126,7 +120,7 @@ SyncPoller, Void> beginDelete( /** * Get Online Endpoint. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -137,12 +131,12 @@ SyncPoller, Void> beginDelete( * @return online Endpoint along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String endpointName, Context context); + Response getWithResponse(String resourceGroupName, String workspaceName, String endpointName, + Context context); /** * Get Online Endpoint. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -156,7 +150,7 @@ Response getWithResponse( /** * Update Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -167,15 +161,12 @@ Response getWithResponse( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OnlineEndpointInner> beginUpdate( - String resourceGroupName, - String workspaceName, - String endpointName, - PartialMinimalTrackedResourceWithIdentity body); + SyncPoller, OnlineEndpointInner> beginUpdate(String resourceGroupName, + String workspaceName, String endpointName, PartialMinimalTrackedResourceWithIdentity body); /** * Update Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -187,16 +178,12 @@ SyncPoller, OnlineEndpointInner> beginUpdate( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OnlineEndpointInner> beginUpdate( - String resourceGroupName, - String workspaceName, - String endpointName, - PartialMinimalTrackedResourceWithIdentity body, - Context context); + SyncPoller, OnlineEndpointInner> beginUpdate(String resourceGroupName, + String workspaceName, String endpointName, PartialMinimalTrackedResourceWithIdentity body, Context context); /** * Update Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -207,15 +194,12 @@ SyncPoller, OnlineEndpointInner> beginUpdate( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - OnlineEndpointInner update( - String resourceGroupName, - String workspaceName, - String endpointName, + OnlineEndpointInner update(String resourceGroupName, String workspaceName, String endpointName, PartialMinimalTrackedResourceWithIdentity body); /** * Update Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -227,16 +211,12 @@ OnlineEndpointInner update( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - OnlineEndpointInner update( - String resourceGroupName, - String workspaceName, - String endpointName, - PartialMinimalTrackedResourceWithIdentity body, - Context context); + OnlineEndpointInner update(String resourceGroupName, String workspaceName, String endpointName, + PartialMinimalTrackedResourceWithIdentity body, Context context); /** * Create or update Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -247,12 +227,12 @@ OnlineEndpointInner update( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OnlineEndpointInner> beginCreateOrUpdate( - String resourceGroupName, String workspaceName, String endpointName, OnlineEndpointInner body); + SyncPoller, OnlineEndpointInner> beginCreateOrUpdate(String resourceGroupName, + String workspaceName, String endpointName, OnlineEndpointInner body); /** * Create or update Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -264,12 +244,12 @@ SyncPoller, OnlineEndpointInner> beginCreateOrUp * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OnlineEndpointInner> beginCreateOrUpdate( - String resourceGroupName, String workspaceName, String endpointName, OnlineEndpointInner body, Context context); + SyncPoller, OnlineEndpointInner> beginCreateOrUpdate(String resourceGroupName, + String workspaceName, String endpointName, OnlineEndpointInner body, Context context); /** * Create or update Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -280,12 +260,12 @@ SyncPoller, OnlineEndpointInner> beginCreateOrUp * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - OnlineEndpointInner createOrUpdate( - String resourceGroupName, String workspaceName, String endpointName, OnlineEndpointInner body); + OnlineEndpointInner createOrUpdate(String resourceGroupName, String workspaceName, String endpointName, + OnlineEndpointInner body); /** * Create or update Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -297,12 +277,12 @@ OnlineEndpointInner createOrUpdate( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - OnlineEndpointInner createOrUpdate( - String resourceGroupName, String workspaceName, String endpointName, OnlineEndpointInner body, Context context); + OnlineEndpointInner createOrUpdate(String resourceGroupName, String workspaceName, String endpointName, + OnlineEndpointInner body, Context context); /** * List EndpointAuthKeys for an Endpoint using Key-based authentication. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -313,12 +293,12 @@ OnlineEndpointInner createOrUpdate( * @return keys for endpoint authentication along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listKeysWithResponse( - String resourceGroupName, String workspaceName, String endpointName, Context context); + Response listKeysWithResponse(String resourceGroupName, String workspaceName, + String endpointName, Context context); /** * List EndpointAuthKeys for an Endpoint using Key-based authentication. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -332,7 +312,7 @@ Response listKeysWithResponse( /** * Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -343,12 +323,12 @@ Response listKeysWithResponse( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginRegenerateKeys( - String resourceGroupName, String workspaceName, String endpointName, RegenerateEndpointKeysRequest body); + SyncPoller, Void> beginRegenerateKeys(String resourceGroupName, String workspaceName, + String endpointName, RegenerateEndpointKeysRequest body); /** * Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -360,16 +340,12 @@ SyncPoller, Void> beginRegenerateKeys( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginRegenerateKeys( - String resourceGroupName, - String workspaceName, - String endpointName, - RegenerateEndpointKeysRequest body, - Context context); + SyncPoller, Void> beginRegenerateKeys(String resourceGroupName, String workspaceName, + String endpointName, RegenerateEndpointKeysRequest body, Context context); /** * Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -379,12 +355,12 @@ SyncPoller, Void> beginRegenerateKeys( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void regenerateKeys( - String resourceGroupName, String workspaceName, String endpointName, RegenerateEndpointKeysRequest body); + void regenerateKeys(String resourceGroupName, String workspaceName, String endpointName, + RegenerateEndpointKeysRequest body); /** * Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -395,16 +371,12 @@ void regenerateKeys( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void regenerateKeys( - String resourceGroupName, - String workspaceName, - String endpointName, - RegenerateEndpointKeysRequest body, - Context context); + void regenerateKeys(String resourceGroupName, String workspaceName, String endpointName, + RegenerateEndpointKeysRequest body, Context context); /** - * Retrieve a valid AAD token for an Endpoint using AMLToken-based authentication. - * + * Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -415,12 +387,12 @@ void regenerateKeys( * @return service Token along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getTokenWithResponse( - String resourceGroupName, String workspaceName, String endpointName, Context context); + Response getTokenWithResponse(String resourceGroupName, String workspaceName, + String endpointName, Context context); /** - * Retrieve a valid AAD token for an Endpoint using AMLToken-based authentication. - * + * Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/OperationsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/OperationsClient.java index cf8b8217b3035..b222e86651c94 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/OperationsClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/OperationsClient.java @@ -8,31 +8,33 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -import com.azure.resourcemanager.machinelearning.fluent.models.AmlOperationInner; +import com.azure.resourcemanager.machinelearning.fluent.models.OperationInner; -/** An instance of this class provides access to all the operations defined in OperationsClient. */ +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ public interface OperationsClient { /** * Lists all of the available Azure Machine Learning Workspaces REST API operations. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an array of operations supported by the resource provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + PagedIterable list(); /** * Lists all of the available Azure Machine Learning Workspaces REST API operations. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an array of operations supported by the resource provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + PagedIterable list(Context context); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/PrivateEndpointConnectionsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/PrivateEndpointConnectionsClient.java index 2b613c7f88e3f..b3867155b4b7b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/PrivateEndpointConnectionsClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/PrivateEndpointConnectionsClient.java @@ -11,25 +11,27 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.machinelearning.fluent.models.PrivateEndpointConnectionInner; -/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +/** + * An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. + */ public interface PrivateEndpointConnectionsClient { /** * List all the private endpoint connections associated with the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of private endpoint connection associated with the specified workspace as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String workspaceName); /** * List all the private endpoint connections associated with the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -37,14 +39,14 @@ public interface PrivateEndpointConnectionsClient { * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of private endpoint connection associated with the specified workspace as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String workspaceName, Context context); /** * Gets the specified private endpoint connection associated with the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. @@ -55,12 +57,12 @@ public interface PrivateEndpointConnectionsClient { * @return the specified private endpoint connection associated with the workspace along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context); + Response getWithResponse(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName, Context context); /** * Gets the specified private endpoint connection associated with the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. @@ -70,12 +72,12 @@ Response getWithResponse( * @return the specified private endpoint connection associated with the workspace. */ @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner get( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName); + PrivateEndpointConnectionInner get(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName); /** * Update the state of specified private endpoint connection associated with the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. @@ -87,16 +89,12 @@ PrivateEndpointConnectionInner get( * @return the Private Endpoint Connection resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties, - Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner properties, Context context); /** * Update the state of specified private endpoint connection associated with the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. @@ -107,15 +105,12 @@ Response createOrUpdateWithResponse( * @return the Private Endpoint Connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner createOrUpdate( - String resourceGroupName, - String workspaceName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties); + PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner properties); /** * Deletes the specified private endpoint connection associated with the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. @@ -126,12 +121,12 @@ PrivateEndpointConnectionInner createOrUpdate( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context); + Response deleteWithResponse(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName, Context context); /** * Deletes the specified private endpoint connection associated with the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/PrivateLinkResourcesClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/PrivateLinkResourcesClient.java index 1dc6edf69f64a..c40a3ce213ae6 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/PrivateLinkResourcesClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/PrivateLinkResourcesClient.java @@ -10,11 +10,13 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.machinelearning.fluent.models.PrivateLinkResourceListResultInner; -/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ +/** + * An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. + */ public interface PrivateLinkResourcesClient { /** * Gets the private link resources that need to be created for a workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -24,12 +26,12 @@ public interface PrivateLinkResourcesClient { * @return the private link resources that need to be created for a workspace along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse( - String resourceGroupName, String workspaceName, Context context); + Response listWithResponse(String resourceGroupName, String workspaceName, + Context context); /** * Gets the private link resources that need to be created for a workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/QuotasClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/QuotasClient.java index f7d696e1bf38f..bff12926f7fb4 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/QuotasClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/QuotasClient.java @@ -13,11 +13,13 @@ import com.azure.resourcemanager.machinelearning.fluent.models.UpdateWorkspaceQuotasResultInner; import com.azure.resourcemanager.machinelearning.models.QuotaUpdateParameters; -/** An instance of this class provides access to all the operations defined in QuotasClient. */ +/** + * An instance of this class provides access to all the operations defined in QuotasClient. + */ public interface QuotasClient { /** * Update quota for each VM family in workspace. - * + * * @param location The location for update quota is queried. * @param parameters Quota update parameters. * @param context The context to associate with this operation. @@ -27,12 +29,12 @@ public interface QuotasClient { * @return the result of update workspace quota along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String location, QuotaUpdateParameters parameters, Context context); + Response updateWithResponse(String location, QuotaUpdateParameters parameters, + Context context); /** * Update quota for each VM family in workspace. - * + * * @param location The location for update quota is queried. * @param parameters Quota update parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -45,27 +47,27 @@ Response updateWithResponse( /** * Gets the currently assigned Workspace Quotas based on VMFamily. - * + * * @param location The location for which resource usage is queried. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently assigned Workspace Quotas based on VMFamily as paginated response with {@link - * PagedIterable}. + * @return the currently assigned Workspace Quotas based on VMFamily as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String location); /** * Gets the currently assigned Workspace Quotas based on VMFamily. - * + * * @param location The location for which resource usage is queried. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently assigned Workspace Quotas based on VMFamily as paginated response with {@link - * PagedIterable}. + * @return the currently assigned Workspace Quotas based on VMFamily as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String location, Context context); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistriesClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistriesClient.java new file mode 100644 index 0000000000000..30efcfc24822b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistriesClient.java @@ -0,0 +1,297 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.models.RegistryInner; +import com.azure.resourcemanager.machinelearning.models.PartialRegistryPartialTrackedResource; + +/** + * An instance of this class provides access to all the operations defined in RegistriesClient. + */ +public interface RegistriesClient { + /** + * List registries by subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List registries by subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List registries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List registries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Delete registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName); + + /** + * Delete registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, Context context); + + /** + * Delete registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName); + + /** + * Delete registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, Context context); + + /** + * Get registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registry along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String registryName, + Context context); + + /** + * Get registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegistryInner getByResourceGroup(String resourceGroupName, String registryName); + + /** + * Update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String registryName, + PartialRegistryPartialTrackedResource body, Context context); + + /** + * Update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegistryInner update(String resourceGroupName, String registryName, PartialRegistryPartialTrackedResource body); + + /** + * Create or update registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RegistryInner> beginCreateOrUpdate(String resourceGroupName, + String registryName, RegistryInner body); + + /** + * Create or update registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RegistryInner> beginCreateOrUpdate(String resourceGroupName, + String registryName, RegistryInner body, Context context); + + /** + * Create or update registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegistryInner createOrUpdate(String resourceGroupName, String registryName, RegistryInner body); + + /** + * Create or update registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegistryInner createOrUpdate(String resourceGroupName, String registryName, RegistryInner body, Context context); + + /** + * Remove regions from registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RegistryInner> beginRemoveRegions(String resourceGroupName, + String registryName, RegistryInner body); + + /** + * Remove regions from registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RegistryInner> beginRemoveRegions(String resourceGroupName, + String registryName, RegistryInner body, Context context); + + /** + * Remove regions from registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegistryInner removeRegions(String resourceGroupName, String registryName, RegistryInner body); + + /** + * Remove regions from registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegistryInner removeRegions(String resourceGroupName, String registryName, RegistryInner body, Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryCodeContainersClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryCodeContainersClient.java new file mode 100644 index 0000000000000..db782ef7731df --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryCodeContainersClient.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.models.CodeContainerInner; + +/** + * An instance of this class provides access to all the operations defined in RegistryCodeContainersClient. + */ +public interface RegistryCodeContainersClient { + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName); + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, String skip, Context context); + + /** + * Delete Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String codeName); + + /** + * Delete Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String codeName, + Context context); + + /** + * Delete Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String codeName); + + /** + * Delete Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String codeName, Context context); + + /** + * Get Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return code container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String registryName, String codeName, + Context context); + + /** + * Get Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return code container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CodeContainerInner get(String resourceGroupName, String registryName, String codeName); + + /** + * Create or update Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CodeContainerInner> beginCreateOrUpdate(String resourceGroupName, + String registryName, String codeName, CodeContainerInner body); + + /** + * Create or update Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CodeContainerInner> beginCreateOrUpdate(String resourceGroupName, + String registryName, String codeName, CodeContainerInner body, Context context); + + /** + * Create or update Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CodeContainerInner createOrUpdate(String resourceGroupName, String registryName, String codeName, + CodeContainerInner body); + + /** + * Create or update Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CodeContainerInner createOrUpdate(String resourceGroupName, String registryName, String codeName, + CodeContainerInner body, Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryCodeVersionsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryCodeVersionsClient.java new file mode 100644 index 0000000000000..abda21cb6547f --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryCodeVersionsClient.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.models.CodeVersionInner; +import com.azure.resourcemanager.machinelearning.fluent.models.PendingUploadResponseDtoInner; +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; + +/** + * An instance of this class provides access to all the operations defined in RegistryCodeVersionsClient. + */ +public interface RegistryCodeVersionsClient { + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, String codeName); + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, String codeName, String orderBy, + Integer top, String skip, Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String codeName, + String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String codeName, + String version, Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String codeName, String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String codeName, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String registryName, String codeName, + String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CodeVersionInner get(String resourceGroupName, String registryName, String codeName, String version); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CodeVersionInner> beginCreateOrUpdate(String resourceGroupName, + String registryName, String codeName, String version, CodeVersionInner body); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CodeVersionInner> beginCreateOrUpdate(String resourceGroupName, + String registryName, String codeName, String version, CodeVersionInner body, Context context); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CodeVersionInner createOrUpdate(String resourceGroupName, String registryName, String codeName, String version, + CodeVersionInner body); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CodeVersionInner createOrUpdate(String resourceGroupName, String registryName, String codeName, String version, + CodeVersionInner body, Context context); + + /** + * Generate a storage location and credential for the client to upload a code asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Pending upload name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrGetStartPendingUploadWithResponse(String resourceGroupName, + String registryName, String codeName, String version, PendingUploadRequestDto body, Context context); + + /** + * Generate a storage location and credential for the client to upload a code asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Pending upload name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PendingUploadResponseDtoInner createOrGetStartPendingUpload(String resourceGroupName, String registryName, + String codeName, String version, PendingUploadRequestDto body); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryComponentContainersClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryComponentContainersClient.java new file mode 100644 index 0000000000000..4ab7c9853bf6f --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryComponentContainersClient.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.models.ComponentContainerInner; + +/** + * An instance of this class provides access to all the operations defined in RegistryComponentContainersClient. + */ +public interface RegistryComponentContainersClient { + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName); + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, String skip, + Context context); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String componentName); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String componentName, + Context context); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String componentName); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String componentName, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String registryName, + String componentName, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ComponentContainerInner get(String resourceGroupName, String registryName, String componentName); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ComponentContainerInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, String componentName, ComponentContainerInner body); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ComponentContainerInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, String componentName, ComponentContainerInner body, + Context context); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ComponentContainerInner createOrUpdate(String resourceGroupName, String registryName, String componentName, + ComponentContainerInner body); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ComponentContainerInner createOrUpdate(String resourceGroupName, String registryName, String componentName, + ComponentContainerInner body, Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryComponentVersionsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryComponentVersionsClient.java new file mode 100644 index 0000000000000..a493d51e7a07d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryComponentVersionsClient.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.models.ComponentVersionInner; + +/** + * An instance of this class provides access to all the operations defined in RegistryComponentVersionsClient. + */ +public interface RegistryComponentVersionsClient { + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, String componentName); + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, String componentName, + String orderBy, Integer top, String skip, Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String componentName, + String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String componentName, + String version, Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String componentName, String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String componentName, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String registryName, String componentName, + String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ComponentVersionInner get(String resourceGroupName, String registryName, String componentName, String version); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ComponentVersionInner> beginCreateOrUpdate(String resourceGroupName, + String registryName, String componentName, String version, ComponentVersionInner body); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ComponentVersionInner> beginCreateOrUpdate(String resourceGroupName, + String registryName, String componentName, String version, ComponentVersionInner body, Context context); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ComponentVersionInner createOrUpdate(String resourceGroupName, String registryName, String componentName, + String version, ComponentVersionInner body); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ComponentVersionInner createOrUpdate(String resourceGroupName, String registryName, String componentName, + String version, ComponentVersionInner body, Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryDataContainersClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryDataContainersClient.java new file mode 100644 index 0000000000000..e53c73329815e --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryDataContainersClient.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.models.DataContainerInner; +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** + * An instance of this class provides access to all the operations defined in RegistryDataContainersClient. + */ +public interface RegistryDataContainersClient { + /** + * List Data containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName); + + /** + * List Data containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, String skip, + ListViewType listViewType, Context context); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String name); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String name, + Context context); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String name); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String name, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String registryName, String name, + Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataContainerInner get(String resourceGroupName, String registryName, String name); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DataContainerInner> beginCreateOrUpdate(String resourceGroupName, + String registryName, String name, DataContainerInner body); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DataContainerInner> beginCreateOrUpdate(String resourceGroupName, + String registryName, String name, DataContainerInner body, Context context); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataContainerInner createOrUpdate(String resourceGroupName, String registryName, String name, + DataContainerInner body); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataContainerInner createOrUpdate(String resourceGroupName, String registryName, String name, + DataContainerInner body, Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryDataReferencesClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryDataReferencesClient.java new file mode 100644 index 0000000000000..690bf26251587 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryDataReferencesClient.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.GetBlobReferenceSasResponseDtoInner; +import com.azure.resourcemanager.machinelearning.models.GetBlobReferenceSasRequestDto; + +/** + * An instance of this class provides access to all the operations defined in RegistryDataReferencesClient. + */ +public interface RegistryDataReferencesClient { + /** + * Get blob reference SAS Uri. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data reference name. + * @param version Version identifier. + * @param body Asset id and blob uri. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return blob reference SAS Uri along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getBlobReferenceSasWithResponse(String resourceGroupName, + String registryName, String name, String version, GetBlobReferenceSasRequestDto body, Context context); + + /** + * Get blob reference SAS Uri. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data reference name. + * @param version Version identifier. + * @param body Asset id and blob uri. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return blob reference SAS Uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GetBlobReferenceSasResponseDtoInner getBlobReferenceSas(String resourceGroupName, String registryName, String name, + String version, GetBlobReferenceSasRequestDto body); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryDataVersionsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryDataVersionsClient.java new file mode 100644 index 0000000000000..746599d4390ab --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryDataVersionsClient.java @@ -0,0 +1,258 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.models.DataVersionBaseInner; +import com.azure.resourcemanager.machinelearning.fluent.models.PendingUploadResponseDtoInner; +import com.azure.resourcemanager.machinelearning.models.ListViewType; +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; + +/** + * An instance of this class provides access to all the operations defined in RegistryDataVersionsClient. + */ +public interface RegistryDataVersionsClient { + /** + * List data versions in the data container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data container's name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataVersionBase entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, String name); + + /** + * List data versions in the data container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data container's name. + * @param orderBy Please choose OrderBy value from ['createdtime', 'modifiedtime']. + * @param top 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. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataVersionBase entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, String name, String orderBy, + Integer top, String skip, String tags, ListViewType listViewType, Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String name, + String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String name, + String version, Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String name, String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String name, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String registryName, String name, + String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataVersionBaseInner get(String resourceGroupName, String registryName, String name, String version); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DataVersionBaseInner> beginCreateOrUpdate(String resourceGroupName, + String registryName, String name, String version, DataVersionBaseInner body); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DataVersionBaseInner> beginCreateOrUpdate(String resourceGroupName, + String registryName, String name, String version, DataVersionBaseInner body, Context context); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataVersionBaseInner createOrUpdate(String resourceGroupName, String registryName, String name, String version, + DataVersionBaseInner body); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataVersionBaseInner createOrUpdate(String resourceGroupName, String registryName, String name, String version, + DataVersionBaseInner body, Context context); + + /** + * Generate a storage location and credential for the client to upload a data asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data asset name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrGetStartPendingUploadWithResponse(String resourceGroupName, + String registryName, String name, String version, PendingUploadRequestDto body, Context context); + + /** + * Generate a storage location and credential for the client to upload a data asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data asset name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PendingUploadResponseDtoInner createOrGetStartPendingUpload(String resourceGroupName, String registryName, + String name, String version, PendingUploadRequestDto body); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryEnvironmentContainersClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryEnvironmentContainersClient.java new file mode 100644 index 0000000000000..1a05274522d5b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryEnvironmentContainersClient.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentContainerInner; +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** + * An instance of this class provides access to all the operations defined in RegistryEnvironmentContainersClient. + */ +public interface RegistryEnvironmentContainersClient { + /** + * List environment containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName); + + /** + * List environment containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, String skip, + ListViewType listViewType, Context context); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, + String environmentName); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, + String environmentName, Context context); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String environmentName); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String environmentName, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String registryName, + String environmentName, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EnvironmentContainerInner get(String resourceGroupName, String registryName, String environmentName); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EnvironmentContainerInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, String environmentName, EnvironmentContainerInner body); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EnvironmentContainerInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, String environmentName, EnvironmentContainerInner body, + Context context); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EnvironmentContainerInner createOrUpdate(String resourceGroupName, String registryName, String environmentName, + EnvironmentContainerInner body); + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EnvironmentContainerInner createOrUpdate(String resourceGroupName, String registryName, String environmentName, + EnvironmentContainerInner body, Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryEnvironmentVersionsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryEnvironmentVersionsClient.java new file mode 100644 index 0000000000000..ba7844b2fdb62 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryEnvironmentVersionsClient.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentVersionInner; +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** + * An instance of this class provides access to all the operations defined in RegistryEnvironmentVersionsClient. + */ +public interface RegistryEnvironmentVersionsClient { + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, String environmentName); + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, String environmentName, + String orderBy, Integer top, String skip, ListViewType listViewType, Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, + String environmentName, String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, + String environmentName, String version, Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String environmentName, String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String environmentName, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String registryName, + String environmentName, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EnvironmentVersionInner get(String resourceGroupName, String registryName, String environmentName, String version); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EnvironmentVersionInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, String environmentName, String version, + EnvironmentVersionInner body); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EnvironmentVersionInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, String environmentName, String version, + EnvironmentVersionInner body, Context context); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EnvironmentVersionInner createOrUpdate(String resourceGroupName, String registryName, String environmentName, + String version, EnvironmentVersionInner body); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EnvironmentVersionInner createOrUpdate(String resourceGroupName, String registryName, String environmentName, + String version, EnvironmentVersionInner body, Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryModelContainersClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryModelContainersClient.java new file mode 100644 index 0000000000000..ffd6476b53c6d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryModelContainersClient.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.models.ModelContainerInner; +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** + * An instance of this class provides access to all the operations defined in RegistryModelContainersClient. + */ +public interface RegistryModelContainersClient { + /** + * List model containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName); + + /** + * List model containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, String skip, + ListViewType listViewType, Context context); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String modelName); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String modelName, + Context context); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String modelName); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String modelName, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String registryName, String modelName, + Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ModelContainerInner get(String resourceGroupName, String registryName, String modelName); + + /** + * Create or update model container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ModelContainerInner> beginCreateOrUpdate(String resourceGroupName, + String registryName, String modelName, ModelContainerInner body); + + /** + * Create or update model container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ModelContainerInner> beginCreateOrUpdate(String resourceGroupName, + String registryName, String modelName, ModelContainerInner body, Context context); + + /** + * Create or update model container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ModelContainerInner createOrUpdate(String resourceGroupName, String registryName, String modelName, + ModelContainerInner body); + + /** + * Create or update model container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ModelContainerInner createOrUpdate(String resourceGroupName, String registryName, String modelName, + ModelContainerInner body, Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryModelVersionsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryModelVersionsClient.java new file mode 100644 index 0000000000000..11e3725d463fe --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/RegistryModelVersionsClient.java @@ -0,0 +1,260 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.models.ModelVersionInner; +import com.azure.resourcemanager.machinelearning.fluent.models.PendingUploadResponseDtoInner; +import com.azure.resourcemanager.machinelearning.models.ListViewType; +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; + +/** + * An instance of this class provides access to all the operations defined in RegistryModelVersionsClient. + */ +public interface RegistryModelVersionsClient { + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, String modelName); + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param version Version identifier. + * @param description Model description. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param properties Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, String modelName, String skip, + String orderBy, Integer top, String version, String description, String tags, String properties, + ListViewType listViewType, Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String modelName, + String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String modelName, + String version, Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String modelName, String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String modelName, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String registryName, String modelName, + String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ModelVersionInner get(String resourceGroupName, String registryName, String modelName, String version); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ModelVersionInner> beginCreateOrUpdate(String resourceGroupName, + String registryName, String modelName, String version, ModelVersionInner body); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ModelVersionInner> beginCreateOrUpdate(String resourceGroupName, + String registryName, String modelName, String version, ModelVersionInner body, Context context); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ModelVersionInner createOrUpdate(String resourceGroupName, String registryName, String modelName, String version, + ModelVersionInner body); + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ModelVersionInner createOrUpdate(String resourceGroupName, String registryName, String modelName, String version, + ModelVersionInner body, Context context); + + /** + * Generate a storage location and credential for the client to upload a model asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Model name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrGetStartPendingUploadWithResponse(String resourceGroupName, + String registryName, String modelName, String version, PendingUploadRequestDto body, Context context); + + /** + * Generate a storage location and credential for the client to upload a model asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Model name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PendingUploadResponseDtoInner createOrGetStartPendingUpload(String resourceGroupName, String registryName, + String modelName, String version, PendingUploadRequestDto body); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/SchedulesClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/SchedulesClient.java index ad9f8256ddeed..cd31652c50e56 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/SchedulesClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/SchedulesClient.java @@ -14,11 +14,13 @@ import com.azure.resourcemanager.machinelearning.fluent.models.ScheduleInner; import com.azure.resourcemanager.machinelearning.models.ScheduleListViewType; -/** An instance of this class provides access to all the operations defined in SchedulesClient. */ +/** + * An instance of this class provides access to all the operations defined in SchedulesClient. + */ public interface SchedulesClient { /** * List schedules in specified workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -31,7 +33,7 @@ public interface SchedulesClient { /** * List schedules in specified workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -43,16 +45,12 @@ public interface SchedulesClient { * @return a paginated list of Schedule entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, - String workspaceName, - String skip, - ScheduleListViewType listViewType, - Context context); + PagedIterable list(String resourceGroupName, String workspaceName, String skip, + ScheduleListViewType listViewType, Context context); /** * Delete schedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Schedule name. @@ -66,7 +64,7 @@ PagedIterable list( /** * Delete schedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Schedule name. @@ -77,12 +75,12 @@ PagedIterable list( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String workspaceName, String name, Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String name, + Context context); /** * Delete schedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Schedule name. @@ -95,7 +93,7 @@ SyncPoller, Void> beginDelete( /** * Delete schedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Schedule name. @@ -109,7 +107,7 @@ SyncPoller, Void> beginDelete( /** * Get schedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Schedule name. @@ -120,12 +118,12 @@ SyncPoller, Void> beginDelete( * @return schedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String name, Context context); + Response getWithResponse(String resourceGroupName, String workspaceName, String name, + Context context); /** * Get schedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Schedule name. @@ -139,7 +137,7 @@ Response getWithResponse( /** * Create or update schedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Schedule name. @@ -150,12 +148,12 @@ Response getWithResponse( * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ScheduleInner> beginCreateOrUpdate( - String resourceGroupName, String workspaceName, String name, ScheduleInner body); + SyncPoller, ScheduleInner> beginCreateOrUpdate(String resourceGroupName, + String workspaceName, String name, ScheduleInner body); /** * Create or update schedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Schedule name. @@ -167,12 +165,12 @@ SyncPoller, ScheduleInner> beginCreateOrUpdate( * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ScheduleInner> beginCreateOrUpdate( - String resourceGroupName, String workspaceName, String name, ScheduleInner body, Context context); + SyncPoller, ScheduleInner> beginCreateOrUpdate(String resourceGroupName, + String workspaceName, String name, ScheduleInner body, Context context); /** * Create or update schedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Schedule name. @@ -187,7 +185,7 @@ SyncPoller, ScheduleInner> beginCreateOrUpdate( /** * Create or update schedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Schedule name. @@ -199,6 +197,6 @@ SyncPoller, ScheduleInner> beginCreateOrUpdate( * @return azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - ScheduleInner createOrUpdate( - String resourceGroupName, String workspaceName, String name, ScheduleInner body, Context context); + ScheduleInner createOrUpdate(String resourceGroupName, String workspaceName, String name, ScheduleInner body, + Context context); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ServerlessEndpointsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ServerlessEndpointsClient.java new file mode 100644 index 0000000000000..ec664f5bab71f --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/ServerlessEndpointsClient.java @@ -0,0 +1,366 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.models.EndpointAuthKeysInner; +import com.azure.resourcemanager.machinelearning.fluent.models.ServerlessEndpointInner; +import com.azure.resourcemanager.machinelearning.models.PartialMinimalTrackedResourceWithSkuAndIdentity; +import com.azure.resourcemanager.machinelearning.models.RegenerateEndpointKeysRequest; + +/** + * An instance of this class provides access to all the operations defined in ServerlessEndpointsClient. + */ +public interface ServerlessEndpointsClient { + /** + * List Serverless Endpoints. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ServerlessEndpoint entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * List Serverless Endpoints. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ServerlessEndpoint entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String skip, + Context context); + + /** + * Delete Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String name); + + /** + * Delete Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String name, + Context context); + + /** + * Delete Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String name); + + /** + * Delete Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String name, Context context); + + /** + * Get Serverless Endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return serverless Endpoint along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String workspaceName, String name, + Context context); + + /** + * Get Serverless Endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return serverless Endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServerlessEndpointInner get(String resourceGroupName, String workspaceName, String name); + + /** + * Update Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body Serverless Endpoint entity to apply during operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ServerlessEndpointInner> beginUpdate(String resourceGroupName, + String workspaceName, String name, PartialMinimalTrackedResourceWithSkuAndIdentity body); + + /** + * Update Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body Serverless Endpoint entity to apply during operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ServerlessEndpointInner> beginUpdate(String resourceGroupName, + String workspaceName, String name, PartialMinimalTrackedResourceWithSkuAndIdentity body, Context context); + + /** + * Update Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body Serverless Endpoint entity to apply during operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServerlessEndpointInner update(String resourceGroupName, String workspaceName, String name, + PartialMinimalTrackedResourceWithSkuAndIdentity body); + + /** + * Update Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body Serverless Endpoint entity to apply during operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServerlessEndpointInner update(String resourceGroupName, String workspaceName, String name, + PartialMinimalTrackedResourceWithSkuAndIdentity body, Context context); + + /** + * Create or update Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body Serverless Endpoint entity to apply during operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ServerlessEndpointInner> + beginCreateOrUpdate(String resourceGroupName, String workspaceName, String name, ServerlessEndpointInner body); + + /** + * Create or update Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body Serverless Endpoint entity to apply during operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ServerlessEndpointInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String name, ServerlessEndpointInner body, Context context); + + /** + * Create or update Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body Serverless Endpoint entity to apply during operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServerlessEndpointInner createOrUpdate(String resourceGroupName, String workspaceName, String name, + ServerlessEndpointInner body); + + /** + * Create or update Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body Serverless Endpoint entity to apply during operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServerlessEndpointInner createOrUpdate(String resourceGroupName, String workspaceName, String name, + ServerlessEndpointInner body, Context context); + + /** + * List EndpointAuthKeys for an Endpoint using Key-based authentication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return keys for endpoint authentication along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listKeysWithResponse(String resourceGroupName, String workspaceName, String name, + Context context); + + /** + * List EndpointAuthKeys for an Endpoint using Key-based authentication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return keys for endpoint authentication. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EndpointAuthKeysInner listKeys(String resourceGroupName, String workspaceName, String name); + + /** + * Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body RegenerateKeys request . + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of keys for endpoint authentication. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EndpointAuthKeysInner> beginRegenerateKeys(String resourceGroupName, + String workspaceName, String name, RegenerateEndpointKeysRequest body); + + /** + * Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body RegenerateKeys request . + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of keys for endpoint authentication. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EndpointAuthKeysInner> beginRegenerateKeys(String resourceGroupName, + String workspaceName, String name, RegenerateEndpointKeysRequest body, Context context); + + /** + * Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body RegenerateKeys request . + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return keys for endpoint authentication. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EndpointAuthKeysInner regenerateKeys(String resourceGroupName, String workspaceName, String name, + RegenerateEndpointKeysRequest body); + + /** + * Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body RegenerateKeys request . + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return keys for endpoint authentication. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EndpointAuthKeysInner regenerateKeys(String resourceGroupName, String workspaceName, String name, + RegenerateEndpointKeysRequest body, Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/UsagesClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/UsagesClient.java index e51b16de1b3d9..675c00685de40 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/UsagesClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/UsagesClient.java @@ -10,31 +10,33 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.machinelearning.fluent.models.UsageInner; -/** An instance of this class provides access to all the operations defined in UsagesClient. */ +/** + * An instance of this class provides access to all the operations defined in UsagesClient. + */ public interface UsagesClient { /** * Gets the current usage information as well as limits for AML resources for given subscription and location. - * + * * @param location The location for which resource usage is queried. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current usage information as well as limits for AML resources for given subscription and location as - * paginated response with {@link PagedIterable}. + * paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String location); /** * Gets the current usage information as well as limits for AML resources for given subscription and location. - * + * * @param location The location for which resource usage is queried. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current usage information as well as limits for AML resources for given subscription and location as - * paginated response with {@link PagedIterable}. + * paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String location, Context context); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/VirtualMachineSizesClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/VirtualMachineSizesClient.java index 15b40d65457f1..c0febf79a6e40 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/VirtualMachineSizesClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/VirtualMachineSizesClient.java @@ -10,11 +10,13 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.machinelearning.fluent.models.VirtualMachineSizeListResultInner; -/** An instance of this class provides access to all the operations defined in VirtualMachineSizesClient. */ +/** + * An instance of this class provides access to all the operations defined in VirtualMachineSizesClient. + */ public interface VirtualMachineSizesClient { /** * Returns supported VM Sizes in a location. - * + * * @param location The location upon which virtual-machine-sizes is queried. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -27,7 +29,7 @@ public interface VirtualMachineSizesClient { /** * Returns supported VM Sizes in a location. - * + * * @param location The location upon which virtual-machine-sizes is queried. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/WorkspaceConnectionsClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/WorkspaceConnectionsClient.java index 442aaf6a54807..eee87969a4a32 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/WorkspaceConnectionsClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/WorkspaceConnectionsClient.java @@ -11,11 +11,13 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.machinelearning.fluent.models.WorkspaceConnectionPropertiesV2BasicResourceInner; -/** An instance of this class provides access to all the operations defined in WorkspaceConnectionsClient. */ +/** + * An instance of this class provides access to all the operations defined in WorkspaceConnectionsClient. + */ public interface WorkspaceConnectionsClient { /** * The create operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param connectionName Friendly name of the workspace connection. @@ -27,16 +29,13 @@ public interface WorkspaceConnectionsClient { * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String resourceGroupName, - String workspaceName, - String connectionName, - WorkspaceConnectionPropertiesV2BasicResourceInner parameters, + Response createWithResponse(String resourceGroupName, + String workspaceName, String connectionName, WorkspaceConnectionPropertiesV2BasicResourceInner parameters, Context context); /** * The create operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param connectionName Friendly name of the workspace connection. @@ -47,15 +46,12 @@ Response createWithResponse( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - WorkspaceConnectionPropertiesV2BasicResourceInner create( - String resourceGroupName, - String workspaceName, - String connectionName, - WorkspaceConnectionPropertiesV2BasicResourceInner parameters); + WorkspaceConnectionPropertiesV2BasicResourceInner create(String resourceGroupName, String workspaceName, + String connectionName, WorkspaceConnectionPropertiesV2BasicResourceInner parameters); /** * The get operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param connectionName Friendly name of the workspace connection. @@ -66,12 +62,12 @@ WorkspaceConnectionPropertiesV2BasicResourceInner create( * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String connectionName, Context context); + Response getWithResponse(String resourceGroupName, + String workspaceName, String connectionName, Context context); /** * The get operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param connectionName Friendly name of the workspace connection. @@ -81,12 +77,12 @@ Response getWithResponse( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - WorkspaceConnectionPropertiesV2BasicResourceInner get( - String resourceGroupName, String workspaceName, String connectionName); + WorkspaceConnectionPropertiesV2BasicResourceInner get(String resourceGroupName, String workspaceName, + String connectionName); /** * The delete operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param connectionName Friendly name of the workspace connection. @@ -97,12 +93,12 @@ WorkspaceConnectionPropertiesV2BasicResourceInner get( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String workspaceName, String connectionName, Context context); + Response deleteWithResponse(String resourceGroupName, String workspaceName, String connectionName, + Context context); /** * The delete operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param connectionName Friendly name of the workspace connection. @@ -115,7 +111,7 @@ Response deleteWithResponse( /** * The list operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -124,12 +120,12 @@ Response deleteWithResponse( * @return the paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, String workspaceName); + PagedIterable list(String resourceGroupName, + String workspaceName); /** * The list operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param target Target of the workspace connection. @@ -141,6 +137,37 @@ PagedIterable list( * @return the paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, String workspaceName, String target, String category, Context context); + PagedIterable list(String resourceGroupName, + String workspaceName, String target, String category, Context context); + + /** + * List all the secrets of a machine learning workspaces connections. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param connectionName Friendly name of the workspace connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listSecretsWithResponse(String resourceGroupName, + String workspaceName, String connectionName, Context context); + + /** + * List all the secrets of a machine learning workspaces connections. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param connectionName Friendly name of the workspace connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkspaceConnectionPropertiesV2BasicResourceInner listSecrets(String resourceGroupName, String workspaceName, + String connectionName); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/WorkspaceFeaturesClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/WorkspaceFeaturesClient.java index 9c67243899aba..8437e6ab4254e 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/WorkspaceFeaturesClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/WorkspaceFeaturesClient.java @@ -10,11 +10,13 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.machinelearning.fluent.models.AmlUserFeatureInner; -/** An instance of this class provides access to all the operations defined in WorkspaceFeaturesClient. */ +/** + * An instance of this class provides access to all the operations defined in WorkspaceFeaturesClient. + */ public interface WorkspaceFeaturesClient { /** * Lists all enabled features for a workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -27,7 +29,7 @@ public interface WorkspaceFeaturesClient { /** * Lists all enabled features for a workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/WorkspacesClient.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/WorkspacesClient.java index 2057cda2ab5a4..c5422614b13d3 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/WorkspacesClient.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/WorkspacesClient.java @@ -19,14 +19,16 @@ import com.azure.resourcemanager.machinelearning.fluent.models.NotebookAccessTokenResultInner; import com.azure.resourcemanager.machinelearning.fluent.models.NotebookResourceInfoInner; import com.azure.resourcemanager.machinelearning.fluent.models.WorkspaceInner; +import com.azure.resourcemanager.machinelearning.fluent.models.WorkspaceUpdateParametersInner; import com.azure.resourcemanager.machinelearning.models.DiagnoseWorkspaceParameters; -import com.azure.resourcemanager.machinelearning.models.WorkspaceUpdateParameters; -/** An instance of this class provides access to all the operations defined in WorkspacesClient. */ +/** + * An instance of this class provides access to all the operations defined in WorkspacesClient. + */ public interface WorkspacesClient { /** * Gets the properties of the specified machine learning workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -36,12 +38,12 @@ public interface WorkspacesClient { * @return the properties of the specified machine learning workspace along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String workspaceName, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, String workspaceName, + Context context); /** * Gets the properties of the specified machine learning workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -54,7 +56,7 @@ Response getByResourceGroupWithResponse( /** * Creates or updates a workspace with the specified parameters. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param parameters The parameters for creating or updating a machine learning workspace. @@ -64,12 +66,12 @@ Response getByResourceGroupWithResponse( * @return the {@link SyncPoller} for polling of an object that represents a machine learning workspace. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, WorkspaceInner> beginCreateOrUpdate( - String resourceGroupName, String workspaceName, WorkspaceInner parameters); + SyncPoller, WorkspaceInner> beginCreateOrUpdate(String resourceGroupName, + String workspaceName, WorkspaceInner parameters); /** * Creates or updates a workspace with the specified parameters. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param parameters The parameters for creating or updating a machine learning workspace. @@ -80,12 +82,12 @@ SyncPoller, WorkspaceInner> beginCreateOrUpdate( * @return the {@link SyncPoller} for polling of an object that represents a machine learning workspace. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, WorkspaceInner> beginCreateOrUpdate( - String resourceGroupName, String workspaceName, WorkspaceInner parameters, Context context); + SyncPoller, WorkspaceInner> beginCreateOrUpdate(String resourceGroupName, + String workspaceName, WorkspaceInner parameters, Context context); /** * Creates or updates a workspace with the specified parameters. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param parameters The parameters for creating or updating a machine learning workspace. @@ -99,7 +101,7 @@ SyncPoller, WorkspaceInner> beginCreateOrUpdate( /** * Creates or updates a workspace with the specified parameters. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param parameters The parameters for creating or updating a machine learning workspace. @@ -110,12 +112,12 @@ SyncPoller, WorkspaceInner> beginCreateOrUpdate( * @return an object that represents a machine learning workspace. */ @ServiceMethod(returns = ReturnType.SINGLE) - WorkspaceInner createOrUpdate( - String resourceGroupName, String workspaceName, WorkspaceInner parameters, Context context); + WorkspaceInner createOrUpdate(String resourceGroupName, String workspaceName, WorkspaceInner parameters, + Context context); /** * Deletes a machine learning workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -128,9 +130,10 @@ WorkspaceInner createOrUpdate( /** * Deletes a machine learning workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. + * @param forceToPurge Flag to indicate delete is a purge request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -138,11 +141,12 @@ WorkspaceInner createOrUpdate( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, Boolean forceToPurge, + Context context); /** * Deletes a machine learning workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -154,20 +158,21 @@ WorkspaceInner createOrUpdate( /** * Deletes a machine learning workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. + * @param forceToPurge Flag to indicate delete is a purge request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String workspaceName, Context context); + void delete(String resourceGroupName, String workspaceName, Boolean forceToPurge, Context context); /** * Updates a machine learning workspace with the specified parameters. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param parameters The parameters for updating a machine learning workspace. @@ -177,12 +182,12 @@ WorkspaceInner createOrUpdate( * @return the {@link SyncPoller} for polling of an object that represents a machine learning workspace. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, WorkspaceInner> beginUpdate( - String resourceGroupName, String workspaceName, WorkspaceUpdateParameters parameters); + SyncPoller, WorkspaceInner> beginUpdate(String resourceGroupName, String workspaceName, + WorkspaceUpdateParametersInner parameters); /** * Updates a machine learning workspace with the specified parameters. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param parameters The parameters for updating a machine learning workspace. @@ -193,12 +198,12 @@ SyncPoller, WorkspaceInner> beginUpdate( * @return the {@link SyncPoller} for polling of an object that represents a machine learning workspace. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, WorkspaceInner> beginUpdate( - String resourceGroupName, String workspaceName, WorkspaceUpdateParameters parameters, Context context); + SyncPoller, WorkspaceInner> beginUpdate(String resourceGroupName, String workspaceName, + WorkspaceUpdateParametersInner parameters, Context context); /** * Updates a machine learning workspace with the specified parameters. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param parameters The parameters for updating a machine learning workspace. @@ -208,11 +213,11 @@ SyncPoller, WorkspaceInner> beginUpdate( * @return an object that represents a machine learning workspace. */ @ServiceMethod(returns = ReturnType.SINGLE) - WorkspaceInner update(String resourceGroupName, String workspaceName, WorkspaceUpdateParameters parameters); + WorkspaceInner update(String resourceGroupName, String workspaceName, WorkspaceUpdateParametersInner parameters); /** * Updates a machine learning workspace with the specified parameters. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param parameters The parameters for updating a machine learning workspace. @@ -223,40 +228,40 @@ SyncPoller, WorkspaceInner> beginUpdate( * @return an object that represents a machine learning workspace. */ @ServiceMethod(returns = ReturnType.SINGLE) - WorkspaceInner update( - String resourceGroupName, String workspaceName, WorkspaceUpdateParameters parameters, Context context); + WorkspaceInner update(String resourceGroupName, String workspaceName, WorkspaceUpdateParametersInner parameters, + Context context); /** * Lists all the available machine learning workspaces under the specified resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list machine learning workspaces as paginated response with {@link - * PagedIterable}. + * @return the result of a request to list machine learning workspaces as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); /** * Lists all the available machine learning workspaces under the specified resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param skip Continuation token for pagination. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list machine learning workspaces as paginated response with {@link - * PagedIterable}. + * @return the result of a request to list machine learning workspaces as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, String skip, Context context); /** * Diagnose workspace setup issue. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -265,12 +270,12 @@ WorkspaceInner update( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DiagnoseResponseResultInner> beginDiagnose( - String resourceGroupName, String workspaceName); + SyncPoller, DiagnoseResponseResultInner> + beginDiagnose(String resourceGroupName, String workspaceName); /** * Diagnose workspace setup issue. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param parameters The parameter of diagnosing workspace health. @@ -286,7 +291,7 @@ SyncPoller, DiagnoseResponseResultInner> /** * Diagnose workspace setup issue. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -299,7 +304,7 @@ SyncPoller, DiagnoseResponseResultInner> /** * Diagnose workspace setup issue. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param parameters The parameter of diagnosing workspace health. @@ -310,13 +315,13 @@ SyncPoller, DiagnoseResponseResultInner> * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - DiagnoseResponseResultInner diagnose( - String resourceGroupName, String workspaceName, DiagnoseWorkspaceParameters parameters, Context context); + DiagnoseResponseResultInner diagnose(String resourceGroupName, String workspaceName, + DiagnoseWorkspaceParameters parameters, Context context); /** * Lists all the keys associated with this workspace. This includes keys for the storage account, app insights and * password for container registry. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -326,13 +331,13 @@ DiagnoseResponseResultInner diagnose( * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listKeysWithResponse( - String resourceGroupName, String workspaceName, Context context); + Response listKeysWithResponse(String resourceGroupName, String workspaceName, + Context context); /** * Lists all the keys associated with this workspace. This includes keys for the storage account, app insights and * password for container registry. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -346,7 +351,7 @@ Response listKeysWithResponse( /** * Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and * password for container registry. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -360,7 +365,7 @@ Response listKeysWithResponse( /** * Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and * password for container registry. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -375,7 +380,7 @@ Response listKeysWithResponse( /** * Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and * password for container registry. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -388,7 +393,7 @@ Response listKeysWithResponse( /** * Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and * password for container registry. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -401,32 +406,32 @@ Response listKeysWithResponse( /** * Lists all the available machine learning workspaces under the specified subscription. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list machine learning workspaces as paginated response with {@link - * PagedIterable}. + * @return the result of a request to list machine learning workspaces as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); /** * Lists all the available machine learning workspaces under the specified subscription. - * + * * @param skip Continuation token for pagination. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list machine learning workspaces as paginated response with {@link - * PagedIterable}. + * @return the result of a request to list machine learning workspaces as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String skip, Context context); /** * return notebook access token and refresh token. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -436,12 +441,12 @@ Response listKeysWithResponse( * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listNotebookAccessTokenWithResponse( - String resourceGroupName, String workspaceName, Context context); + Response listNotebookAccessTokenWithResponse(String resourceGroupName, + String workspaceName, Context context); /** * return notebook access token and refresh token. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -454,7 +459,7 @@ Response listNotebookAccessTokenWithResponse( /** * Prepare a notebook. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -463,12 +468,12 @@ Response listNotebookAccessTokenWithResponse( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, NotebookResourceInfoInner> beginPrepareNotebook( - String resourceGroupName, String workspaceName); + SyncPoller, NotebookResourceInfoInner> + beginPrepareNotebook(String resourceGroupName, String workspaceName); /** * Prepare a notebook. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -478,12 +483,12 @@ SyncPoller, NotebookResourceInfoInner> beg * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, NotebookResourceInfoInner> beginPrepareNotebook( - String resourceGroupName, String workspaceName, Context context); + SyncPoller, NotebookResourceInfoInner> + beginPrepareNotebook(String resourceGroupName, String workspaceName, Context context); /** * Prepare a notebook. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -496,7 +501,7 @@ SyncPoller, NotebookResourceInfoInner> beg /** * Prepare a notebook. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -510,7 +515,7 @@ SyncPoller, NotebookResourceInfoInner> beg /** * List storage account keys of a workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -520,12 +525,12 @@ SyncPoller, NotebookResourceInfoInner> beg * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listStorageAccountKeysWithResponse( - String resourceGroupName, String workspaceName, Context context); + Response listStorageAccountKeysWithResponse(String resourceGroupName, + String workspaceName, Context context); /** * List storage account keys of a workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -538,7 +543,7 @@ Response listStorageAccountKeysWithResponse( /** * List keys of a notebook. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -548,12 +553,12 @@ Response listStorageAccountKeysWithResponse( * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listNotebookKeysWithResponse( - String resourceGroupName, String workspaceName, Context context); + Response listNotebookKeysWithResponse(String resourceGroupName, String workspaceName, + Context context); /** * List keys of a notebook. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -566,7 +571,7 @@ Response listNotebookKeysWithResponse( /** * Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -576,12 +581,12 @@ Response listNotebookKeysWithResponse( * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listOutboundNetworkDependenciesEndpointsWithResponse( - String resourceGroupName, String workspaceName, Context context); + Response listOutboundNetworkDependenciesEndpointsWithResponse(String resourceGroupName, + String workspaceName, Context context); /** * Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/AmlOperationInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/AmlOperationInner.java deleted file mode 100644 index a21e00f4df18e..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/AmlOperationInner.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.machinelearning.models.AmlOperationDisplay; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Azure Machine Learning workspace REST API operation. */ -@Fluent -public final class AmlOperationInner { - /* - * Operation name: {provider}/{resource}/{operation} - */ - @JsonProperty(value = "name") - private String name; - - /* - * Display name of operation - */ - @JsonProperty(value = "display") - private AmlOperationDisplay display; - - /* - * Indicates whether the operation applies to data-plane - */ - @JsonProperty(value = "isDataAction") - private Boolean isDataAction; - - /** Creates an instance of AmlOperationInner class. */ - public AmlOperationInner() { - } - - /** - * Get the name property: Operation name: {provider}/{resource}/{operation}. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Operation name: {provider}/{resource}/{operation}. - * - * @param name the name value to set. - * @return the AmlOperationInner object itself. - */ - public AmlOperationInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the display property: Display name of operation. - * - * @return the display value. - */ - public AmlOperationDisplay display() { - return this.display; - } - - /** - * Set the display property: Display name of operation. - * - * @param display the display value to set. - * @return the AmlOperationInner object itself. - */ - public AmlOperationInner withDisplay(AmlOperationDisplay display) { - this.display = display; - return this; - } - - /** - * Get the isDataAction property: Indicates whether the operation applies to data-plane. - * - * @return the isDataAction value. - */ - public Boolean isDataAction() { - return this.isDataAction; - } - - /** - * Set the isDataAction property: Indicates whether the operation applies to data-plane. - * - * @param isDataAction the isDataAction value to set. - * @return the AmlOperationInner object itself. - */ - public AmlOperationInner withIsDataAction(Boolean isDataAction) { - this.isDataAction = isDataAction; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - display().validate(); - } - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/AmlUserFeatureInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/AmlUserFeatureInner.java index a089fbd59b950..faf14637e3516 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/AmlUserFeatureInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/AmlUserFeatureInner.java @@ -5,36 +5,41 @@ package com.azure.resourcemanager.machinelearning.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Features enabled for a workspace. */ +/** + * Features enabled for a workspace. + */ @Fluent -public final class AmlUserFeatureInner { +public final class AmlUserFeatureInner implements JsonSerializable { /* * Specifies the feature ID */ - @JsonProperty(value = "id") private String id; /* * Specifies the feature name */ - @JsonProperty(value = "displayName") private String displayName; /* * Describes the feature for user experience */ - @JsonProperty(value = "description") private String description; - /** Creates an instance of AmlUserFeatureInner class. */ + /** + * Creates an instance of AmlUserFeatureInner class. + */ public AmlUserFeatureInner() { } /** * Get the id property: Specifies the feature ID. - * + * * @return the id value. */ public String id() { @@ -43,7 +48,7 @@ public String id() { /** * Set the id property: Specifies the feature ID. - * + * * @param id the id value to set. * @return the AmlUserFeatureInner object itself. */ @@ -54,7 +59,7 @@ public AmlUserFeatureInner withId(String id) { /** * Get the displayName property: Specifies the feature name. - * + * * @return the displayName value. */ public String displayName() { @@ -63,7 +68,7 @@ public String displayName() { /** * Set the displayName property: Specifies the feature name. - * + * * @param displayName the displayName value to set. * @return the AmlUserFeatureInner object itself. */ @@ -74,7 +79,7 @@ public AmlUserFeatureInner withDisplayName(String displayName) { /** * Get the description property: Describes the feature for user experience. - * + * * @return the description value. */ public String description() { @@ -83,7 +88,7 @@ public String description() { /** * Set the description property: Describes the feature for user experience. - * + * * @param description the description value to set. * @return the AmlUserFeatureInner object itself. */ @@ -94,9 +99,51 @@ public AmlUserFeatureInner withDescription(String description) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AmlUserFeatureInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AmlUserFeatureInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AmlUserFeatureInner. + */ + public static AmlUserFeatureInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AmlUserFeatureInner deserializedAmlUserFeatureInner = new AmlUserFeatureInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAmlUserFeatureInner.id = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedAmlUserFeatureInner.displayName = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedAmlUserFeatureInner.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAmlUserFeatureInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/BatchDeploymentInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/BatchDeploymentInner.java index 3ec008adca648..459580f505a7a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/BatchDeploymentInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/BatchDeploymentInner.java @@ -8,52 +8,69 @@ import com.azure.core.management.Resource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.models.BatchDeploymentProperties; import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; import com.azure.resourcemanager.machinelearning.models.Sku; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; -/** The BatchDeployment model. */ +/** + * The BatchDeployment model. + */ @Fluent public final class BatchDeploymentInner extends Resource { /* * Managed service identity (system assigned and/or user assigned identities) */ - @JsonProperty(value = "identity") private ManagedServiceIdentity identity; /* * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. */ - @JsonProperty(value = "kind") private String kind; /* * [Required] Additional attributes of the entity. */ - @JsonProperty(value = "properties", required = true) private BatchDeploymentProperties properties; /* * Sku details required for ARM contract for Autoscaling. */ - @JsonProperty(value = "sku") private Sku sku; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of BatchDeploymentInner class. */ + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of BatchDeploymentInner class. + */ public BatchDeploymentInner() { } /** * Get the identity property: Managed service identity (system assigned and/or user assigned identities). - * + * * @return the identity value. */ public ManagedServiceIdentity identity() { @@ -62,7 +79,7 @@ public ManagedServiceIdentity identity() { /** * Set the identity property: Managed service identity (system assigned and/or user assigned identities). - * + * * @param identity the identity value to set. * @return the BatchDeploymentInner object itself. */ @@ -74,7 +91,7 @@ public BatchDeploymentInner withIdentity(ManagedServiceIdentity identity) { /** * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of * the same type. - * + * * @return the kind value. */ public String kind() { @@ -84,7 +101,7 @@ public String kind() { /** * Set the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of * the same type. - * + * * @param kind the kind value to set. * @return the BatchDeploymentInner object itself. */ @@ -95,7 +112,7 @@ public BatchDeploymentInner withKind(String kind) { /** * Get the properties property: [Required] Additional attributes of the entity. - * + * * @return the properties value. */ public BatchDeploymentProperties properties() { @@ -104,7 +121,7 @@ public BatchDeploymentProperties properties() { /** * Set the properties property: [Required] Additional attributes of the entity. - * + * * @param properties the properties value to set. * @return the BatchDeploymentInner object itself. */ @@ -115,7 +132,7 @@ public BatchDeploymentInner withProperties(BatchDeploymentProperties properties) /** * Get the sku property: Sku details required for ARM contract for Autoscaling. - * + * * @return the sku value. */ public Sku sku() { @@ -124,7 +141,7 @@ public Sku sku() { /** * Set the sku property: Sku details required for ARM contract for Autoscaling. - * + * * @param sku the sku value to set. * @return the BatchDeploymentInner object itself. */ @@ -135,21 +152,55 @@ public BatchDeploymentInner withSku(Sku sku) { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } - /** {@inheritDoc} */ + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * {@inheritDoc} + */ @Override public BatchDeploymentInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public BatchDeploymentInner withTags(Map tags) { super.withTags(tags); @@ -158,7 +209,7 @@ public BatchDeploymentInner withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -166,8 +217,8 @@ public void validate() { identity().validate(); } if (properties() == null) { - throw LOGGER - .logExceptionAsError( + throw LOGGER.atError() + .log( new IllegalArgumentException("Missing required property properties in model BatchDeploymentInner")); } else { properties().validate(); @@ -178,4 +229,65 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(BatchDeploymentInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeJsonField("sku", this.sku); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchDeploymentInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchDeploymentInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BatchDeploymentInner. + */ + public static BatchDeploymentInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BatchDeploymentInner deserializedBatchDeploymentInner = new BatchDeploymentInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedBatchDeploymentInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedBatchDeploymentInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedBatchDeploymentInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedBatchDeploymentInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedBatchDeploymentInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedBatchDeploymentInner.properties = BatchDeploymentProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedBatchDeploymentInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedBatchDeploymentInner.kind = reader.getString(); + } else if ("sku".equals(fieldName)) { + deserializedBatchDeploymentInner.sku = Sku.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedBatchDeploymentInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBatchDeploymentInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/BatchEndpointInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/BatchEndpointInner.java index 487307ea149b4..2a3d4441d1bcf 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/BatchEndpointInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/BatchEndpointInner.java @@ -8,52 +8,69 @@ import com.azure.core.management.Resource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.models.BatchEndpointProperties; import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; import com.azure.resourcemanager.machinelearning.models.Sku; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; -/** The BatchEndpoint model. */ +/** + * The BatchEndpoint model. + */ @Fluent public final class BatchEndpointInner extends Resource { /* * Managed service identity (system assigned and/or user assigned identities) */ - @JsonProperty(value = "identity") private ManagedServiceIdentity identity; /* * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. */ - @JsonProperty(value = "kind") private String kind; /* * [Required] Additional attributes of the entity. */ - @JsonProperty(value = "properties", required = true) private BatchEndpointProperties properties; /* * Sku details required for ARM contract for Autoscaling. */ - @JsonProperty(value = "sku") private Sku sku; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of BatchEndpointInner class. */ + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of BatchEndpointInner class. + */ public BatchEndpointInner() { } /** * Get the identity property: Managed service identity (system assigned and/or user assigned identities). - * + * * @return the identity value. */ public ManagedServiceIdentity identity() { @@ -62,7 +79,7 @@ public ManagedServiceIdentity identity() { /** * Set the identity property: Managed service identity (system assigned and/or user assigned identities). - * + * * @param identity the identity value to set. * @return the BatchEndpointInner object itself. */ @@ -74,7 +91,7 @@ public BatchEndpointInner withIdentity(ManagedServiceIdentity identity) { /** * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of * the same type. - * + * * @return the kind value. */ public String kind() { @@ -84,7 +101,7 @@ public String kind() { /** * Set the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of * the same type. - * + * * @param kind the kind value to set. * @return the BatchEndpointInner object itself. */ @@ -95,7 +112,7 @@ public BatchEndpointInner withKind(String kind) { /** * Get the properties property: [Required] Additional attributes of the entity. - * + * * @return the properties value. */ public BatchEndpointProperties properties() { @@ -104,7 +121,7 @@ public BatchEndpointProperties properties() { /** * Set the properties property: [Required] Additional attributes of the entity. - * + * * @param properties the properties value to set. * @return the BatchEndpointInner object itself. */ @@ -115,7 +132,7 @@ public BatchEndpointInner withProperties(BatchEndpointProperties properties) { /** * Get the sku property: Sku details required for ARM contract for Autoscaling. - * + * * @return the sku value. */ public Sku sku() { @@ -124,7 +141,7 @@ public Sku sku() { /** * Set the sku property: Sku details required for ARM contract for Autoscaling. - * + * * @param sku the sku value to set. * @return the BatchEndpointInner object itself. */ @@ -135,21 +152,55 @@ public BatchEndpointInner withSku(Sku sku) { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } - /** {@inheritDoc} */ + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * {@inheritDoc} + */ @Override public BatchEndpointInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public BatchEndpointInner withTags(Map tags) { super.withTags(tags); @@ -158,7 +209,7 @@ public BatchEndpointInner withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -166,9 +217,8 @@ public void validate() { identity().validate(); } if (properties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property properties in model BatchEndpointInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property properties in model BatchEndpointInner")); } else { properties().validate(); } @@ -178,4 +228,65 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(BatchEndpointInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeJsonField("sku", this.sku); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchEndpointInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchEndpointInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BatchEndpointInner. + */ + public static BatchEndpointInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BatchEndpointInner deserializedBatchEndpointInner = new BatchEndpointInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedBatchEndpointInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedBatchEndpointInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedBatchEndpointInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedBatchEndpointInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedBatchEndpointInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedBatchEndpointInner.properties = BatchEndpointProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedBatchEndpointInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedBatchEndpointInner.kind = reader.getString(); + } else if ("sku".equals(fieldName)) { + deserializedBatchEndpointInner.sku = Sku.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedBatchEndpointInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBatchEndpointInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ClusterUpdateProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ClusterUpdateProperties.java index 4abc0bf1e9e19..3529474f10de8 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ClusterUpdateProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ClusterUpdateProperties.java @@ -5,25 +5,32 @@ package com.azure.resourcemanager.machinelearning.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.models.ScaleSettingsInformation; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** The properties of a amlCompute that need to be updated. */ +/** + * The properties of a amlCompute that need to be updated. + */ @Fluent -public final class ClusterUpdateProperties { +public final class ClusterUpdateProperties implements JsonSerializable { /* * Properties of ClusterUpdate */ - @JsonProperty(value = "properties") private ScaleSettingsInformation properties; - /** Creates an instance of ClusterUpdateProperties class. */ + /** + * Creates an instance of ClusterUpdateProperties class. + */ public ClusterUpdateProperties() { } /** * Get the properties property: Properties of ClusterUpdate. - * + * * @return the properties value. */ public ScaleSettingsInformation properties() { @@ -32,7 +39,7 @@ public ScaleSettingsInformation properties() { /** * Set the properties property: Properties of ClusterUpdate. - * + * * @param properties the properties value to set. * @return the ClusterUpdateProperties object itself. */ @@ -43,7 +50,7 @@ public ClusterUpdateProperties withProperties(ScaleSettingsInformation propertie /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -51,4 +58,40 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterUpdateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterUpdateProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ClusterUpdateProperties. + */ + public static ClusterUpdateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterUpdateProperties deserializedClusterUpdateProperties = new ClusterUpdateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedClusterUpdateProperties.properties = ScaleSettingsInformation.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterUpdateProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/CodeContainerInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/CodeContainerInner.java index 627c39dd4d842..81ef24936822e 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/CodeContainerInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/CodeContainerInner.java @@ -8,31 +8,51 @@ import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.models.CodeContainerProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Azure Resource Manager resource envelope. */ +/** + * Azure Resource Manager resource envelope. + */ @Fluent public final class CodeContainerInner extends ProxyResource { /* * [Required] Additional attributes of the entity. */ - @JsonProperty(value = "properties", required = true) private CodeContainerProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of CodeContainerInner class. */ + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of CodeContainerInner class. + */ public CodeContainerInner() { } /** * Get the properties property: [Required] Additional attributes of the entity. - * + * * @return the properties value. */ public CodeContainerProperties properties() { @@ -41,7 +61,7 @@ public CodeContainerProperties properties() { /** * Set the properties property: [Required] Additional attributes of the entity. - * + * * @param properties the properties value to set. * @return the CodeContainerInner object itself. */ @@ -52,27 +72,101 @@ public CodeContainerInner withProperties(CodeContainerProperties properties) { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (properties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property properties in model CodeContainerInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property properties in model CodeContainerInner")); } else { properties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(CodeContainerInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CodeContainerInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CodeContainerInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CodeContainerInner. + */ + public static CodeContainerInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CodeContainerInner deserializedCodeContainerInner = new CodeContainerInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCodeContainerInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedCodeContainerInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCodeContainerInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedCodeContainerInner.properties = CodeContainerProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedCodeContainerInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCodeContainerInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/CodeVersionInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/CodeVersionInner.java index ec872c6209d14..5b0d8710edc07 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/CodeVersionInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/CodeVersionInner.java @@ -8,31 +8,51 @@ import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.models.CodeVersionProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Azure Resource Manager resource envelope. */ +/** + * Azure Resource Manager resource envelope. + */ @Fluent public final class CodeVersionInner extends ProxyResource { /* * [Required] Additional attributes of the entity. */ - @JsonProperty(value = "properties", required = true) private CodeVersionProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of CodeVersionInner class. */ + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of CodeVersionInner class. + */ public CodeVersionInner() { } /** * Get the properties property: [Required] Additional attributes of the entity. - * + * * @return the properties value. */ public CodeVersionProperties properties() { @@ -41,7 +61,7 @@ public CodeVersionProperties properties() { /** * Set the properties property: [Required] Additional attributes of the entity. - * + * * @param properties the properties value to set. * @return the CodeVersionInner object itself. */ @@ -52,27 +72,101 @@ public CodeVersionInner withProperties(CodeVersionProperties properties) { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (properties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property properties in model CodeVersionInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property properties in model CodeVersionInner")); } else { properties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(CodeVersionInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CodeVersionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CodeVersionInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CodeVersionInner. + */ + public static CodeVersionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CodeVersionInner deserializedCodeVersionInner = new CodeVersionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCodeVersionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedCodeVersionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCodeVersionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedCodeVersionInner.properties = CodeVersionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedCodeVersionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCodeVersionInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ComponentContainerInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ComponentContainerInner.java index cfcf51505906b..0168e82327e59 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ComponentContainerInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ComponentContainerInner.java @@ -8,31 +8,51 @@ import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.models.ComponentContainerProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Azure Resource Manager resource envelope. */ +/** + * Azure Resource Manager resource envelope. + */ @Fluent public final class ComponentContainerInner extends ProxyResource { /* * [Required] Additional attributes of the entity. */ - @JsonProperty(value = "properties", required = true) private ComponentContainerProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of ComponentContainerInner class. */ + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of ComponentContainerInner class. + */ public ComponentContainerInner() { } /** * Get the properties property: [Required] Additional attributes of the entity. - * + * * @return the properties value. */ public ComponentContainerProperties properties() { @@ -41,7 +61,7 @@ public ComponentContainerProperties properties() { /** * Set the properties property: [Required] Additional attributes of the entity. - * + * * @param properties the properties value to set. * @return the ComponentContainerInner object itself. */ @@ -52,28 +72,102 @@ public ComponentContainerInner withProperties(ComponentContainerProperties prope /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (properties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property properties in model ComponentContainerInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property properties in model ComponentContainerInner")); } else { properties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(ComponentContainerInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ComponentContainerInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ComponentContainerInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ComponentContainerInner. + */ + public static ComponentContainerInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ComponentContainerInner deserializedComponentContainerInner = new ComponentContainerInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedComponentContainerInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedComponentContainerInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedComponentContainerInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedComponentContainerInner.properties = ComponentContainerProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedComponentContainerInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedComponentContainerInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ComponentVersionInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ComponentVersionInner.java index 55676a9cd644c..fbe9071c6c41d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ComponentVersionInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ComponentVersionInner.java @@ -8,31 +8,51 @@ import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.models.ComponentVersionProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Azure Resource Manager resource envelope. */ +/** + * Azure Resource Manager resource envelope. + */ @Fluent public final class ComponentVersionInner extends ProxyResource { /* * [Required] Additional attributes of the entity. */ - @JsonProperty(value = "properties", required = true) private ComponentVersionProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of ComponentVersionInner class. */ + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of ComponentVersionInner class. + */ public ComponentVersionInner() { } /** * Get the properties property: [Required] Additional attributes of the entity. - * + * * @return the properties value. */ public ComponentVersionProperties properties() { @@ -41,7 +61,7 @@ public ComponentVersionProperties properties() { /** * Set the properties property: [Required] Additional attributes of the entity. - * + * * @param properties the properties value to set. * @return the ComponentVersionInner object itself. */ @@ -52,28 +72,102 @@ public ComponentVersionInner withProperties(ComponentVersionProperties propertie /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (properties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property properties in model ComponentVersionInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property properties in model ComponentVersionInner")); } else { properties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(ComponentVersionInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ComponentVersionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ComponentVersionInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ComponentVersionInner. + */ + public static ComponentVersionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ComponentVersionInner deserializedComponentVersionInner = new ComponentVersionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedComponentVersionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedComponentVersionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedComponentVersionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedComponentVersionInner.properties = ComponentVersionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedComponentVersionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedComponentVersionInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ComputeResourceInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ComputeResourceInner.java index 170e868b87e95..9885a5d752a74 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ComputeResourceInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ComputeResourceInner.java @@ -7,60 +7,74 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.models.Compute; import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; import com.azure.resourcemanager.machinelearning.models.Sku; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; -/** Machine Learning compute object wrapped into ARM resource envelope. */ +/** + * Machine Learning compute object wrapped into ARM resource envelope. + */ @Fluent public final class ComputeResourceInner extends ProxyResource { /* * The identity of the resource. */ - @JsonProperty(value = "identity") private ManagedServiceIdentity identity; /* * Specifies the location of the resource. */ - @JsonProperty(value = "location") private String location; /* * Contains resource tags defined as key/value pairs. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* * The sku of the workspace. */ - @JsonProperty(value = "sku") private Sku sku; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; /* * Compute properties */ - @JsonProperty(value = "properties") private Compute properties; - /** Creates an instance of ComputeResourceInner class. */ + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of ComputeResourceInner class. + */ public ComputeResourceInner() { } /** * Get the identity property: The identity of the resource. - * + * * @return the identity value. */ public ManagedServiceIdentity identity() { @@ -69,7 +83,7 @@ public ManagedServiceIdentity identity() { /** * Set the identity property: The identity of the resource. - * + * * @param identity the identity value to set. * @return the ComputeResourceInner object itself. */ @@ -80,7 +94,7 @@ public ComputeResourceInner withIdentity(ManagedServiceIdentity identity) { /** * Get the location property: Specifies the location of the resource. - * + * * @return the location value. */ public String location() { @@ -89,7 +103,7 @@ public String location() { /** * Set the location property: Specifies the location of the resource. - * + * * @param location the location value to set. * @return the ComputeResourceInner object itself. */ @@ -100,7 +114,7 @@ public ComputeResourceInner withLocation(String location) { /** * Get the tags property: Contains resource tags defined as key/value pairs. - * + * * @return the tags value. */ public Map tags() { @@ -109,7 +123,7 @@ public Map tags() { /** * Set the tags property: Contains resource tags defined as key/value pairs. - * + * * @param tags the tags value to set. * @return the ComputeResourceInner object itself. */ @@ -120,7 +134,7 @@ public ComputeResourceInner withTags(Map tags) { /** * Get the sku property: The sku of the workspace. - * + * * @return the sku value. */ public Sku sku() { @@ -129,7 +143,7 @@ public Sku sku() { /** * Set the sku property: The sku of the workspace. - * + * * @param sku the sku value to set. * @return the ComputeResourceInner object itself. */ @@ -140,7 +154,7 @@ public ComputeResourceInner withSku(Sku sku) { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { @@ -149,7 +163,7 @@ public SystemData systemData() { /** * Get the properties property: Compute properties. - * + * * @return the properties value. */ public Compute properties() { @@ -158,7 +172,7 @@ public Compute properties() { /** * Set the properties property: Compute properties. - * + * * @param properties the properties value to set. * @return the ComputeResourceInner object itself. */ @@ -167,9 +181,39 @@ public ComputeResourceInner withProperties(Compute properties) { return this; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -183,4 +227,62 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ComputeResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ComputeResourceInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ComputeResourceInner. + */ + public static ComputeResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ComputeResourceInner deserializedComputeResourceInner = new ComputeResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedComputeResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedComputeResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedComputeResourceInner.type = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedComputeResourceInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("location".equals(fieldName)) { + deserializedComputeResourceInner.location = reader.getString(); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedComputeResourceInner.tags = tags; + } else if ("sku".equals(fieldName)) { + deserializedComputeResourceInner.sku = Sku.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedComputeResourceInner.systemData = SystemData.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedComputeResourceInner.properties = Compute.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedComputeResourceInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ComputeSecretsInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ComputeSecretsInner.java index ad8ddc04d37d5..3d620290a0eea 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ComputeSecretsInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ComputeSecretsInner.java @@ -5,36 +5,111 @@ package com.azure.resourcemanager.machinelearning.fluent.models; import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.models.AksComputeSecrets; +import com.azure.resourcemanager.machinelearning.models.ComputeType; import com.azure.resourcemanager.machinelearning.models.DatabricksComputeSecrets; import com.azure.resourcemanager.machinelearning.models.VirtualMachineSecrets; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Secrets related to a Machine Learning compute. Might differ for every type of compute. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "computeType", - defaultImpl = ComputeSecretsInner.class) -@JsonTypeName("ComputeSecrets") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "AKS", value = AksComputeSecrets.class), - @JsonSubTypes.Type(name = "VirtualMachine", value = VirtualMachineSecrets.class), - @JsonSubTypes.Type(name = "Databricks", value = DatabricksComputeSecrets.class) -}) +import java.io.IOException; + +/** + * Secrets related to a Machine Learning compute. Might differ for every type of compute. + */ @Immutable -public class ComputeSecretsInner { - /** Creates an instance of ComputeSecretsInner class. */ +public class ComputeSecretsInner implements JsonSerializable { + /* + * The type of compute + */ + private ComputeType computeType = ComputeType.fromString("ComputeSecrets"); + + /** + * Creates an instance of ComputeSecretsInner class. + */ public ComputeSecretsInner() { } + /** + * Get the computeType property: The type of compute. + * + * @return the computeType value. + */ + public ComputeType computeType() { + return this.computeType; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("computeType", this.computeType == null ? null : this.computeType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ComputeSecretsInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ComputeSecretsInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ComputeSecretsInner. + */ + public static ComputeSecretsInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("computeType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("AKS".equals(discriminatorValue)) { + return AksComputeSecrets.fromJson(readerToUse.reset()); + } else if ("VirtualMachine".equals(discriminatorValue)) { + return VirtualMachineSecrets.fromJson(readerToUse.reset()); + } else if ("Databricks".equals(discriminatorValue)) { + return DatabricksComputeSecrets.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static ComputeSecretsInner fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ComputeSecretsInner deserializedComputeSecretsInner = new ComputeSecretsInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("computeType".equals(fieldName)) { + deserializedComputeSecretsInner.computeType = ComputeType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedComputeSecretsInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/DataContainerInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/DataContainerInner.java index 71116c0b5ad20..b20e49abe512e 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/DataContainerInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/DataContainerInner.java @@ -8,31 +8,51 @@ import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.models.DataContainerProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Azure Resource Manager resource envelope. */ +/** + * Azure Resource Manager resource envelope. + */ @Fluent public final class DataContainerInner extends ProxyResource { /* * [Required] Additional attributes of the entity. */ - @JsonProperty(value = "properties", required = true) private DataContainerProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of DataContainerInner class. */ + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of DataContainerInner class. + */ public DataContainerInner() { } /** * Get the properties property: [Required] Additional attributes of the entity. - * + * * @return the properties value. */ public DataContainerProperties properties() { @@ -41,7 +61,7 @@ public DataContainerProperties properties() { /** * Set the properties property: [Required] Additional attributes of the entity. - * + * * @param properties the properties value to set. * @return the DataContainerInner object itself. */ @@ -52,27 +72,101 @@ public DataContainerInner withProperties(DataContainerProperties properties) { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (properties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property properties in model DataContainerInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property properties in model DataContainerInner")); } else { properties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(DataContainerInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataContainerInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataContainerInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataContainerInner. + */ + public static DataContainerInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataContainerInner deserializedDataContainerInner = new DataContainerInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDataContainerInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDataContainerInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDataContainerInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDataContainerInner.properties = DataContainerProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDataContainerInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDataContainerInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/DataVersionBaseInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/DataVersionBaseInner.java index 4496968987269..90443894107ed 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/DataVersionBaseInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/DataVersionBaseInner.java @@ -8,31 +8,51 @@ import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.models.DataVersionBaseProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Azure Resource Manager resource envelope. */ +/** + * Azure Resource Manager resource envelope. + */ @Fluent public final class DataVersionBaseInner extends ProxyResource { /* * [Required] Additional attributes of the entity. */ - @JsonProperty(value = "properties", required = true) private DataVersionBaseProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of DataVersionBaseInner class. */ + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of DataVersionBaseInner class. + */ public DataVersionBaseInner() { } /** * Get the properties property: [Required] Additional attributes of the entity. - * + * * @return the properties value. */ public DataVersionBaseProperties properties() { @@ -41,7 +61,7 @@ public DataVersionBaseProperties properties() { /** * Set the properties property: [Required] Additional attributes of the entity. - * + * * @param properties the properties value to set. * @return the DataVersionBaseInner object itself. */ @@ -52,22 +72,52 @@ public DataVersionBaseInner withProperties(DataVersionBaseProperties properties) /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (properties() == null) { - throw LOGGER - .logExceptionAsError( + throw LOGGER.atError() + .log( new IllegalArgumentException("Missing required property properties in model DataVersionBaseInner")); } else { properties().validate(); @@ -75,4 +125,49 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(DataVersionBaseInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataVersionBaseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataVersionBaseInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataVersionBaseInner. + */ + public static DataVersionBaseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataVersionBaseInner deserializedDataVersionBaseInner = new DataVersionBaseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDataVersionBaseInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDataVersionBaseInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDataVersionBaseInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDataVersionBaseInner.properties = DataVersionBaseProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDataVersionBaseInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDataVersionBaseInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/DatastoreInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/DatastoreInner.java index d462f55031fdf..90773283eb3a5 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/DatastoreInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/DatastoreInner.java @@ -8,31 +8,51 @@ import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.models.DatastoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Azure Resource Manager resource envelope. */ +/** + * Azure Resource Manager resource envelope. + */ @Fluent public final class DatastoreInner extends ProxyResource { /* * [Required] Additional attributes of the entity. */ - @JsonProperty(value = "properties", required = true) private DatastoreProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of DatastoreInner class. */ + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of DatastoreInner class. + */ public DatastoreInner() { } /** * Get the properties property: [Required] Additional attributes of the entity. - * + * * @return the properties value. */ public DatastoreProperties properties() { @@ -41,7 +61,7 @@ public DatastoreProperties properties() { /** * Set the properties property: [Required] Additional attributes of the entity. - * + * * @param properties the properties value to set. * @return the DatastoreInner object itself. */ @@ -52,27 +72,101 @@ public DatastoreInner withProperties(DatastoreProperties properties) { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (properties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property properties in model DatastoreInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property properties in model DatastoreInner")); } else { properties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(DatastoreInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DatastoreInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatastoreInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DatastoreInner. + */ + public static DatastoreInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DatastoreInner deserializedDatastoreInner = new DatastoreInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDatastoreInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDatastoreInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDatastoreInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDatastoreInner.properties = DatastoreProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDatastoreInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDatastoreInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/DatastoreSecretsInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/DatastoreSecretsInner.java index 2cb1bcd991478..d1535e727afcb 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/DatastoreSecretsInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/DatastoreSecretsInner.java @@ -5,38 +5,114 @@ package com.azure.resourcemanager.machinelearning.fluent.models; import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.models.AccountKeyDatastoreSecrets; import com.azure.resourcemanager.machinelearning.models.CertificateDatastoreSecrets; import com.azure.resourcemanager.machinelearning.models.SasDatastoreSecrets; +import com.azure.resourcemanager.machinelearning.models.SecretsType; import com.azure.resourcemanager.machinelearning.models.ServicePrincipalDatastoreSecrets; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Base definition for datastore secrets. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "secretsType", - defaultImpl = DatastoreSecretsInner.class) -@JsonTypeName("DatastoreSecrets") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "AccountKey", value = AccountKeyDatastoreSecrets.class), - @JsonSubTypes.Type(name = "Certificate", value = CertificateDatastoreSecrets.class), - @JsonSubTypes.Type(name = "Sas", value = SasDatastoreSecrets.class), - @JsonSubTypes.Type(name = "ServicePrincipal", value = ServicePrincipalDatastoreSecrets.class) -}) +import java.io.IOException; + +/** + * Base definition for datastore secrets. + */ @Immutable -public class DatastoreSecretsInner { - /** Creates an instance of DatastoreSecretsInner class. */ +public class DatastoreSecretsInner implements JsonSerializable { + /* + * [Required] Credential type used to authentication with storage. + */ + private SecretsType secretsType = SecretsType.fromString("DatastoreSecrets"); + + /** + * Creates an instance of DatastoreSecretsInner class. + */ public DatastoreSecretsInner() { } + /** + * Get the secretsType property: [Required] Credential type used to authentication with storage. + * + * @return the secretsType value. + */ + public SecretsType secretsType() { + return this.secretsType; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("secretsType", this.secretsType == null ? null : this.secretsType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DatastoreSecretsInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatastoreSecretsInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DatastoreSecretsInner. + */ + public static DatastoreSecretsInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("secretsType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("AccountKey".equals(discriminatorValue)) { + return AccountKeyDatastoreSecrets.fromJson(readerToUse.reset()); + } else if ("Certificate".equals(discriminatorValue)) { + return CertificateDatastoreSecrets.fromJson(readerToUse.reset()); + } else if ("Sas".equals(discriminatorValue)) { + return SasDatastoreSecrets.fromJson(readerToUse.reset()); + } else if ("ServicePrincipal".equals(discriminatorValue)) { + return ServicePrincipalDatastoreSecrets.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static DatastoreSecretsInner fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DatastoreSecretsInner deserializedDatastoreSecretsInner = new DatastoreSecretsInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("secretsType".equals(fieldName)) { + deserializedDatastoreSecretsInner.secretsType = SecretsType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDatastoreSecretsInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/DeploymentLogsInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/DeploymentLogsInner.java index d9e251314114f..532f61f4d78cc 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/DeploymentLogsInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/DeploymentLogsInner.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.machinelearning.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The DeploymentLogs model. */ +/** + * The DeploymentLogs model. + */ @Fluent -public final class DeploymentLogsInner { +public final class DeploymentLogsInner implements JsonSerializable { /* * The retrieved online deployment logs. */ - @JsonProperty(value = "content") private String content; - /** Creates an instance of DeploymentLogsInner class. */ + /** + * Creates an instance of DeploymentLogsInner class. + */ public DeploymentLogsInner() { } /** * Get the content property: The retrieved online deployment logs. - * + * * @return the content value. */ public String content() { @@ -31,7 +38,7 @@ public String content() { /** * Set the content property: The retrieved online deployment logs. - * + * * @param content the content value to set. * @return the DeploymentLogsInner object itself. */ @@ -42,9 +49,45 @@ public DeploymentLogsInner withContent(String content) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("content", this.content); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeploymentLogsInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeploymentLogsInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DeploymentLogsInner. + */ + public static DeploymentLogsInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeploymentLogsInner deserializedDeploymentLogsInner = new DeploymentLogsInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("content".equals(fieldName)) { + deserializedDeploymentLogsInner.content = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDeploymentLogsInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/DiagnoseResponseResultInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/DiagnoseResponseResultInner.java index 0294a92441bb6..5ac507407d872 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/DiagnoseResponseResultInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/DiagnoseResponseResultInner.java @@ -5,25 +5,32 @@ package com.azure.resourcemanager.machinelearning.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.models.DiagnoseResponseResultValue; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** The DiagnoseResponseResult model. */ +/** + * The DiagnoseResponseResult model. + */ @Fluent -public final class DiagnoseResponseResultInner { +public final class DiagnoseResponseResultInner implements JsonSerializable { /* * The value property. */ - @JsonProperty(value = "value") private DiagnoseResponseResultValue value; - /** Creates an instance of DiagnoseResponseResultInner class. */ + /** + * Creates an instance of DiagnoseResponseResultInner class. + */ public DiagnoseResponseResultInner() { } /** * Get the value property: The value property. - * + * * @return the value value. */ public DiagnoseResponseResultValue value() { @@ -32,7 +39,7 @@ public DiagnoseResponseResultValue value() { /** * Set the value property: The value property. - * + * * @param value the value value to set. * @return the DiagnoseResponseResultInner object itself. */ @@ -43,7 +50,7 @@ public DiagnoseResponseResultInner withValue(DiagnoseResponseResultValue value) /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -51,4 +58,40 @@ public void validate() { value().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiagnoseResponseResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiagnoseResponseResultInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DiagnoseResponseResultInner. + */ + public static DiagnoseResponseResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiagnoseResponseResultInner deserializedDiagnoseResponseResultInner = new DiagnoseResponseResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedDiagnoseResponseResultInner.value = DiagnoseResponseResultValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDiagnoseResponseResultInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/EndpointAuthKeysInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/EndpointAuthKeysInner.java index cd26c1312628f..33f23772b606c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/EndpointAuthKeysInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/EndpointAuthKeysInner.java @@ -5,30 +5,36 @@ package com.azure.resourcemanager.machinelearning.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Keys for endpoint authentication. */ +/** + * Keys for endpoint authentication. + */ @Fluent -public final class EndpointAuthKeysInner { +public final class EndpointAuthKeysInner implements JsonSerializable { /* * The primary key. */ - @JsonProperty(value = "primaryKey") private String primaryKey; /* * The secondary key. */ - @JsonProperty(value = "secondaryKey") private String secondaryKey; - /** Creates an instance of EndpointAuthKeysInner class. */ + /** + * Creates an instance of EndpointAuthKeysInner class. + */ public EndpointAuthKeysInner() { } /** * Get the primaryKey property: The primary key. - * + * * @return the primaryKey value. */ public String primaryKey() { @@ -37,7 +43,7 @@ public String primaryKey() { /** * Set the primaryKey property: The primary key. - * + * * @param primaryKey the primaryKey value to set. * @return the EndpointAuthKeysInner object itself. */ @@ -48,7 +54,7 @@ public EndpointAuthKeysInner withPrimaryKey(String primaryKey) { /** * Get the secondaryKey property: The secondary key. - * + * * @return the secondaryKey value. */ public String secondaryKey() { @@ -57,7 +63,7 @@ public String secondaryKey() { /** * Set the secondaryKey property: The secondary key. - * + * * @param secondaryKey the secondaryKey value to set. * @return the EndpointAuthKeysInner object itself. */ @@ -68,9 +74,48 @@ public EndpointAuthKeysInner withSecondaryKey(String secondaryKey) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("primaryKey", this.primaryKey); + jsonWriter.writeStringField("secondaryKey", this.secondaryKey); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EndpointAuthKeysInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EndpointAuthKeysInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the EndpointAuthKeysInner. + */ + public static EndpointAuthKeysInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EndpointAuthKeysInner deserializedEndpointAuthKeysInner = new EndpointAuthKeysInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("primaryKey".equals(fieldName)) { + deserializedEndpointAuthKeysInner.primaryKey = reader.getString(); + } else if ("secondaryKey".equals(fieldName)) { + deserializedEndpointAuthKeysInner.secondaryKey = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEndpointAuthKeysInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/EndpointAuthTokenInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/EndpointAuthTokenInner.java index f0a288636a6cd..f427b864474cf 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/EndpointAuthTokenInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/EndpointAuthTokenInner.java @@ -5,42 +5,46 @@ package com.azure.resourcemanager.machinelearning.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Service Token. */ +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Service Token. + */ @Fluent -public final class EndpointAuthTokenInner { +public final class EndpointAuthTokenInner implements JsonSerializable { /* * Access token for endpoint authentication. */ - @JsonProperty(value = "accessToken") private String accessToken; /* * Access token expiry time (UTC). */ - @JsonProperty(value = "expiryTimeUtc") private Long expiryTimeUtc; /* * Refresh access token after time (UTC). */ - @JsonProperty(value = "refreshAfterTimeUtc") private Long refreshAfterTimeUtc; /* * Access token type. */ - @JsonProperty(value = "tokenType") private String tokenType; - /** Creates an instance of EndpointAuthTokenInner class. */ + /** + * Creates an instance of EndpointAuthTokenInner class. + */ public EndpointAuthTokenInner() { } /** * Get the accessToken property: Access token for endpoint authentication. - * + * * @return the accessToken value. */ public String accessToken() { @@ -49,7 +53,7 @@ public String accessToken() { /** * Set the accessToken property: Access token for endpoint authentication. - * + * * @param accessToken the accessToken value to set. * @return the EndpointAuthTokenInner object itself. */ @@ -60,7 +64,7 @@ public EndpointAuthTokenInner withAccessToken(String accessToken) { /** * Get the expiryTimeUtc property: Access token expiry time (UTC). - * + * * @return the expiryTimeUtc value. */ public Long expiryTimeUtc() { @@ -69,7 +73,7 @@ public Long expiryTimeUtc() { /** * Set the expiryTimeUtc property: Access token expiry time (UTC). - * + * * @param expiryTimeUtc the expiryTimeUtc value to set. * @return the EndpointAuthTokenInner object itself. */ @@ -80,7 +84,7 @@ public EndpointAuthTokenInner withExpiryTimeUtc(Long expiryTimeUtc) { /** * Get the refreshAfterTimeUtc property: Refresh access token after time (UTC). - * + * * @return the refreshAfterTimeUtc value. */ public Long refreshAfterTimeUtc() { @@ -89,7 +93,7 @@ public Long refreshAfterTimeUtc() { /** * Set the refreshAfterTimeUtc property: Refresh access token after time (UTC). - * + * * @param refreshAfterTimeUtc the refreshAfterTimeUtc value to set. * @return the EndpointAuthTokenInner object itself. */ @@ -100,7 +104,7 @@ public EndpointAuthTokenInner withRefreshAfterTimeUtc(Long refreshAfterTimeUtc) /** * Get the tokenType property: Access token type. - * + * * @return the tokenType value. */ public String tokenType() { @@ -109,7 +113,7 @@ public String tokenType() { /** * Set the tokenType property: Access token type. - * + * * @param tokenType the tokenType value to set. * @return the EndpointAuthTokenInner object itself. */ @@ -120,9 +124,54 @@ public EndpointAuthTokenInner withTokenType(String tokenType) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("accessToken", this.accessToken); + jsonWriter.writeNumberField("expiryTimeUtc", this.expiryTimeUtc); + jsonWriter.writeNumberField("refreshAfterTimeUtc", this.refreshAfterTimeUtc); + jsonWriter.writeStringField("tokenType", this.tokenType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EndpointAuthTokenInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EndpointAuthTokenInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the EndpointAuthTokenInner. + */ + public static EndpointAuthTokenInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EndpointAuthTokenInner deserializedEndpointAuthTokenInner = new EndpointAuthTokenInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("accessToken".equals(fieldName)) { + deserializedEndpointAuthTokenInner.accessToken = reader.getString(); + } else if ("expiryTimeUtc".equals(fieldName)) { + deserializedEndpointAuthTokenInner.expiryTimeUtc = reader.getNullable(JsonReader::getLong); + } else if ("refreshAfterTimeUtc".equals(fieldName)) { + deserializedEndpointAuthTokenInner.refreshAfterTimeUtc = reader.getNullable(JsonReader::getLong); + } else if ("tokenType".equals(fieldName)) { + deserializedEndpointAuthTokenInner.tokenType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEndpointAuthTokenInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/EndpointPropertiesBaseInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/EndpointPropertiesBaseInner.java index 6219e1e61a6c7..25bf585399b47 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/EndpointPropertiesBaseInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/EndpointPropertiesBaseInner.java @@ -6,61 +6,61 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.models.EndpointAuthMode; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; -/** Inference Endpoint base definition. */ +/** + * Inference Endpoint base definition. + */ @Fluent -public class EndpointPropertiesBaseInner { +public class EndpointPropertiesBaseInner implements JsonSerializable { /* * [Required] Use 'Key' for key based authentication and 'AMLToken' for Azure Machine Learning token-based * authentication. 'Key' doesn't expire but 'AMLToken' does. */ - @JsonProperty(value = "authMode", required = true) private EndpointAuthMode authMode; /* * Description of the inference endpoint. */ - @JsonProperty(value = "description") private String description; /* * EndpointAuthKeys to set initially on an Endpoint. * This property will always be returned as null. AuthKey values must be retrieved using the ListKeys API. */ - @JsonProperty(value = "keys") private EndpointAuthKeysInner keys; /* * Property dictionary. Properties can be added, but not removed or altered. */ - @JsonProperty(value = "properties") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map properties; /* * Endpoint URI. */ - @JsonProperty(value = "scoringUri", access = JsonProperty.Access.WRITE_ONLY) private String scoringUri; /* * Endpoint Swagger URI. */ - @JsonProperty(value = "swaggerUri", access = JsonProperty.Access.WRITE_ONLY) private String swaggerUri; - /** Creates an instance of EndpointPropertiesBaseInner class. */ + /** + * Creates an instance of EndpointPropertiesBaseInner class. + */ public EndpointPropertiesBaseInner() { } /** * Get the authMode property: [Required] Use 'Key' for key based authentication and 'AMLToken' for Azure Machine * Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. - * + * * @return the authMode value. */ public EndpointAuthMode authMode() { @@ -70,7 +70,7 @@ public EndpointAuthMode authMode() { /** * Set the authMode property: [Required] Use 'Key' for key based authentication and 'AMLToken' for Azure Machine * Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. - * + * * @param authMode the authMode value to set. * @return the EndpointPropertiesBaseInner object itself. */ @@ -81,7 +81,7 @@ public EndpointPropertiesBaseInner withAuthMode(EndpointAuthMode authMode) { /** * Get the description property: Description of the inference endpoint. - * + * * @return the description value. */ public String description() { @@ -90,7 +90,7 @@ public String description() { /** * Set the description property: Description of the inference endpoint. - * + * * @param description the description value to set. * @return the EndpointPropertiesBaseInner object itself. */ @@ -100,9 +100,9 @@ public EndpointPropertiesBaseInner withDescription(String description) { } /** - * Get the keys property: EndpointAuthKeys to set initially on an Endpoint. This property will always be returned as - * null. AuthKey values must be retrieved using the ListKeys API. - * + * Get the keys property: EndpointAuthKeys to set initially on an Endpoint. + * This property will always be returned as null. AuthKey values must be retrieved using the ListKeys API. + * * @return the keys value. */ public EndpointAuthKeysInner keys() { @@ -110,9 +110,9 @@ public EndpointAuthKeysInner keys() { } /** - * Set the keys property: EndpointAuthKeys to set initially on an Endpoint. This property will always be returned as - * null. AuthKey values must be retrieved using the ListKeys API. - * + * Set the keys property: EndpointAuthKeys to set initially on an Endpoint. + * This property will always be returned as null. AuthKey values must be retrieved using the ListKeys API. + * * @param keys the keys value to set. * @return the EndpointPropertiesBaseInner object itself. */ @@ -123,7 +123,7 @@ public EndpointPropertiesBaseInner withKeys(EndpointAuthKeysInner keys) { /** * Get the properties property: Property dictionary. Properties can be added, but not removed or altered. - * + * * @return the properties value. */ public Map properties() { @@ -132,7 +132,7 @@ public Map properties() { /** * Set the properties property: Property dictionary. Properties can be added, but not removed or altered. - * + * * @param properties the properties value to set. * @return the EndpointPropertiesBaseInner object itself. */ @@ -143,33 +143,54 @@ public EndpointPropertiesBaseInner withProperties(Map properties /** * Get the scoringUri property: Endpoint URI. - * + * * @return the scoringUri value. */ public String scoringUri() { return this.scoringUri; } + /** + * Set the scoringUri property: Endpoint URI. + * + * @param scoringUri the scoringUri value to set. + * @return the EndpointPropertiesBaseInner object itself. + */ + EndpointPropertiesBaseInner withScoringUri(String scoringUri) { + this.scoringUri = scoringUri; + return this; + } + /** * Get the swaggerUri property: Endpoint Swagger URI. - * + * * @return the swaggerUri value. */ public String swaggerUri() { return this.swaggerUri; } + /** + * Set the swaggerUri property: Endpoint Swagger URI. + * + * @param swaggerUri the swaggerUri value to set. + * @return the EndpointPropertiesBaseInner object itself. + */ + EndpointPropertiesBaseInner withSwaggerUri(String swaggerUri) { + this.swaggerUri = swaggerUri; + return this; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (authMode() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property authMode in model EndpointPropertiesBaseInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property authMode in model EndpointPropertiesBaseInner")); } if (keys() != null) { keys().validate(); @@ -177,4 +198,55 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(EndpointPropertiesBaseInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("authMode", this.authMode == null ? null : this.authMode.toString()); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeJsonField("keys", this.keys); + jsonWriter.writeMapField("properties", this.properties, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EndpointPropertiesBaseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EndpointPropertiesBaseInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EndpointPropertiesBaseInner. + */ + public static EndpointPropertiesBaseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EndpointPropertiesBaseInner deserializedEndpointPropertiesBaseInner = new EndpointPropertiesBaseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("authMode".equals(fieldName)) { + deserializedEndpointPropertiesBaseInner.authMode = EndpointAuthMode.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedEndpointPropertiesBaseInner.description = reader.getString(); + } else if ("keys".equals(fieldName)) { + deserializedEndpointPropertiesBaseInner.keys = EndpointAuthKeysInner.fromJson(reader); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedEndpointPropertiesBaseInner.properties = properties; + } else if ("scoringUri".equals(fieldName)) { + deserializedEndpointPropertiesBaseInner.scoringUri = reader.getString(); + } else if ("swaggerUri".equals(fieldName)) { + deserializedEndpointPropertiesBaseInner.swaggerUri = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEndpointPropertiesBaseInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/EnvironmentContainerInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/EnvironmentContainerInner.java index a6d47c5fe1aa8..988eef2ab7d49 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/EnvironmentContainerInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/EnvironmentContainerInner.java @@ -8,31 +8,51 @@ import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.models.EnvironmentContainerProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Azure Resource Manager resource envelope. */ +/** + * Azure Resource Manager resource envelope. + */ @Fluent public final class EnvironmentContainerInner extends ProxyResource { /* * [Required] Additional attributes of the entity. */ - @JsonProperty(value = "properties", required = true) private EnvironmentContainerProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of EnvironmentContainerInner class. */ + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of EnvironmentContainerInner class. + */ public EnvironmentContainerInner() { } /** * Get the properties property: [Required] Additional attributes of the entity. - * + * * @return the properties value. */ public EnvironmentContainerProperties properties() { @@ -41,7 +61,7 @@ public EnvironmentContainerProperties properties() { /** * Set the properties property: [Required] Additional attributes of the entity. - * + * * @param properties the properties value to set. * @return the EnvironmentContainerInner object itself. */ @@ -52,28 +72,102 @@ public EnvironmentContainerInner withProperties(EnvironmentContainerProperties p /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (properties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property properties in model EnvironmentContainerInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property properties in model EnvironmentContainerInner")); } else { properties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(EnvironmentContainerInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EnvironmentContainerInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EnvironmentContainerInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EnvironmentContainerInner. + */ + public static EnvironmentContainerInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EnvironmentContainerInner deserializedEnvironmentContainerInner = new EnvironmentContainerInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEnvironmentContainerInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEnvironmentContainerInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEnvironmentContainerInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedEnvironmentContainerInner.properties = EnvironmentContainerProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEnvironmentContainerInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEnvironmentContainerInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/EnvironmentVersionInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/EnvironmentVersionInner.java index ce8d1971fc7a3..479e58bf02483 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/EnvironmentVersionInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/EnvironmentVersionInner.java @@ -8,31 +8,51 @@ import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.models.EnvironmentVersionProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Azure Resource Manager resource envelope. */ +/** + * Azure Resource Manager resource envelope. + */ @Fluent public final class EnvironmentVersionInner extends ProxyResource { /* * [Required] Additional attributes of the entity. */ - @JsonProperty(value = "properties", required = true) private EnvironmentVersionProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of EnvironmentVersionInner class. */ + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of EnvironmentVersionInner class. + */ public EnvironmentVersionInner() { } /** * Get the properties property: [Required] Additional attributes of the entity. - * + * * @return the properties value. */ public EnvironmentVersionProperties properties() { @@ -41,7 +61,7 @@ public EnvironmentVersionProperties properties() { /** * Set the properties property: [Required] Additional attributes of the entity. - * + * * @param properties the properties value to set. * @return the EnvironmentVersionInner object itself. */ @@ -52,28 +72,102 @@ public EnvironmentVersionInner withProperties(EnvironmentVersionProperties prope /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (properties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property properties in model EnvironmentVersionInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property properties in model EnvironmentVersionInner")); } else { properties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(EnvironmentVersionInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EnvironmentVersionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EnvironmentVersionInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EnvironmentVersionInner. + */ + public static EnvironmentVersionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EnvironmentVersionInner deserializedEnvironmentVersionInner = new EnvironmentVersionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEnvironmentVersionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEnvironmentVersionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEnvironmentVersionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedEnvironmentVersionInner.properties = EnvironmentVersionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEnvironmentVersionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEnvironmentVersionInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ExternalFqdnResponseInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ExternalFqdnResponseInner.java index 8dbef74cad4f9..1ddfcb011592a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ExternalFqdnResponseInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ExternalFqdnResponseInner.java @@ -5,26 +5,33 @@ package com.azure.resourcemanager.machinelearning.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.models.FqdnEndpoints; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** The ExternalFqdnResponse model. */ +/** + * The ExternalFqdnResponse model. + */ @Fluent -public final class ExternalFqdnResponseInner { +public final class ExternalFqdnResponseInner implements JsonSerializable { /* * The value property. */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of ExternalFqdnResponseInner class. */ + /** + * Creates an instance of ExternalFqdnResponseInner class. + */ public ExternalFqdnResponseInner() { } /** * Get the value property: The value property. - * + * * @return the value value. */ public List value() { @@ -33,7 +40,7 @@ public List value() { /** * Set the value property: The value property. - * + * * @param value the value value to set. * @return the ExternalFqdnResponseInner object itself. */ @@ -44,7 +51,7 @@ public ExternalFqdnResponseInner withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -52,4 +59,41 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExternalFqdnResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExternalFqdnResponseInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExternalFqdnResponseInner. + */ + public static ExternalFqdnResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExternalFqdnResponseInner deserializedExternalFqdnResponseInner = new ExternalFqdnResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> FqdnEndpoints.fromJson(reader1)); + deserializedExternalFqdnResponseInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedExternalFqdnResponseInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/FeatureInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/FeatureInner.java new file mode 100644 index 0000000000000..5fab82ad54b0b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/FeatureInner.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.machinelearning.models.FeatureProperties; +import java.io.IOException; + +/** + * Azure Resource Manager resource envelope. + */ +@Fluent +public final class FeatureInner extends ProxyResource { + /* + * [Required] Additional attributes of the entity. + */ + private FeatureProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of FeatureInner class. + */ + public FeatureInner() { + } + + /** + * Get the properties property: [Required] Additional attributes of the entity. + * + * @return the properties value. + */ + public FeatureProperties properties() { + return this.properties; + } + + /** + * Set the properties property: [Required] Additional attributes of the entity. + * + * @param properties the properties value to set. + * @return the FeatureInner object itself. + */ + public FeatureInner withProperties(FeatureProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property properties in model FeatureInner")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FeatureInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FeatureInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FeatureInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FeatureInner. + */ + public static FeatureInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FeatureInner deserializedFeatureInner = new FeatureInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedFeatureInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedFeatureInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedFeatureInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedFeatureInner.properties = FeatureProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedFeatureInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFeatureInner; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/FeaturesetContainerInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/FeaturesetContainerInner.java new file mode 100644 index 0000000000000..75e459199aecd --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/FeaturesetContainerInner.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.machinelearning.models.FeaturesetContainerProperties; +import java.io.IOException; + +/** + * Azure Resource Manager resource envelope. + */ +@Fluent +public final class FeaturesetContainerInner extends ProxyResource { + /* + * [Required] Additional attributes of the entity. + */ + private FeaturesetContainerProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of FeaturesetContainerInner class. + */ + public FeaturesetContainerInner() { + } + + /** + * Get the properties property: [Required] Additional attributes of the entity. + * + * @return the properties value. + */ + public FeaturesetContainerProperties properties() { + return this.properties; + } + + /** + * Set the properties property: [Required] Additional attributes of the entity. + * + * @param properties the properties value to set. + * @return the FeaturesetContainerInner object itself. + */ + public FeaturesetContainerInner withProperties(FeaturesetContainerProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property properties in model FeaturesetContainerInner")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FeaturesetContainerInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FeaturesetContainerInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FeaturesetContainerInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FeaturesetContainerInner. + */ + public static FeaturesetContainerInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FeaturesetContainerInner deserializedFeaturesetContainerInner = new FeaturesetContainerInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedFeaturesetContainerInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedFeaturesetContainerInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedFeaturesetContainerInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedFeaturesetContainerInner.properties = FeaturesetContainerProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedFeaturesetContainerInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFeaturesetContainerInner; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/FeaturesetVersionBackfillResponseInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/FeaturesetVersionBackfillResponseInner.java new file mode 100644 index 0000000000000..24b63beb85cbe --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/FeaturesetVersionBackfillResponseInner.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Response payload for creating a backfill request for a given feature set version. + */ +@Fluent +public final class FeaturesetVersionBackfillResponseInner + implements JsonSerializable { + /* + * List of jobs submitted as part of the backfill request. + */ + private List jobIds; + + /** + * Creates an instance of FeaturesetVersionBackfillResponseInner class. + */ + public FeaturesetVersionBackfillResponseInner() { + } + + /** + * Get the jobIds property: List of jobs submitted as part of the backfill request. + * + * @return the jobIds value. + */ + public List jobIds() { + return this.jobIds; + } + + /** + * Set the jobIds property: List of jobs submitted as part of the backfill request. + * + * @param jobIds the jobIds value to set. + * @return the FeaturesetVersionBackfillResponseInner object itself. + */ + public FeaturesetVersionBackfillResponseInner withJobIds(List jobIds) { + this.jobIds = jobIds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("jobIds", this.jobIds, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FeaturesetVersionBackfillResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FeaturesetVersionBackfillResponseInner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FeaturesetVersionBackfillResponseInner. + */ + public static FeaturesetVersionBackfillResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FeaturesetVersionBackfillResponseInner deserializedFeaturesetVersionBackfillResponseInner + = new FeaturesetVersionBackfillResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("jobIds".equals(fieldName)) { + List jobIds = reader.readArray(reader1 -> reader1.getString()); + deserializedFeaturesetVersionBackfillResponseInner.jobIds = jobIds; + } else { + reader.skipChildren(); + } + } + + return deserializedFeaturesetVersionBackfillResponseInner; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/FeaturesetVersionInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/FeaturesetVersionInner.java new file mode 100644 index 0000000000000..68b3d08df57cb --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/FeaturesetVersionInner.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.machinelearning.models.FeaturesetVersionProperties; +import java.io.IOException; + +/** + * Azure Resource Manager resource envelope. + */ +@Fluent +public final class FeaturesetVersionInner extends ProxyResource { + /* + * [Required] Additional attributes of the entity. + */ + private FeaturesetVersionProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of FeaturesetVersionInner class. + */ + public FeaturesetVersionInner() { + } + + /** + * Get the properties property: [Required] Additional attributes of the entity. + * + * @return the properties value. + */ + public FeaturesetVersionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: [Required] Additional attributes of the entity. + * + * @param properties the properties value to set. + * @return the FeaturesetVersionInner object itself. + */ + public FeaturesetVersionInner withProperties(FeaturesetVersionProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property properties in model FeaturesetVersionInner")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FeaturesetVersionInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FeaturesetVersionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FeaturesetVersionInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FeaturesetVersionInner. + */ + public static FeaturesetVersionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FeaturesetVersionInner deserializedFeaturesetVersionInner = new FeaturesetVersionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedFeaturesetVersionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedFeaturesetVersionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedFeaturesetVersionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedFeaturesetVersionInner.properties = FeaturesetVersionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedFeaturesetVersionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFeaturesetVersionInner; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/FeaturestoreEntityContainerInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/FeaturestoreEntityContainerInner.java new file mode 100644 index 0000000000000..3cff75870f94d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/FeaturestoreEntityContainerInner.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.machinelearning.models.FeaturestoreEntityContainerProperties; +import java.io.IOException; + +/** + * Azure Resource Manager resource envelope. + */ +@Fluent +public final class FeaturestoreEntityContainerInner extends ProxyResource { + /* + * [Required] Additional attributes of the entity. + */ + private FeaturestoreEntityContainerProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of FeaturestoreEntityContainerInner class. + */ + public FeaturestoreEntityContainerInner() { + } + + /** + * Get the properties property: [Required] Additional attributes of the entity. + * + * @return the properties value. + */ + public FeaturestoreEntityContainerProperties properties() { + return this.properties; + } + + /** + * Set the properties property: [Required] Additional attributes of the entity. + * + * @param properties the properties value to set. + * @return the FeaturestoreEntityContainerInner object itself. + */ + public FeaturestoreEntityContainerInner withProperties(FeaturestoreEntityContainerProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property properties in model FeaturestoreEntityContainerInner")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FeaturestoreEntityContainerInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FeaturestoreEntityContainerInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FeaturestoreEntityContainerInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FeaturestoreEntityContainerInner. + */ + public static FeaturestoreEntityContainerInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FeaturestoreEntityContainerInner deserializedFeaturestoreEntityContainerInner + = new FeaturestoreEntityContainerInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedFeaturestoreEntityContainerInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedFeaturestoreEntityContainerInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedFeaturestoreEntityContainerInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedFeaturestoreEntityContainerInner.properties + = FeaturestoreEntityContainerProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedFeaturestoreEntityContainerInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFeaturestoreEntityContainerInner; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/FeaturestoreEntityVersionInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/FeaturestoreEntityVersionInner.java new file mode 100644 index 0000000000000..1c8eee3d76d3d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/FeaturestoreEntityVersionInner.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.machinelearning.models.FeaturestoreEntityVersionProperties; +import java.io.IOException; + +/** + * Azure Resource Manager resource envelope. + */ +@Fluent +public final class FeaturestoreEntityVersionInner extends ProxyResource { + /* + * [Required] Additional attributes of the entity. + */ + private FeaturestoreEntityVersionProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of FeaturestoreEntityVersionInner class. + */ + public FeaturestoreEntityVersionInner() { + } + + /** + * Get the properties property: [Required] Additional attributes of the entity. + * + * @return the properties value. + */ + public FeaturestoreEntityVersionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: [Required] Additional attributes of the entity. + * + * @param properties the properties value to set. + * @return the FeaturestoreEntityVersionInner object itself. + */ + public FeaturestoreEntityVersionInner withProperties(FeaturestoreEntityVersionProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property properties in model FeaturestoreEntityVersionInner")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FeaturestoreEntityVersionInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FeaturestoreEntityVersionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FeaturestoreEntityVersionInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FeaturestoreEntityVersionInner. + */ + public static FeaturestoreEntityVersionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FeaturestoreEntityVersionInner deserializedFeaturestoreEntityVersionInner + = new FeaturestoreEntityVersionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedFeaturestoreEntityVersionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedFeaturestoreEntityVersionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedFeaturestoreEntityVersionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedFeaturestoreEntityVersionInner.properties + = FeaturestoreEntityVersionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedFeaturestoreEntityVersionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFeaturestoreEntityVersionInner; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/GetBlobReferenceSasResponseDtoInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/GetBlobReferenceSasResponseDtoInner.java new file mode 100644 index 0000000000000..fa2ad37f68573 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/GetBlobReferenceSasResponseDtoInner.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.machinelearning.models.GetBlobReferenceForConsumptionDto; +import java.io.IOException; + +/** + * BlobReferenceSASResponse for getBlobReferenceSAS API. + */ +@Fluent +public final class GetBlobReferenceSasResponseDtoInner + implements JsonSerializable { + /* + * Blob reference for consumption details + */ + private GetBlobReferenceForConsumptionDto blobReferenceForConsumption; + + /** + * Creates an instance of GetBlobReferenceSasResponseDtoInner class. + */ + public GetBlobReferenceSasResponseDtoInner() { + } + + /** + * Get the blobReferenceForConsumption property: Blob reference for consumption details. + * + * @return the blobReferenceForConsumption value. + */ + public GetBlobReferenceForConsumptionDto blobReferenceForConsumption() { + return this.blobReferenceForConsumption; + } + + /** + * Set the blobReferenceForConsumption property: Blob reference for consumption details. + * + * @param blobReferenceForConsumption the blobReferenceForConsumption value to set. + * @return the GetBlobReferenceSasResponseDtoInner object itself. + */ + public GetBlobReferenceSasResponseDtoInner + withBlobReferenceForConsumption(GetBlobReferenceForConsumptionDto blobReferenceForConsumption) { + this.blobReferenceForConsumption = blobReferenceForConsumption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (blobReferenceForConsumption() != null) { + blobReferenceForConsumption().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("blobReferenceForConsumption", this.blobReferenceForConsumption); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GetBlobReferenceSasResponseDtoInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GetBlobReferenceSasResponseDtoInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GetBlobReferenceSasResponseDtoInner. + */ + public static GetBlobReferenceSasResponseDtoInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GetBlobReferenceSasResponseDtoInner deserializedGetBlobReferenceSasResponseDtoInner + = new GetBlobReferenceSasResponseDtoInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("blobReferenceForConsumption".equals(fieldName)) { + deserializedGetBlobReferenceSasResponseDtoInner.blobReferenceForConsumption + = GetBlobReferenceForConsumptionDto.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGetBlobReferenceSasResponseDtoInner; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/JobBaseInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/JobBaseInner.java index 031843b713324..f9f23857c3dcf 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/JobBaseInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/JobBaseInner.java @@ -8,31 +8,51 @@ import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.models.JobBaseProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Azure Resource Manager resource envelope. */ +/** + * Azure Resource Manager resource envelope. + */ @Fluent public final class JobBaseInner extends ProxyResource { /* * [Required] Additional attributes of the entity. */ - @JsonProperty(value = "properties", required = true) private JobBaseProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of JobBaseInner class. */ + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of JobBaseInner class. + */ public JobBaseInner() { } /** * Get the properties property: [Required] Additional attributes of the entity. - * + * * @return the properties value. */ public JobBaseProperties properties() { @@ -41,7 +61,7 @@ public JobBaseProperties properties() { /** * Set the properties property: [Required] Additional attributes of the entity. - * + * * @param properties the properties value to set. * @return the JobBaseInner object itself. */ @@ -52,27 +72,101 @@ public JobBaseInner withProperties(JobBaseProperties properties) { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (properties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property properties in model JobBaseInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property properties in model JobBaseInner")); } else { properties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(JobBaseInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobBaseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobBaseInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the JobBaseInner. + */ + public static JobBaseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobBaseInner deserializedJobBaseInner = new JobBaseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedJobBaseInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedJobBaseInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedJobBaseInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedJobBaseInner.properties = JobBaseProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedJobBaseInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedJobBaseInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ListNotebookKeysResultInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ListNotebookKeysResultInner.java index 7750f1375b4c3..e6f115efc86ae 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ListNotebookKeysResultInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ListNotebookKeysResultInner.java @@ -5,30 +5,36 @@ package com.azure.resourcemanager.machinelearning.fluent.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The ListNotebookKeysResult model. */ +/** + * The ListNotebookKeysResult model. + */ @Immutable -public final class ListNotebookKeysResultInner { +public final class ListNotebookKeysResultInner implements JsonSerializable { /* * The primaryAccessKey property. */ - @JsonProperty(value = "primaryAccessKey", access = JsonProperty.Access.WRITE_ONLY) private String primaryAccessKey; /* * The secondaryAccessKey property. */ - @JsonProperty(value = "secondaryAccessKey", access = JsonProperty.Access.WRITE_ONLY) private String secondaryAccessKey; - /** Creates an instance of ListNotebookKeysResultInner class. */ + /** + * Creates an instance of ListNotebookKeysResultInner class. + */ public ListNotebookKeysResultInner() { } /** * Get the primaryAccessKey property: The primaryAccessKey property. - * + * * @return the primaryAccessKey value. */ public String primaryAccessKey() { @@ -37,7 +43,7 @@ public String primaryAccessKey() { /** * Get the secondaryAccessKey property: The secondaryAccessKey property. - * + * * @return the secondaryAccessKey value. */ public String secondaryAccessKey() { @@ -46,9 +52,46 @@ public String secondaryAccessKey() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListNotebookKeysResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListNotebookKeysResultInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ListNotebookKeysResultInner. + */ + public static ListNotebookKeysResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListNotebookKeysResultInner deserializedListNotebookKeysResultInner = new ListNotebookKeysResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("primaryAccessKey".equals(fieldName)) { + deserializedListNotebookKeysResultInner.primaryAccessKey = reader.getString(); + } else if ("secondaryAccessKey".equals(fieldName)) { + deserializedListNotebookKeysResultInner.secondaryAccessKey = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListNotebookKeysResultInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ListStorageAccountKeysResultInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ListStorageAccountKeysResultInner.java index f4fd116ddf389..6a4fbb94a968e 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ListStorageAccountKeysResultInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ListStorageAccountKeysResultInner.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.machinelearning.fluent.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The ListStorageAccountKeysResult model. */ +/** + * The ListStorageAccountKeysResult model. + */ @Immutable -public final class ListStorageAccountKeysResultInner { +public final class ListStorageAccountKeysResultInner implements JsonSerializable { /* * The userStorageKey property. */ - @JsonProperty(value = "userStorageKey", access = JsonProperty.Access.WRITE_ONLY) private String userStorageKey; - /** Creates an instance of ListStorageAccountKeysResultInner class. */ + /** + * Creates an instance of ListStorageAccountKeysResultInner class. + */ public ListStorageAccountKeysResultInner() { } /** * Get the userStorageKey property: The userStorageKey property. - * + * * @return the userStorageKey value. */ public String userStorageKey() { @@ -31,9 +38,45 @@ public String userStorageKey() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListStorageAccountKeysResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListStorageAccountKeysResultInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ListStorageAccountKeysResultInner. + */ + public static ListStorageAccountKeysResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListStorageAccountKeysResultInner deserializedListStorageAccountKeysResultInner + = new ListStorageAccountKeysResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("userStorageKey".equals(fieldName)) { + deserializedListStorageAccountKeysResultInner.userStorageKey = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListStorageAccountKeysResultInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ListWorkspaceKeysResultInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ListWorkspaceKeysResultInner.java index 7e18cd1ee62ea..ce6ca9d857d11 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ListWorkspaceKeysResultInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ListWorkspaceKeysResultInner.java @@ -5,49 +5,52 @@ package com.azure.resourcemanager.machinelearning.fluent.models; import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.models.RegistryListCredentialsResult; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** The ListWorkspaceKeysResult model. */ +/** + * The ListWorkspaceKeysResult model. + */ @Immutable -public final class ListWorkspaceKeysResultInner { +public final class ListWorkspaceKeysResultInner implements JsonSerializable { /* * The userStorageKey property. */ - @JsonProperty(value = "userStorageKey", access = JsonProperty.Access.WRITE_ONLY) private String userStorageKey; /* * The userStorageResourceId property. */ - @JsonProperty(value = "userStorageResourceId", access = JsonProperty.Access.WRITE_ONLY) private String userStorageResourceId; /* * The appInsightsInstrumentationKey property. */ - @JsonProperty(value = "appInsightsInstrumentationKey", access = JsonProperty.Access.WRITE_ONLY) private String appInsightsInstrumentationKey; /* * The containerRegistryCredentials property. */ - @JsonProperty(value = "containerRegistryCredentials", access = JsonProperty.Access.WRITE_ONLY) private RegistryListCredentialsResult containerRegistryCredentials; /* * The notebookAccessKeys property. */ - @JsonProperty(value = "notebookAccessKeys", access = JsonProperty.Access.WRITE_ONLY) private ListNotebookKeysResultInner notebookAccessKeys; - /** Creates an instance of ListWorkspaceKeysResultInner class. */ + /** + * Creates an instance of ListWorkspaceKeysResultInner class. + */ public ListWorkspaceKeysResultInner() { } /** * Get the userStorageKey property: The userStorageKey property. - * + * * @return the userStorageKey value. */ public String userStorageKey() { @@ -56,7 +59,7 @@ public String userStorageKey() { /** * Get the userStorageResourceId property: The userStorageResourceId property. - * + * * @return the userStorageResourceId value. */ public String userStorageResourceId() { @@ -65,7 +68,7 @@ public String userStorageResourceId() { /** * Get the appInsightsInstrumentationKey property: The appInsightsInstrumentationKey property. - * + * * @return the appInsightsInstrumentationKey value. */ public String appInsightsInstrumentationKey() { @@ -74,7 +77,7 @@ public String appInsightsInstrumentationKey() { /** * Get the containerRegistryCredentials property: The containerRegistryCredentials property. - * + * * @return the containerRegistryCredentials value. */ public RegistryListCredentialsResult containerRegistryCredentials() { @@ -83,7 +86,7 @@ public RegistryListCredentialsResult containerRegistryCredentials() { /** * Get the notebookAccessKeys property: The notebookAccessKeys property. - * + * * @return the notebookAccessKeys value. */ public ListNotebookKeysResultInner notebookAccessKeys() { @@ -92,7 +95,7 @@ public ListNotebookKeysResultInner notebookAccessKeys() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -103,4 +106,49 @@ public void validate() { notebookAccessKeys().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListWorkspaceKeysResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListWorkspaceKeysResultInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ListWorkspaceKeysResultInner. + */ + public static ListWorkspaceKeysResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListWorkspaceKeysResultInner deserializedListWorkspaceKeysResultInner = new ListWorkspaceKeysResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("userStorageKey".equals(fieldName)) { + deserializedListWorkspaceKeysResultInner.userStorageKey = reader.getString(); + } else if ("userStorageResourceId".equals(fieldName)) { + deserializedListWorkspaceKeysResultInner.userStorageResourceId = reader.getString(); + } else if ("appInsightsInstrumentationKey".equals(fieldName)) { + deserializedListWorkspaceKeysResultInner.appInsightsInstrumentationKey = reader.getString(); + } else if ("containerRegistryCredentials".equals(fieldName)) { + deserializedListWorkspaceKeysResultInner.containerRegistryCredentials + = RegistryListCredentialsResult.fromJson(reader); + } else if ("notebookAccessKeys".equals(fieldName)) { + deserializedListWorkspaceKeysResultInner.notebookAccessKeys + = ListNotebookKeysResultInner.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedListWorkspaceKeysResultInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ManagedNetworkProvisionStatusInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ManagedNetworkProvisionStatusInner.java new file mode 100644 index 0000000000000..a4d6b08c3e63c --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ManagedNetworkProvisionStatusInner.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.machinelearning.models.ManagedNetworkStatus; +import java.io.IOException; + +/** + * Status of the Provisioning for the managed network of a machine learning workspace. + */ +@Fluent +public final class ManagedNetworkProvisionStatusInner implements JsonSerializable { + /* + * The sparkReady property. + */ + private Boolean sparkReady; + + /* + * Status for the managed network of a machine learning workspace. + */ + private ManagedNetworkStatus status; + + /** + * Creates an instance of ManagedNetworkProvisionStatusInner class. + */ + public ManagedNetworkProvisionStatusInner() { + } + + /** + * Get the sparkReady property: The sparkReady property. + * + * @return the sparkReady value. + */ + public Boolean sparkReady() { + return this.sparkReady; + } + + /** + * Set the sparkReady property: The sparkReady property. + * + * @param sparkReady the sparkReady value to set. + * @return the ManagedNetworkProvisionStatusInner object itself. + */ + public ManagedNetworkProvisionStatusInner withSparkReady(Boolean sparkReady) { + this.sparkReady = sparkReady; + return this; + } + + /** + * Get the status property: Status for the managed network of a machine learning workspace. + * + * @return the status value. + */ + public ManagedNetworkStatus status() { + return this.status; + } + + /** + * Set the status property: Status for the managed network of a machine learning workspace. + * + * @param status the status value to set. + * @return the ManagedNetworkProvisionStatusInner object itself. + */ + public ManagedNetworkProvisionStatusInner withStatus(ManagedNetworkStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("sparkReady", this.sparkReady); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedNetworkProvisionStatusInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedNetworkProvisionStatusInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedNetworkProvisionStatusInner. + */ + public static ManagedNetworkProvisionStatusInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedNetworkProvisionStatusInner deserializedManagedNetworkProvisionStatusInner + = new ManagedNetworkProvisionStatusInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sparkReady".equals(fieldName)) { + deserializedManagedNetworkProvisionStatusInner.sparkReady + = reader.getNullable(JsonReader::getBoolean); + } else if ("status".equals(fieldName)) { + deserializedManagedNetworkProvisionStatusInner.status + = ManagedNetworkStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedNetworkProvisionStatusInner; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ManagedNetworkSettingsInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ManagedNetworkSettingsInner.java new file mode 100644 index 0000000000000..288819df29d09 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ManagedNetworkSettingsInner.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.machinelearning.models.IsolationMode; +import com.azure.resourcemanager.machinelearning.models.OutboundRule; +import java.io.IOException; +import java.util.Map; + +/** + * Managed Network settings for a machine learning workspace. + */ +@Fluent +public final class ManagedNetworkSettingsInner implements JsonSerializable { + /* + * Isolation mode for the managed network of a machine learning workspace. + */ + private IsolationMode isolationMode; + + /* + * The networkId property. + */ + private String networkId; + + /* + * Dictionary of + */ + private Map outboundRules; + + /* + * Status of the Provisioning for the managed network of a machine learning workspace. + */ + private ManagedNetworkProvisionStatusInner status; + + /** + * Creates an instance of ManagedNetworkSettingsInner class. + */ + public ManagedNetworkSettingsInner() { + } + + /** + * Get the isolationMode property: Isolation mode for the managed network of a machine learning workspace. + * + * @return the isolationMode value. + */ + public IsolationMode isolationMode() { + return this.isolationMode; + } + + /** + * Set the isolationMode property: Isolation mode for the managed network of a machine learning workspace. + * + * @param isolationMode the isolationMode value to set. + * @return the ManagedNetworkSettingsInner object itself. + */ + public ManagedNetworkSettingsInner withIsolationMode(IsolationMode isolationMode) { + this.isolationMode = isolationMode; + return this; + } + + /** + * Get the networkId property: The networkId property. + * + * @return the networkId value. + */ + public String networkId() { + return this.networkId; + } + + /** + * Get the outboundRules property: Dictionary of <OutboundRule>. + * + * @return the outboundRules value. + */ + public Map outboundRules() { + return this.outboundRules; + } + + /** + * Set the outboundRules property: Dictionary of <OutboundRule>. + * + * @param outboundRules the outboundRules value to set. + * @return the ManagedNetworkSettingsInner object itself. + */ + public ManagedNetworkSettingsInner withOutboundRules(Map outboundRules) { + this.outboundRules = outboundRules; + return this; + } + + /** + * Get the status property: Status of the Provisioning for the managed network of a machine learning workspace. + * + * @return the status value. + */ + public ManagedNetworkProvisionStatusInner status() { + return this.status; + } + + /** + * Set the status property: Status of the Provisioning for the managed network of a machine learning workspace. + * + * @param status the status value to set. + * @return the ManagedNetworkSettingsInner object itself. + */ + public ManagedNetworkSettingsInner withStatus(ManagedNetworkProvisionStatusInner status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (outboundRules() != null) { + outboundRules().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + if (status() != null) { + status().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("isolationMode", this.isolationMode == null ? null : this.isolationMode.toString()); + jsonWriter.writeMapField("outboundRules", this.outboundRules, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("status", this.status); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedNetworkSettingsInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedNetworkSettingsInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedNetworkSettingsInner. + */ + public static ManagedNetworkSettingsInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedNetworkSettingsInner deserializedManagedNetworkSettingsInner = new ManagedNetworkSettingsInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("isolationMode".equals(fieldName)) { + deserializedManagedNetworkSettingsInner.isolationMode + = IsolationMode.fromString(reader.getString()); + } else if ("networkId".equals(fieldName)) { + deserializedManagedNetworkSettingsInner.networkId = reader.getString(); + } else if ("outboundRules".equals(fieldName)) { + Map outboundRules = reader.readMap(reader1 -> OutboundRule.fromJson(reader1)); + deserializedManagedNetworkSettingsInner.outboundRules = outboundRules; + } else if ("status".equals(fieldName)) { + deserializedManagedNetworkSettingsInner.status + = ManagedNetworkProvisionStatusInner.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedNetworkSettingsInner; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/MarketplaceSubscriptionInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/MarketplaceSubscriptionInner.java new file mode 100644 index 0000000000000..600c30acbe368 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/MarketplaceSubscriptionInner.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.machinelearning.models.MarketplaceSubscriptionProperties; +import java.io.IOException; + +/** + * Azure Resource Manager resource envelope. + */ +@Fluent +public final class MarketplaceSubscriptionInner extends ProxyResource { + /* + * [Required] Additional attributes of the entity. + */ + private MarketplaceSubscriptionProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of MarketplaceSubscriptionInner class. + */ + public MarketplaceSubscriptionInner() { + } + + /** + * Get the properties property: [Required] Additional attributes of the entity. + * + * @return the properties value. + */ + public MarketplaceSubscriptionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: [Required] Additional attributes of the entity. + * + * @param properties the properties value to set. + * @return the MarketplaceSubscriptionInner object itself. + */ + public MarketplaceSubscriptionInner withProperties(MarketplaceSubscriptionProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property properties in model MarketplaceSubscriptionInner")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MarketplaceSubscriptionInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MarketplaceSubscriptionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MarketplaceSubscriptionInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MarketplaceSubscriptionInner. + */ + public static MarketplaceSubscriptionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MarketplaceSubscriptionInner deserializedMarketplaceSubscriptionInner = new MarketplaceSubscriptionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMarketplaceSubscriptionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMarketplaceSubscriptionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMarketplaceSubscriptionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedMarketplaceSubscriptionInner.properties + = MarketplaceSubscriptionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedMarketplaceSubscriptionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMarketplaceSubscriptionInner; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ModelContainerInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ModelContainerInner.java index 59b94aaaf36e2..1bd535de9b535 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ModelContainerInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ModelContainerInner.java @@ -8,31 +8,51 @@ import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.models.ModelContainerProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Azure Resource Manager resource envelope. */ +/** + * Azure Resource Manager resource envelope. + */ @Fluent public final class ModelContainerInner extends ProxyResource { /* * [Required] Additional attributes of the entity. */ - @JsonProperty(value = "properties", required = true) private ModelContainerProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of ModelContainerInner class. */ + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of ModelContainerInner class. + */ public ModelContainerInner() { } /** * Get the properties property: [Required] Additional attributes of the entity. - * + * * @return the properties value. */ public ModelContainerProperties properties() { @@ -41,7 +61,7 @@ public ModelContainerProperties properties() { /** * Set the properties property: [Required] Additional attributes of the entity. - * + * * @param properties the properties value to set. * @return the ModelContainerInner object itself. */ @@ -52,27 +72,101 @@ public ModelContainerInner withProperties(ModelContainerProperties properties) { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (properties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property properties in model ModelContainerInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property properties in model ModelContainerInner")); } else { properties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(ModelContainerInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ModelContainerInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ModelContainerInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ModelContainerInner. + */ + public static ModelContainerInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ModelContainerInner deserializedModelContainerInner = new ModelContainerInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedModelContainerInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedModelContainerInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedModelContainerInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedModelContainerInner.properties = ModelContainerProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedModelContainerInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedModelContainerInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ModelVersionInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ModelVersionInner.java index 8d5e0c69f79d5..7f2f08e98758b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ModelVersionInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ModelVersionInner.java @@ -8,31 +8,51 @@ import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.models.ModelVersionProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Azure Resource Manager resource envelope. */ +/** + * Azure Resource Manager resource envelope. + */ @Fluent public final class ModelVersionInner extends ProxyResource { /* * [Required] Additional attributes of the entity. */ - @JsonProperty(value = "properties", required = true) private ModelVersionProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of ModelVersionInner class. */ + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of ModelVersionInner class. + */ public ModelVersionInner() { } /** * Get the properties property: [Required] Additional attributes of the entity. - * + * * @return the properties value. */ public ModelVersionProperties properties() { @@ -41,7 +61,7 @@ public ModelVersionProperties properties() { /** * Set the properties property: [Required] Additional attributes of the entity. - * + * * @param properties the properties value to set. * @return the ModelVersionInner object itself. */ @@ -52,27 +72,101 @@ public ModelVersionInner withProperties(ModelVersionProperties properties) { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (properties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property properties in model ModelVersionInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property properties in model ModelVersionInner")); } else { properties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(ModelVersionInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ModelVersionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ModelVersionInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ModelVersionInner. + */ + public static ModelVersionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ModelVersionInner deserializedModelVersionInner = new ModelVersionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedModelVersionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedModelVersionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedModelVersionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedModelVersionInner.properties = ModelVersionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedModelVersionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedModelVersionInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/NotebookAccessTokenResultInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/NotebookAccessTokenResultInner.java index 6fb3125ba2403..92e2d3d03636c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/NotebookAccessTokenResultInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/NotebookAccessTokenResultInner.java @@ -5,66 +5,66 @@ package com.azure.resourcemanager.machinelearning.fluent.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The NotebookAccessTokenResult model. */ +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The NotebookAccessTokenResult model. + */ @Immutable -public final class NotebookAccessTokenResultInner { +public final class NotebookAccessTokenResultInner implements JsonSerializable { /* * The notebookResourceId property. */ - @JsonProperty(value = "notebookResourceId", access = JsonProperty.Access.WRITE_ONLY) private String notebookResourceId; /* * The hostName property. */ - @JsonProperty(value = "hostName", access = JsonProperty.Access.WRITE_ONLY) private String hostname; /* * The publicDns property. */ - @JsonProperty(value = "publicDns", access = JsonProperty.Access.WRITE_ONLY) private String publicDns; /* * The accessToken property. */ - @JsonProperty(value = "accessToken", access = JsonProperty.Access.WRITE_ONLY) private String accessToken; /* * The tokenType property. */ - @JsonProperty(value = "tokenType", access = JsonProperty.Access.WRITE_ONLY) private String tokenType; /* * The expiresIn property. */ - @JsonProperty(value = "expiresIn", access = JsonProperty.Access.WRITE_ONLY) private Integer expiresIn; /* * The refreshToken property. */ - @JsonProperty(value = "refreshToken", access = JsonProperty.Access.WRITE_ONLY) private String refreshToken; /* * The scope property. */ - @JsonProperty(value = "scope", access = JsonProperty.Access.WRITE_ONLY) private String scope; - /** Creates an instance of NotebookAccessTokenResultInner class. */ + /** + * Creates an instance of NotebookAccessTokenResultInner class. + */ public NotebookAccessTokenResultInner() { } /** * Get the notebookResourceId property: The notebookResourceId property. - * + * * @return the notebookResourceId value. */ public String notebookResourceId() { @@ -73,7 +73,7 @@ public String notebookResourceId() { /** * Get the hostname property: The hostName property. - * + * * @return the hostname value. */ public String hostname() { @@ -82,7 +82,7 @@ public String hostname() { /** * Get the publicDns property: The publicDns property. - * + * * @return the publicDns value. */ public String publicDns() { @@ -91,7 +91,7 @@ public String publicDns() { /** * Get the accessToken property: The accessToken property. - * + * * @return the accessToken value. */ public String accessToken() { @@ -100,7 +100,7 @@ public String accessToken() { /** * Get the tokenType property: The tokenType property. - * + * * @return the tokenType value. */ public String tokenType() { @@ -109,7 +109,7 @@ public String tokenType() { /** * Get the expiresIn property: The expiresIn property. - * + * * @return the expiresIn value. */ public Integer expiresIn() { @@ -118,7 +118,7 @@ public Integer expiresIn() { /** * Get the refreshToken property: The refreshToken property. - * + * * @return the refreshToken value. */ public String refreshToken() { @@ -127,7 +127,7 @@ public String refreshToken() { /** * Get the scope property: The scope property. - * + * * @return the scope value. */ public String scope() { @@ -136,9 +136,59 @@ public String scope() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NotebookAccessTokenResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NotebookAccessTokenResultInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NotebookAccessTokenResultInner. + */ + public static NotebookAccessTokenResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NotebookAccessTokenResultInner deserializedNotebookAccessTokenResultInner + = new NotebookAccessTokenResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("notebookResourceId".equals(fieldName)) { + deserializedNotebookAccessTokenResultInner.notebookResourceId = reader.getString(); + } else if ("hostName".equals(fieldName)) { + deserializedNotebookAccessTokenResultInner.hostname = reader.getString(); + } else if ("publicDns".equals(fieldName)) { + deserializedNotebookAccessTokenResultInner.publicDns = reader.getString(); + } else if ("accessToken".equals(fieldName)) { + deserializedNotebookAccessTokenResultInner.accessToken = reader.getString(); + } else if ("tokenType".equals(fieldName)) { + deserializedNotebookAccessTokenResultInner.tokenType = reader.getString(); + } else if ("expiresIn".equals(fieldName)) { + deserializedNotebookAccessTokenResultInner.expiresIn = reader.getNullable(JsonReader::getInt); + } else if ("refreshToken".equals(fieldName)) { + deserializedNotebookAccessTokenResultInner.refreshToken = reader.getString(); + } else if ("scope".equals(fieldName)) { + deserializedNotebookAccessTokenResultInner.scope = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNotebookAccessTokenResultInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/NotebookResourceInfoInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/NotebookResourceInfoInner.java index 9433886680171..eaec582a6eb33 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/NotebookResourceInfoInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/NotebookResourceInfoInner.java @@ -5,37 +5,42 @@ package com.azure.resourcemanager.machinelearning.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.models.NotebookPreparationError; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** The NotebookResourceInfo model. */ +/** + * The NotebookResourceInfo model. + */ @Fluent -public final class NotebookResourceInfoInner { +public final class NotebookResourceInfoInner implements JsonSerializable { /* * The fqdn property. */ - @JsonProperty(value = "fqdn") private String fqdn; /* * the data plane resourceId that used to initialize notebook component */ - @JsonProperty(value = "resourceId") private String resourceId; /* * The error that occurs when preparing notebook. */ - @JsonProperty(value = "notebookPreparationError") private NotebookPreparationError notebookPreparationError; - /** Creates an instance of NotebookResourceInfoInner class. */ + /** + * Creates an instance of NotebookResourceInfoInner class. + */ public NotebookResourceInfoInner() { } /** * Get the fqdn property: The fqdn property. - * + * * @return the fqdn value. */ public String fqdn() { @@ -44,7 +49,7 @@ public String fqdn() { /** * Set the fqdn property: The fqdn property. - * + * * @param fqdn the fqdn value to set. * @return the NotebookResourceInfoInner object itself. */ @@ -55,7 +60,7 @@ public NotebookResourceInfoInner withFqdn(String fqdn) { /** * Get the resourceId property: the data plane resourceId that used to initialize notebook component. - * + * * @return the resourceId value. */ public String resourceId() { @@ -64,7 +69,7 @@ public String resourceId() { /** * Set the resourceId property: the data plane resourceId that used to initialize notebook component. - * + * * @param resourceId the resourceId value to set. * @return the NotebookResourceInfoInner object itself. */ @@ -75,7 +80,7 @@ public NotebookResourceInfoInner withResourceId(String resourceId) { /** * Get the notebookPreparationError property: The error that occurs when preparing notebook. - * + * * @return the notebookPreparationError value. */ public NotebookPreparationError notebookPreparationError() { @@ -84,7 +89,7 @@ public NotebookPreparationError notebookPreparationError() { /** * Set the notebookPreparationError property: The error that occurs when preparing notebook. - * + * * @param notebookPreparationError the notebookPreparationError value to set. * @return the NotebookResourceInfoInner object itself. */ @@ -95,7 +100,7 @@ public NotebookResourceInfoInner withNotebookPreparationError(NotebookPreparatio /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -103,4 +108,47 @@ public void validate() { notebookPreparationError().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("fqdn", this.fqdn); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeJsonField("notebookPreparationError", this.notebookPreparationError); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NotebookResourceInfoInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NotebookResourceInfoInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NotebookResourceInfoInner. + */ + public static NotebookResourceInfoInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NotebookResourceInfoInner deserializedNotebookResourceInfoInner = new NotebookResourceInfoInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("fqdn".equals(fieldName)) { + deserializedNotebookResourceInfoInner.fqdn = reader.getString(); + } else if ("resourceId".equals(fieldName)) { + deserializedNotebookResourceInfoInner.resourceId = reader.getString(); + } else if ("notebookPreparationError".equals(fieldName)) { + deserializedNotebookResourceInfoInner.notebookPreparationError + = NotebookPreparationError.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNotebookResourceInfoInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/OnlineDeploymentInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/OnlineDeploymentInner.java index d48288f3c4471..66f0eb42c4226 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/OnlineDeploymentInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/OnlineDeploymentInner.java @@ -8,52 +8,69 @@ import com.azure.core.management.Resource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; import com.azure.resourcemanager.machinelearning.models.OnlineDeploymentProperties; import com.azure.resourcemanager.machinelearning.models.Sku; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; -/** The OnlineDeployment model. */ +/** + * The OnlineDeployment model. + */ @Fluent public final class OnlineDeploymentInner extends Resource { /* * Managed service identity (system assigned and/or user assigned identities) */ - @JsonProperty(value = "identity") private ManagedServiceIdentity identity; /* * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. */ - @JsonProperty(value = "kind") private String kind; /* * [Required] Additional attributes of the entity. */ - @JsonProperty(value = "properties", required = true) private OnlineDeploymentProperties properties; /* * Sku details required for ARM contract for Autoscaling. */ - @JsonProperty(value = "sku") private Sku sku; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of OnlineDeploymentInner class. */ + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of OnlineDeploymentInner class. + */ public OnlineDeploymentInner() { } /** * Get the identity property: Managed service identity (system assigned and/or user assigned identities). - * + * * @return the identity value. */ public ManagedServiceIdentity identity() { @@ -62,7 +79,7 @@ public ManagedServiceIdentity identity() { /** * Set the identity property: Managed service identity (system assigned and/or user assigned identities). - * + * * @param identity the identity value to set. * @return the OnlineDeploymentInner object itself. */ @@ -74,7 +91,7 @@ public OnlineDeploymentInner withIdentity(ManagedServiceIdentity identity) { /** * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of * the same type. - * + * * @return the kind value. */ public String kind() { @@ -84,7 +101,7 @@ public String kind() { /** * Set the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of * the same type. - * + * * @param kind the kind value to set. * @return the OnlineDeploymentInner object itself. */ @@ -95,7 +112,7 @@ public OnlineDeploymentInner withKind(String kind) { /** * Get the properties property: [Required] Additional attributes of the entity. - * + * * @return the properties value. */ public OnlineDeploymentProperties properties() { @@ -104,7 +121,7 @@ public OnlineDeploymentProperties properties() { /** * Set the properties property: [Required] Additional attributes of the entity. - * + * * @param properties the properties value to set. * @return the OnlineDeploymentInner object itself. */ @@ -115,7 +132,7 @@ public OnlineDeploymentInner withProperties(OnlineDeploymentProperties propertie /** * Get the sku property: Sku details required for ARM contract for Autoscaling. - * + * * @return the sku value. */ public Sku sku() { @@ -124,7 +141,7 @@ public Sku sku() { /** * Set the sku property: Sku details required for ARM contract for Autoscaling. - * + * * @param sku the sku value to set. * @return the OnlineDeploymentInner object itself. */ @@ -135,21 +152,55 @@ public OnlineDeploymentInner withSku(Sku sku) { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } - /** {@inheritDoc} */ + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * {@inheritDoc} + */ @Override public OnlineDeploymentInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public OnlineDeploymentInner withTags(Map tags) { super.withTags(tags); @@ -158,7 +209,7 @@ public OnlineDeploymentInner withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -166,10 +217,9 @@ public void validate() { identity().validate(); } if (properties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property properties in model OnlineDeploymentInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property properties in model OnlineDeploymentInner")); } else { properties().validate(); } @@ -179,4 +229,65 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(OnlineDeploymentInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeJsonField("sku", this.sku); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OnlineDeploymentInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OnlineDeploymentInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OnlineDeploymentInner. + */ + public static OnlineDeploymentInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OnlineDeploymentInner deserializedOnlineDeploymentInner = new OnlineDeploymentInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedOnlineDeploymentInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedOnlineDeploymentInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedOnlineDeploymentInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedOnlineDeploymentInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedOnlineDeploymentInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedOnlineDeploymentInner.properties = OnlineDeploymentProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedOnlineDeploymentInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedOnlineDeploymentInner.kind = reader.getString(); + } else if ("sku".equals(fieldName)) { + deserializedOnlineDeploymentInner.sku = Sku.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedOnlineDeploymentInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOnlineDeploymentInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/OnlineEndpointInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/OnlineEndpointInner.java index 0f940fd5bb9f6..79ac86bb7abbe 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/OnlineEndpointInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/OnlineEndpointInner.java @@ -8,52 +8,69 @@ import com.azure.core.management.Resource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; import com.azure.resourcemanager.machinelearning.models.OnlineEndpointProperties; import com.azure.resourcemanager.machinelearning.models.Sku; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; -/** The OnlineEndpoint model. */ +/** + * The OnlineEndpoint model. + */ @Fluent public final class OnlineEndpointInner extends Resource { /* * Managed service identity (system assigned and/or user assigned identities) */ - @JsonProperty(value = "identity") private ManagedServiceIdentity identity; /* * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. */ - @JsonProperty(value = "kind") private String kind; /* * [Required] Additional attributes of the entity. */ - @JsonProperty(value = "properties", required = true) private OnlineEndpointProperties properties; /* * Sku details required for ARM contract for Autoscaling. */ - @JsonProperty(value = "sku") private Sku sku; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of OnlineEndpointInner class. */ + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of OnlineEndpointInner class. + */ public OnlineEndpointInner() { } /** * Get the identity property: Managed service identity (system assigned and/or user assigned identities). - * + * * @return the identity value. */ public ManagedServiceIdentity identity() { @@ -62,7 +79,7 @@ public ManagedServiceIdentity identity() { /** * Set the identity property: Managed service identity (system assigned and/or user assigned identities). - * + * * @param identity the identity value to set. * @return the OnlineEndpointInner object itself. */ @@ -74,7 +91,7 @@ public OnlineEndpointInner withIdentity(ManagedServiceIdentity identity) { /** * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of * the same type. - * + * * @return the kind value. */ public String kind() { @@ -84,7 +101,7 @@ public String kind() { /** * Set the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of * the same type. - * + * * @param kind the kind value to set. * @return the OnlineEndpointInner object itself. */ @@ -95,7 +112,7 @@ public OnlineEndpointInner withKind(String kind) { /** * Get the properties property: [Required] Additional attributes of the entity. - * + * * @return the properties value. */ public OnlineEndpointProperties properties() { @@ -104,7 +121,7 @@ public OnlineEndpointProperties properties() { /** * Set the properties property: [Required] Additional attributes of the entity. - * + * * @param properties the properties value to set. * @return the OnlineEndpointInner object itself. */ @@ -115,7 +132,7 @@ public OnlineEndpointInner withProperties(OnlineEndpointProperties properties) { /** * Get the sku property: Sku details required for ARM contract for Autoscaling. - * + * * @return the sku value. */ public Sku sku() { @@ -124,7 +141,7 @@ public Sku sku() { /** * Set the sku property: Sku details required for ARM contract for Autoscaling. - * + * * @param sku the sku value to set. * @return the OnlineEndpointInner object itself. */ @@ -135,21 +152,55 @@ public OnlineEndpointInner withSku(Sku sku) { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } - /** {@inheritDoc} */ + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * {@inheritDoc} + */ @Override public OnlineEndpointInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public OnlineEndpointInner withTags(Map tags) { super.withTags(tags); @@ -158,7 +209,7 @@ public OnlineEndpointInner withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -166,9 +217,8 @@ public void validate() { identity().validate(); } if (properties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property properties in model OnlineEndpointInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property properties in model OnlineEndpointInner")); } else { properties().validate(); } @@ -178,4 +228,65 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(OnlineEndpointInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeJsonField("sku", this.sku); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OnlineEndpointInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OnlineEndpointInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OnlineEndpointInner. + */ + public static OnlineEndpointInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OnlineEndpointInner deserializedOnlineEndpointInner = new OnlineEndpointInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedOnlineEndpointInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedOnlineEndpointInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedOnlineEndpointInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedOnlineEndpointInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedOnlineEndpointInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedOnlineEndpointInner.properties = OnlineEndpointProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedOnlineEndpointInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedOnlineEndpointInner.kind = reader.getString(); + } else if ("sku".equals(fieldName)) { + deserializedOnlineEndpointInner.sku = Sku.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedOnlineEndpointInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOnlineEndpointInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/OperationInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/OperationInner.java new file mode 100644 index 0000000000000..84135d31bcfa3 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/OperationInner.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.machinelearning.models.ActionType; +import com.azure.resourcemanager.machinelearning.models.OperationDisplay; +import com.azure.resourcemanager.machinelearning.models.Origin; +import java.io.IOException; + +/** + * REST API Operation + * + * Details of a REST API operation, returned from the Resource Provider Operations API. + */ +@Fluent +public final class OperationInner implements JsonSerializable { + /* + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + */ + private String name; + + /* + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for + * ARM/control-plane operations. + */ + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. + */ + private OperationDisplay display; + + /* + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + * value is "user,system" + */ + private Origin origin; + + /* + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ + private ActionType actionType; + + /** + * Creates an instance of OperationInner class. + */ + public OperationInner() { + } + + /** + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Localized display information for this particular operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + public Origin origin() { + return this.origin; + } + + /** + * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + public ActionType actionType() { + return this.actionType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("display", this.display); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationInner. + */ + public static OperationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationInner deserializedOperationInner = new OperationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedOperationInner.name = reader.getString(); + } else if ("isDataAction".equals(fieldName)) { + deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); + } else if ("display".equals(fieldName)) { + deserializedOperationInner.display = OperationDisplay.fromJson(reader); + } else if ("origin".equals(fieldName)) { + deserializedOperationInner.origin = Origin.fromString(reader.getString()); + } else if ("actionType".equals(fieldName)) { + deserializedOperationInner.actionType = ActionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationInner; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/OutboundRuleBasicResourceInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/OutboundRuleBasicResourceInner.java new file mode 100644 index 0000000000000..6795602d33bbd --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/OutboundRuleBasicResourceInner.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.machinelearning.models.OutboundRule; +import java.io.IOException; + +/** + * Outbound Rule Basic Resource for the managed network of a machine learning workspace. + */ +@Fluent +public final class OutboundRuleBasicResourceInner extends ProxyResource { + /* + * Outbound Rule for the managed network of a machine learning workspace. + */ + private OutboundRule properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of OutboundRuleBasicResourceInner class. + */ + public OutboundRuleBasicResourceInner() { + } + + /** + * Get the properties property: Outbound Rule for the managed network of a machine learning workspace. + * + * @return the properties value. + */ + public OutboundRule properties() { + return this.properties; + } + + /** + * Set the properties property: Outbound Rule for the managed network of a machine learning workspace. + * + * @param properties the properties value to set. + * @return the OutboundRuleBasicResourceInner object itself. + */ + public OutboundRuleBasicResourceInner withProperties(OutboundRule properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property properties in model OutboundRuleBasicResourceInner")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OutboundRuleBasicResourceInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OutboundRuleBasicResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OutboundRuleBasicResourceInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OutboundRuleBasicResourceInner. + */ + public static OutboundRuleBasicResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OutboundRuleBasicResourceInner deserializedOutboundRuleBasicResourceInner + = new OutboundRuleBasicResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedOutboundRuleBasicResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedOutboundRuleBasicResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedOutboundRuleBasicResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedOutboundRuleBasicResourceInner.properties = OutboundRule.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedOutboundRuleBasicResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOutboundRuleBasicResourceInner; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PendingUploadResponseDtoInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PendingUploadResponseDtoInner.java new file mode 100644 index 0000000000000..c5a5b5cf9b8f9 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PendingUploadResponseDtoInner.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.machinelearning.models.BlobReferenceForConsumptionDto; +import com.azure.resourcemanager.machinelearning.models.PendingUploadType; +import java.io.IOException; + +/** + * The PendingUploadResponseDto model. + */ +@Fluent +public final class PendingUploadResponseDtoInner implements JsonSerializable { + /* + * Container level read, write, list SAS + */ + private BlobReferenceForConsumptionDto blobReferenceForConsumption; + + /* + * ID for this upload request + */ + private String pendingUploadId; + + /* + * TemporaryBlobReference is the only supported type + */ + private PendingUploadType pendingUploadType; + + /** + * Creates an instance of PendingUploadResponseDtoInner class. + */ + public PendingUploadResponseDtoInner() { + } + + /** + * Get the blobReferenceForConsumption property: Container level read, write, list SAS. + * + * @return the blobReferenceForConsumption value. + */ + public BlobReferenceForConsumptionDto blobReferenceForConsumption() { + return this.blobReferenceForConsumption; + } + + /** + * Set the blobReferenceForConsumption property: Container level read, write, list SAS. + * + * @param blobReferenceForConsumption the blobReferenceForConsumption value to set. + * @return the PendingUploadResponseDtoInner object itself. + */ + public PendingUploadResponseDtoInner + withBlobReferenceForConsumption(BlobReferenceForConsumptionDto blobReferenceForConsumption) { + this.blobReferenceForConsumption = blobReferenceForConsumption; + return this; + } + + /** + * Get the pendingUploadId property: ID for this upload request. + * + * @return the pendingUploadId value. + */ + public String pendingUploadId() { + return this.pendingUploadId; + } + + /** + * Set the pendingUploadId property: ID for this upload request. + * + * @param pendingUploadId the pendingUploadId value to set. + * @return the PendingUploadResponseDtoInner object itself. + */ + public PendingUploadResponseDtoInner withPendingUploadId(String pendingUploadId) { + this.pendingUploadId = pendingUploadId; + return this; + } + + /** + * Get the pendingUploadType property: TemporaryBlobReference is the only supported type. + * + * @return the pendingUploadType value. + */ + public PendingUploadType pendingUploadType() { + return this.pendingUploadType; + } + + /** + * Set the pendingUploadType property: TemporaryBlobReference is the only supported type. + * + * @param pendingUploadType the pendingUploadType value to set. + * @return the PendingUploadResponseDtoInner object itself. + */ + public PendingUploadResponseDtoInner withPendingUploadType(PendingUploadType pendingUploadType) { + this.pendingUploadType = pendingUploadType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (blobReferenceForConsumption() != null) { + blobReferenceForConsumption().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("blobReferenceForConsumption", this.blobReferenceForConsumption); + jsonWriter.writeStringField("pendingUploadId", this.pendingUploadId); + jsonWriter.writeStringField("pendingUploadType", + this.pendingUploadType == null ? null : this.pendingUploadType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PendingUploadResponseDtoInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PendingUploadResponseDtoInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PendingUploadResponseDtoInner. + */ + public static PendingUploadResponseDtoInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PendingUploadResponseDtoInner deserializedPendingUploadResponseDtoInner + = new PendingUploadResponseDtoInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("blobReferenceForConsumption".equals(fieldName)) { + deserializedPendingUploadResponseDtoInner.blobReferenceForConsumption + = BlobReferenceForConsumptionDto.fromJson(reader); + } else if ("pendingUploadId".equals(fieldName)) { + deserializedPendingUploadResponseDtoInner.pendingUploadId = reader.getString(); + } else if ("pendingUploadType".equals(fieldName)) { + deserializedPendingUploadResponseDtoInner.pendingUploadType + = PendingUploadType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPendingUploadResponseDtoInner; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PrivateEndpointConnectionInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PrivateEndpointConnectionInner.java index ac7de011781ba..a18d97bb627af 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PrivateEndpointConnectionInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PrivateEndpointConnectionInner.java @@ -7,62 +7,76 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; import com.azure.resourcemanager.machinelearning.models.PrivateEndpoint; import com.azure.resourcemanager.machinelearning.models.PrivateEndpointConnectionProvisioningState; import com.azure.resourcemanager.machinelearning.models.PrivateLinkServiceConnectionState; import com.azure.resourcemanager.machinelearning.models.Sku; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; -/** The Private Endpoint Connection resource. */ +/** + * The Private Endpoint Connection resource. + */ @Fluent public final class PrivateEndpointConnectionInner extends ProxyResource { /* * Resource properties. */ - @JsonProperty(value = "properties") private PrivateEndpointConnectionProperties innerProperties; /* * The identity of the resource. */ - @JsonProperty(value = "identity") private ManagedServiceIdentity identity; /* * Specifies the location of the resource. */ - @JsonProperty(value = "location") private String location; /* * Contains resource tags defined as key/value pairs. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* * The sku of the workspace. */ - @JsonProperty(value = "sku") private Sku sku; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of PrivateEndpointConnectionInner class. */ + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of PrivateEndpointConnectionInner class. + */ public PrivateEndpointConnectionInner() { } /** * Get the innerProperties property: Resource properties. - * + * * @return the innerProperties value. */ private PrivateEndpointConnectionProperties innerProperties() { @@ -71,7 +85,7 @@ private PrivateEndpointConnectionProperties innerProperties() { /** * Get the identity property: The identity of the resource. - * + * * @return the identity value. */ public ManagedServiceIdentity identity() { @@ -80,7 +94,7 @@ public ManagedServiceIdentity identity() { /** * Set the identity property: The identity of the resource. - * + * * @param identity the identity value to set. * @return the PrivateEndpointConnectionInner object itself. */ @@ -91,7 +105,7 @@ public PrivateEndpointConnectionInner withIdentity(ManagedServiceIdentity identi /** * Get the location property: Specifies the location of the resource. - * + * * @return the location value. */ public String location() { @@ -100,7 +114,7 @@ public String location() { /** * Set the location property: Specifies the location of the resource. - * + * * @param location the location value to set. * @return the PrivateEndpointConnectionInner object itself. */ @@ -111,7 +125,7 @@ public PrivateEndpointConnectionInner withLocation(String location) { /** * Get the tags property: Contains resource tags defined as key/value pairs. - * + * * @return the tags value. */ public Map tags() { @@ -120,7 +134,7 @@ public Map tags() { /** * Set the tags property: Contains resource tags defined as key/value pairs. - * + * * @param tags the tags value to set. * @return the PrivateEndpointConnectionInner object itself. */ @@ -131,7 +145,7 @@ public PrivateEndpointConnectionInner withTags(Map tags) { /** * Get the sku property: The sku of the workspace. - * + * * @return the sku value. */ public Sku sku() { @@ -140,7 +154,7 @@ public Sku sku() { /** * Set the sku property: The sku of the workspace. - * + * * @param sku the sku value to set. * @return the PrivateEndpointConnectionInner object itself. */ @@ -151,16 +165,46 @@ public PrivateEndpointConnectionInner withSku(Sku sku) { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Get the privateEndpoint property: The resource of private end point. - * + * * @return the privateEndpoint value. */ public PrivateEndpoint privateEndpoint() { @@ -169,7 +213,7 @@ public PrivateEndpoint privateEndpoint() { /** * Set the privateEndpoint property: The resource of private end point. - * + * * @param privateEndpoint the privateEndpoint value to set. * @return the PrivateEndpointConnectionInner object itself. */ @@ -184,7 +228,7 @@ public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privat /** * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection * between service consumer and provider. - * + * * @return the privateLinkServiceConnectionState value. */ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { @@ -194,12 +238,12 @@ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { /** * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection * between service consumer and provider. - * + * * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. * @return the PrivateEndpointConnectionInner object itself. */ - public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( - PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + public PrivateEndpointConnectionInner + withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { if (this.innerProperties() == null) { this.innerProperties = new PrivateEndpointConnectionProperties(); } @@ -209,7 +253,7 @@ public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( /** * Get the provisioningState property: The provisioning state of the private endpoint connection resource. - * + * * @return the provisioningState value. */ public PrivateEndpointConnectionProvisioningState provisioningState() { @@ -218,7 +262,7 @@ public PrivateEndpointConnectionProvisioningState provisioningState() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -232,4 +276,64 @@ public void validate() { sku().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("sku", this.sku); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PrivateEndpointConnectionInner. + */ + public static PrivateEndpointConnectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionInner deserializedPrivateEndpointConnectionInner + = new PrivateEndpointConnectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.innerProperties + = PrivateEndpointConnectionProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("location".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.location = reader.getString(); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedPrivateEndpointConnectionInner.tags = tags; + } else if ("sku".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.sku = Sku.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PrivateEndpointConnectionProperties.java index c09c5305622f9..73c00d781c1ce 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PrivateEndpointConnectionProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PrivateEndpointConnectionProperties.java @@ -6,39 +6,45 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.models.PrivateEndpoint; import com.azure.resourcemanager.machinelearning.models.PrivateEndpointConnectionProvisioningState; import com.azure.resourcemanager.machinelearning.models.PrivateLinkServiceConnectionState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Properties of the PrivateEndpointConnectProperties. */ +/** + * Properties of the PrivateEndpointConnectProperties. + */ @Fluent -public final class PrivateEndpointConnectionProperties { +public final class PrivateEndpointConnectionProperties + implements JsonSerializable { /* * The resource of private end point. */ - @JsonProperty(value = "privateEndpoint") private PrivateEndpoint privateEndpoint; /* * A collection of information about the state of the connection between service consumer and provider. */ - @JsonProperty(value = "privateLinkServiceConnectionState", required = true) private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; /* * The provisioning state of the private endpoint connection resource. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private PrivateEndpointConnectionProvisioningState provisioningState; - /** Creates an instance of PrivateEndpointConnectionProperties class. */ + /** + * Creates an instance of PrivateEndpointConnectionProperties class. + */ public PrivateEndpointConnectionProperties() { } /** * Get the privateEndpoint property: The resource of private end point. - * + * * @return the privateEndpoint value. */ public PrivateEndpoint privateEndpoint() { @@ -47,7 +53,7 @@ public PrivateEndpoint privateEndpoint() { /** * Set the privateEndpoint property: The resource of private end point. - * + * * @param privateEndpoint the privateEndpoint value to set. * @return the PrivateEndpointConnectionProperties object itself. */ @@ -59,7 +65,7 @@ public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint p /** * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection * between service consumer and provider. - * + * * @return the privateLinkServiceConnectionState value. */ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { @@ -69,19 +75,19 @@ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { /** * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection * between service consumer and provider. - * + * * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. * @return the PrivateEndpointConnectionProperties object itself. */ - public PrivateEndpointConnectionProperties withPrivateLinkServiceConnectionState( - PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + public PrivateEndpointConnectionProperties + withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; return this; } /** * Get the provisioningState property: The provisioning state of the private endpoint connection resource. - * + * * @return the provisioningState value. */ public PrivateEndpointConnectionProvisioningState provisioningState() { @@ -90,7 +96,7 @@ public PrivateEndpointConnectionProvisioningState provisioningState() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -98,15 +104,58 @@ public void validate() { privateEndpoint().validate(); } if (privateLinkServiceConnectionState() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property privateLinkServiceConnectionState in model" - + " PrivateEndpointConnectionProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property privateLinkServiceConnectionState in model PrivateEndpointConnectionProperties")); } else { privateLinkServiceConnectionState().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("privateLinkServiceConnectionState", this.privateLinkServiceConnectionState); + jsonWriter.writeJsonField("privateEndpoint", this.privateEndpoint); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PrivateEndpointConnectionProperties. + */ + public static PrivateEndpointConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionProperties deserializedPrivateEndpointConnectionProperties + = new PrivateEndpointConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("privateLinkServiceConnectionState".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.privateLinkServiceConnectionState + = PrivateLinkServiceConnectionState.fromJson(reader); + } else if ("privateEndpoint".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.privateEndpoint = PrivateEndpoint.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.provisioningState + = PrivateEndpointConnectionProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PrivateLinkResourceListResultInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PrivateLinkResourceListResultInner.java index 6047466b92300..7c0b27237e550 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PrivateLinkResourceListResultInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PrivateLinkResourceListResultInner.java @@ -5,26 +5,33 @@ package com.azure.resourcemanager.machinelearning.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.models.PrivateLinkResource; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** A list of private link resources. */ +/** + * A list of private link resources. + */ @Fluent -public final class PrivateLinkResourceListResultInner { +public final class PrivateLinkResourceListResultInner implements JsonSerializable { /* * Array of private link resources */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of PrivateLinkResourceListResultInner class. */ + /** + * Creates an instance of PrivateLinkResourceListResultInner class. + */ public PrivateLinkResourceListResultInner() { } /** * Get the value property: Array of private link resources. - * + * * @return the value value. */ public List value() { @@ -33,7 +40,7 @@ public List value() { /** * Set the value property: Array of private link resources. - * + * * @param value the value value to set. * @return the PrivateLinkResourceListResultInner object itself. */ @@ -44,7 +51,7 @@ public PrivateLinkResourceListResultInner withValue(List va /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -52,4 +59,43 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceListResultInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkResourceListResultInner. + */ + public static PrivateLinkResourceListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceListResultInner deserializedPrivateLinkResourceListResultInner + = new PrivateLinkResourceListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrivateLinkResource.fromJson(reader1)); + deserializedPrivateLinkResourceListResultInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceListResultInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PrivateLinkResourceProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PrivateLinkResourceProperties.java index 7547a19c2fa61..856715b8d7665 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PrivateLinkResourceProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/PrivateLinkResourceProperties.java @@ -5,37 +5,42 @@ package com.azure.resourcemanager.machinelearning.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** Properties of a private link resource. */ +/** + * Properties of a private link resource. + */ @Fluent -public final class PrivateLinkResourceProperties { +public final class PrivateLinkResourceProperties implements JsonSerializable { /* * The private link resource group id. */ - @JsonProperty(value = "groupId", access = JsonProperty.Access.WRITE_ONLY) private String groupId; /* * The private link resource required member names. */ - @JsonProperty(value = "requiredMembers", access = JsonProperty.Access.WRITE_ONLY) private List requiredMembers; /* * The private link resource Private link DNS zone name. */ - @JsonProperty(value = "requiredZoneNames") private List requiredZoneNames; - /** Creates an instance of PrivateLinkResourceProperties class. */ + /** + * Creates an instance of PrivateLinkResourceProperties class. + */ public PrivateLinkResourceProperties() { } /** * Get the groupId property: The private link resource group id. - * + * * @return the groupId value. */ public String groupId() { @@ -44,7 +49,7 @@ public String groupId() { /** * Get the requiredMembers property: The private link resource required member names. - * + * * @return the requiredMembers value. */ public List requiredMembers() { @@ -53,7 +58,7 @@ public List requiredMembers() { /** * Get the requiredZoneNames property: The private link resource Private link DNS zone name. - * + * * @return the requiredZoneNames value. */ public List requiredZoneNames() { @@ -62,7 +67,7 @@ public List requiredZoneNames() { /** * Set the requiredZoneNames property: The private link resource Private link DNS zone name. - * + * * @param requiredZoneNames the requiredZoneNames value to set. * @return the PrivateLinkResourceProperties object itself. */ @@ -73,9 +78,53 @@ public PrivateLinkResourceProperties withRequiredZoneNames(List required /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("requiredZoneNames", this.requiredZoneNames, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkResourceProperties. + */ + public static PrivateLinkResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceProperties deserializedPrivateLinkResourceProperties + = new PrivateLinkResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("groupId".equals(fieldName)) { + deserializedPrivateLinkResourceProperties.groupId = reader.getString(); + } else if ("requiredMembers".equals(fieldName)) { + List requiredMembers = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateLinkResourceProperties.requiredMembers = requiredMembers; + } else if ("requiredZoneNames".equals(fieldName)) { + List requiredZoneNames = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateLinkResourceProperties.requiredZoneNames = requiredZoneNames; + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/RegistryInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/RegistryInner.java new file mode 100644 index 0000000000000..446a0a7f6dcfa --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/RegistryInner.java @@ -0,0 +1,450 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.machinelearning.models.ArmResourceId; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.RegistryPrivateEndpointConnection; +import com.azure.resourcemanager.machinelearning.models.RegistryRegionArmDetails; +import com.azure.resourcemanager.machinelearning.models.Sku; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * The Registry model. + */ +@Fluent +public final class RegistryInner extends Resource { + /* + * Managed service identity (system assigned and/or user assigned identities) + */ + private ManagedServiceIdentity identity; + + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. + */ + private String kind; + + /* + * [Required] Additional attributes of the entity. + */ + private RegistryProperties innerProperties = new RegistryProperties(); + + /* + * Sku details required for ARM contract for Autoscaling. + */ + private Sku sku; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of RegistryInner class. + */ + public RegistryInner() { + } + + /** + * Get the identity property: Managed service identity (system assigned and/or user assigned identities). + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Managed service identity (system assigned and/or user assigned identities). + * + * @param identity the identity value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Set the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type. + * + * @param kind the kind value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withKind(String kind) { + this.kind = kind; + return this; + } + + /** + * Get the innerProperties property: [Required] Additional attributes of the entity. + * + * @return the innerProperties value. + */ + private RegistryProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the sku property: Sku details required for ARM contract for Autoscaling. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: Sku details required for ARM contract for Autoscaling. + * + * @param sku the sku value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * {@inheritDoc} + */ + @Override + public RegistryInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RegistryInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the discoveryUrl property: Discovery URL for the Registry. + * + * @return the discoveryUrl value. + */ + public String discoveryUrl() { + return this.innerProperties() == null ? null : this.innerProperties().discoveryUrl(); + } + + /** + * Set the discoveryUrl property: Discovery URL for the Registry. + * + * @param discoveryUrl the discoveryUrl value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withDiscoveryUrl(String discoveryUrl) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryProperties(); + } + this.innerProperties().withDiscoveryUrl(discoveryUrl); + return this; + } + + /** + * Get the intellectualPropertyPublisher property: IntellectualPropertyPublisher for the registry. + * + * @return the intellectualPropertyPublisher value. + */ + public String intellectualPropertyPublisher() { + return this.innerProperties() == null ? null : this.innerProperties().intellectualPropertyPublisher(); + } + + /** + * Set the intellectualPropertyPublisher property: IntellectualPropertyPublisher for the registry. + * + * @param intellectualPropertyPublisher the intellectualPropertyPublisher value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withIntellectualPropertyPublisher(String intellectualPropertyPublisher) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryProperties(); + } + this.innerProperties().withIntellectualPropertyPublisher(intellectualPropertyPublisher); + return this; + } + + /** + * Get the managedResourceGroup property: ResourceId of the managed RG if the registry has system created resources. + * + * @return the managedResourceGroup value. + */ + public ArmResourceId managedResourceGroup() { + return this.innerProperties() == null ? null : this.innerProperties().managedResourceGroup(); + } + + /** + * Set the managedResourceGroup property: ResourceId of the managed RG if the registry has system created resources. + * + * @param managedResourceGroup the managedResourceGroup value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withManagedResourceGroup(ArmResourceId managedResourceGroup) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryProperties(); + } + this.innerProperties().withManagedResourceGroup(managedResourceGroup); + return this; + } + + /** + * Get the mlFlowRegistryUri property: MLFlow Registry URI for the Registry. + * + * @return the mlFlowRegistryUri value. + */ + public String mlFlowRegistryUri() { + return this.innerProperties() == null ? null : this.innerProperties().mlFlowRegistryUri(); + } + + /** + * Set the mlFlowRegistryUri property: MLFlow Registry URI for the Registry. + * + * @param mlFlowRegistryUri the mlFlowRegistryUri value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withMlFlowRegistryUri(String mlFlowRegistryUri) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryProperties(); + } + this.innerProperties().withMlFlowRegistryUri(mlFlowRegistryUri); + return this; + } + + /** + * Get the registryPrivateEndpointConnections property: Private endpoint connections info used for pending + * connections in private link portal. + * + * @return the registryPrivateEndpointConnections value. + */ + public List registryPrivateEndpointConnections() { + return this.innerProperties() == null ? null : this.innerProperties().registryPrivateEndpointConnections(); + } + + /** + * Set the registryPrivateEndpointConnections property: Private endpoint connections info used for pending + * connections in private link portal. + * + * @param registryPrivateEndpointConnections the registryPrivateEndpointConnections value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withRegistryPrivateEndpointConnections( + List registryPrivateEndpointConnections) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryProperties(); + } + this.innerProperties().withRegistryPrivateEndpointConnections(registryPrivateEndpointConnections); + return this; + } + + /** + * Get the publicNetworkAccess property: Is the Registry accessible from the internet? + * Possible values: "Enabled" or "Disabled". + * + * @return the publicNetworkAccess value. + */ + public String publicNetworkAccess() { + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); + } + + /** + * Set the publicNetworkAccess property: Is the Registry accessible from the internet? + * Possible values: "Enabled" or "Disabled". + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withPublicNetworkAccess(String publicNetworkAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryProperties(); + } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + /** + * Get the regionDetails property: Details of each region the registry is in. + * + * @return the regionDetails value. + */ + public List regionDetails() { + return this.innerProperties() == null ? null : this.innerProperties().regionDetails(); + } + + /** + * Set the regionDetails property: Details of each region the registry is in. + * + * @param regionDetails the regionDetails value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withRegionDetails(List regionDetails) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryProperties(); + } + this.innerProperties().withRegionDetails(regionDetails); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (innerProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property innerProperties in model RegistryInner")); + } else { + innerProperties().validate(); + } + if (sku() != null) { + sku().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RegistryInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeJsonField("sku", this.sku); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RegistryInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RegistryInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RegistryInner. + */ + public static RegistryInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RegistryInner deserializedRegistryInner = new RegistryInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRegistryInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedRegistryInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRegistryInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedRegistryInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedRegistryInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedRegistryInner.innerProperties = RegistryProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedRegistryInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedRegistryInner.kind = reader.getString(); + } else if ("sku".equals(fieldName)) { + deserializedRegistryInner.sku = Sku.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedRegistryInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRegistryInner; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/RegistryPrivateEndpointConnectionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/RegistryPrivateEndpointConnectionProperties.java new file mode 100644 index 0000000000000..3c3f8d2420624 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/RegistryPrivateEndpointConnectionProperties.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.machinelearning.models.PrivateEndpointResource; +import com.azure.resourcemanager.machinelearning.models.RegistryPrivateLinkServiceConnectionState; +import java.io.IOException; +import java.util.List; + +/** + * Properties of the Private Endpoint Connection. + */ +@Fluent +public final class RegistryPrivateEndpointConnectionProperties + implements JsonSerializable { + /* + * The group ids + */ + private List groupIds; + + /* + * The PE network resource that is linked to this PE connection. + */ + private PrivateEndpointResource privateEndpoint; + + /* + * The connection state. + */ + private RegistryPrivateLinkServiceConnectionState registryPrivateLinkServiceConnectionState; + + /* + * One of null, "Succeeded", "Provisioning", "Failed". While not approved, it's null. + */ + private String provisioningState; + + /** + * Creates an instance of RegistryPrivateEndpointConnectionProperties class. + */ + public RegistryPrivateEndpointConnectionProperties() { + } + + /** + * Get the groupIds property: The group ids. + * + * @return the groupIds value. + */ + public List groupIds() { + return this.groupIds; + } + + /** + * Set the groupIds property: The group ids. + * + * @param groupIds the groupIds value to set. + * @return the RegistryPrivateEndpointConnectionProperties object itself. + */ + public RegistryPrivateEndpointConnectionProperties withGroupIds(List groupIds) { + this.groupIds = groupIds; + return this; + } + + /** + * Get the privateEndpoint property: The PE network resource that is linked to this PE connection. + * + * @return the privateEndpoint value. + */ + public PrivateEndpointResource privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: The PE network resource that is linked to this PE connection. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the RegistryPrivateEndpointConnectionProperties object itself. + */ + public RegistryPrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpointResource privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get the registryPrivateLinkServiceConnectionState property: The connection state. + * + * @return the registryPrivateLinkServiceConnectionState value. + */ + public RegistryPrivateLinkServiceConnectionState registryPrivateLinkServiceConnectionState() { + return this.registryPrivateLinkServiceConnectionState; + } + + /** + * Set the registryPrivateLinkServiceConnectionState property: The connection state. + * + * @param registryPrivateLinkServiceConnectionState the registryPrivateLinkServiceConnectionState value to set. + * @return the RegistryPrivateEndpointConnectionProperties object itself. + */ + public RegistryPrivateEndpointConnectionProperties withRegistryPrivateLinkServiceConnectionState( + RegistryPrivateLinkServiceConnectionState registryPrivateLinkServiceConnectionState) { + this.registryPrivateLinkServiceConnectionState = registryPrivateLinkServiceConnectionState; + return this; + } + + /** + * Get the provisioningState property: One of null, "Succeeded", "Provisioning", "Failed". While not approved, it's + * null. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: One of null, "Succeeded", "Provisioning", "Failed". While not approved, it's + * null. + * + * @param provisioningState the provisioningState value to set. + * @return the RegistryPrivateEndpointConnectionProperties object itself. + */ + public RegistryPrivateEndpointConnectionProperties withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (registryPrivateLinkServiceConnectionState() != null) { + registryPrivateLinkServiceConnectionState().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("groupIds", this.groupIds, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("privateEndpoint", this.privateEndpoint); + jsonWriter.writeJsonField("registryPrivateLinkServiceConnectionState", + this.registryPrivateLinkServiceConnectionState); + jsonWriter.writeStringField("provisioningState", this.provisioningState); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RegistryPrivateEndpointConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RegistryPrivateEndpointConnectionProperties if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RegistryPrivateEndpointConnectionProperties. + */ + public static RegistryPrivateEndpointConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RegistryPrivateEndpointConnectionProperties deserializedRegistryPrivateEndpointConnectionProperties + = new RegistryPrivateEndpointConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("groupIds".equals(fieldName)) { + List groupIds = reader.readArray(reader1 -> reader1.getString()); + deserializedRegistryPrivateEndpointConnectionProperties.groupIds = groupIds; + } else if ("privateEndpoint".equals(fieldName)) { + deserializedRegistryPrivateEndpointConnectionProperties.privateEndpoint + = PrivateEndpointResource.fromJson(reader); + } else if ("registryPrivateLinkServiceConnectionState".equals(fieldName)) { + deserializedRegistryPrivateEndpointConnectionProperties.registryPrivateLinkServiceConnectionState + = RegistryPrivateLinkServiceConnectionState.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedRegistryPrivateEndpointConnectionProperties.provisioningState = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRegistryPrivateEndpointConnectionProperties; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/RegistryProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/RegistryProperties.java new file mode 100644 index 0000000000000..6ddc52a4f0521 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/RegistryProperties.java @@ -0,0 +1,286 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.machinelearning.models.ArmResourceId; +import com.azure.resourcemanager.machinelearning.models.RegistryPrivateEndpointConnection; +import com.azure.resourcemanager.machinelearning.models.RegistryRegionArmDetails; +import java.io.IOException; +import java.util.List; + +/** + * Details of the Registry. + */ +@Fluent +public final class RegistryProperties implements JsonSerializable { + /* + * Discovery URL for the Registry + */ + private String discoveryUrl; + + /* + * IntellectualPropertyPublisher for the registry + */ + private String intellectualPropertyPublisher; + + /* + * ResourceId of the managed RG if the registry has system created resources + */ + private ArmResourceId managedResourceGroup; + + /* + * MLFlow Registry URI for the Registry + */ + private String mlFlowRegistryUri; + + /* + * Private endpoint connections info used for pending connections in private link portal + */ + private List registryPrivateEndpointConnections; + + /* + * Is the Registry accessible from the internet? + * Possible values: "Enabled" or "Disabled" + */ + private String publicNetworkAccess; + + /* + * Details of each region the registry is in + */ + private List regionDetails; + + /** + * Creates an instance of RegistryProperties class. + */ + public RegistryProperties() { + } + + /** + * Get the discoveryUrl property: Discovery URL for the Registry. + * + * @return the discoveryUrl value. + */ + public String discoveryUrl() { + return this.discoveryUrl; + } + + /** + * Set the discoveryUrl property: Discovery URL for the Registry. + * + * @param discoveryUrl the discoveryUrl value to set. + * @return the RegistryProperties object itself. + */ + public RegistryProperties withDiscoveryUrl(String discoveryUrl) { + this.discoveryUrl = discoveryUrl; + return this; + } + + /** + * Get the intellectualPropertyPublisher property: IntellectualPropertyPublisher for the registry. + * + * @return the intellectualPropertyPublisher value. + */ + public String intellectualPropertyPublisher() { + return this.intellectualPropertyPublisher; + } + + /** + * Set the intellectualPropertyPublisher property: IntellectualPropertyPublisher for the registry. + * + * @param intellectualPropertyPublisher the intellectualPropertyPublisher value to set. + * @return the RegistryProperties object itself. + */ + public RegistryProperties withIntellectualPropertyPublisher(String intellectualPropertyPublisher) { + this.intellectualPropertyPublisher = intellectualPropertyPublisher; + return this; + } + + /** + * Get the managedResourceGroup property: ResourceId of the managed RG if the registry has system created resources. + * + * @return the managedResourceGroup value. + */ + public ArmResourceId managedResourceGroup() { + return this.managedResourceGroup; + } + + /** + * Set the managedResourceGroup property: ResourceId of the managed RG if the registry has system created resources. + * + * @param managedResourceGroup the managedResourceGroup value to set. + * @return the RegistryProperties object itself. + */ + public RegistryProperties withManagedResourceGroup(ArmResourceId managedResourceGroup) { + this.managedResourceGroup = managedResourceGroup; + return this; + } + + /** + * Get the mlFlowRegistryUri property: MLFlow Registry URI for the Registry. + * + * @return the mlFlowRegistryUri value. + */ + public String mlFlowRegistryUri() { + return this.mlFlowRegistryUri; + } + + /** + * Set the mlFlowRegistryUri property: MLFlow Registry URI for the Registry. + * + * @param mlFlowRegistryUri the mlFlowRegistryUri value to set. + * @return the RegistryProperties object itself. + */ + public RegistryProperties withMlFlowRegistryUri(String mlFlowRegistryUri) { + this.mlFlowRegistryUri = mlFlowRegistryUri; + return this; + } + + /** + * Get the registryPrivateEndpointConnections property: Private endpoint connections info used for pending + * connections in private link portal. + * + * @return the registryPrivateEndpointConnections value. + */ + public List registryPrivateEndpointConnections() { + return this.registryPrivateEndpointConnections; + } + + /** + * Set the registryPrivateEndpointConnections property: Private endpoint connections info used for pending + * connections in private link portal. + * + * @param registryPrivateEndpointConnections the registryPrivateEndpointConnections value to set. + * @return the RegistryProperties object itself. + */ + public RegistryProperties withRegistryPrivateEndpointConnections( + List registryPrivateEndpointConnections) { + this.registryPrivateEndpointConnections = registryPrivateEndpointConnections; + return this; + } + + /** + * Get the publicNetworkAccess property: Is the Registry accessible from the internet? + * Possible values: "Enabled" or "Disabled". + * + * @return the publicNetworkAccess value. + */ + public String publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Is the Registry accessible from the internet? + * Possible values: "Enabled" or "Disabled". + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the RegistryProperties object itself. + */ + public RegistryProperties withPublicNetworkAccess(String publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the regionDetails property: Details of each region the registry is in. + * + * @return the regionDetails value. + */ + public List regionDetails() { + return this.regionDetails; + } + + /** + * Set the regionDetails property: Details of each region the registry is in. + * + * @param regionDetails the regionDetails value to set. + * @return the RegistryProperties object itself. + */ + public RegistryProperties withRegionDetails(List regionDetails) { + this.regionDetails = regionDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (managedResourceGroup() != null) { + managedResourceGroup().validate(); + } + if (registryPrivateEndpointConnections() != null) { + registryPrivateEndpointConnections().forEach(e -> e.validate()); + } + if (regionDetails() != null) { + regionDetails().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("discoveryUrl", this.discoveryUrl); + jsonWriter.writeStringField("intellectualPropertyPublisher", this.intellectualPropertyPublisher); + jsonWriter.writeJsonField("managedResourceGroup", this.managedResourceGroup); + jsonWriter.writeStringField("mlFlowRegistryUri", this.mlFlowRegistryUri); + jsonWriter.writeArrayField("registryPrivateEndpointConnections", this.registryPrivateEndpointConnections, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("publicNetworkAccess", this.publicNetworkAccess); + jsonWriter.writeArrayField("regionDetails", this.regionDetails, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RegistryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RegistryProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RegistryProperties. + */ + public static RegistryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RegistryProperties deserializedRegistryProperties = new RegistryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("discoveryUrl".equals(fieldName)) { + deserializedRegistryProperties.discoveryUrl = reader.getString(); + } else if ("intellectualPropertyPublisher".equals(fieldName)) { + deserializedRegistryProperties.intellectualPropertyPublisher = reader.getString(); + } else if ("managedResourceGroup".equals(fieldName)) { + deserializedRegistryProperties.managedResourceGroup = ArmResourceId.fromJson(reader); + } else if ("mlFlowRegistryUri".equals(fieldName)) { + deserializedRegistryProperties.mlFlowRegistryUri = reader.getString(); + } else if ("registryPrivateEndpointConnections".equals(fieldName)) { + List registryPrivateEndpointConnections + = reader.readArray(reader1 -> RegistryPrivateEndpointConnection.fromJson(reader1)); + deserializedRegistryProperties.registryPrivateEndpointConnections + = registryPrivateEndpointConnections; + } else if ("publicNetworkAccess".equals(fieldName)) { + deserializedRegistryProperties.publicNetworkAccess = reader.getString(); + } else if ("regionDetails".equals(fieldName)) { + List regionDetails + = reader.readArray(reader1 -> RegistryRegionArmDetails.fromJson(reader1)); + deserializedRegistryProperties.regionDetails = regionDetails; + } else { + reader.skipChildren(); + } + } + + return deserializedRegistryProperties; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ResourceQuotaInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ResourceQuotaInner.java index 66cc692078955..bfe2dbbb5075e 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ResourceQuotaInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ResourceQuotaInner.java @@ -5,58 +5,58 @@ package com.azure.resourcemanager.machinelearning.fluent.models; import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.models.QuotaUnit; import com.azure.resourcemanager.machinelearning.models.ResourceName; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** The quota assigned to a resource. */ +/** + * The quota assigned to a resource. + */ @Immutable -public final class ResourceQuotaInner { +public final class ResourceQuotaInner implements JsonSerializable { /* * Specifies the resource ID. */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; /* * Region of the AML workspace in the id. */ - @JsonProperty(value = "amlWorkspaceLocation", access = JsonProperty.Access.WRITE_ONLY) private String amlWorkspaceLocation; /* * Specifies the resource type. */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) private String type; /* * Name of the resource. */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private ResourceName name; /* - * Limit. - * * The maximum permitted quota of the resource. */ - @JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY) private Long limit; /* * An enum describing the unit of quota measurement. */ - @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) private QuotaUnit unit; - /** Creates an instance of ResourceQuotaInner class. */ + /** + * Creates an instance of ResourceQuotaInner class. + */ public ResourceQuotaInner() { } /** * Get the id property: Specifies the resource ID. - * + * * @return the id value. */ public String id() { @@ -65,7 +65,7 @@ public String id() { /** * Get the amlWorkspaceLocation property: Region of the AML workspace in the id. - * + * * @return the amlWorkspaceLocation value. */ public String amlWorkspaceLocation() { @@ -74,7 +74,7 @@ public String amlWorkspaceLocation() { /** * Get the type property: Specifies the resource type. - * + * * @return the type value. */ public String type() { @@ -83,7 +83,7 @@ public String type() { /** * Get the name property: Name of the resource. - * + * * @return the name value. */ public ResourceName name() { @@ -91,10 +91,8 @@ public ResourceName name() { } /** - * Get the limit property: Limit. - * - *

The maximum permitted quota of the resource. - * + * Get the limit property: The maximum permitted quota of the resource. + * * @return the limit value. */ public Long limit() { @@ -103,7 +101,7 @@ public Long limit() { /** * Get the unit property: An enum describing the unit of quota measurement. - * + * * @return the unit value. */ public QuotaUnit unit() { @@ -112,7 +110,7 @@ public QuotaUnit unit() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -120,4 +118,49 @@ public void validate() { name().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceQuotaInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceQuotaInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceQuotaInner. + */ + public static ResourceQuotaInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceQuotaInner deserializedResourceQuotaInner = new ResourceQuotaInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedResourceQuotaInner.id = reader.getString(); + } else if ("amlWorkspaceLocation".equals(fieldName)) { + deserializedResourceQuotaInner.amlWorkspaceLocation = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedResourceQuotaInner.type = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedResourceQuotaInner.name = ResourceName.fromJson(reader); + } else if ("limit".equals(fieldName)) { + deserializedResourceQuotaInner.limit = reader.getNullable(JsonReader::getLong); + } else if ("unit".equals(fieldName)) { + deserializedResourceQuotaInner.unit = QuotaUnit.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceQuotaInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ScheduleInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ScheduleInner.java index 4efea46f4816c..0073aa67f7108 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ScheduleInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ScheduleInner.java @@ -8,31 +8,51 @@ import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.models.ScheduleProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Azure Resource Manager resource envelope. */ +/** + * Azure Resource Manager resource envelope. + */ @Fluent public final class ScheduleInner extends ProxyResource { /* * [Required] Additional attributes of the entity. */ - @JsonProperty(value = "properties", required = true) private ScheduleProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of ScheduleInner class. */ + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of ScheduleInner class. + */ public ScheduleInner() { } /** * Get the properties property: [Required] Additional attributes of the entity. - * + * * @return the properties value. */ public ScheduleProperties properties() { @@ -41,7 +61,7 @@ public ScheduleProperties properties() { /** * Set the properties property: [Required] Additional attributes of the entity. - * + * * @param properties the properties value to set. * @return the ScheduleInner object itself. */ @@ -52,27 +72,101 @@ public ScheduleInner withProperties(ScheduleProperties properties) { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (properties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property properties in model ScheduleInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property properties in model ScheduleInner")); } else { properties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(ScheduleInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScheduleInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScheduleInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ScheduleInner. + */ + public static ScheduleInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScheduleInner deserializedScheduleInner = new ScheduleInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedScheduleInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedScheduleInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedScheduleInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedScheduleInner.properties = ScheduleProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedScheduleInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedScheduleInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ServerlessEndpointInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ServerlessEndpointInner.java new file mode 100644 index 0000000000000..28a631019f71c --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/ServerlessEndpointInner.java @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.ServerlessEndpointProperties; +import com.azure.resourcemanager.machinelearning.models.Sku; +import java.io.IOException; +import java.util.Map; + +/** + * The ServerlessEndpoint model. + */ +@Fluent +public final class ServerlessEndpointInner extends Resource { + /* + * Managed service identity (system assigned and/or user assigned identities) + */ + private ManagedServiceIdentity identity; + + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. + */ + private String kind; + + /* + * [Required] Additional attributes of the entity. + */ + private ServerlessEndpointProperties properties; + + /* + * Sku details required for ARM contract for Autoscaling. + */ + private Sku sku; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of ServerlessEndpointInner class. + */ + public ServerlessEndpointInner() { + } + + /** + * Get the identity property: Managed service identity (system assigned and/or user assigned identities). + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Managed service identity (system assigned and/or user assigned identities). + * + * @param identity the identity value to set. + * @return the ServerlessEndpointInner object itself. + */ + public ServerlessEndpointInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Set the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type. + * + * @param kind the kind value to set. + * @return the ServerlessEndpointInner object itself. + */ + public ServerlessEndpointInner withKind(String kind) { + this.kind = kind; + return this; + } + + /** + * Get the properties property: [Required] Additional attributes of the entity. + * + * @return the properties value. + */ + public ServerlessEndpointProperties properties() { + return this.properties; + } + + /** + * Set the properties property: [Required] Additional attributes of the entity. + * + * @param properties the properties value to set. + * @return the ServerlessEndpointInner object itself. + */ + public ServerlessEndpointInner withProperties(ServerlessEndpointProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the sku property: Sku details required for ARM contract for Autoscaling. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: Sku details required for ARM contract for Autoscaling. + * + * @param sku the sku value to set. + * @return the ServerlessEndpointInner object itself. + */ + public ServerlessEndpointInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * {@inheritDoc} + */ + @Override + public ServerlessEndpointInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ServerlessEndpointInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (properties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property properties in model ServerlessEndpointInner")); + } else { + properties().validate(); + } + if (sku() != null) { + sku().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ServerlessEndpointInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeJsonField("sku", this.sku); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServerlessEndpointInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServerlessEndpointInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ServerlessEndpointInner. + */ + public static ServerlessEndpointInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServerlessEndpointInner deserializedServerlessEndpointInner = new ServerlessEndpointInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedServerlessEndpointInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedServerlessEndpointInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedServerlessEndpointInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedServerlessEndpointInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedServerlessEndpointInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedServerlessEndpointInner.properties = ServerlessEndpointProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedServerlessEndpointInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedServerlessEndpointInner.kind = reader.getString(); + } else if ("sku".equals(fieldName)) { + deserializedServerlessEndpointInner.sku = Sku.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedServerlessEndpointInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedServerlessEndpointInner; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/SharedPrivateLinkResourceProperty.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/SharedPrivateLinkResourceProperty.java index 958d5005f9a12..cb38303f4796b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/SharedPrivateLinkResourceProperty.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/SharedPrivateLinkResourceProperty.java @@ -5,43 +5,47 @@ package com.azure.resourcemanager.machinelearning.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.models.PrivateEndpointServiceConnectionStatus; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Properties of a shared private link resource. */ +/** + * Properties of a shared private link resource. + */ @Fluent -public final class SharedPrivateLinkResourceProperty { +public final class SharedPrivateLinkResourceProperty implements JsonSerializable { /* * The resource id that private link links to. */ - @JsonProperty(value = "privateLinkResourceId") private String privateLinkResourceId; /* * The private link resource group id. */ - @JsonProperty(value = "groupId") private String groupId; /* * Request message. */ - @JsonProperty(value = "requestMessage") private String requestMessage; /* * Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. */ - @JsonProperty(value = "status") private PrivateEndpointServiceConnectionStatus status; - /** Creates an instance of SharedPrivateLinkResourceProperty class. */ + /** + * Creates an instance of SharedPrivateLinkResourceProperty class. + */ public SharedPrivateLinkResourceProperty() { } /** * Get the privateLinkResourceId property: The resource id that private link links to. - * + * * @return the privateLinkResourceId value. */ public String privateLinkResourceId() { @@ -50,7 +54,7 @@ public String privateLinkResourceId() { /** * Set the privateLinkResourceId property: The resource id that private link links to. - * + * * @param privateLinkResourceId the privateLinkResourceId value to set. * @return the SharedPrivateLinkResourceProperty object itself. */ @@ -61,7 +65,7 @@ public SharedPrivateLinkResourceProperty withPrivateLinkResourceId(String privat /** * Get the groupId property: The private link resource group id. - * + * * @return the groupId value. */ public String groupId() { @@ -70,7 +74,7 @@ public String groupId() { /** * Set the groupId property: The private link resource group id. - * + * * @param groupId the groupId value to set. * @return the SharedPrivateLinkResourceProperty object itself. */ @@ -81,7 +85,7 @@ public SharedPrivateLinkResourceProperty withGroupId(String groupId) { /** * Get the requestMessage property: Request message. - * + * * @return the requestMessage value. */ public String requestMessage() { @@ -90,7 +94,7 @@ public String requestMessage() { /** * Set the requestMessage property: Request message. - * + * * @param requestMessage the requestMessage value to set. * @return the SharedPrivateLinkResourceProperty object itself. */ @@ -102,7 +106,7 @@ public SharedPrivateLinkResourceProperty withRequestMessage(String requestMessag /** * Get the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the * service. - * + * * @return the status value. */ public PrivateEndpointServiceConnectionStatus status() { @@ -112,7 +116,7 @@ public PrivateEndpointServiceConnectionStatus status() { /** * Set the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the * service. - * + * * @param status the status value to set. * @return the SharedPrivateLinkResourceProperty object itself. */ @@ -123,9 +127,56 @@ public SharedPrivateLinkResourceProperty withStatus(PrivateEndpointServiceConnec /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("privateLinkResourceId", this.privateLinkResourceId); + jsonWriter.writeStringField("groupId", this.groupId); + jsonWriter.writeStringField("requestMessage", this.requestMessage); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SharedPrivateLinkResourceProperty from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SharedPrivateLinkResourceProperty if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SharedPrivateLinkResourceProperty. + */ + public static SharedPrivateLinkResourceProperty fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SharedPrivateLinkResourceProperty deserializedSharedPrivateLinkResourceProperty + = new SharedPrivateLinkResourceProperty(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("privateLinkResourceId".equals(fieldName)) { + deserializedSharedPrivateLinkResourceProperty.privateLinkResourceId = reader.getString(); + } else if ("groupId".equals(fieldName)) { + deserializedSharedPrivateLinkResourceProperty.groupId = reader.getString(); + } else if ("requestMessage".equals(fieldName)) { + deserializedSharedPrivateLinkResourceProperty.requestMessage = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedSharedPrivateLinkResourceProperty.status + = PrivateEndpointServiceConnectionStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSharedPrivateLinkResourceProperty; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/SkuResourceInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/SkuResourceInner.java index 7eeb0fa29679c..39e15b7bc7c70 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/SkuResourceInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/SkuResourceInner.java @@ -5,38 +5,43 @@ package com.azure.resourcemanager.machinelearning.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.models.SkuCapacity; import com.azure.resourcemanager.machinelearning.models.SkuSetting; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Fulfills ARM Contract requirement to list all available SKUS for a resource. */ +/** + * Fulfills ARM Contract requirement to list all available SKUS for a resource. + */ @Fluent -public final class SkuResourceInner { +public final class SkuResourceInner implements JsonSerializable { /* * Gets or sets the Sku Capacity. */ - @JsonProperty(value = "capacity") private SkuCapacity capacity; /* * The resource type name. */ - @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) private String resourceType; /* * Gets or sets the Sku. */ - @JsonProperty(value = "sku") private SkuSetting sku; - /** Creates an instance of SkuResourceInner class. */ + /** + * Creates an instance of SkuResourceInner class. + */ public SkuResourceInner() { } /** * Get the capacity property: Gets or sets the Sku Capacity. - * + * * @return the capacity value. */ public SkuCapacity capacity() { @@ -45,7 +50,7 @@ public SkuCapacity capacity() { /** * Set the capacity property: Gets or sets the Sku Capacity. - * + * * @param capacity the capacity value to set. * @return the SkuResourceInner object itself. */ @@ -56,7 +61,7 @@ public SkuResourceInner withCapacity(SkuCapacity capacity) { /** * Get the resourceType property: The resource type name. - * + * * @return the resourceType value. */ public String resourceType() { @@ -65,7 +70,7 @@ public String resourceType() { /** * Get the sku property: Gets or sets the Sku. - * + * * @return the sku value. */ public SkuSetting sku() { @@ -74,7 +79,7 @@ public SkuSetting sku() { /** * Set the sku property: Gets or sets the Sku. - * + * * @param sku the sku value to set. * @return the SkuResourceInner object itself. */ @@ -85,7 +90,7 @@ public SkuResourceInner withSku(SkuSetting sku) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -96,4 +101,45 @@ public void validate() { sku().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("capacity", this.capacity); + jsonWriter.writeJsonField("sku", this.sku); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SkuResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SkuResourceInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SkuResourceInner. + */ + public static SkuResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SkuResourceInner deserializedSkuResourceInner = new SkuResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("capacity".equals(fieldName)) { + deserializedSkuResourceInner.capacity = SkuCapacity.fromJson(reader); + } else if ("resourceType".equals(fieldName)) { + deserializedSkuResourceInner.resourceType = reader.getString(); + } else if ("sku".equals(fieldName)) { + deserializedSkuResourceInner.sku = SkuSetting.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSkuResourceInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/UpdateWorkspaceQuotasResultInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/UpdateWorkspaceQuotasResultInner.java index dbbad12998c90..b2771b0c32ca9 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/UpdateWorkspaceQuotasResultInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/UpdateWorkspaceQuotasResultInner.java @@ -5,33 +5,39 @@ package com.azure.resourcemanager.machinelearning.fluent.models; import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.models.UpdateWorkspaceQuotas; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** The result of update workspace quota. */ +/** + * The result of update workspace quota. + */ @Immutable -public final class UpdateWorkspaceQuotasResultInner { +public final class UpdateWorkspaceQuotasResultInner implements JsonSerializable { /* * The list of workspace quota update result. */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* - * The URI to fetch the next page of workspace quota update result. Call ListNext() with this to fetch the next - * page of Workspace Quota update result. + * The URI to fetch the next page of workspace quota update result. Call ListNext() with this to fetch the next page + * of Workspace Quota update result. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of UpdateWorkspaceQuotasResultInner class. */ + /** + * Creates an instance of UpdateWorkspaceQuotasResultInner class. + */ public UpdateWorkspaceQuotasResultInner() { } /** * Get the value property: The list of workspace quota update result. - * + * * @return the value value. */ public List value() { @@ -41,7 +47,7 @@ public List value() { /** * Get the nextLink property: The URI to fetch the next page of workspace quota update result. Call ListNext() with * this to fetch the next page of Workspace Quota update result. - * + * * @return the nextLink value. */ public String nextLink() { @@ -50,7 +56,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -58,4 +64,44 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateWorkspaceQuotasResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateWorkspaceQuotasResultInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the UpdateWorkspaceQuotasResultInner. + */ + public static UpdateWorkspaceQuotasResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateWorkspaceQuotasResultInner deserializedUpdateWorkspaceQuotasResultInner + = new UpdateWorkspaceQuotasResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> UpdateWorkspaceQuotas.fromJson(reader1)); + deserializedUpdateWorkspaceQuotasResultInner.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedUpdateWorkspaceQuotasResultInner.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUpdateWorkspaceQuotasResultInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/UsageInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/UsageInner.java index e4fe732059630..fe0db708401b5 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/UsageInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/UsageInner.java @@ -5,62 +5,63 @@ package com.azure.resourcemanager.machinelearning.fluent.models; import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.models.UsageName; import com.azure.resourcemanager.machinelearning.models.UsageUnit; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Describes AML Resource Usage. */ +/** + * Describes AML Resource Usage. + */ @Immutable -public final class UsageInner { +public final class UsageInner implements JsonSerializable { /* * Specifies the resource ID. */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; /* * Region of the AML workspace in the id. */ - @JsonProperty(value = "amlWorkspaceLocation", access = JsonProperty.Access.WRITE_ONLY) private String amlWorkspaceLocation; /* * Specifies the resource type. */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) private String type; /* * An enum describing the unit of usage measurement. */ - @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) private UsageUnit unit; /* * The current usage of the resource. */ - @JsonProperty(value = "currentValue", access = JsonProperty.Access.WRITE_ONLY) private Long currentValue; /* * The maximum permitted usage of the resource. */ - @JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY) private Long limit; /* * The name of the type of usage. */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private UsageName name; - /** Creates an instance of UsageInner class. */ + /** + * Creates an instance of UsageInner class. + */ public UsageInner() { } /** * Get the id property: Specifies the resource ID. - * + * * @return the id value. */ public String id() { @@ -69,7 +70,7 @@ public String id() { /** * Get the amlWorkspaceLocation property: Region of the AML workspace in the id. - * + * * @return the amlWorkspaceLocation value. */ public String amlWorkspaceLocation() { @@ -78,7 +79,7 @@ public String amlWorkspaceLocation() { /** * Get the type property: Specifies the resource type. - * + * * @return the type value. */ public String type() { @@ -87,7 +88,7 @@ public String type() { /** * Get the unit property: An enum describing the unit of usage measurement. - * + * * @return the unit value. */ public UsageUnit unit() { @@ -96,7 +97,7 @@ public UsageUnit unit() { /** * Get the currentValue property: The current usage of the resource. - * + * * @return the currentValue value. */ public Long currentValue() { @@ -105,7 +106,7 @@ public Long currentValue() { /** * Get the limit property: The maximum permitted usage of the resource. - * + * * @return the limit value. */ public Long limit() { @@ -114,7 +115,7 @@ public Long limit() { /** * Get the name property: The name of the type of usage. - * + * * @return the name value. */ public UsageName name() { @@ -123,7 +124,7 @@ public UsageName name() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -131,4 +132,51 @@ public void validate() { name().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UsageInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UsageInner if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the UsageInner. + */ + public static UsageInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UsageInner deserializedUsageInner = new UsageInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedUsageInner.id = reader.getString(); + } else if ("amlWorkspaceLocation".equals(fieldName)) { + deserializedUsageInner.amlWorkspaceLocation = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedUsageInner.type = reader.getString(); + } else if ("unit".equals(fieldName)) { + deserializedUsageInner.unit = UsageUnit.fromString(reader.getString()); + } else if ("currentValue".equals(fieldName)) { + deserializedUsageInner.currentValue = reader.getNullable(JsonReader::getLong); + } else if ("limit".equals(fieldName)) { + deserializedUsageInner.limit = reader.getNullable(JsonReader::getLong); + } else if ("name".equals(fieldName)) { + deserializedUsageInner.name = UsageName.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedUsageInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/VirtualMachineSizeListResultInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/VirtualMachineSizeListResultInner.java index 1b6d96583c16f..b6f1536ddcf8a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/VirtualMachineSizeListResultInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/VirtualMachineSizeListResultInner.java @@ -5,26 +5,33 @@ package com.azure.resourcemanager.machinelearning.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.models.VirtualMachineSize; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** The List Virtual Machine size operation response. */ +/** + * The List Virtual Machine size operation response. + */ @Fluent -public final class VirtualMachineSizeListResultInner { +public final class VirtualMachineSizeListResultInner implements JsonSerializable { /* * The list of virtual machine sizes supported by AmlCompute. */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of VirtualMachineSizeListResultInner class. */ + /** + * Creates an instance of VirtualMachineSizeListResultInner class. + */ public VirtualMachineSizeListResultInner() { } /** * Get the value property: The list of virtual machine sizes supported by AmlCompute. - * + * * @return the value value. */ public List value() { @@ -33,7 +40,7 @@ public List value() { /** * Set the value property: The list of virtual machine sizes supported by AmlCompute. - * + * * @param value the value value to set. * @return the VirtualMachineSizeListResultInner object itself. */ @@ -44,7 +51,7 @@ public VirtualMachineSizeListResultInner withValue(List valu /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -52,4 +59,42 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineSizeListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineSizeListResultInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualMachineSizeListResultInner. + */ + public static VirtualMachineSizeListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineSizeListResultInner deserializedVirtualMachineSizeListResultInner + = new VirtualMachineSizeListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> VirtualMachineSize.fromJson(reader1)); + deserializedVirtualMachineSizeListResultInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineSizeListResultInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/WorkspaceConnectionPropertiesV2BasicResourceInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/WorkspaceConnectionPropertiesV2BasicResourceInner.java index 640d838868b7c..372b93698a8cc 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/WorkspaceConnectionPropertiesV2BasicResourceInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/WorkspaceConnectionPropertiesV2BasicResourceInner.java @@ -8,31 +8,51 @@ import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.models.WorkspaceConnectionPropertiesV2; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** The WorkspaceConnectionPropertiesV2BasicResource model. */ +/** + * The WorkspaceConnectionPropertiesV2BasicResource model. + */ @Fluent public final class WorkspaceConnectionPropertiesV2BasicResourceInner extends ProxyResource { /* * The properties property. */ - @JsonProperty(value = "properties", required = true) private WorkspaceConnectionPropertiesV2 properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of WorkspaceConnectionPropertiesV2BasicResourceInner class. */ + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of WorkspaceConnectionPropertiesV2BasicResourceInner class. + */ public WorkspaceConnectionPropertiesV2BasicResourceInner() { } /** * Get the properties property: The properties property. - * + * * @return the properties value. */ public WorkspaceConnectionPropertiesV2 properties() { @@ -41,42 +61,118 @@ public WorkspaceConnectionPropertiesV2 properties() { /** * Set the properties property: The properties property. - * + * * @param properties the properties value to set. * @return the WorkspaceConnectionPropertiesV2BasicResourceInner object itself. */ - public WorkspaceConnectionPropertiesV2BasicResourceInner withProperties( - WorkspaceConnectionPropertiesV2 properties) { + public WorkspaceConnectionPropertiesV2BasicResourceInner + withProperties(WorkspaceConnectionPropertiesV2 properties) { this.properties = properties; return this; } /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (properties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property properties in model" - + " WorkspaceConnectionPropertiesV2BasicResourceInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property properties in model WorkspaceConnectionPropertiesV2BasicResourceInner")); } else { properties().validate(); } } - private static final ClientLogger LOGGER = - new ClientLogger(WorkspaceConnectionPropertiesV2BasicResourceInner.class); + private static final ClientLogger LOGGER + = new ClientLogger(WorkspaceConnectionPropertiesV2BasicResourceInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceConnectionPropertiesV2BasicResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceConnectionPropertiesV2BasicResourceInner if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the WorkspaceConnectionPropertiesV2BasicResourceInner. + */ + public static WorkspaceConnectionPropertiesV2BasicResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceConnectionPropertiesV2BasicResourceInner deserializedWorkspaceConnectionPropertiesV2BasicResourceInner + = new WorkspaceConnectionPropertiesV2BasicResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedWorkspaceConnectionPropertiesV2BasicResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedWorkspaceConnectionPropertiesV2BasicResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedWorkspaceConnectionPropertiesV2BasicResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedWorkspaceConnectionPropertiesV2BasicResourceInner.properties + = WorkspaceConnectionPropertiesV2.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedWorkspaceConnectionPropertiesV2BasicResourceInner.systemData + = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceConnectionPropertiesV2BasicResourceInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/WorkspaceInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/WorkspaceInner.java index 0574f791c1fea..b335ff448efc2 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/WorkspaceInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/WorkspaceInner.java @@ -7,65 +7,87 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.models.EncryptionProperty; +import com.azure.resourcemanager.machinelearning.models.FeatureStoreSettings; import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; import com.azure.resourcemanager.machinelearning.models.ProvisioningState; import com.azure.resourcemanager.machinelearning.models.PublicNetworkAccess; +import com.azure.resourcemanager.machinelearning.models.ServerlessComputeSettings; import com.azure.resourcemanager.machinelearning.models.ServiceManagedResourcesSettings; import com.azure.resourcemanager.machinelearning.models.SharedPrivateLinkResource; import com.azure.resourcemanager.machinelearning.models.Sku; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.resourcemanager.machinelearning.models.WorkspaceHubConfig; +import java.io.IOException; import java.util.List; import java.util.Map; -/** An object that represents a machine learning workspace. */ +/** + * An object that represents a machine learning workspace. + */ @Fluent public final class WorkspaceInner extends ProxyResource { /* * The properties of the machine learning workspace. */ - @JsonProperty(value = "properties") private WorkspacePropertiesInner innerProperties; /* * The identity of the resource. */ - @JsonProperty(value = "identity") private ManagedServiceIdentity identity; + /* + * The kind property. + */ + private String kind; + /* * Specifies the location of the resource. */ - @JsonProperty(value = "location") private String location; /* * Contains resource tags defined as key/value pairs. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* * The sku of the workspace. */ - @JsonProperty(value = "sku") private Sku sku; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of WorkspaceInner class. */ + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of WorkspaceInner class. + */ public WorkspaceInner() { } /** * Get the innerProperties property: The properties of the machine learning workspace. - * + * * @return the innerProperties value. */ private WorkspacePropertiesInner innerProperties() { @@ -74,7 +96,7 @@ private WorkspacePropertiesInner innerProperties() { /** * Get the identity property: The identity of the resource. - * + * * @return the identity value. */ public ManagedServiceIdentity identity() { @@ -83,7 +105,7 @@ public ManagedServiceIdentity identity() { /** * Set the identity property: The identity of the resource. - * + * * @param identity the identity value to set. * @return the WorkspaceInner object itself. */ @@ -92,9 +114,29 @@ public WorkspaceInner withIdentity(ManagedServiceIdentity identity) { return this; } + /** + * Get the kind property: The kind property. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Set the kind property: The kind property. + * + * @param kind the kind value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withKind(String kind) { + this.kind = kind; + return this; + } + /** * Get the location property: Specifies the location of the resource. - * + * * @return the location value. */ public String location() { @@ -103,7 +145,7 @@ public String location() { /** * Set the location property: Specifies the location of the resource. - * + * * @param location the location value to set. * @return the WorkspaceInner object itself. */ @@ -114,7 +156,7 @@ public WorkspaceInner withLocation(String location) { /** * Get the tags property: Contains resource tags defined as key/value pairs. - * + * * @return the tags value. */ public Map tags() { @@ -123,7 +165,7 @@ public Map tags() { /** * Set the tags property: Contains resource tags defined as key/value pairs. - * + * * @param tags the tags value to set. * @return the WorkspaceInner object itself. */ @@ -134,7 +176,7 @@ public WorkspaceInner withTags(Map tags) { /** * Get the sku property: The sku of the workspace. - * + * * @return the sku value. */ public Sku sku() { @@ -143,7 +185,7 @@ public Sku sku() { /** * Set the sku property: The sku of the workspace. - * + * * @param sku the sku value to set. * @return the WorkspaceInner object itself. */ @@ -154,16 +196,46 @@ public WorkspaceInner withSku(Sku sku) { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Get the workspaceId property: The immutable id associated with this workspace. - * + * * @return the workspaceId value. */ public String workspaceId() { @@ -172,7 +244,7 @@ public String workspaceId() { /** * Get the description property: The description of this workspace. - * + * * @return the description value. */ public String description() { @@ -181,7 +253,7 @@ public String description() { /** * Set the description property: The description of this workspace. - * + * * @param description the description value to set. * @return the WorkspaceInner object itself. */ @@ -195,7 +267,7 @@ public WorkspaceInner withDescription(String description) { /** * Get the friendlyName property: The friendly name for this workspace. This name in mutable. - * + * * @return the friendlyName value. */ public String friendlyName() { @@ -204,7 +276,7 @@ public String friendlyName() { /** * Set the friendlyName property: The friendly name for this workspace. This name in mutable. - * + * * @param friendlyName the friendlyName value to set. * @return the WorkspaceInner object itself. */ @@ -219,7 +291,7 @@ public WorkspaceInner withFriendlyName(String friendlyName) { /** * Get the keyVault property: ARM id of the key vault associated with this workspace. This cannot be changed once * the workspace has been created. - * + * * @return the keyVault value. */ public String keyVault() { @@ -229,7 +301,7 @@ public String keyVault() { /** * Set the keyVault property: ARM id of the key vault associated with this workspace. This cannot be changed once * the workspace has been created. - * + * * @param keyVault the keyVault value to set. * @return the WorkspaceInner object itself. */ @@ -243,7 +315,7 @@ public WorkspaceInner withKeyVault(String keyVault) { /** * Get the applicationInsights property: ARM id of the application insights associated with this workspace. - * + * * @return the applicationInsights value. */ public String applicationInsights() { @@ -252,7 +324,7 @@ public String applicationInsights() { /** * Set the applicationInsights property: ARM id of the application insights associated with this workspace. - * + * * @param applicationInsights the applicationInsights value to set. * @return the WorkspaceInner object itself. */ @@ -266,7 +338,7 @@ public WorkspaceInner withApplicationInsights(String applicationInsights) { /** * Get the containerRegistry property: ARM id of the container registry associated with this workspace. - * + * * @return the containerRegistry value. */ public String containerRegistry() { @@ -275,7 +347,7 @@ public String containerRegistry() { /** * Set the containerRegistry property: ARM id of the container registry associated with this workspace. - * + * * @param containerRegistry the containerRegistry value to set. * @return the WorkspaceInner object itself. */ @@ -290,7 +362,7 @@ public WorkspaceInner withContainerRegistry(String containerRegistry) { /** * Get the storageAccount property: ARM id of the storage account associated with this workspace. This cannot be * changed once the workspace has been created. - * + * * @return the storageAccount value. */ public String storageAccount() { @@ -300,7 +372,7 @@ public String storageAccount() { /** * Set the storageAccount property: ARM id of the storage account associated with this workspace. This cannot be * changed once the workspace has been created. - * + * * @param storageAccount the storageAccount value to set. * @return the WorkspaceInner object itself. */ @@ -315,7 +387,7 @@ public WorkspaceInner withStorageAccount(String storageAccount) { /** * Get the discoveryUrl property: Url for the discovery service to identify regional endpoints for machine learning * experimentation services. - * + * * @return the discoveryUrl value. */ public String discoveryUrl() { @@ -325,7 +397,7 @@ public String discoveryUrl() { /** * Set the discoveryUrl property: Url for the discovery service to identify regional endpoints for machine learning * experimentation services. - * + * * @param discoveryUrl the discoveryUrl value to set. * @return the WorkspaceInner object itself. */ @@ -340,7 +412,7 @@ public WorkspaceInner withDiscoveryUrl(String discoveryUrl) { /** * Get the provisioningState property: The current deployment state of workspace resource. The provisioningState is * to indicate states for resource provisioning. - * + * * @return the provisioningState value. */ public ProvisioningState provisioningState() { @@ -349,7 +421,7 @@ public ProvisioningState provisioningState() { /** * Get the encryption property: The encryption settings of Azure ML workspace. - * + * * @return the encryption value. */ public EncryptionProperty encryption() { @@ -358,7 +430,7 @@ public EncryptionProperty encryption() { /** * Set the encryption property: The encryption settings of Azure ML workspace. - * + * * @param encryption the encryption value to set. * @return the WorkspaceInner object itself. */ @@ -373,7 +445,7 @@ public WorkspaceInner withEncryption(EncryptionProperty encryption) { /** * Get the hbiWorkspace property: The flag to signal HBI data in the workspace and reduce diagnostic data collected * by the service. - * + * * @return the hbiWorkspace value. */ public Boolean hbiWorkspace() { @@ -383,7 +455,7 @@ public Boolean hbiWorkspace() { /** * Set the hbiWorkspace property: The flag to signal HBI data in the workspace and reduce diagnostic data collected * by the service. - * + * * @param hbiWorkspace the hbiWorkspace value to set. * @return the WorkspaceInner object itself. */ @@ -398,7 +470,7 @@ public WorkspaceInner withHbiWorkspace(Boolean hbiWorkspace) { /** * Get the serviceProvisionedResourceGroup property: The name of the managed resource group created by workspace RP * in customer subscription if the workspace is CMK workspace. - * + * * @return the serviceProvisionedResourceGroup value. */ public String serviceProvisionedResourceGroup() { @@ -407,7 +479,7 @@ public String serviceProvisionedResourceGroup() { /** * Get the privateLinkCount property: Count of private connections in the workspace. - * + * * @return the privateLinkCount value. */ public Integer privateLinkCount() { @@ -416,7 +488,7 @@ public Integer privateLinkCount() { /** * Get the imageBuildCompute property: The compute name for image build. - * + * * @return the imageBuildCompute value. */ public String imageBuildCompute() { @@ -425,7 +497,7 @@ public String imageBuildCompute() { /** * Set the imageBuildCompute property: The compute name for image build. - * + * * @param imageBuildCompute the imageBuildCompute value to set. * @return the WorkspaceInner object itself. */ @@ -440,7 +512,7 @@ public WorkspaceInner withImageBuildCompute(String imageBuildCompute) { /** * Get the allowPublicAccessWhenBehindVnet property: The flag to indicate whether to allow public access when behind * VNet. - * + * * @return the allowPublicAccessWhenBehindVnet value. */ public Boolean allowPublicAccessWhenBehindVnet() { @@ -450,7 +522,7 @@ public Boolean allowPublicAccessWhenBehindVnet() { /** * Set the allowPublicAccessWhenBehindVnet property: The flag to indicate whether to allow public access when behind * VNet. - * + * * @param allowPublicAccessWhenBehindVnet the allowPublicAccessWhenBehindVnet value to set. * @return the WorkspaceInner object itself. */ @@ -464,7 +536,7 @@ public WorkspaceInner withAllowPublicAccessWhenBehindVnet(Boolean allowPublicAcc /** * Get the publicNetworkAccess property: Whether requests from Public Network are allowed. - * + * * @return the publicNetworkAccess value. */ public PublicNetworkAccess publicNetworkAccess() { @@ -473,7 +545,7 @@ public PublicNetworkAccess publicNetworkAccess() { /** * Set the publicNetworkAccess property: Whether requests from Public Network are allowed. - * + * * @param publicNetworkAccess the publicNetworkAccess value to set. * @return the WorkspaceInner object itself. */ @@ -487,16 +559,39 @@ public WorkspaceInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkA /** * Get the privateEndpointConnections property: The list of private endpoint connections in the workspace. - * + * * @return the privateEndpointConnections value. */ public List privateEndpointConnections() { return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); } + /** + * Get the serverlessComputeSettings property: Settings for serverless compute created in the workspace. + * + * @return the serverlessComputeSettings value. + */ + public ServerlessComputeSettings serverlessComputeSettings() { + return this.innerProperties() == null ? null : this.innerProperties().serverlessComputeSettings(); + } + + /** + * Set the serverlessComputeSettings property: Settings for serverless compute created in the workspace. + * + * @param serverlessComputeSettings the serverlessComputeSettings value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withServerlessComputeSettings(ServerlessComputeSettings serverlessComputeSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesInner(); + } + this.innerProperties().withServerlessComputeSettings(serverlessComputeSettings); + return this; + } + /** * Get the sharedPrivateLinkResources property: The list of shared private link resources in this workspace. - * + * * @return the sharedPrivateLinkResources value. */ public List sharedPrivateLinkResources() { @@ -505,7 +600,7 @@ public List sharedPrivateLinkResources() { /** * Set the sharedPrivateLinkResources property: The list of shared private link resources in this workspace. - * + * * @param sharedPrivateLinkResources the sharedPrivateLinkResources value to set. * @return the WorkspaceInner object itself. */ @@ -519,7 +614,7 @@ public WorkspaceInner withSharedPrivateLinkResources(List associatedWorkspaces() { + return this.innerProperties() == null ? null : this.innerProperties().associatedWorkspaces(); + } + + /** + * Set the associatedWorkspaces property: The associatedWorkspaces property. + * + * @param associatedWorkspaces the associatedWorkspaces value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withAssociatedWorkspaces(List associatedWorkspaces) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesInner(); + } + this.innerProperties().withAssociatedWorkspaces(associatedWorkspaces); + return this; + } + + /** + * Get the enableDataIsolation property: The enableDataIsolation property. + * + * @return the enableDataIsolation value. + */ + public Boolean enableDataIsolation() { + return this.innerProperties() == null ? null : this.innerProperties().enableDataIsolation(); + } + + /** + * Set the enableDataIsolation property: The enableDataIsolation property. + * + * @param enableDataIsolation the enableDataIsolation value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withEnableDataIsolation(Boolean enableDataIsolation) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesInner(); + } + this.innerProperties().withEnableDataIsolation(enableDataIsolation); + return this; + } + + /** + * Get the hubResourceId property: The hubResourceId property. + * + * @return the hubResourceId value. + */ + public String hubResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().hubResourceId(); + } + + /** + * Set the hubResourceId property: The hubResourceId property. + * + * @param hubResourceId the hubResourceId value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withHubResourceId(String hubResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesInner(); + } + this.innerProperties().withHubResourceId(hubResourceId); + return this; + } + + /** + * Get the workspaceHubConfig property: WorkspaceHub's configuration object. + * + * @return the workspaceHubConfig value. + */ + public WorkspaceHubConfig workspaceHubConfig() { + return this.innerProperties() == null ? null : this.innerProperties().workspaceHubConfig(); + } + + /** + * Set the workspaceHubConfig property: WorkspaceHub's configuration object. + * + * @param workspaceHubConfig the workspaceHubConfig value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withWorkspaceHubConfig(WorkspaceHubConfig workspaceHubConfig) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesInner(); + } + this.innerProperties().withWorkspaceHubConfig(workspaceHubConfig); + return this; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -645,4 +878,65 @@ public void validate() { sku().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("sku", this.sku); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the WorkspaceInner. + */ + public static WorkspaceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceInner deserializedWorkspaceInner = new WorkspaceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedWorkspaceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedWorkspaceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedWorkspaceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedWorkspaceInner.innerProperties = WorkspacePropertiesInner.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedWorkspaceInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedWorkspaceInner.kind = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedWorkspaceInner.location = reader.getString(); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedWorkspaceInner.tags = tags; + } else if ("sku".equals(fieldName)) { + deserializedWorkspaceInner.sku = Sku.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedWorkspaceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceInner; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/WorkspacePropertiesInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/WorkspacePropertiesInner.java index 147434b8ed519..76f9377dcb92d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/WorkspacePropertiesInner.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/WorkspacePropertiesInner.java @@ -5,178 +5,199 @@ package com.azure.resourcemanager.machinelearning.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.models.EncryptionProperty; +import com.azure.resourcemanager.machinelearning.models.FeatureStoreSettings; import com.azure.resourcemanager.machinelearning.models.ProvisioningState; import com.azure.resourcemanager.machinelearning.models.PublicNetworkAccess; +import com.azure.resourcemanager.machinelearning.models.ServerlessComputeSettings; import com.azure.resourcemanager.machinelearning.models.ServiceManagedResourcesSettings; import com.azure.resourcemanager.machinelearning.models.SharedPrivateLinkResource; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.resourcemanager.machinelearning.models.WorkspaceHubConfig; +import java.io.IOException; import java.util.List; -/** The properties of a machine learning workspace. */ +/** + * The properties of a machine learning workspace. + */ @Fluent -public final class WorkspacePropertiesInner { +public final class WorkspacePropertiesInner implements JsonSerializable { /* * The immutable id associated with this workspace. */ - @JsonProperty(value = "workspaceId", access = JsonProperty.Access.WRITE_ONLY) private String workspaceId; /* * The description of this workspace. */ - @JsonProperty(value = "description") private String description; /* * The friendly name for this workspace. This name in mutable */ - @JsonProperty(value = "friendlyName") private String friendlyName; /* * ARM id of the key vault associated with this workspace. This cannot be changed once the workspace has been * created */ - @JsonProperty(value = "keyVault") private String keyVault; /* * ARM id of the application insights associated with this workspace. */ - @JsonProperty(value = "applicationInsights") private String applicationInsights; /* * ARM id of the container registry associated with this workspace. */ - @JsonProperty(value = "containerRegistry") private String containerRegistry; /* * ARM id of the storage account associated with this workspace. This cannot be changed once the workspace has been * created */ - @JsonProperty(value = "storageAccount") private String storageAccount; /* * Url for the discovery service to identify regional endpoints for machine learning experimentation services */ - @JsonProperty(value = "discoveryUrl") private String discoveryUrl; /* * The current deployment state of workspace resource. The provisioningState is to indicate states for resource * provisioning. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; /* * The encryption settings of Azure ML workspace. */ - @JsonProperty(value = "encryption") private EncryptionProperty encryption; /* * The flag to signal HBI data in the workspace and reduce diagnostic data collected by the service */ - @JsonProperty(value = "hbiWorkspace") private Boolean hbiWorkspace; /* * The name of the managed resource group created by workspace RP in customer subscription if the workspace is CMK * workspace */ - @JsonProperty(value = "serviceProvisionedResourceGroup", access = JsonProperty.Access.WRITE_ONLY) private String serviceProvisionedResourceGroup; /* * Count of private connections in the workspace */ - @JsonProperty(value = "privateLinkCount", access = JsonProperty.Access.WRITE_ONLY) private Integer privateLinkCount; /* * The compute name for image build */ - @JsonProperty(value = "imageBuildCompute") private String imageBuildCompute; /* * The flag to indicate whether to allow public access when behind VNet. */ - @JsonProperty(value = "allowPublicAccessWhenBehindVnet") private Boolean allowPublicAccessWhenBehindVnet; /* * Whether requests from Public Network are allowed. */ - @JsonProperty(value = "publicNetworkAccess") private PublicNetworkAccess publicNetworkAccess; /* * The list of private endpoint connections in the workspace. */ - @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) private List privateEndpointConnections; + /* + * Settings for serverless compute created in the workspace + */ + private ServerlessComputeSettings serverlessComputeSettings; + /* * The list of shared private link resources in this workspace. */ - @JsonProperty(value = "sharedPrivateLinkResources") private List sharedPrivateLinkResources; /* * The notebook info of Azure ML workspace. */ - @JsonProperty(value = "notebookInfo", access = JsonProperty.Access.WRITE_ONLY) private NotebookResourceInfoInner notebookInfo; /* * The service managed resource settings. */ - @JsonProperty(value = "serviceManagedResourcesSettings") private ServiceManagedResourcesSettings serviceManagedResourcesSettings; /* * The user assigned identity resource id that represents the workspace identity. */ - @JsonProperty(value = "primaryUserAssignedIdentity") private String primaryUserAssignedIdentity; /* * The tenant id associated with this workspace. */ - @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) private String tenantId; /* * If the storage associated with the workspace has hierarchical namespace(HNS) enabled. */ - @JsonProperty(value = "storageHnsEnabled", access = JsonProperty.Access.WRITE_ONLY) private Boolean storageHnsEnabled; /* * The URI associated with this workspace that machine learning flow must point at to set up tracking. */ - @JsonProperty(value = "mlFlowTrackingUri", access = JsonProperty.Access.WRITE_ONLY) private String mlFlowTrackingUri; /* * Enabling v1_legacy_mode may prevent you from using features provided by the v2 API. */ - @JsonProperty(value = "v1LegacyMode") private Boolean v1LegacyMode; - /** Creates an instance of WorkspacePropertiesInner class. */ + /* + * Managed Network settings for a machine learning workspace. + */ + private ManagedNetworkSettingsInner managedNetwork; + + /* + * Settings for feature store type workspace. + */ + private FeatureStoreSettings featureStoreSettings; + + /* + * The associatedWorkspaces property. + */ + private List associatedWorkspaces; + + /* + * The enableDataIsolation property. + */ + private Boolean enableDataIsolation; + + /* + * The hubResourceId property. + */ + private String hubResourceId; + + /* + * WorkspaceHub's configuration object. + */ + private WorkspaceHubConfig workspaceHubConfig; + + /** + * Creates an instance of WorkspacePropertiesInner class. + */ public WorkspacePropertiesInner() { } /** * Get the workspaceId property: The immutable id associated with this workspace. - * + * * @return the workspaceId value. */ public String workspaceId() { @@ -185,7 +206,7 @@ public String workspaceId() { /** * Get the description property: The description of this workspace. - * + * * @return the description value. */ public String description() { @@ -194,7 +215,7 @@ public String description() { /** * Set the description property: The description of this workspace. - * + * * @param description the description value to set. * @return the WorkspacePropertiesInner object itself. */ @@ -205,7 +226,7 @@ public WorkspacePropertiesInner withDescription(String description) { /** * Get the friendlyName property: The friendly name for this workspace. This name in mutable. - * + * * @return the friendlyName value. */ public String friendlyName() { @@ -214,7 +235,7 @@ public String friendlyName() { /** * Set the friendlyName property: The friendly name for this workspace. This name in mutable. - * + * * @param friendlyName the friendlyName value to set. * @return the WorkspacePropertiesInner object itself. */ @@ -226,7 +247,7 @@ public WorkspacePropertiesInner withFriendlyName(String friendlyName) { /** * Get the keyVault property: ARM id of the key vault associated with this workspace. This cannot be changed once * the workspace has been created. - * + * * @return the keyVault value. */ public String keyVault() { @@ -236,7 +257,7 @@ public String keyVault() { /** * Set the keyVault property: ARM id of the key vault associated with this workspace. This cannot be changed once * the workspace has been created. - * + * * @param keyVault the keyVault value to set. * @return the WorkspacePropertiesInner object itself. */ @@ -247,7 +268,7 @@ public WorkspacePropertiesInner withKeyVault(String keyVault) { /** * Get the applicationInsights property: ARM id of the application insights associated with this workspace. - * + * * @return the applicationInsights value. */ public String applicationInsights() { @@ -256,7 +277,7 @@ public String applicationInsights() { /** * Set the applicationInsights property: ARM id of the application insights associated with this workspace. - * + * * @param applicationInsights the applicationInsights value to set. * @return the WorkspacePropertiesInner object itself. */ @@ -267,7 +288,7 @@ public WorkspacePropertiesInner withApplicationInsights(String applicationInsigh /** * Get the containerRegistry property: ARM id of the container registry associated with this workspace. - * + * * @return the containerRegistry value. */ public String containerRegistry() { @@ -276,7 +297,7 @@ public String containerRegistry() { /** * Set the containerRegistry property: ARM id of the container registry associated with this workspace. - * + * * @param containerRegistry the containerRegistry value to set. * @return the WorkspacePropertiesInner object itself. */ @@ -288,7 +309,7 @@ public WorkspacePropertiesInner withContainerRegistry(String containerRegistry) /** * Get the storageAccount property: ARM id of the storage account associated with this workspace. This cannot be * changed once the workspace has been created. - * + * * @return the storageAccount value. */ public String storageAccount() { @@ -298,7 +319,7 @@ public String storageAccount() { /** * Set the storageAccount property: ARM id of the storage account associated with this workspace. This cannot be * changed once the workspace has been created. - * + * * @param storageAccount the storageAccount value to set. * @return the WorkspacePropertiesInner object itself. */ @@ -310,7 +331,7 @@ public WorkspacePropertiesInner withStorageAccount(String storageAccount) { /** * Get the discoveryUrl property: Url for the discovery service to identify regional endpoints for machine learning * experimentation services. - * + * * @return the discoveryUrl value. */ public String discoveryUrl() { @@ -320,7 +341,7 @@ public String discoveryUrl() { /** * Set the discoveryUrl property: Url for the discovery service to identify regional endpoints for machine learning * experimentation services. - * + * * @param discoveryUrl the discoveryUrl value to set. * @return the WorkspacePropertiesInner object itself. */ @@ -332,7 +353,7 @@ public WorkspacePropertiesInner withDiscoveryUrl(String discoveryUrl) { /** * Get the provisioningState property: The current deployment state of workspace resource. The provisioningState is * to indicate states for resource provisioning. - * + * * @return the provisioningState value. */ public ProvisioningState provisioningState() { @@ -341,7 +362,7 @@ public ProvisioningState provisioningState() { /** * Get the encryption property: The encryption settings of Azure ML workspace. - * + * * @return the encryption value. */ public EncryptionProperty encryption() { @@ -350,7 +371,7 @@ public EncryptionProperty encryption() { /** * Set the encryption property: The encryption settings of Azure ML workspace. - * + * * @param encryption the encryption value to set. * @return the WorkspacePropertiesInner object itself. */ @@ -362,7 +383,7 @@ public WorkspacePropertiesInner withEncryption(EncryptionProperty encryption) { /** * Get the hbiWorkspace property: The flag to signal HBI data in the workspace and reduce diagnostic data collected * by the service. - * + * * @return the hbiWorkspace value. */ public Boolean hbiWorkspace() { @@ -372,7 +393,7 @@ public Boolean hbiWorkspace() { /** * Set the hbiWorkspace property: The flag to signal HBI data in the workspace and reduce diagnostic data collected * by the service. - * + * * @param hbiWorkspace the hbiWorkspace value to set. * @return the WorkspacePropertiesInner object itself. */ @@ -384,7 +405,7 @@ public WorkspacePropertiesInner withHbiWorkspace(Boolean hbiWorkspace) { /** * Get the serviceProvisionedResourceGroup property: The name of the managed resource group created by workspace RP * in customer subscription if the workspace is CMK workspace. - * + * * @return the serviceProvisionedResourceGroup value. */ public String serviceProvisionedResourceGroup() { @@ -393,7 +414,7 @@ public String serviceProvisionedResourceGroup() { /** * Get the privateLinkCount property: Count of private connections in the workspace. - * + * * @return the privateLinkCount value. */ public Integer privateLinkCount() { @@ -402,7 +423,7 @@ public Integer privateLinkCount() { /** * Get the imageBuildCompute property: The compute name for image build. - * + * * @return the imageBuildCompute value. */ public String imageBuildCompute() { @@ -411,7 +432,7 @@ public String imageBuildCompute() { /** * Set the imageBuildCompute property: The compute name for image build. - * + * * @param imageBuildCompute the imageBuildCompute value to set. * @return the WorkspacePropertiesInner object itself. */ @@ -423,7 +444,7 @@ public WorkspacePropertiesInner withImageBuildCompute(String imageBuildCompute) /** * Get the allowPublicAccessWhenBehindVnet property: The flag to indicate whether to allow public access when behind * VNet. - * + * * @return the allowPublicAccessWhenBehindVnet value. */ public Boolean allowPublicAccessWhenBehindVnet() { @@ -433,7 +454,7 @@ public Boolean allowPublicAccessWhenBehindVnet() { /** * Set the allowPublicAccessWhenBehindVnet property: The flag to indicate whether to allow public access when behind * VNet. - * + * * @param allowPublicAccessWhenBehindVnet the allowPublicAccessWhenBehindVnet value to set. * @return the WorkspacePropertiesInner object itself. */ @@ -444,7 +465,7 @@ public WorkspacePropertiesInner withAllowPublicAccessWhenBehindVnet(Boolean allo /** * Get the publicNetworkAccess property: Whether requests from Public Network are allowed. - * + * * @return the publicNetworkAccess value. */ public PublicNetworkAccess publicNetworkAccess() { @@ -453,7 +474,7 @@ public PublicNetworkAccess publicNetworkAccess() { /** * Set the publicNetworkAccess property: Whether requests from Public Network are allowed. - * + * * @param publicNetworkAccess the publicNetworkAccess value to set. * @return the WorkspacePropertiesInner object itself. */ @@ -464,16 +485,36 @@ public WorkspacePropertiesInner withPublicNetworkAccess(PublicNetworkAccess publ /** * Get the privateEndpointConnections property: The list of private endpoint connections in the workspace. - * + * * @return the privateEndpointConnections value. */ public List privateEndpointConnections() { return this.privateEndpointConnections; } + /** + * Get the serverlessComputeSettings property: Settings for serverless compute created in the workspace. + * + * @return the serverlessComputeSettings value. + */ + public ServerlessComputeSettings serverlessComputeSettings() { + return this.serverlessComputeSettings; + } + + /** + * Set the serverlessComputeSettings property: Settings for serverless compute created in the workspace. + * + * @param serverlessComputeSettings the serverlessComputeSettings value to set. + * @return the WorkspacePropertiesInner object itself. + */ + public WorkspacePropertiesInner withServerlessComputeSettings(ServerlessComputeSettings serverlessComputeSettings) { + this.serverlessComputeSettings = serverlessComputeSettings; + return this; + } + /** * Get the sharedPrivateLinkResources property: The list of shared private link resources in this workspace. - * + * * @return the sharedPrivateLinkResources value. */ public List sharedPrivateLinkResources() { @@ -482,19 +523,19 @@ public List sharedPrivateLinkResources() { /** * Set the sharedPrivateLinkResources property: The list of shared private link resources in this workspace. - * + * * @param sharedPrivateLinkResources the sharedPrivateLinkResources value to set. * @return the WorkspacePropertiesInner object itself. */ - public WorkspacePropertiesInner withSharedPrivateLinkResources( - List sharedPrivateLinkResources) { + public WorkspacePropertiesInner + withSharedPrivateLinkResources(List sharedPrivateLinkResources) { this.sharedPrivateLinkResources = sharedPrivateLinkResources; return this; } /** * Get the notebookInfo property: The notebook info of Azure ML workspace. - * + * * @return the notebookInfo value. */ public NotebookResourceInfoInner notebookInfo() { @@ -503,7 +544,7 @@ public NotebookResourceInfoInner notebookInfo() { /** * Get the serviceManagedResourcesSettings property: The service managed resource settings. - * + * * @return the serviceManagedResourcesSettings value. */ public ServiceManagedResourcesSettings serviceManagedResourcesSettings() { @@ -512,12 +553,12 @@ public ServiceManagedResourcesSettings serviceManagedResourcesSettings() { /** * Set the serviceManagedResourcesSettings property: The service managed resource settings. - * + * * @param serviceManagedResourcesSettings the serviceManagedResourcesSettings value to set. * @return the WorkspacePropertiesInner object itself. */ - public WorkspacePropertiesInner withServiceManagedResourcesSettings( - ServiceManagedResourcesSettings serviceManagedResourcesSettings) { + public WorkspacePropertiesInner + withServiceManagedResourcesSettings(ServiceManagedResourcesSettings serviceManagedResourcesSettings) { this.serviceManagedResourcesSettings = serviceManagedResourcesSettings; return this; } @@ -525,7 +566,7 @@ public WorkspacePropertiesInner withServiceManagedResourcesSettings( /** * Get the primaryUserAssignedIdentity property: The user assigned identity resource id that represents the * workspace identity. - * + * * @return the primaryUserAssignedIdentity value. */ public String primaryUserAssignedIdentity() { @@ -535,7 +576,7 @@ public String primaryUserAssignedIdentity() { /** * Set the primaryUserAssignedIdentity property: The user assigned identity resource id that represents the * workspace identity. - * + * * @param primaryUserAssignedIdentity the primaryUserAssignedIdentity value to set. * @return the WorkspacePropertiesInner object itself. */ @@ -546,7 +587,7 @@ public WorkspacePropertiesInner withPrimaryUserAssignedIdentity(String primaryUs /** * Get the tenantId property: The tenant id associated with this workspace. - * + * * @return the tenantId value. */ public String tenantId() { @@ -556,7 +597,7 @@ public String tenantId() { /** * Get the storageHnsEnabled property: If the storage associated with the workspace has hierarchical namespace(HNS) * enabled. - * + * * @return the storageHnsEnabled value. */ public Boolean storageHnsEnabled() { @@ -566,7 +607,7 @@ public Boolean storageHnsEnabled() { /** * Get the mlFlowTrackingUri property: The URI associated with this workspace that machine learning flow must point * at to set up tracking. - * + * * @return the mlFlowTrackingUri value. */ public String mlFlowTrackingUri() { @@ -576,7 +617,7 @@ public String mlFlowTrackingUri() { /** * Get the v1LegacyMode property: Enabling v1_legacy_mode may prevent you from using features provided by the v2 * API. - * + * * @return the v1LegacyMode value. */ public Boolean v1LegacyMode() { @@ -586,7 +627,7 @@ public Boolean v1LegacyMode() { /** * Set the v1LegacyMode property: Enabling v1_legacy_mode may prevent you from using features provided by the v2 * API. - * + * * @param v1LegacyMode the v1LegacyMode value to set. * @return the WorkspacePropertiesInner object itself. */ @@ -595,9 +636,129 @@ public WorkspacePropertiesInner withV1LegacyMode(Boolean v1LegacyMode) { return this; } + /** + * Get the managedNetwork property: Managed Network settings for a machine learning workspace. + * + * @return the managedNetwork value. + */ + public ManagedNetworkSettingsInner managedNetwork() { + return this.managedNetwork; + } + + /** + * Set the managedNetwork property: Managed Network settings for a machine learning workspace. + * + * @param managedNetwork the managedNetwork value to set. + * @return the WorkspacePropertiesInner object itself. + */ + public WorkspacePropertiesInner withManagedNetwork(ManagedNetworkSettingsInner managedNetwork) { + this.managedNetwork = managedNetwork; + return this; + } + + /** + * Get the featureStoreSettings property: Settings for feature store type workspace. + * + * @return the featureStoreSettings value. + */ + public FeatureStoreSettings featureStoreSettings() { + return this.featureStoreSettings; + } + + /** + * Set the featureStoreSettings property: Settings for feature store type workspace. + * + * @param featureStoreSettings the featureStoreSettings value to set. + * @return the WorkspacePropertiesInner object itself. + */ + public WorkspacePropertiesInner withFeatureStoreSettings(FeatureStoreSettings featureStoreSettings) { + this.featureStoreSettings = featureStoreSettings; + return this; + } + + /** + * Get the associatedWorkspaces property: The associatedWorkspaces property. + * + * @return the associatedWorkspaces value. + */ + public List associatedWorkspaces() { + return this.associatedWorkspaces; + } + + /** + * Set the associatedWorkspaces property: The associatedWorkspaces property. + * + * @param associatedWorkspaces the associatedWorkspaces value to set. + * @return the WorkspacePropertiesInner object itself. + */ + public WorkspacePropertiesInner withAssociatedWorkspaces(List associatedWorkspaces) { + this.associatedWorkspaces = associatedWorkspaces; + return this; + } + + /** + * Get the enableDataIsolation property: The enableDataIsolation property. + * + * @return the enableDataIsolation value. + */ + public Boolean enableDataIsolation() { + return this.enableDataIsolation; + } + + /** + * Set the enableDataIsolation property: The enableDataIsolation property. + * + * @param enableDataIsolation the enableDataIsolation value to set. + * @return the WorkspacePropertiesInner object itself. + */ + public WorkspacePropertiesInner withEnableDataIsolation(Boolean enableDataIsolation) { + this.enableDataIsolation = enableDataIsolation; + return this; + } + + /** + * Get the hubResourceId property: The hubResourceId property. + * + * @return the hubResourceId value. + */ + public String hubResourceId() { + return this.hubResourceId; + } + + /** + * Set the hubResourceId property: The hubResourceId property. + * + * @param hubResourceId the hubResourceId value to set. + * @return the WorkspacePropertiesInner object itself. + */ + public WorkspacePropertiesInner withHubResourceId(String hubResourceId) { + this.hubResourceId = hubResourceId; + return this; + } + + /** + * Get the workspaceHubConfig property: WorkspaceHub's configuration object. + * + * @return the workspaceHubConfig value. + */ + public WorkspaceHubConfig workspaceHubConfig() { + return this.workspaceHubConfig; + } + + /** + * Set the workspaceHubConfig property: WorkspaceHub's configuration object. + * + * @param workspaceHubConfig the workspaceHubConfig value to set. + * @return the WorkspacePropertiesInner object itself. + */ + public WorkspacePropertiesInner withWorkspaceHubConfig(WorkspaceHubConfig workspaceHubConfig) { + this.workspaceHubConfig = workspaceHubConfig; + return this; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -607,6 +768,9 @@ public void validate() { if (privateEndpointConnections() != null) { privateEndpointConnections().forEach(e -> e.validate()); } + if (serverlessComputeSettings() != null) { + serverlessComputeSettings().validate(); + } if (sharedPrivateLinkResources() != null) { sharedPrivateLinkResources().forEach(e -> e.validate()); } @@ -616,5 +780,148 @@ public void validate() { if (serviceManagedResourcesSettings() != null) { serviceManagedResourcesSettings().validate(); } + if (managedNetwork() != null) { + managedNetwork().validate(); + } + if (featureStoreSettings() != null) { + featureStoreSettings().validate(); + } + if (workspaceHubConfig() != null) { + workspaceHubConfig().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("friendlyName", this.friendlyName); + jsonWriter.writeStringField("keyVault", this.keyVault); + jsonWriter.writeStringField("applicationInsights", this.applicationInsights); + jsonWriter.writeStringField("containerRegistry", this.containerRegistry); + jsonWriter.writeStringField("storageAccount", this.storageAccount); + jsonWriter.writeStringField("discoveryUrl", this.discoveryUrl); + jsonWriter.writeJsonField("encryption", this.encryption); + jsonWriter.writeBooleanField("hbiWorkspace", this.hbiWorkspace); + jsonWriter.writeStringField("imageBuildCompute", this.imageBuildCompute); + jsonWriter.writeBooleanField("allowPublicAccessWhenBehindVnet", this.allowPublicAccessWhenBehindVnet); + jsonWriter.writeStringField("publicNetworkAccess", + this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); + jsonWriter.writeJsonField("serverlessComputeSettings", this.serverlessComputeSettings); + jsonWriter.writeArrayField("sharedPrivateLinkResources", this.sharedPrivateLinkResources, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("serviceManagedResourcesSettings", this.serviceManagedResourcesSettings); + jsonWriter.writeStringField("primaryUserAssignedIdentity", this.primaryUserAssignedIdentity); + jsonWriter.writeBooleanField("v1LegacyMode", this.v1LegacyMode); + jsonWriter.writeJsonField("managedNetwork", this.managedNetwork); + jsonWriter.writeJsonField("featureStoreSettings", this.featureStoreSettings); + jsonWriter.writeArrayField("associatedWorkspaces", this.associatedWorkspaces, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("enableDataIsolation", this.enableDataIsolation); + jsonWriter.writeStringField("hubResourceId", this.hubResourceId); + jsonWriter.writeJsonField("workspaceHubConfig", this.workspaceHubConfig); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspacePropertiesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspacePropertiesInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the WorkspacePropertiesInner. + */ + public static WorkspacePropertiesInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspacePropertiesInner deserializedWorkspacePropertiesInner = new WorkspacePropertiesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("workspaceId".equals(fieldName)) { + deserializedWorkspacePropertiesInner.workspaceId = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedWorkspacePropertiesInner.description = reader.getString(); + } else if ("friendlyName".equals(fieldName)) { + deserializedWorkspacePropertiesInner.friendlyName = reader.getString(); + } else if ("keyVault".equals(fieldName)) { + deserializedWorkspacePropertiesInner.keyVault = reader.getString(); + } else if ("applicationInsights".equals(fieldName)) { + deserializedWorkspacePropertiesInner.applicationInsights = reader.getString(); + } else if ("containerRegistry".equals(fieldName)) { + deserializedWorkspacePropertiesInner.containerRegistry = reader.getString(); + } else if ("storageAccount".equals(fieldName)) { + deserializedWorkspacePropertiesInner.storageAccount = reader.getString(); + } else if ("discoveryUrl".equals(fieldName)) { + deserializedWorkspacePropertiesInner.discoveryUrl = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedWorkspacePropertiesInner.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("encryption".equals(fieldName)) { + deserializedWorkspacePropertiesInner.encryption = EncryptionProperty.fromJson(reader); + } else if ("hbiWorkspace".equals(fieldName)) { + deserializedWorkspacePropertiesInner.hbiWorkspace = reader.getNullable(JsonReader::getBoolean); + } else if ("serviceProvisionedResourceGroup".equals(fieldName)) { + deserializedWorkspacePropertiesInner.serviceProvisionedResourceGroup = reader.getString(); + } else if ("privateLinkCount".equals(fieldName)) { + deserializedWorkspacePropertiesInner.privateLinkCount = reader.getNullable(JsonReader::getInt); + } else if ("imageBuildCompute".equals(fieldName)) { + deserializedWorkspacePropertiesInner.imageBuildCompute = reader.getString(); + } else if ("allowPublicAccessWhenBehindVnet".equals(fieldName)) { + deserializedWorkspacePropertiesInner.allowPublicAccessWhenBehindVnet + = reader.getNullable(JsonReader::getBoolean); + } else if ("publicNetworkAccess".equals(fieldName)) { + deserializedWorkspacePropertiesInner.publicNetworkAccess + = PublicNetworkAccess.fromString(reader.getString()); + } else if ("privateEndpointConnections".equals(fieldName)) { + List privateEndpointConnections + = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); + deserializedWorkspacePropertiesInner.privateEndpointConnections = privateEndpointConnections; + } else if ("serverlessComputeSettings".equals(fieldName)) { + deserializedWorkspacePropertiesInner.serverlessComputeSettings + = ServerlessComputeSettings.fromJson(reader); + } else if ("sharedPrivateLinkResources".equals(fieldName)) { + List sharedPrivateLinkResources + = reader.readArray(reader1 -> SharedPrivateLinkResource.fromJson(reader1)); + deserializedWorkspacePropertiesInner.sharedPrivateLinkResources = sharedPrivateLinkResources; + } else if ("notebookInfo".equals(fieldName)) { + deserializedWorkspacePropertiesInner.notebookInfo = NotebookResourceInfoInner.fromJson(reader); + } else if ("serviceManagedResourcesSettings".equals(fieldName)) { + deserializedWorkspacePropertiesInner.serviceManagedResourcesSettings + = ServiceManagedResourcesSettings.fromJson(reader); + } else if ("primaryUserAssignedIdentity".equals(fieldName)) { + deserializedWorkspacePropertiesInner.primaryUserAssignedIdentity = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedWorkspacePropertiesInner.tenantId = reader.getString(); + } else if ("storageHnsEnabled".equals(fieldName)) { + deserializedWorkspacePropertiesInner.storageHnsEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("mlFlowTrackingUri".equals(fieldName)) { + deserializedWorkspacePropertiesInner.mlFlowTrackingUri = reader.getString(); + } else if ("v1LegacyMode".equals(fieldName)) { + deserializedWorkspacePropertiesInner.v1LegacyMode = reader.getNullable(JsonReader::getBoolean); + } else if ("managedNetwork".equals(fieldName)) { + deserializedWorkspacePropertiesInner.managedNetwork = ManagedNetworkSettingsInner.fromJson(reader); + } else if ("featureStoreSettings".equals(fieldName)) { + deserializedWorkspacePropertiesInner.featureStoreSettings = FeatureStoreSettings.fromJson(reader); + } else if ("associatedWorkspaces".equals(fieldName)) { + List associatedWorkspaces = reader.readArray(reader1 -> reader1.getString()); + deserializedWorkspacePropertiesInner.associatedWorkspaces = associatedWorkspaces; + } else if ("enableDataIsolation".equals(fieldName)) { + deserializedWorkspacePropertiesInner.enableDataIsolation + = reader.getNullable(JsonReader::getBoolean); + } else if ("hubResourceId".equals(fieldName)) { + deserializedWorkspacePropertiesInner.hubResourceId = reader.getString(); + } else if ("workspaceHubConfig".equals(fieldName)) { + deserializedWorkspacePropertiesInner.workspaceHubConfig = WorkspaceHubConfig.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspacePropertiesInner; + }); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/WorkspacePropertiesUpdateParameters.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/WorkspacePropertiesUpdateParameters.java deleted file mode 100644 index ecf35a74ba330..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/WorkspacePropertiesUpdateParameters.java +++ /dev/null @@ -1,240 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.machinelearning.models.PublicNetworkAccess; -import com.azure.resourcemanager.machinelearning.models.ServiceManagedResourcesSettings; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The parameters for updating the properties of a machine learning workspace. */ -@Fluent -public final class WorkspacePropertiesUpdateParameters { - /* - * The description of this workspace. - */ - @JsonProperty(value = "description") - private String description; - - /* - * The friendly name for this workspace. - */ - @JsonProperty(value = "friendlyName") - private String friendlyName; - - /* - * The compute name for image build - */ - @JsonProperty(value = "imageBuildCompute") - private String imageBuildCompute; - - /* - * The service managed resource settings. - */ - @JsonProperty(value = "serviceManagedResourcesSettings") - private ServiceManagedResourcesSettings serviceManagedResourcesSettings; - - /* - * The user assigned identity resource id that represents the workspace identity. - */ - @JsonProperty(value = "primaryUserAssignedIdentity") - private String primaryUserAssignedIdentity; - - /* - * Whether requests from Public Network are allowed. - */ - @JsonProperty(value = "publicNetworkAccess") - private PublicNetworkAccess publicNetworkAccess; - - /* - * ARM id of the application insights associated with this workspace. - */ - @JsonProperty(value = "applicationInsights") - private String applicationInsights; - - /* - * ARM id of the container registry associated with this workspace. - */ - @JsonProperty(value = "containerRegistry") - private String containerRegistry; - - /** Creates an instance of WorkspacePropertiesUpdateParameters class. */ - public WorkspacePropertiesUpdateParameters() { - } - - /** - * Get the description property: The description of this workspace. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The description of this workspace. - * - * @param description the description value to set. - * @return the WorkspacePropertiesUpdateParameters object itself. - */ - public WorkspacePropertiesUpdateParameters withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the friendlyName property: The friendly name for this workspace. - * - * @return the friendlyName value. - */ - public String friendlyName() { - return this.friendlyName; - } - - /** - * Set the friendlyName property: The friendly name for this workspace. - * - * @param friendlyName the friendlyName value to set. - * @return the WorkspacePropertiesUpdateParameters object itself. - */ - public WorkspacePropertiesUpdateParameters withFriendlyName(String friendlyName) { - this.friendlyName = friendlyName; - return this; - } - - /** - * Get the imageBuildCompute property: The compute name for image build. - * - * @return the imageBuildCompute value. - */ - public String imageBuildCompute() { - return this.imageBuildCompute; - } - - /** - * Set the imageBuildCompute property: The compute name for image build. - * - * @param imageBuildCompute the imageBuildCompute value to set. - * @return the WorkspacePropertiesUpdateParameters object itself. - */ - public WorkspacePropertiesUpdateParameters withImageBuildCompute(String imageBuildCompute) { - this.imageBuildCompute = imageBuildCompute; - return this; - } - - /** - * Get the serviceManagedResourcesSettings property: The service managed resource settings. - * - * @return the serviceManagedResourcesSettings value. - */ - public ServiceManagedResourcesSettings serviceManagedResourcesSettings() { - return this.serviceManagedResourcesSettings; - } - - /** - * Set the serviceManagedResourcesSettings property: The service managed resource settings. - * - * @param serviceManagedResourcesSettings the serviceManagedResourcesSettings value to set. - * @return the WorkspacePropertiesUpdateParameters object itself. - */ - public WorkspacePropertiesUpdateParameters withServiceManagedResourcesSettings( - ServiceManagedResourcesSettings serviceManagedResourcesSettings) { - this.serviceManagedResourcesSettings = serviceManagedResourcesSettings; - return this; - } - - /** - * Get the primaryUserAssignedIdentity property: The user assigned identity resource id that represents the - * workspace identity. - * - * @return the primaryUserAssignedIdentity value. - */ - public String primaryUserAssignedIdentity() { - return this.primaryUserAssignedIdentity; - } - - /** - * Set the primaryUserAssignedIdentity property: The user assigned identity resource id that represents the - * workspace identity. - * - * @param primaryUserAssignedIdentity the primaryUserAssignedIdentity value to set. - * @return the WorkspacePropertiesUpdateParameters object itself. - */ - public WorkspacePropertiesUpdateParameters withPrimaryUserAssignedIdentity(String primaryUserAssignedIdentity) { - this.primaryUserAssignedIdentity = primaryUserAssignedIdentity; - return this; - } - - /** - * Get the publicNetworkAccess property: Whether requests from Public Network are allowed. - * - * @return the publicNetworkAccess value. - */ - public PublicNetworkAccess publicNetworkAccess() { - return this.publicNetworkAccess; - } - - /** - * Set the publicNetworkAccess property: Whether requests from Public Network are allowed. - * - * @param publicNetworkAccess the publicNetworkAccess value to set. - * @return the WorkspacePropertiesUpdateParameters object itself. - */ - public WorkspacePropertiesUpdateParameters withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { - this.publicNetworkAccess = publicNetworkAccess; - return this; - } - - /** - * Get the applicationInsights property: ARM id of the application insights associated with this workspace. - * - * @return the applicationInsights value. - */ - public String applicationInsights() { - return this.applicationInsights; - } - - /** - * Set the applicationInsights property: ARM id of the application insights associated with this workspace. - * - * @param applicationInsights the applicationInsights value to set. - * @return the WorkspacePropertiesUpdateParameters object itself. - */ - public WorkspacePropertiesUpdateParameters withApplicationInsights(String applicationInsights) { - this.applicationInsights = applicationInsights; - return this; - } - - /** - * Get the containerRegistry property: ARM id of the container registry associated with this workspace. - * - * @return the containerRegistry value. - */ - public String containerRegistry() { - return this.containerRegistry; - } - - /** - * Set the containerRegistry property: ARM id of the container registry associated with this workspace. - * - * @param containerRegistry the containerRegistry value to set. - * @return the WorkspacePropertiesUpdateParameters object itself. - */ - public WorkspacePropertiesUpdateParameters withContainerRegistry(String containerRegistry) { - this.containerRegistry = containerRegistry; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (serviceManagedResourcesSettings() != null) { - serviceManagedResourcesSettings().validate(); - } - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/WorkspacePropertiesUpdateParametersInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/WorkspacePropertiesUpdateParametersInner.java new file mode 100644 index 0000000000000..b032dc624ca54 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/WorkspacePropertiesUpdateParametersInner.java @@ -0,0 +1,497 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.machinelearning.models.EncryptionUpdateProperties; +import com.azure.resourcemanager.machinelearning.models.FeatureStoreSettings; +import com.azure.resourcemanager.machinelearning.models.PublicNetworkAccess; +import com.azure.resourcemanager.machinelearning.models.ServerlessComputeSettings; +import com.azure.resourcemanager.machinelearning.models.ServiceManagedResourcesSettings; +import java.io.IOException; + +/** + * The parameters for updating the properties of a machine learning workspace. + */ +@Fluent +public final class WorkspacePropertiesUpdateParametersInner + implements JsonSerializable { + /* + * The description of this workspace. + */ + private String description; + + /* + * The friendly name for this workspace. + */ + private String friendlyName; + + /* + * The compute name for image build + */ + private String imageBuildCompute; + + /* + * The service managed resource settings. + */ + private ServiceManagedResourcesSettings serviceManagedResourcesSettings; + + /* + * The user assigned identity resource id that represents the workspace identity. + */ + private String primaryUserAssignedIdentity; + + /* + * Settings for serverless compute created in the workspace + */ + private ServerlessComputeSettings serverlessComputeSettings; + + /* + * Whether requests from Public Network are allowed. + */ + private PublicNetworkAccess publicNetworkAccess; + + /* + * ARM id of the application insights associated with this workspace. + */ + private String applicationInsights; + + /* + * ARM id of the container registry associated with this workspace. + */ + private String containerRegistry; + + /* + * Settings for feature store type workspace. + */ + private FeatureStoreSettings featureStoreSettings; + + /* + * Managed Network settings for a machine learning workspace. + */ + private ManagedNetworkSettingsInner managedNetwork; + + /* + * The enableDataIsolation property. + */ + private Boolean enableDataIsolation; + + /* + * Enabling v1_legacy_mode may prevent you from using features provided by the v2 API. + */ + private Boolean v1LegacyMode; + + /* + * The encryption property. + */ + private EncryptionUpdateProperties encryption; + + /** + * Creates an instance of WorkspacePropertiesUpdateParametersInner class. + */ + public WorkspacePropertiesUpdateParametersInner() { + } + + /** + * Get the description property: The description of this workspace. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of this workspace. + * + * @param description the description value to set. + * @return the WorkspacePropertiesUpdateParametersInner object itself. + */ + public WorkspacePropertiesUpdateParametersInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the friendlyName property: The friendly name for this workspace. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: The friendly name for this workspace. + * + * @param friendlyName the friendlyName value to set. + * @return the WorkspacePropertiesUpdateParametersInner object itself. + */ + public WorkspacePropertiesUpdateParametersInner withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the imageBuildCompute property: The compute name for image build. + * + * @return the imageBuildCompute value. + */ + public String imageBuildCompute() { + return this.imageBuildCompute; + } + + /** + * Set the imageBuildCompute property: The compute name for image build. + * + * @param imageBuildCompute the imageBuildCompute value to set. + * @return the WorkspacePropertiesUpdateParametersInner object itself. + */ + public WorkspacePropertiesUpdateParametersInner withImageBuildCompute(String imageBuildCompute) { + this.imageBuildCompute = imageBuildCompute; + return this; + } + + /** + * Get the serviceManagedResourcesSettings property: The service managed resource settings. + * + * @return the serviceManagedResourcesSettings value. + */ + public ServiceManagedResourcesSettings serviceManagedResourcesSettings() { + return this.serviceManagedResourcesSettings; + } + + /** + * Set the serviceManagedResourcesSettings property: The service managed resource settings. + * + * @param serviceManagedResourcesSettings the serviceManagedResourcesSettings value to set. + * @return the WorkspacePropertiesUpdateParametersInner object itself. + */ + public WorkspacePropertiesUpdateParametersInner + withServiceManagedResourcesSettings(ServiceManagedResourcesSettings serviceManagedResourcesSettings) { + this.serviceManagedResourcesSettings = serviceManagedResourcesSettings; + return this; + } + + /** + * Get the primaryUserAssignedIdentity property: The user assigned identity resource id that represents the + * workspace identity. + * + * @return the primaryUserAssignedIdentity value. + */ + public String primaryUserAssignedIdentity() { + return this.primaryUserAssignedIdentity; + } + + /** + * Set the primaryUserAssignedIdentity property: The user assigned identity resource id that represents the + * workspace identity. + * + * @param primaryUserAssignedIdentity the primaryUserAssignedIdentity value to set. + * @return the WorkspacePropertiesUpdateParametersInner object itself. + */ + public WorkspacePropertiesUpdateParametersInner + withPrimaryUserAssignedIdentity(String primaryUserAssignedIdentity) { + this.primaryUserAssignedIdentity = primaryUserAssignedIdentity; + return this; + } + + /** + * Get the serverlessComputeSettings property: Settings for serverless compute created in the workspace. + * + * @return the serverlessComputeSettings value. + */ + public ServerlessComputeSettings serverlessComputeSettings() { + return this.serverlessComputeSettings; + } + + /** + * Set the serverlessComputeSettings property: Settings for serverless compute created in the workspace. + * + * @param serverlessComputeSettings the serverlessComputeSettings value to set. + * @return the WorkspacePropertiesUpdateParametersInner object itself. + */ + public WorkspacePropertiesUpdateParametersInner + withServerlessComputeSettings(ServerlessComputeSettings serverlessComputeSettings) { + this.serverlessComputeSettings = serverlessComputeSettings; + return this; + } + + /** + * Get the publicNetworkAccess property: Whether requests from Public Network are allowed. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Whether requests from Public Network are allowed. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the WorkspacePropertiesUpdateParametersInner object itself. + */ + public WorkspacePropertiesUpdateParametersInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the applicationInsights property: ARM id of the application insights associated with this workspace. + * + * @return the applicationInsights value. + */ + public String applicationInsights() { + return this.applicationInsights; + } + + /** + * Set the applicationInsights property: ARM id of the application insights associated with this workspace. + * + * @param applicationInsights the applicationInsights value to set. + * @return the WorkspacePropertiesUpdateParametersInner object itself. + */ + public WorkspacePropertiesUpdateParametersInner withApplicationInsights(String applicationInsights) { + this.applicationInsights = applicationInsights; + return this; + } + + /** + * Get the containerRegistry property: ARM id of the container registry associated with this workspace. + * + * @return the containerRegistry value. + */ + public String containerRegistry() { + return this.containerRegistry; + } + + /** + * Set the containerRegistry property: ARM id of the container registry associated with this workspace. + * + * @param containerRegistry the containerRegistry value to set. + * @return the WorkspacePropertiesUpdateParametersInner object itself. + */ + public WorkspacePropertiesUpdateParametersInner withContainerRegistry(String containerRegistry) { + this.containerRegistry = containerRegistry; + return this; + } + + /** + * Get the featureStoreSettings property: Settings for feature store type workspace. + * + * @return the featureStoreSettings value. + */ + public FeatureStoreSettings featureStoreSettings() { + return this.featureStoreSettings; + } + + /** + * Set the featureStoreSettings property: Settings for feature store type workspace. + * + * @param featureStoreSettings the featureStoreSettings value to set. + * @return the WorkspacePropertiesUpdateParametersInner object itself. + */ + public WorkspacePropertiesUpdateParametersInner + withFeatureStoreSettings(FeatureStoreSettings featureStoreSettings) { + this.featureStoreSettings = featureStoreSettings; + return this; + } + + /** + * Get the managedNetwork property: Managed Network settings for a machine learning workspace. + * + * @return the managedNetwork value. + */ + public ManagedNetworkSettingsInner managedNetwork() { + return this.managedNetwork; + } + + /** + * Set the managedNetwork property: Managed Network settings for a machine learning workspace. + * + * @param managedNetwork the managedNetwork value to set. + * @return the WorkspacePropertiesUpdateParametersInner object itself. + */ + public WorkspacePropertiesUpdateParametersInner withManagedNetwork(ManagedNetworkSettingsInner managedNetwork) { + this.managedNetwork = managedNetwork; + return this; + } + + /** + * Get the enableDataIsolation property: The enableDataIsolation property. + * + * @return the enableDataIsolation value. + */ + public Boolean enableDataIsolation() { + return this.enableDataIsolation; + } + + /** + * Set the enableDataIsolation property: The enableDataIsolation property. + * + * @param enableDataIsolation the enableDataIsolation value to set. + * @return the WorkspacePropertiesUpdateParametersInner object itself. + */ + public WorkspacePropertiesUpdateParametersInner withEnableDataIsolation(Boolean enableDataIsolation) { + this.enableDataIsolation = enableDataIsolation; + return this; + } + + /** + * Get the v1LegacyMode property: Enabling v1_legacy_mode may prevent you from using features provided by the v2 + * API. + * + * @return the v1LegacyMode value. + */ + public Boolean v1LegacyMode() { + return this.v1LegacyMode; + } + + /** + * Set the v1LegacyMode property: Enabling v1_legacy_mode may prevent you from using features provided by the v2 + * API. + * + * @param v1LegacyMode the v1LegacyMode value to set. + * @return the WorkspacePropertiesUpdateParametersInner object itself. + */ + public WorkspacePropertiesUpdateParametersInner withV1LegacyMode(Boolean v1LegacyMode) { + this.v1LegacyMode = v1LegacyMode; + return this; + } + + /** + * Get the encryption property: The encryption property. + * + * @return the encryption value. + */ + public EncryptionUpdateProperties encryption() { + return this.encryption; + } + + /** + * Set the encryption property: The encryption property. + * + * @param encryption the encryption value to set. + * @return the WorkspacePropertiesUpdateParametersInner object itself. + */ + public WorkspacePropertiesUpdateParametersInner withEncryption(EncryptionUpdateProperties encryption) { + this.encryption = encryption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serviceManagedResourcesSettings() != null) { + serviceManagedResourcesSettings().validate(); + } + if (serverlessComputeSettings() != null) { + serverlessComputeSettings().validate(); + } + if (featureStoreSettings() != null) { + featureStoreSettings().validate(); + } + if (managedNetwork() != null) { + managedNetwork().validate(); + } + if (encryption() != null) { + encryption().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("friendlyName", this.friendlyName); + jsonWriter.writeStringField("imageBuildCompute", this.imageBuildCompute); + jsonWriter.writeJsonField("serviceManagedResourcesSettings", this.serviceManagedResourcesSettings); + jsonWriter.writeStringField("primaryUserAssignedIdentity", this.primaryUserAssignedIdentity); + jsonWriter.writeJsonField("serverlessComputeSettings", this.serverlessComputeSettings); + jsonWriter.writeStringField("publicNetworkAccess", + this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); + jsonWriter.writeStringField("applicationInsights", this.applicationInsights); + jsonWriter.writeStringField("containerRegistry", this.containerRegistry); + jsonWriter.writeJsonField("featureStoreSettings", this.featureStoreSettings); + jsonWriter.writeJsonField("managedNetwork", this.managedNetwork); + jsonWriter.writeBooleanField("enableDataIsolation", this.enableDataIsolation); + jsonWriter.writeBooleanField("v1LegacyMode", this.v1LegacyMode); + jsonWriter.writeJsonField("encryption", this.encryption); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspacePropertiesUpdateParametersInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspacePropertiesUpdateParametersInner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the WorkspacePropertiesUpdateParametersInner. + */ + public static WorkspacePropertiesUpdateParametersInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspacePropertiesUpdateParametersInner deserializedWorkspacePropertiesUpdateParametersInner + = new WorkspacePropertiesUpdateParametersInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedWorkspacePropertiesUpdateParametersInner.description = reader.getString(); + } else if ("friendlyName".equals(fieldName)) { + deserializedWorkspacePropertiesUpdateParametersInner.friendlyName = reader.getString(); + } else if ("imageBuildCompute".equals(fieldName)) { + deserializedWorkspacePropertiesUpdateParametersInner.imageBuildCompute = reader.getString(); + } else if ("serviceManagedResourcesSettings".equals(fieldName)) { + deserializedWorkspacePropertiesUpdateParametersInner.serviceManagedResourcesSettings + = ServiceManagedResourcesSettings.fromJson(reader); + } else if ("primaryUserAssignedIdentity".equals(fieldName)) { + deserializedWorkspacePropertiesUpdateParametersInner.primaryUserAssignedIdentity + = reader.getString(); + } else if ("serverlessComputeSettings".equals(fieldName)) { + deserializedWorkspacePropertiesUpdateParametersInner.serverlessComputeSettings + = ServerlessComputeSettings.fromJson(reader); + } else if ("publicNetworkAccess".equals(fieldName)) { + deserializedWorkspacePropertiesUpdateParametersInner.publicNetworkAccess + = PublicNetworkAccess.fromString(reader.getString()); + } else if ("applicationInsights".equals(fieldName)) { + deserializedWorkspacePropertiesUpdateParametersInner.applicationInsights = reader.getString(); + } else if ("containerRegistry".equals(fieldName)) { + deserializedWorkspacePropertiesUpdateParametersInner.containerRegistry = reader.getString(); + } else if ("featureStoreSettings".equals(fieldName)) { + deserializedWorkspacePropertiesUpdateParametersInner.featureStoreSettings + = FeatureStoreSettings.fromJson(reader); + } else if ("managedNetwork".equals(fieldName)) { + deserializedWorkspacePropertiesUpdateParametersInner.managedNetwork + = ManagedNetworkSettingsInner.fromJson(reader); + } else if ("enableDataIsolation".equals(fieldName)) { + deserializedWorkspacePropertiesUpdateParametersInner.enableDataIsolation + = reader.getNullable(JsonReader::getBoolean); + } else if ("v1LegacyMode".equals(fieldName)) { + deserializedWorkspacePropertiesUpdateParametersInner.v1LegacyMode + = reader.getNullable(JsonReader::getBoolean); + } else if ("encryption".equals(fieldName)) { + deserializedWorkspacePropertiesUpdateParametersInner.encryption + = EncryptionUpdateProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspacePropertiesUpdateParametersInner; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/WorkspaceUpdateParametersInner.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/WorkspaceUpdateParametersInner.java new file mode 100644 index 0000000000000..dd3ca6c2142fa --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/WorkspaceUpdateParametersInner.java @@ -0,0 +1,514 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.machinelearning.models.EncryptionUpdateProperties; +import com.azure.resourcemanager.machinelearning.models.FeatureStoreSettings; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.PublicNetworkAccess; +import com.azure.resourcemanager.machinelearning.models.ServerlessComputeSettings; +import com.azure.resourcemanager.machinelearning.models.ServiceManagedResourcesSettings; +import com.azure.resourcemanager.machinelearning.models.Sku; +import java.io.IOException; +import java.util.Map; + +/** + * The parameters for updating a machine learning workspace. + */ +@Fluent +public final class WorkspaceUpdateParametersInner implements JsonSerializable { + /* + * The resource tags for the machine learning workspace. + */ + private Map tags; + + /* + * The sku of the workspace. + */ + private Sku sku; + + /* + * The identity of the resource. + */ + private ManagedServiceIdentity identity; + + /* + * The properties that the machine learning workspace will be updated with. + */ + private WorkspacePropertiesUpdateParametersInner innerProperties; + + /** + * Creates an instance of WorkspaceUpdateParametersInner class. + */ + public WorkspaceUpdateParametersInner() { + } + + /** + * Get the tags property: The resource tags for the machine learning workspace. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The resource tags for the machine learning workspace. + * + * @param tags the tags value to set. + * @return the WorkspaceUpdateParametersInner object itself. + */ + public WorkspaceUpdateParametersInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the sku property: The sku of the workspace. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: The sku of the workspace. + * + * @param sku the sku value to set. + * @return the WorkspaceUpdateParametersInner object itself. + */ + public WorkspaceUpdateParametersInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the identity property: The identity of the resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the resource. + * + * @param identity the identity value to set. + * @return the WorkspaceUpdateParametersInner object itself. + */ + public WorkspaceUpdateParametersInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the innerProperties property: The properties that the machine learning workspace will be updated with. + * + * @return the innerProperties value. + */ + private WorkspacePropertiesUpdateParametersInner innerProperties() { + return this.innerProperties; + } + + /** + * Get the description property: The description of this workspace. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: The description of this workspace. + * + * @param description the description value to set. + * @return the WorkspaceUpdateParametersInner object itself. + */ + public WorkspaceUpdateParametersInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesUpdateParametersInner(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the friendlyName property: The friendly name for this workspace. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + } + + /** + * Set the friendlyName property: The friendly name for this workspace. + * + * @param friendlyName the friendlyName value to set. + * @return the WorkspaceUpdateParametersInner object itself. + */ + public WorkspaceUpdateParametersInner withFriendlyName(String friendlyName) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesUpdateParametersInner(); + } + this.innerProperties().withFriendlyName(friendlyName); + return this; + } + + /** + * Get the imageBuildCompute property: The compute name for image build. + * + * @return the imageBuildCompute value. + */ + public String imageBuildCompute() { + return this.innerProperties() == null ? null : this.innerProperties().imageBuildCompute(); + } + + /** + * Set the imageBuildCompute property: The compute name for image build. + * + * @param imageBuildCompute the imageBuildCompute value to set. + * @return the WorkspaceUpdateParametersInner object itself. + */ + public WorkspaceUpdateParametersInner withImageBuildCompute(String imageBuildCompute) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesUpdateParametersInner(); + } + this.innerProperties().withImageBuildCompute(imageBuildCompute); + return this; + } + + /** + * Get the serviceManagedResourcesSettings property: The service managed resource settings. + * + * @return the serviceManagedResourcesSettings value. + */ + public ServiceManagedResourcesSettings serviceManagedResourcesSettings() { + return this.innerProperties() == null ? null : this.innerProperties().serviceManagedResourcesSettings(); + } + + /** + * Set the serviceManagedResourcesSettings property: The service managed resource settings. + * + * @param serviceManagedResourcesSettings the serviceManagedResourcesSettings value to set. + * @return the WorkspaceUpdateParametersInner object itself. + */ + public WorkspaceUpdateParametersInner + withServiceManagedResourcesSettings(ServiceManagedResourcesSettings serviceManagedResourcesSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesUpdateParametersInner(); + } + this.innerProperties().withServiceManagedResourcesSettings(serviceManagedResourcesSettings); + return this; + } + + /** + * Get the primaryUserAssignedIdentity property: The user assigned identity resource id that represents the + * workspace identity. + * + * @return the primaryUserAssignedIdentity value. + */ + public String primaryUserAssignedIdentity() { + return this.innerProperties() == null ? null : this.innerProperties().primaryUserAssignedIdentity(); + } + + /** + * Set the primaryUserAssignedIdentity property: The user assigned identity resource id that represents the + * workspace identity. + * + * @param primaryUserAssignedIdentity the primaryUserAssignedIdentity value to set. + * @return the WorkspaceUpdateParametersInner object itself. + */ + public WorkspaceUpdateParametersInner withPrimaryUserAssignedIdentity(String primaryUserAssignedIdentity) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesUpdateParametersInner(); + } + this.innerProperties().withPrimaryUserAssignedIdentity(primaryUserAssignedIdentity); + return this; + } + + /** + * Get the serverlessComputeSettings property: Settings for serverless compute created in the workspace. + * + * @return the serverlessComputeSettings value. + */ + public ServerlessComputeSettings serverlessComputeSettings() { + return this.innerProperties() == null ? null : this.innerProperties().serverlessComputeSettings(); + } + + /** + * Set the serverlessComputeSettings property: Settings for serverless compute created in the workspace. + * + * @param serverlessComputeSettings the serverlessComputeSettings value to set. + * @return the WorkspaceUpdateParametersInner object itself. + */ + public WorkspaceUpdateParametersInner + withServerlessComputeSettings(ServerlessComputeSettings serverlessComputeSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesUpdateParametersInner(); + } + this.innerProperties().withServerlessComputeSettings(serverlessComputeSettings); + return this; + } + + /** + * Get the publicNetworkAccess property: Whether requests from Public Network are allowed. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); + } + + /** + * Set the publicNetworkAccess property: Whether requests from Public Network are allowed. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the WorkspaceUpdateParametersInner object itself. + */ + public WorkspaceUpdateParametersInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesUpdateParametersInner(); + } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + /** + * Get the applicationInsights property: ARM id of the application insights associated with this workspace. + * + * @return the applicationInsights value. + */ + public String applicationInsights() { + return this.innerProperties() == null ? null : this.innerProperties().applicationInsights(); + } + + /** + * Set the applicationInsights property: ARM id of the application insights associated with this workspace. + * + * @param applicationInsights the applicationInsights value to set. + * @return the WorkspaceUpdateParametersInner object itself. + */ + public WorkspaceUpdateParametersInner withApplicationInsights(String applicationInsights) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesUpdateParametersInner(); + } + this.innerProperties().withApplicationInsights(applicationInsights); + return this; + } + + /** + * Get the containerRegistry property: ARM id of the container registry associated with this workspace. + * + * @return the containerRegistry value. + */ + public String containerRegistry() { + return this.innerProperties() == null ? null : this.innerProperties().containerRegistry(); + } + + /** + * Set the containerRegistry property: ARM id of the container registry associated with this workspace. + * + * @param containerRegistry the containerRegistry value to set. + * @return the WorkspaceUpdateParametersInner object itself. + */ + public WorkspaceUpdateParametersInner withContainerRegistry(String containerRegistry) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesUpdateParametersInner(); + } + this.innerProperties().withContainerRegistry(containerRegistry); + return this; + } + + /** + * Get the featureStoreSettings property: Settings for feature store type workspace. + * + * @return the featureStoreSettings value. + */ + public FeatureStoreSettings featureStoreSettings() { + return this.innerProperties() == null ? null : this.innerProperties().featureStoreSettings(); + } + + /** + * Set the featureStoreSettings property: Settings for feature store type workspace. + * + * @param featureStoreSettings the featureStoreSettings value to set. + * @return the WorkspaceUpdateParametersInner object itself. + */ + public WorkspaceUpdateParametersInner withFeatureStoreSettings(FeatureStoreSettings featureStoreSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesUpdateParametersInner(); + } + this.innerProperties().withFeatureStoreSettings(featureStoreSettings); + return this; + } + + /** + * Get the managedNetwork property: Managed Network settings for a machine learning workspace. + * + * @return the managedNetwork value. + */ + public ManagedNetworkSettingsInner managedNetwork() { + return this.innerProperties() == null ? null : this.innerProperties().managedNetwork(); + } + + /** + * Set the managedNetwork property: Managed Network settings for a machine learning workspace. + * + * @param managedNetwork the managedNetwork value to set. + * @return the WorkspaceUpdateParametersInner object itself. + */ + public WorkspaceUpdateParametersInner withManagedNetwork(ManagedNetworkSettingsInner managedNetwork) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesUpdateParametersInner(); + } + this.innerProperties().withManagedNetwork(managedNetwork); + return this; + } + + /** + * Get the enableDataIsolation property: The enableDataIsolation property. + * + * @return the enableDataIsolation value. + */ + public Boolean enableDataIsolation() { + return this.innerProperties() == null ? null : this.innerProperties().enableDataIsolation(); + } + + /** + * Set the enableDataIsolation property: The enableDataIsolation property. + * + * @param enableDataIsolation the enableDataIsolation value to set. + * @return the WorkspaceUpdateParametersInner object itself. + */ + public WorkspaceUpdateParametersInner withEnableDataIsolation(Boolean enableDataIsolation) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesUpdateParametersInner(); + } + this.innerProperties().withEnableDataIsolation(enableDataIsolation); + return this; + } + + /** + * Get the v1LegacyMode property: Enabling v1_legacy_mode may prevent you from using features provided by the v2 + * API. + * + * @return the v1LegacyMode value. + */ + public Boolean v1LegacyMode() { + return this.innerProperties() == null ? null : this.innerProperties().v1LegacyMode(); + } + + /** + * Set the v1LegacyMode property: Enabling v1_legacy_mode may prevent you from using features provided by the v2 + * API. + * + * @param v1LegacyMode the v1LegacyMode value to set. + * @return the WorkspaceUpdateParametersInner object itself. + */ + public WorkspaceUpdateParametersInner withV1LegacyMode(Boolean v1LegacyMode) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesUpdateParametersInner(); + } + this.innerProperties().withV1LegacyMode(v1LegacyMode); + return this; + } + + /** + * Get the encryption property: The encryption property. + * + * @return the encryption value. + */ + public EncryptionUpdateProperties encryption() { + return this.innerProperties() == null ? null : this.innerProperties().encryption(); + } + + /** + * Set the encryption property: The encryption property. + * + * @param encryption the encryption value to set. + * @return the WorkspaceUpdateParametersInner object itself. + */ + public WorkspaceUpdateParametersInner withEncryption(EncryptionUpdateProperties encryption) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspacePropertiesUpdateParametersInner(); + } + this.innerProperties().withEncryption(encryption); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (identity() != null) { + identity().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceUpdateParametersInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceUpdateParametersInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the WorkspaceUpdateParametersInner. + */ + public static WorkspaceUpdateParametersInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceUpdateParametersInner deserializedWorkspaceUpdateParametersInner + = new WorkspaceUpdateParametersInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedWorkspaceUpdateParametersInner.tags = tags; + } else if ("sku".equals(fieldName)) { + deserializedWorkspaceUpdateParametersInner.sku = Sku.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedWorkspaceUpdateParametersInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedWorkspaceUpdateParametersInner.innerProperties + = WorkspacePropertiesUpdateParametersInner.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceUpdateParametersInner; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/package-info.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/package-info.java index 3e822d30cd968..9540e342a5907 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/package-info.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/models/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the inner data models for AzureMachineLearningWorkspaces. These APIs allow end users to operate on - * Azure Machine Learning Workspace resources. + * Package containing the inner data models for AzureMachineLearningServices. + * These APIs allow end users to operate on Azure Machine Learning Workspace resources. */ package com.azure.resourcemanager.machinelearning.fluent.models; diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/package-info.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/package-info.java index f5bef46229750..3a42b7602c976 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/package-info.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/fluent/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the service clients for AzureMachineLearningWorkspaces. These APIs allow end users to operate on - * Azure Machine Learning Workspace resources. + * Package containing the service clients for AzureMachineLearningServices. + * These APIs allow end users to operate on Azure Machine Learning Workspace resources. */ package com.azure.resourcemanager.machinelearning.fluent; diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AmlOperationImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AmlOperationImpl.java deleted file mode 100644 index 803be140a597c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AmlOperationImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.implementation; - -import com.azure.resourcemanager.machinelearning.fluent.models.AmlOperationInner; -import com.azure.resourcemanager.machinelearning.models.AmlOperation; -import com.azure.resourcemanager.machinelearning.models.AmlOperationDisplay; - -public final class AmlOperationImpl implements AmlOperation { - private AmlOperationInner innerObject; - - private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - - AmlOperationImpl( - AmlOperationInner innerObject, - com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String name() { - return this.innerModel().name(); - } - - public AmlOperationDisplay display() { - return this.innerModel().display(); - } - - public Boolean isDataAction() { - return this.innerModel().isDataAction(); - } - - public AmlOperationInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AmlUserFeatureImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AmlUserFeatureImpl.java index 3430c2ef2701b..ac8f925a38ad4 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AmlUserFeatureImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AmlUserFeatureImpl.java @@ -12,8 +12,7 @@ public final class AmlUserFeatureImpl implements AmlUserFeature { private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - AmlUserFeatureImpl( - AmlUserFeatureInner innerObject, + AmlUserFeatureImpl(AmlUserFeatureInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AzureMachineLearningServicesBuilder.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AzureMachineLearningServicesBuilder.java new file mode 100644 index 0000000000000..069b2a76dfb19 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AzureMachineLearningServicesBuilder.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** + * A builder for creating a new instance of the AzureMachineLearningServicesImpl type. + */ +@ServiceClientBuilder(serviceClients = { AzureMachineLearningServicesImpl.class }) +public final class AzureMachineLearningServicesBuilder { + /* + * The ID of the target subscription. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the AzureMachineLearningServicesBuilder. + */ + public AzureMachineLearningServicesBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the AzureMachineLearningServicesBuilder. + */ + public AzureMachineLearningServicesBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the AzureMachineLearningServicesBuilder. + */ + public AzureMachineLearningServicesBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the AzureMachineLearningServicesBuilder. + */ + public AzureMachineLearningServicesBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the AzureMachineLearningServicesBuilder. + */ + public AzureMachineLearningServicesBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the AzureMachineLearningServicesBuilder. + */ + public AzureMachineLearningServicesBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of AzureMachineLearningServicesImpl with the provided parameters. + * + * @return an instance of AzureMachineLearningServicesImpl. + */ + public AzureMachineLearningServicesImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval + = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + AzureMachineLearningServicesImpl client = new AzureMachineLearningServicesImpl(localPipeline, + localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + return client; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AzureMachineLearningServicesImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AzureMachineLearningServicesImpl.java new file mode 100644 index 0000000000000..e8a788c47d435 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AzureMachineLearningServicesImpl.java @@ -0,0 +1,1040 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.machinelearning.fluent.AzureMachineLearningServices; +import com.azure.resourcemanager.machinelearning.fluent.BatchDeploymentsClient; +import com.azure.resourcemanager.machinelearning.fluent.BatchEndpointsClient; +import com.azure.resourcemanager.machinelearning.fluent.CodeContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.CodeVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.ComponentContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.ComponentVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.ComputesClient; +import com.azure.resourcemanager.machinelearning.fluent.DataContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.DatastoresClient; +import com.azure.resourcemanager.machinelearning.fluent.DataVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.EnvironmentContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.EnvironmentVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.FeaturesClient; +import com.azure.resourcemanager.machinelearning.fluent.FeaturesetContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.FeaturesetVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.FeaturestoreEntityContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.FeaturestoreEntityVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.JobsClient; +import com.azure.resourcemanager.machinelearning.fluent.ManagedNetworkProvisionsClient; +import com.azure.resourcemanager.machinelearning.fluent.ManagedNetworkSettingsRulesClient; +import com.azure.resourcemanager.machinelearning.fluent.MarketplaceSubscriptionsClient; +import com.azure.resourcemanager.machinelearning.fluent.ModelContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.ModelVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.OnlineDeploymentsClient; +import com.azure.resourcemanager.machinelearning.fluent.OnlineEndpointsClient; +import com.azure.resourcemanager.machinelearning.fluent.OperationsClient; +import com.azure.resourcemanager.machinelearning.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.machinelearning.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.machinelearning.fluent.QuotasClient; +import com.azure.resourcemanager.machinelearning.fluent.RegistriesClient; +import com.azure.resourcemanager.machinelearning.fluent.RegistryCodeContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.RegistryCodeVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.RegistryComponentContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.RegistryComponentVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.RegistryDataContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.RegistryDataReferencesClient; +import com.azure.resourcemanager.machinelearning.fluent.RegistryDataVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.RegistryEnvironmentContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.RegistryEnvironmentVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.RegistryModelContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.RegistryModelVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.SchedulesClient; +import com.azure.resourcemanager.machinelearning.fluent.ServerlessEndpointsClient; +import com.azure.resourcemanager.machinelearning.fluent.UsagesClient; +import com.azure.resourcemanager.machinelearning.fluent.VirtualMachineSizesClient; +import com.azure.resourcemanager.machinelearning.fluent.WorkspaceConnectionsClient; +import com.azure.resourcemanager.machinelearning.fluent.WorkspaceFeaturesClient; +import com.azure.resourcemanager.machinelearning.fluent.WorkspacesClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the AzureMachineLearningServicesImpl type. + */ +@ServiceClient(builder = AzureMachineLearningServicesBuilder.class) +public final class AzureMachineLearningServicesImpl implements AzureMachineLearningServices { + /** + * The ID of the target subscription. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** + * server parameter. + */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * Api Version. + */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** + * The HTTP pipeline to send requests through. + */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** + * The serializer to serialize an object into a string. + */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * The default poll interval for long-running operation. + */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** + * The OperationsClient object to access its operations. + */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** + * The WorkspacesClient object to access its operations. + */ + private final WorkspacesClient workspaces; + + /** + * Gets the WorkspacesClient object to access its operations. + * + * @return the WorkspacesClient object. + */ + public WorkspacesClient getWorkspaces() { + return this.workspaces; + } + + /** + * The UsagesClient object to access its operations. + */ + private final UsagesClient usages; + + /** + * Gets the UsagesClient object to access its operations. + * + * @return the UsagesClient object. + */ + public UsagesClient getUsages() { + return this.usages; + } + + /** + * The VirtualMachineSizesClient object to access its operations. + */ + private final VirtualMachineSizesClient virtualMachineSizes; + + /** + * Gets the VirtualMachineSizesClient object to access its operations. + * + * @return the VirtualMachineSizesClient object. + */ + public VirtualMachineSizesClient getVirtualMachineSizes() { + return this.virtualMachineSizes; + } + + /** + * The QuotasClient object to access its operations. + */ + private final QuotasClient quotas; + + /** + * Gets the QuotasClient object to access its operations. + * + * @return the QuotasClient object. + */ + public QuotasClient getQuotas() { + return this.quotas; + } + + /** + * The ComputesClient object to access its operations. + */ + private final ComputesClient computes; + + /** + * Gets the ComputesClient object to access its operations. + * + * @return the ComputesClient object. + */ + public ComputesClient getComputes() { + return this.computes; + } + + /** + * The PrivateEndpointConnectionsClient object to access its operations. + */ + private final PrivateEndpointConnectionsClient privateEndpointConnections; + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * The PrivateLinkResourcesClient object to access its operations. + */ + private final PrivateLinkResourcesClient privateLinkResources; + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + public PrivateLinkResourcesClient getPrivateLinkResources() { + return this.privateLinkResources; + } + + /** + * The WorkspaceConnectionsClient object to access its operations. + */ + private final WorkspaceConnectionsClient workspaceConnections; + + /** + * Gets the WorkspaceConnectionsClient object to access its operations. + * + * @return the WorkspaceConnectionsClient object. + */ + public WorkspaceConnectionsClient getWorkspaceConnections() { + return this.workspaceConnections; + } + + /** + * The ManagedNetworkSettingsRulesClient object to access its operations. + */ + private final ManagedNetworkSettingsRulesClient managedNetworkSettingsRules; + + /** + * Gets the ManagedNetworkSettingsRulesClient object to access its operations. + * + * @return the ManagedNetworkSettingsRulesClient object. + */ + public ManagedNetworkSettingsRulesClient getManagedNetworkSettingsRules() { + return this.managedNetworkSettingsRules; + } + + /** + * The ManagedNetworkProvisionsClient object to access its operations. + */ + private final ManagedNetworkProvisionsClient managedNetworkProvisions; + + /** + * Gets the ManagedNetworkProvisionsClient object to access its operations. + * + * @return the ManagedNetworkProvisionsClient object. + */ + public ManagedNetworkProvisionsClient getManagedNetworkProvisions() { + return this.managedNetworkProvisions; + } + + /** + * The RegistryCodeContainersClient object to access its operations. + */ + private final RegistryCodeContainersClient registryCodeContainers; + + /** + * Gets the RegistryCodeContainersClient object to access its operations. + * + * @return the RegistryCodeContainersClient object. + */ + public RegistryCodeContainersClient getRegistryCodeContainers() { + return this.registryCodeContainers; + } + + /** + * The RegistryCodeVersionsClient object to access its operations. + */ + private final RegistryCodeVersionsClient registryCodeVersions; + + /** + * Gets the RegistryCodeVersionsClient object to access its operations. + * + * @return the RegistryCodeVersionsClient object. + */ + public RegistryCodeVersionsClient getRegistryCodeVersions() { + return this.registryCodeVersions; + } + + /** + * The RegistryComponentContainersClient object to access its operations. + */ + private final RegistryComponentContainersClient registryComponentContainers; + + /** + * Gets the RegistryComponentContainersClient object to access its operations. + * + * @return the RegistryComponentContainersClient object. + */ + public RegistryComponentContainersClient getRegistryComponentContainers() { + return this.registryComponentContainers; + } + + /** + * The RegistryComponentVersionsClient object to access its operations. + */ + private final RegistryComponentVersionsClient registryComponentVersions; + + /** + * Gets the RegistryComponentVersionsClient object to access its operations. + * + * @return the RegistryComponentVersionsClient object. + */ + public RegistryComponentVersionsClient getRegistryComponentVersions() { + return this.registryComponentVersions; + } + + /** + * The RegistryDataContainersClient object to access its operations. + */ + private final RegistryDataContainersClient registryDataContainers; + + /** + * Gets the RegistryDataContainersClient object to access its operations. + * + * @return the RegistryDataContainersClient object. + */ + public RegistryDataContainersClient getRegistryDataContainers() { + return this.registryDataContainers; + } + + /** + * The RegistryDataVersionsClient object to access its operations. + */ + private final RegistryDataVersionsClient registryDataVersions; + + /** + * Gets the RegistryDataVersionsClient object to access its operations. + * + * @return the RegistryDataVersionsClient object. + */ + public RegistryDataVersionsClient getRegistryDataVersions() { + return this.registryDataVersions; + } + + /** + * The RegistryDataReferencesClient object to access its operations. + */ + private final RegistryDataReferencesClient registryDataReferences; + + /** + * Gets the RegistryDataReferencesClient object to access its operations. + * + * @return the RegistryDataReferencesClient object. + */ + public RegistryDataReferencesClient getRegistryDataReferences() { + return this.registryDataReferences; + } + + /** + * The RegistryEnvironmentContainersClient object to access its operations. + */ + private final RegistryEnvironmentContainersClient registryEnvironmentContainers; + + /** + * Gets the RegistryEnvironmentContainersClient object to access its operations. + * + * @return the RegistryEnvironmentContainersClient object. + */ + public RegistryEnvironmentContainersClient getRegistryEnvironmentContainers() { + return this.registryEnvironmentContainers; + } + + /** + * The RegistryEnvironmentVersionsClient object to access its operations. + */ + private final RegistryEnvironmentVersionsClient registryEnvironmentVersions; + + /** + * Gets the RegistryEnvironmentVersionsClient object to access its operations. + * + * @return the RegistryEnvironmentVersionsClient object. + */ + public RegistryEnvironmentVersionsClient getRegistryEnvironmentVersions() { + return this.registryEnvironmentVersions; + } + + /** + * The MarketplaceSubscriptionsClient object to access its operations. + */ + private final MarketplaceSubscriptionsClient marketplaceSubscriptions; + + /** + * Gets the MarketplaceSubscriptionsClient object to access its operations. + * + * @return the MarketplaceSubscriptionsClient object. + */ + public MarketplaceSubscriptionsClient getMarketplaceSubscriptions() { + return this.marketplaceSubscriptions; + } + + /** + * The RegistryModelContainersClient object to access its operations. + */ + private final RegistryModelContainersClient registryModelContainers; + + /** + * Gets the RegistryModelContainersClient object to access its operations. + * + * @return the RegistryModelContainersClient object. + */ + public RegistryModelContainersClient getRegistryModelContainers() { + return this.registryModelContainers; + } + + /** + * The RegistryModelVersionsClient object to access its operations. + */ + private final RegistryModelVersionsClient registryModelVersions; + + /** + * Gets the RegistryModelVersionsClient object to access its operations. + * + * @return the RegistryModelVersionsClient object. + */ + public RegistryModelVersionsClient getRegistryModelVersions() { + return this.registryModelVersions; + } + + /** + * The BatchEndpointsClient object to access its operations. + */ + private final BatchEndpointsClient batchEndpoints; + + /** + * Gets the BatchEndpointsClient object to access its operations. + * + * @return the BatchEndpointsClient object. + */ + public BatchEndpointsClient getBatchEndpoints() { + return this.batchEndpoints; + } + + /** + * The BatchDeploymentsClient object to access its operations. + */ + private final BatchDeploymentsClient batchDeployments; + + /** + * Gets the BatchDeploymentsClient object to access its operations. + * + * @return the BatchDeploymentsClient object. + */ + public BatchDeploymentsClient getBatchDeployments() { + return this.batchDeployments; + } + + /** + * The CodeContainersClient object to access its operations. + */ + private final CodeContainersClient codeContainers; + + /** + * Gets the CodeContainersClient object to access its operations. + * + * @return the CodeContainersClient object. + */ + public CodeContainersClient getCodeContainers() { + return this.codeContainers; + } + + /** + * The CodeVersionsClient object to access its operations. + */ + private final CodeVersionsClient codeVersions; + + /** + * Gets the CodeVersionsClient object to access its operations. + * + * @return the CodeVersionsClient object. + */ + public CodeVersionsClient getCodeVersions() { + return this.codeVersions; + } + + /** + * The ComponentContainersClient object to access its operations. + */ + private final ComponentContainersClient componentContainers; + + /** + * Gets the ComponentContainersClient object to access its operations. + * + * @return the ComponentContainersClient object. + */ + public ComponentContainersClient getComponentContainers() { + return this.componentContainers; + } + + /** + * The ComponentVersionsClient object to access its operations. + */ + private final ComponentVersionsClient componentVersions; + + /** + * Gets the ComponentVersionsClient object to access its operations. + * + * @return the ComponentVersionsClient object. + */ + public ComponentVersionsClient getComponentVersions() { + return this.componentVersions; + } + + /** + * The DataContainersClient object to access its operations. + */ + private final DataContainersClient dataContainers; + + /** + * Gets the DataContainersClient object to access its operations. + * + * @return the DataContainersClient object. + */ + public DataContainersClient getDataContainers() { + return this.dataContainers; + } + + /** + * The DataVersionsClient object to access its operations. + */ + private final DataVersionsClient dataVersions; + + /** + * Gets the DataVersionsClient object to access its operations. + * + * @return the DataVersionsClient object. + */ + public DataVersionsClient getDataVersions() { + return this.dataVersions; + } + + /** + * The DatastoresClient object to access its operations. + */ + private final DatastoresClient datastores; + + /** + * Gets the DatastoresClient object to access its operations. + * + * @return the DatastoresClient object. + */ + public DatastoresClient getDatastores() { + return this.datastores; + } + + /** + * The EnvironmentContainersClient object to access its operations. + */ + private final EnvironmentContainersClient environmentContainers; + + /** + * Gets the EnvironmentContainersClient object to access its operations. + * + * @return the EnvironmentContainersClient object. + */ + public EnvironmentContainersClient getEnvironmentContainers() { + return this.environmentContainers; + } + + /** + * The EnvironmentVersionsClient object to access its operations. + */ + private final EnvironmentVersionsClient environmentVersions; + + /** + * Gets the EnvironmentVersionsClient object to access its operations. + * + * @return the EnvironmentVersionsClient object. + */ + public EnvironmentVersionsClient getEnvironmentVersions() { + return this.environmentVersions; + } + + /** + * The FeaturesetContainersClient object to access its operations. + */ + private final FeaturesetContainersClient featuresetContainers; + + /** + * Gets the FeaturesetContainersClient object to access its operations. + * + * @return the FeaturesetContainersClient object. + */ + public FeaturesetContainersClient getFeaturesetContainers() { + return this.featuresetContainers; + } + + /** + * The FeaturesClient object to access its operations. + */ + private final FeaturesClient features; + + /** + * Gets the FeaturesClient object to access its operations. + * + * @return the FeaturesClient object. + */ + public FeaturesClient getFeatures() { + return this.features; + } + + /** + * The FeaturesetVersionsClient object to access its operations. + */ + private final FeaturesetVersionsClient featuresetVersions; + + /** + * Gets the FeaturesetVersionsClient object to access its operations. + * + * @return the FeaturesetVersionsClient object. + */ + public FeaturesetVersionsClient getFeaturesetVersions() { + return this.featuresetVersions; + } + + /** + * The FeaturestoreEntityContainersClient object to access its operations. + */ + private final FeaturestoreEntityContainersClient featurestoreEntityContainers; + + /** + * Gets the FeaturestoreEntityContainersClient object to access its operations. + * + * @return the FeaturestoreEntityContainersClient object. + */ + public FeaturestoreEntityContainersClient getFeaturestoreEntityContainers() { + return this.featurestoreEntityContainers; + } + + /** + * The FeaturestoreEntityVersionsClient object to access its operations. + */ + private final FeaturestoreEntityVersionsClient featurestoreEntityVersions; + + /** + * Gets the FeaturestoreEntityVersionsClient object to access its operations. + * + * @return the FeaturestoreEntityVersionsClient object. + */ + public FeaturestoreEntityVersionsClient getFeaturestoreEntityVersions() { + return this.featurestoreEntityVersions; + } + + /** + * The JobsClient object to access its operations. + */ + private final JobsClient jobs; + + /** + * Gets the JobsClient object to access its operations. + * + * @return the JobsClient object. + */ + public JobsClient getJobs() { + return this.jobs; + } + + /** + * The ModelContainersClient object to access its operations. + */ + private final ModelContainersClient modelContainers; + + /** + * Gets the ModelContainersClient object to access its operations. + * + * @return the ModelContainersClient object. + */ + public ModelContainersClient getModelContainers() { + return this.modelContainers; + } + + /** + * The ModelVersionsClient object to access its operations. + */ + private final ModelVersionsClient modelVersions; + + /** + * Gets the ModelVersionsClient object to access its operations. + * + * @return the ModelVersionsClient object. + */ + public ModelVersionsClient getModelVersions() { + return this.modelVersions; + } + + /** + * The OnlineEndpointsClient object to access its operations. + */ + private final OnlineEndpointsClient onlineEndpoints; + + /** + * Gets the OnlineEndpointsClient object to access its operations. + * + * @return the OnlineEndpointsClient object. + */ + public OnlineEndpointsClient getOnlineEndpoints() { + return this.onlineEndpoints; + } + + /** + * The OnlineDeploymentsClient object to access its operations. + */ + private final OnlineDeploymentsClient onlineDeployments; + + /** + * Gets the OnlineDeploymentsClient object to access its operations. + * + * @return the OnlineDeploymentsClient object. + */ + public OnlineDeploymentsClient getOnlineDeployments() { + return this.onlineDeployments; + } + + /** + * The SchedulesClient object to access its operations. + */ + private final SchedulesClient schedules; + + /** + * Gets the SchedulesClient object to access its operations. + * + * @return the SchedulesClient object. + */ + public SchedulesClient getSchedules() { + return this.schedules; + } + + /** + * The ServerlessEndpointsClient object to access its operations. + */ + private final ServerlessEndpointsClient serverlessEndpoints; + + /** + * Gets the ServerlessEndpointsClient object to access its operations. + * + * @return the ServerlessEndpointsClient object. + */ + public ServerlessEndpointsClient getServerlessEndpoints() { + return this.serverlessEndpoints; + } + + /** + * The RegistriesClient object to access its operations. + */ + private final RegistriesClient registries; + + /** + * Gets the RegistriesClient object to access its operations. + * + * @return the RegistriesClient object. + */ + public RegistriesClient getRegistries() { + return this.registries; + } + + /** + * The WorkspaceFeaturesClient object to access its operations. + */ + private final WorkspaceFeaturesClient workspaceFeatures; + + /** + * Gets the WorkspaceFeaturesClient object to access its operations. + * + * @return the WorkspaceFeaturesClient object. + */ + public WorkspaceFeaturesClient getWorkspaceFeatures() { + return this.workspaceFeatures; + } + + /** + * Initializes an instance of AzureMachineLearningServices client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId The ID of the target subscription. + * @param endpoint server parameter. + */ + AzureMachineLearningServicesImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2024-07-01-preview"; + this.operations = new OperationsClientImpl(this); + this.workspaces = new WorkspacesClientImpl(this); + this.usages = new UsagesClientImpl(this); + this.virtualMachineSizes = new VirtualMachineSizesClientImpl(this); + this.quotas = new QuotasClientImpl(this); + this.computes = new ComputesClientImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); + this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); + this.workspaceConnections = new WorkspaceConnectionsClientImpl(this); + this.managedNetworkSettingsRules = new ManagedNetworkSettingsRulesClientImpl(this); + this.managedNetworkProvisions = new ManagedNetworkProvisionsClientImpl(this); + this.registryCodeContainers = new RegistryCodeContainersClientImpl(this); + this.registryCodeVersions = new RegistryCodeVersionsClientImpl(this); + this.registryComponentContainers = new RegistryComponentContainersClientImpl(this); + this.registryComponentVersions = new RegistryComponentVersionsClientImpl(this); + this.registryDataContainers = new RegistryDataContainersClientImpl(this); + this.registryDataVersions = new RegistryDataVersionsClientImpl(this); + this.registryDataReferences = new RegistryDataReferencesClientImpl(this); + this.registryEnvironmentContainers = new RegistryEnvironmentContainersClientImpl(this); + this.registryEnvironmentVersions = new RegistryEnvironmentVersionsClientImpl(this); + this.marketplaceSubscriptions = new MarketplaceSubscriptionsClientImpl(this); + this.registryModelContainers = new RegistryModelContainersClientImpl(this); + this.registryModelVersions = new RegistryModelVersionsClientImpl(this); + this.batchEndpoints = new BatchEndpointsClientImpl(this); + this.batchDeployments = new BatchDeploymentsClientImpl(this); + this.codeContainers = new CodeContainersClientImpl(this); + this.codeVersions = new CodeVersionsClientImpl(this); + this.componentContainers = new ComponentContainersClientImpl(this); + this.componentVersions = new ComponentVersionsClientImpl(this); + this.dataContainers = new DataContainersClientImpl(this); + this.dataVersions = new DataVersionsClientImpl(this); + this.datastores = new DatastoresClientImpl(this); + this.environmentContainers = new EnvironmentContainersClientImpl(this); + this.environmentVersions = new EnvironmentVersionsClientImpl(this); + this.featuresetContainers = new FeaturesetContainersClientImpl(this); + this.features = new FeaturesClientImpl(this); + this.featuresetVersions = new FeaturesetVersionsClientImpl(this); + this.featurestoreEntityContainers = new FeaturestoreEntityContainersClientImpl(this); + this.featurestoreEntityVersions = new FeaturestoreEntityVersionsClientImpl(this); + this.jobs = new JobsClientImpl(this); + this.modelContainers = new ModelContainersClientImpl(this); + this.modelVersions = new ModelVersionsClientImpl(this); + this.onlineEndpoints = new OnlineEndpointsClientImpl(this); + this.onlineDeployments = new OnlineDeploymentsClientImpl(this); + this.schedules = new SchedulesClientImpl(this); + this.serverlessEndpoints = new ServerlessEndpointsClientImpl(this); + this.registries = new RegistriesClientImpl(this); + this.workspaceFeatures = new WorkspaceFeaturesClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + return CoreUtils.mergeContexts(this.getContext(), context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult(Mono>> activationResponse, + HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { + return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, activationResponse, context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), + lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = this.getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(HttpHeaderName.fromString(s)); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AzureMachineLearningServicesImpl.class); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AzureMachineLearningWorkspacesBuilder.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AzureMachineLearningWorkspacesBuilder.java deleted file mode 100644 index 018c1d288b6ac..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AzureMachineLearningWorkspacesBuilder.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.implementation; - -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerAdapter; -import java.time.Duration; - -/** A builder for creating a new instance of the AzureMachineLearningWorkspacesImpl type. */ -@ServiceClientBuilder(serviceClients = {AzureMachineLearningWorkspacesImpl.class}) -public final class AzureMachineLearningWorkspacesBuilder { - /* - * The ID of the target subscription. - */ - private String subscriptionId; - - /** - * Sets The ID of the target subscription. - * - * @param subscriptionId the subscriptionId value. - * @return the AzureMachineLearningWorkspacesBuilder. - */ - public AzureMachineLearningWorkspacesBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /* - * server parameter - */ - private String endpoint; - - /** - * Sets server parameter. - * - * @param endpoint the endpoint value. - * @return the AzureMachineLearningWorkspacesBuilder. - */ - public AzureMachineLearningWorkspacesBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * The environment to connect to - */ - private AzureEnvironment environment; - - /** - * Sets The environment to connect to. - * - * @param environment the environment value. - * @return the AzureMachineLearningWorkspacesBuilder. - */ - public AzureMachineLearningWorkspacesBuilder environment(AzureEnvironment environment) { - this.environment = environment; - return this; - } - - /* - * The HTTP pipeline to send requests through - */ - private HttpPipeline pipeline; - - /** - * Sets The HTTP pipeline to send requests through. - * - * @param pipeline the pipeline value. - * @return the AzureMachineLearningWorkspacesBuilder. - */ - public AzureMachineLearningWorkspacesBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The default poll interval for long-running operation - */ - private Duration defaultPollInterval; - - /** - * Sets The default poll interval for long-running operation. - * - * @param defaultPollInterval the defaultPollInterval value. - * @return the AzureMachineLearningWorkspacesBuilder. - */ - public AzureMachineLearningWorkspacesBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; - return this; - } - - /* - * The serializer to serialize an object into a string - */ - private SerializerAdapter serializerAdapter; - - /** - * Sets The serializer to serialize an object into a string. - * - * @param serializerAdapter the serializerAdapter value. - * @return the AzureMachineLearningWorkspacesBuilder. - */ - public AzureMachineLearningWorkspacesBuilder serializerAdapter(SerializerAdapter serializerAdapter) { - this.serializerAdapter = serializerAdapter; - return this; - } - - /** - * Builds an instance of AzureMachineLearningWorkspacesImpl with the provided parameters. - * - * @return an instance of AzureMachineLearningWorkspacesImpl. - */ - public AzureMachineLearningWorkspacesImpl buildClient() { - String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; - AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; - HttpPipeline localPipeline = - (pipeline != null) - ? pipeline - : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); - Duration localDefaultPollInterval = - (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); - SerializerAdapter localSerializerAdapter = - (serializerAdapter != null) - ? serializerAdapter - : SerializerFactory.createDefaultManagementSerializerAdapter(); - AzureMachineLearningWorkspacesImpl client = - new AzureMachineLearningWorkspacesImpl( - localPipeline, - localSerializerAdapter, - localDefaultPollInterval, - localEnvironment, - subscriptionId, - localEndpoint); - return client; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AzureMachineLearningWorkspacesImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AzureMachineLearningWorkspacesImpl.java deleted file mode 100644 index 242efe7553fdd..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/AzureMachineLearningWorkspacesImpl.java +++ /dev/null @@ -1,654 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.implementation; - -import com.azure.core.annotation.ServiceClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.Response; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.management.polling.PollerFactory; -import com.azure.core.util.Context; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.AsyncPollResponse; -import com.azure.core.util.polling.LongRunningOperationStatus; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.machinelearning.fluent.AzureMachineLearningWorkspaces; -import com.azure.resourcemanager.machinelearning.fluent.BatchDeploymentsClient; -import com.azure.resourcemanager.machinelearning.fluent.BatchEndpointsClient; -import com.azure.resourcemanager.machinelearning.fluent.CodeContainersClient; -import com.azure.resourcemanager.machinelearning.fluent.CodeVersionsClient; -import com.azure.resourcemanager.machinelearning.fluent.ComponentContainersClient; -import com.azure.resourcemanager.machinelearning.fluent.ComponentVersionsClient; -import com.azure.resourcemanager.machinelearning.fluent.ComputesClient; -import com.azure.resourcemanager.machinelearning.fluent.DataContainersClient; -import com.azure.resourcemanager.machinelearning.fluent.DataVersionsClient; -import com.azure.resourcemanager.machinelearning.fluent.DatastoresClient; -import com.azure.resourcemanager.machinelearning.fluent.EnvironmentContainersClient; -import com.azure.resourcemanager.machinelearning.fluent.EnvironmentVersionsClient; -import com.azure.resourcemanager.machinelearning.fluent.JobsClient; -import com.azure.resourcemanager.machinelearning.fluent.ModelContainersClient; -import com.azure.resourcemanager.machinelearning.fluent.ModelVersionsClient; -import com.azure.resourcemanager.machinelearning.fluent.OnlineDeploymentsClient; -import com.azure.resourcemanager.machinelearning.fluent.OnlineEndpointsClient; -import com.azure.resourcemanager.machinelearning.fluent.OperationsClient; -import com.azure.resourcemanager.machinelearning.fluent.PrivateEndpointConnectionsClient; -import com.azure.resourcemanager.machinelearning.fluent.PrivateLinkResourcesClient; -import com.azure.resourcemanager.machinelearning.fluent.QuotasClient; -import com.azure.resourcemanager.machinelearning.fluent.SchedulesClient; -import com.azure.resourcemanager.machinelearning.fluent.UsagesClient; -import com.azure.resourcemanager.machinelearning.fluent.VirtualMachineSizesClient; -import com.azure.resourcemanager.machinelearning.fluent.WorkspaceConnectionsClient; -import com.azure.resourcemanager.machinelearning.fluent.WorkspaceFeaturesClient; -import com.azure.resourcemanager.machinelearning.fluent.WorkspacesClient; -import java.io.IOException; -import java.lang.reflect.Type; -import java.nio.ByteBuffer; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.time.Duration; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the AzureMachineLearningWorkspacesImpl type. */ -@ServiceClient(builder = AzureMachineLearningWorkspacesBuilder.class) -public final class AzureMachineLearningWorkspacesImpl implements AzureMachineLearningWorkspaces { - /** The ID of the target subscription. */ - private final String subscriptionId; - - /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** server parameter. */ - private final String endpoint; - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** Api Version. */ - private final String apiVersion; - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - public String getApiVersion() { - return this.apiVersion; - } - - /** The HTTP pipeline to send requests through. */ - private final HttpPipeline httpPipeline; - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - public HttpPipeline getHttpPipeline() { - return this.httpPipeline; - } - - /** The serializer to serialize an object into a string. */ - private final SerializerAdapter serializerAdapter; - - /** - * Gets The serializer to serialize an object into a string. - * - * @return the serializerAdapter value. - */ - SerializerAdapter getSerializerAdapter() { - return this.serializerAdapter; - } - - /** The default poll interval for long-running operation. */ - private final Duration defaultPollInterval; - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - public Duration getDefaultPollInterval() { - return this.defaultPollInterval; - } - - /** The OperationsClient object to access its operations. */ - private final OperationsClient operations; - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - public OperationsClient getOperations() { - return this.operations; - } - - /** The WorkspacesClient object to access its operations. */ - private final WorkspacesClient workspaces; - - /** - * Gets the WorkspacesClient object to access its operations. - * - * @return the WorkspacesClient object. - */ - public WorkspacesClient getWorkspaces() { - return this.workspaces; - } - - /** The UsagesClient object to access its operations. */ - private final UsagesClient usages; - - /** - * Gets the UsagesClient object to access its operations. - * - * @return the UsagesClient object. - */ - public UsagesClient getUsages() { - return this.usages; - } - - /** The VirtualMachineSizesClient object to access its operations. */ - private final VirtualMachineSizesClient virtualMachineSizes; - - /** - * Gets the VirtualMachineSizesClient object to access its operations. - * - * @return the VirtualMachineSizesClient object. - */ - public VirtualMachineSizesClient getVirtualMachineSizes() { - return this.virtualMachineSizes; - } - - /** The QuotasClient object to access its operations. */ - private final QuotasClient quotas; - - /** - * Gets the QuotasClient object to access its operations. - * - * @return the QuotasClient object. - */ - public QuotasClient getQuotas() { - return this.quotas; - } - - /** The ComputesClient object to access its operations. */ - private final ComputesClient computes; - - /** - * Gets the ComputesClient object to access its operations. - * - * @return the ComputesClient object. - */ - public ComputesClient getComputes() { - return this.computes; - } - - /** The PrivateEndpointConnectionsClient object to access its operations. */ - private final PrivateEndpointConnectionsClient privateEndpointConnections; - - /** - * Gets the PrivateEndpointConnectionsClient object to access its operations. - * - * @return the PrivateEndpointConnectionsClient object. - */ - public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { - return this.privateEndpointConnections; - } - - /** The PrivateLinkResourcesClient object to access its operations. */ - private final PrivateLinkResourcesClient privateLinkResources; - - /** - * Gets the PrivateLinkResourcesClient object to access its operations. - * - * @return the PrivateLinkResourcesClient object. - */ - public PrivateLinkResourcesClient getPrivateLinkResources() { - return this.privateLinkResources; - } - - /** The WorkspaceConnectionsClient object to access its operations. */ - private final WorkspaceConnectionsClient workspaceConnections; - - /** - * Gets the WorkspaceConnectionsClient object to access its operations. - * - * @return the WorkspaceConnectionsClient object. - */ - public WorkspaceConnectionsClient getWorkspaceConnections() { - return this.workspaceConnections; - } - - /** The BatchEndpointsClient object to access its operations. */ - private final BatchEndpointsClient batchEndpoints; - - /** - * Gets the BatchEndpointsClient object to access its operations. - * - * @return the BatchEndpointsClient object. - */ - public BatchEndpointsClient getBatchEndpoints() { - return this.batchEndpoints; - } - - /** The BatchDeploymentsClient object to access its operations. */ - private final BatchDeploymentsClient batchDeployments; - - /** - * Gets the BatchDeploymentsClient object to access its operations. - * - * @return the BatchDeploymentsClient object. - */ - public BatchDeploymentsClient getBatchDeployments() { - return this.batchDeployments; - } - - /** The CodeContainersClient object to access its operations. */ - private final CodeContainersClient codeContainers; - - /** - * Gets the CodeContainersClient object to access its operations. - * - * @return the CodeContainersClient object. - */ - public CodeContainersClient getCodeContainers() { - return this.codeContainers; - } - - /** The CodeVersionsClient object to access its operations. */ - private final CodeVersionsClient codeVersions; - - /** - * Gets the CodeVersionsClient object to access its operations. - * - * @return the CodeVersionsClient object. - */ - public CodeVersionsClient getCodeVersions() { - return this.codeVersions; - } - - /** The ComponentContainersClient object to access its operations. */ - private final ComponentContainersClient componentContainers; - - /** - * Gets the ComponentContainersClient object to access its operations. - * - * @return the ComponentContainersClient object. - */ - public ComponentContainersClient getComponentContainers() { - return this.componentContainers; - } - - /** The ComponentVersionsClient object to access its operations. */ - private final ComponentVersionsClient componentVersions; - - /** - * Gets the ComponentVersionsClient object to access its operations. - * - * @return the ComponentVersionsClient object. - */ - public ComponentVersionsClient getComponentVersions() { - return this.componentVersions; - } - - /** The DataContainersClient object to access its operations. */ - private final DataContainersClient dataContainers; - - /** - * Gets the DataContainersClient object to access its operations. - * - * @return the DataContainersClient object. - */ - public DataContainersClient getDataContainers() { - return this.dataContainers; - } - - /** The DataVersionsClient object to access its operations. */ - private final DataVersionsClient dataVersions; - - /** - * Gets the DataVersionsClient object to access its operations. - * - * @return the DataVersionsClient object. - */ - public DataVersionsClient getDataVersions() { - return this.dataVersions; - } - - /** The DatastoresClient object to access its operations. */ - private final DatastoresClient datastores; - - /** - * Gets the DatastoresClient object to access its operations. - * - * @return the DatastoresClient object. - */ - public DatastoresClient getDatastores() { - return this.datastores; - } - - /** The EnvironmentContainersClient object to access its operations. */ - private final EnvironmentContainersClient environmentContainers; - - /** - * Gets the EnvironmentContainersClient object to access its operations. - * - * @return the EnvironmentContainersClient object. - */ - public EnvironmentContainersClient getEnvironmentContainers() { - return this.environmentContainers; - } - - /** The EnvironmentVersionsClient object to access its operations. */ - private final EnvironmentVersionsClient environmentVersions; - - /** - * Gets the EnvironmentVersionsClient object to access its operations. - * - * @return the EnvironmentVersionsClient object. - */ - public EnvironmentVersionsClient getEnvironmentVersions() { - return this.environmentVersions; - } - - /** The JobsClient object to access its operations. */ - private final JobsClient jobs; - - /** - * Gets the JobsClient object to access its operations. - * - * @return the JobsClient object. - */ - public JobsClient getJobs() { - return this.jobs; - } - - /** The ModelContainersClient object to access its operations. */ - private final ModelContainersClient modelContainers; - - /** - * Gets the ModelContainersClient object to access its operations. - * - * @return the ModelContainersClient object. - */ - public ModelContainersClient getModelContainers() { - return this.modelContainers; - } - - /** The ModelVersionsClient object to access its operations. */ - private final ModelVersionsClient modelVersions; - - /** - * Gets the ModelVersionsClient object to access its operations. - * - * @return the ModelVersionsClient object. - */ - public ModelVersionsClient getModelVersions() { - return this.modelVersions; - } - - /** The OnlineEndpointsClient object to access its operations. */ - private final OnlineEndpointsClient onlineEndpoints; - - /** - * Gets the OnlineEndpointsClient object to access its operations. - * - * @return the OnlineEndpointsClient object. - */ - public OnlineEndpointsClient getOnlineEndpoints() { - return this.onlineEndpoints; - } - - /** The OnlineDeploymentsClient object to access its operations. */ - private final OnlineDeploymentsClient onlineDeployments; - - /** - * Gets the OnlineDeploymentsClient object to access its operations. - * - * @return the OnlineDeploymentsClient object. - */ - public OnlineDeploymentsClient getOnlineDeployments() { - return this.onlineDeployments; - } - - /** The SchedulesClient object to access its operations. */ - private final SchedulesClient schedules; - - /** - * Gets the SchedulesClient object to access its operations. - * - * @return the SchedulesClient object. - */ - public SchedulesClient getSchedules() { - return this.schedules; - } - - /** The WorkspaceFeaturesClient object to access its operations. */ - private final WorkspaceFeaturesClient workspaceFeatures; - - /** - * Gets the WorkspaceFeaturesClient object to access its operations. - * - * @return the WorkspaceFeaturesClient object. - */ - public WorkspaceFeaturesClient getWorkspaceFeatures() { - return this.workspaceFeatures; - } - - /** - * Initializes an instance of AzureMachineLearningWorkspaces client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param serializerAdapter The serializer to serialize an object into a string. - * @param defaultPollInterval The default poll interval for long-running operation. - * @param environment The Azure environment. - * @param subscriptionId The ID of the target subscription. - * @param endpoint server parameter. - */ - AzureMachineLearningWorkspacesImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - Duration defaultPollInterval, - AzureEnvironment environment, - String subscriptionId, - String endpoint) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.apiVersion = "2022-10-01"; - this.operations = new OperationsClientImpl(this); - this.workspaces = new WorkspacesClientImpl(this); - this.usages = new UsagesClientImpl(this); - this.virtualMachineSizes = new VirtualMachineSizesClientImpl(this); - this.quotas = new QuotasClientImpl(this); - this.computes = new ComputesClientImpl(this); - this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); - this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); - this.workspaceConnections = new WorkspaceConnectionsClientImpl(this); - this.batchEndpoints = new BatchEndpointsClientImpl(this); - this.batchDeployments = new BatchDeploymentsClientImpl(this); - this.codeContainers = new CodeContainersClientImpl(this); - this.codeVersions = new CodeVersionsClientImpl(this); - this.componentContainers = new ComponentContainersClientImpl(this); - this.componentVersions = new ComponentVersionsClientImpl(this); - this.dataContainers = new DataContainersClientImpl(this); - this.dataVersions = new DataVersionsClientImpl(this); - this.datastores = new DatastoresClientImpl(this); - this.environmentContainers = new EnvironmentContainersClientImpl(this); - this.environmentVersions = new EnvironmentVersionsClientImpl(this); - this.jobs = new JobsClientImpl(this); - this.modelContainers = new ModelContainersClientImpl(this); - this.modelVersions = new ModelVersionsClientImpl(this); - this.onlineEndpoints = new OnlineEndpointsClientImpl(this); - this.onlineDeployments = new OnlineDeploymentsClientImpl(this); - this.schedules = new SchedulesClientImpl(this); - this.workspaceFeatures = new WorkspaceFeaturesClientImpl(this); - } - - /** - * Gets default client context. - * - * @return the default client context. - */ - public Context getContext() { - return Context.NONE; - } - - /** - * Merges default client context with provided context. - * - * @param context the context to be merged with default client context. - * @return the merged context. - */ - public Context mergeContext(Context context) { - return CoreUtils.mergeContexts(this.getContext(), context); - } - - /** - * Gets long running operation result. - * - * @param activationResponse the response of activation operation. - * @param httpPipeline the http pipeline. - * @param pollResultType type of poll result. - * @param finalResultType type of final result. - * @param context the context shared by all requests. - * @param type of poll result. - * @param type of final result. - * @return poller flux for poll result and final result. - */ - public PollerFlux, U> getLroResult( - Mono>> activationResponse, - HttpPipeline httpPipeline, - Type pollResultType, - Type finalResultType, - Context context) { - return PollerFactory - .create( - serializerAdapter, - httpPipeline, - pollResultType, - finalResultType, - defaultPollInterval, - activationResponse, - context); - } - - /** - * Gets the final result, or an error, based on last async poll response. - * - * @param response the last async poll response. - * @param type of poll result. - * @param type of final result. - * @return the final result, or an error. - */ - public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { - if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { - String errorMessage; - ManagementError managementError = null; - HttpResponse errorResponse = null; - PollResult.Error lroError = response.getValue().getError(); - if (lroError != null) { - errorResponse = - new HttpResponseImpl( - lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); - - errorMessage = response.getValue().getError().getMessage(); - String errorBody = response.getValue().getError().getResponseBody(); - if (errorBody != null) { - // try to deserialize error body to ManagementError - try { - managementError = - this - .getSerializerAdapter() - .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); - if (managementError.getCode() == null || managementError.getMessage() == null) { - managementError = null; - } - } catch (IOException | RuntimeException ioe) { - LOGGER.logThrowableAsWarning(ioe); - } - } - } else { - // fallback to default error message - errorMessage = "Long running operation failed."; - } - if (managementError == null) { - // fallback to default ManagementError - managementError = new ManagementError(response.getStatus().toString(), errorMessage); - } - return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); - } else { - return response.getFinalResult(); - } - } - - private static final class HttpResponseImpl extends HttpResponse { - private final int statusCode; - - private final byte[] responseBody; - - private final HttpHeaders httpHeaders; - - HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { - super(null); - this.statusCode = statusCode; - this.httpHeaders = httpHeaders; - this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); - } - - public int getStatusCode() { - return statusCode; - } - - public String getHeaderValue(String s) { - return httpHeaders.getValue(s); - } - - public HttpHeaders getHeaders() { - return httpHeaders; - } - - public Flux getBody() { - return Flux.just(ByteBuffer.wrap(responseBody)); - } - - public Mono getBodyAsByteArray() { - return Mono.just(responseBody); - } - - public Mono getBodyAsString() { - return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); - } - - public Mono getBodyAsString(Charset charset) { - return Mono.just(new String(responseBody, charset)); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AzureMachineLearningWorkspacesImpl.class); -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/BatchDeploymentImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/BatchDeploymentImpl.java index 379a98ca04ceb..91b616906e5f0 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/BatchDeploymentImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/BatchDeploymentImpl.java @@ -97,8 +97,8 @@ private com.azure.resourcemanager.machinelearning.MachineLearningManager manager private PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties updateBody; - public BatchDeploymentImpl withExistingBatchEndpoint( - String resourceGroupName, String workspaceName, String endpointName) { + public BatchDeploymentImpl withExistingBatchEndpoint(String resourceGroupName, String workspaceName, + String endpointName) { this.resourceGroupName = resourceGroupName; this.workspaceName = workspaceName; this.endpointName = endpointName; @@ -106,22 +106,17 @@ public BatchDeploymentImpl withExistingBatchEndpoint( } public BatchDeployment create() { - this.innerObject = - serviceManager - .serviceClient() - .getBatchDeployments() - .createOrUpdate( - resourceGroupName, workspaceName, endpointName, deploymentName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getBatchDeployments() + .createOrUpdate(resourceGroupName, workspaceName, endpointName, deploymentName, this.innerModel(), + Context.NONE); return this; } public BatchDeployment create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getBatchDeployments() - .createOrUpdate( - resourceGroupName, workspaceName, endpointName, deploymentName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient() + .getBatchDeployments() + .createOrUpdate(resourceGroupName, workspaceName, endpointName, deploymentName, this.innerModel(), context); return this; } @@ -137,51 +132,42 @@ public BatchDeploymentImpl update() { } public BatchDeployment apply() { - this.innerObject = - serviceManager - .serviceClient() - .getBatchDeployments() - .update(resourceGroupName, workspaceName, endpointName, deploymentName, updateBody, Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getBatchDeployments() + .update(resourceGroupName, workspaceName, endpointName, deploymentName, updateBody, Context.NONE); return this; } public BatchDeployment apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getBatchDeployments() - .update(resourceGroupName, workspaceName, endpointName, deploymentName, updateBody, context); + this.innerObject = serviceManager.serviceClient() + .getBatchDeployments() + .update(resourceGroupName, workspaceName, endpointName, deploymentName, updateBody, context); return this; } - BatchDeploymentImpl( - BatchDeploymentInner innerObject, + BatchDeploymentImpl(BatchDeploymentInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); - this.endpointName = Utils.getValueFromIdByName(innerObject.id(), "batchEndpoints"); - this.deploymentName = Utils.getValueFromIdByName(innerObject.id(), "deployments"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.endpointName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "batchEndpoints"); + this.deploymentName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "deployments"); } public BatchDeployment refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getBatchDeployments() - .getWithResponse(resourceGroupName, workspaceName, endpointName, deploymentName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getBatchDeployments() + .getWithResponse(resourceGroupName, workspaceName, endpointName, deploymentName, Context.NONE) + .getValue(); return this; } public BatchDeployment refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getBatchDeployments() - .getWithResponse(resourceGroupName, workspaceName, endpointName, deploymentName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getBatchDeployments() + .getWithResponse(resourceGroupName, workspaceName, endpointName, deploymentName, context) + .getValue(); return this; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/BatchDeploymentsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/BatchDeploymentsClientImpl.java index 6f28d675f5f5a..06cbc420d0ef5 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/BatchDeploymentsClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/BatchDeploymentsClientImpl.java @@ -40,140 +40,104 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in BatchDeploymentsClient. */ +/** + * An instance of this class provides access to all the operations defined in BatchDeploymentsClient. + */ public final class BatchDeploymentsClientImpl implements BatchDeploymentsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final BatchDeploymentsService service; - /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of BatchDeploymentsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ - BatchDeploymentsClientImpl(AzureMachineLearningWorkspacesImpl client) { - this.service = - RestProxy.create(BatchDeploymentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + BatchDeploymentsClientImpl(AzureMachineLearningServicesImpl client) { + this.service + = RestProxy.create(BatchDeploymentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesBatchDeployments to be used by the - * proxy service to perform REST calls. + * The interface defining all the services for AzureMachineLearningServicesBatchDeployments to be used by the proxy + * service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AzureMachineLearning") public interface BatchDeploymentsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}" - + "/deployments") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, + Mono> list(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("endpointName") String endpointName, - @QueryParam("api-version") String apiVersion, - @QueryParam("$orderBy") String orderBy, - @QueryParam("$top") Integer top, - @QueryParam("$skip") String skip, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("endpointName") String endpointName, @QueryParam("api-version") String apiVersion, + @QueryParam("$orderBy") String orderBy, @QueryParam("$top") Integer top, @QueryParam("$skip") String skip, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}" - + "/deployments/{deploymentName}") - @ExpectedResponses({200, 202, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}") + @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, + Mono>> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("endpointName") String endpointName, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("endpointName") String endpointName, @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}" - + "/deployments/{deploymentName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("endpointName") String endpointName, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("endpointName") String endpointName, @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}" - + "/deployments/{deploymentName}") - @ExpectedResponses({200, 202}) + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, + Mono>> update(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("endpointName") String endpointName, - @PathParam("deploymentName") String deploymentName, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("endpointName") String endpointName, @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties body, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}" - + "/deployments/{deploymentName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, + Mono>> createOrUpdate(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("endpointName") String endpointName, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") BatchDeploymentInner body, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("endpointName") String endpointName, @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") BatchDeploymentInner body, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Lists Batch inference deployments in the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Endpoint name. @@ -184,22 +148,18 @@ Mono> listNext( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of BatchDeployment entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String workspaceName, String endpointName, String orderBy, Integer top, String skip) { + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, String endpointName, String orderBy, Integer top, String skip) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -214,35 +174,16 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - this.client.getApiVersion(), - orderBy, - top, - skip, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, endpointName, this.client.getApiVersion(), orderBy, top, skip, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Lists Batch inference deployments in the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Endpoint name. @@ -254,28 +195,18 @@ private Mono> listSinglePageAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of BatchDeployment entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - String orderBy, - Integer top, - String skip, - Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, String endpointName, String orderBy, Integer top, String skip, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -290,32 +221,15 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - this.client.getApiVersion(), - orderBy, - top, - skip, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + endpointName, this.client.getApiVersion(), orderBy, top, skip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Lists Batch inference deployments in the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Endpoint name. @@ -328,8 +242,8 @@ private Mono> listSinglePageAsync( * @return a paginated list of BatchDeployment entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String workspaceName, String endpointName, String orderBy, Integer top, String skip) { + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + String endpointName, String orderBy, Integer top, String skip) { return new PagedFlux<>( () -> listSinglePageAsync(resourceGroupName, workspaceName, endpointName, orderBy, top, skip), nextLink -> listNextSinglePageAsync(nextLink)); @@ -337,7 +251,7 @@ private PagedFlux listAsync( /** * Lists Batch inference deployments in the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Endpoint name. @@ -347,8 +261,8 @@ private PagedFlux listAsync( * @return a paginated list of BatchDeployment entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String workspaceName, String endpointName) { + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + String endpointName) { final String orderBy = null; final Integer top = null; final String skip = null; @@ -359,7 +273,7 @@ private PagedFlux listAsync( /** * Lists Batch inference deployments in the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Endpoint name. @@ -373,14 +287,8 @@ private PagedFlux listAsync( * @return a paginated list of BatchDeployment entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - String orderBy, - Integer top, - String skip, - Context context) { + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + String endpointName, String orderBy, Integer top, String skip, Context context) { return new PagedFlux<>( () -> listSinglePageAsync(resourceGroupName, workspaceName, endpointName, orderBy, top, skip, context), nextLink -> listNextSinglePageAsync(nextLink, context)); @@ -388,7 +296,7 @@ private PagedFlux listAsync( /** * Lists Batch inference deployments in the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Endpoint name. @@ -398,8 +306,8 @@ private PagedFlux listAsync( * @return a paginated list of BatchDeployment entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String workspaceName, String endpointName) { + public PagedIterable list(String resourceGroupName, String workspaceName, + String endpointName) { final String orderBy = null; final Integer top = null; final String skip = null; @@ -408,7 +316,7 @@ public PagedIterable list( /** * Lists Batch inference deployments in the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Endpoint name. @@ -422,21 +330,15 @@ public PagedIterable list( * @return a paginated list of BatchDeployment entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, - String workspaceName, - String endpointName, - String orderBy, - Integer top, - String skip, - Context context) { + public PagedIterable list(String resourceGroupName, String workspaceName, String endpointName, + String orderBy, Integer top, String skip, Context context) { return new PagedIterable<>( listAsync(resourceGroupName, workspaceName, endpointName, orderBy, top, skip, context)); } /** * Delete Batch Inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Endpoint name. @@ -447,19 +349,15 @@ public PagedIterable list( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String endpointName, String deploymentName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -477,24 +375,14 @@ private Mono>> deleteWithResponseAsync( final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - deploymentName, - this.client.getApiVersion(), - accept, - context)) + context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, endpointName, deploymentName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete Batch Inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Endpoint name. @@ -506,19 +394,15 @@ private Mono>> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String endpointName, String deploymentName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -535,22 +419,13 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - deploymentName, - this.client.getApiVersion(), - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, endpointName, deploymentName, this.client.getApiVersion(), accept, context); } /** * Delete Batch Inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Endpoint name. @@ -561,19 +436,17 @@ private Mono>> deleteWithResponseAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, workspaceName, endpointName, deploymentName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, + String endpointName, String deploymentName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, workspaceName, endpointName, deploymentName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Delete Batch Inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Endpoint name. @@ -585,19 +458,18 @@ private PollerFlux, Void> beginDeleteAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName, Context context) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, + String endpointName, String deploymentName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, workspaceName, endpointName, deploymentName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, workspaceName, endpointName, deploymentName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** * Delete Batch Inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Endpoint name. @@ -608,14 +480,14 @@ private PollerFlux, Void> beginDeleteAsync( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName) { + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, + String endpointName, String deploymentName) { return this.beginDeleteAsync(resourceGroupName, workspaceName, endpointName, deploymentName).getSyncPoller(); } /** * Delete Batch Inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Endpoint name. @@ -627,16 +499,15 @@ public SyncPoller, Void> beginDelete( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName, Context context) { - return this - .beginDeleteAsync(resourceGroupName, workspaceName, endpointName, deploymentName, context) + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, + String endpointName, String deploymentName, Context context) { + return this.beginDeleteAsync(resourceGroupName, workspaceName, endpointName, deploymentName, context) .getSyncPoller(); } /** * Delete Batch Inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Endpoint name. @@ -647,16 +518,15 @@ public SyncPoller, Void> beginDelete( * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName) { - return beginDeleteAsync(resourceGroupName, workspaceName, endpointName, deploymentName) - .last() + private Mono deleteAsync(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName) { + return beginDeleteAsync(resourceGroupName, workspaceName, endpointName, deploymentName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete Batch Inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Endpoint name. @@ -668,16 +538,15 @@ private Mono deleteAsync( * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName, Context context) { - return beginDeleteAsync(resourceGroupName, workspaceName, endpointName, deploymentName, context) - .last() + private Mono deleteAsync(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, endpointName, deploymentName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete Batch Inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Endpoint name. @@ -693,7 +562,7 @@ public void delete(String resourceGroupName, String workspaceName, String endpoi /** * Delete Batch Inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Endpoint name. @@ -704,14 +573,14 @@ public void delete(String resourceGroupName, String workspaceName, String endpoi * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName, Context context) { + public void delete(String resourceGroupName, String workspaceName, String endpointName, String deploymentName, + Context context) { deleteAsync(resourceGroupName, workspaceName, endpointName, deploymentName, context).block(); } /** * Gets a batch inference deployment by id. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Endpoint name. @@ -722,19 +591,15 @@ public void delete( * @return a batch inference deployment by id along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String endpointName, String deploymentName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -752,24 +617,14 @@ private Mono> getWithResponseAsync( final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - deploymentName, - this.client.getApiVersion(), - accept, - context)) + context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, endpointName, deploymentName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets a batch inference deployment by id. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Endpoint name. @@ -781,19 +636,15 @@ private Mono> getWithResponseAsync( * @return a batch inference deployment by id along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String endpointName, String deploymentName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -810,22 +661,13 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - deploymentName, - this.client.getApiVersion(), - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + endpointName, deploymentName, this.client.getApiVersion(), accept, context); } /** * Gets a batch inference deployment by id. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Endpoint name. @@ -836,15 +678,15 @@ private Mono> getWithResponseAsync( * @return a batch inference deployment by id on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName) { + private Mono getAsync(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName) { return getWithResponseAsync(resourceGroupName, workspaceName, endpointName, deploymentName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets a batch inference deployment by id. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Endpoint name. @@ -856,14 +698,14 @@ private Mono getAsync( * @return a batch inference deployment by id along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName, Context context) { + public Response getWithResponse(String resourceGroupName, String workspaceName, + String endpointName, String deploymentName, Context context) { return getWithResponseAsync(resourceGroupName, workspaceName, endpointName, deploymentName, context).block(); } /** * Gets a batch inference deployment by id. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Endpoint name. @@ -874,14 +716,14 @@ public Response getWithResponse( * @return a batch inference deployment by id. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BatchDeploymentInner get( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName) { + public BatchDeploymentInner get(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName) { return getWithResponse(resourceGroupName, workspaceName, endpointName, deploymentName, Context.NONE).getValue(); } /** * Update a batch inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -893,23 +735,16 @@ public BatchDeploymentInner get( * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, + private Mono>> updateWithResponseAsync(String resourceGroupName, String workspaceName, + String endpointName, String deploymentName, PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -932,25 +767,14 @@ private Mono>> updateWithResponseAsync( final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - deploymentName, - this.client.getApiVersion(), - body, - accept, - context)) + context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, endpointName, deploymentName, this.client.getApiVersion(), body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Update a batch inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -963,24 +787,16 @@ private Mono>> updateWithResponseAsync( * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties body, - Context context) { + private Mono>> updateWithResponseAsync(String resourceGroupName, String workspaceName, + String endpointName, String deploymentName, + PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1002,23 +818,13 @@ private Mono>> updateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - deploymentName, - this.client.getApiVersion(), - body, - accept, - context); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, endpointName, deploymentName, this.client.getApiVersion(), body, accept, context); } /** * Update a batch inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -1031,26 +837,17 @@ private Mono>> updateWithResponseAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, BatchDeploymentInner> beginUpdateAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, + String resourceGroupName, String workspaceName, String endpointName, String deploymentName, PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties body) { - Mono>> mono = - updateWithResponseAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - BatchDeploymentInner.class, - BatchDeploymentInner.class, - this.client.getContext()); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + BatchDeploymentInner.class, BatchDeploymentInner.class, this.client.getContext()); } /** * Update a batch inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -1064,24 +861,18 @@ private PollerFlux, BatchDeploymentInner> begin */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, BatchDeploymentInner> beginUpdateAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties body, - Context context) { + String resourceGroupName, String workspaceName, String endpointName, String deploymentName, + PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties body, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), BatchDeploymentInner.class, BatchDeploymentInner.class, context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + BatchDeploymentInner.class, BatchDeploymentInner.class, context); } /** * Update a batch inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -1093,20 +884,16 @@ private PollerFlux, BatchDeploymentInner> begin * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, BatchDeploymentInner> beginUpdate( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, + public SyncPoller, BatchDeploymentInner> beginUpdate(String resourceGroupName, + String workspaceName, String endpointName, String deploymentName, PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties body) { - return this - .beginUpdateAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body) + return this.beginUpdateAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body) .getSyncPoller(); } /** * Update a batch inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -1119,21 +906,16 @@ public SyncPoller, BatchDeploymentInner> beginU * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, BatchDeploymentInner> beginUpdate( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties body, - Context context) { - return this - .beginUpdateAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body, context) + public SyncPoller, BatchDeploymentInner> beginUpdate(String resourceGroupName, + String workspaceName, String endpointName, String deploymentName, + PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties body, Context context) { + return this.beginUpdateAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body, context) .getSyncPoller(); } /** * Update a batch inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -1145,20 +927,15 @@ public SyncPoller, BatchDeploymentInner> beginU * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties body) { - return beginUpdateAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body) - .last() + private Mono updateAsync(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName, PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties body) { + return beginUpdateAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Update a batch inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -1171,21 +948,16 @@ private Mono updateAsync( * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties body, + private Mono updateAsync(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName, PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties body, Context context) { - return beginUpdateAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body, context) - .last() + return beginUpdateAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Update a batch inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -1197,18 +969,14 @@ private Mono updateAsync( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BatchDeploymentInner update( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties body) { + public BatchDeploymentInner update(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName, PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties body) { return updateAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body).block(); } /** * Update a batch inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -1221,19 +989,15 @@ public BatchDeploymentInner update( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BatchDeploymentInner update( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties body, + public BatchDeploymentInner update(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName, PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties body, Context context) { return updateAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body, context).block(); } /** * Creates/updates a batch inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -1245,23 +1009,15 @@ public BatchDeploymentInner update( * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - BatchDeploymentInner body) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String endpointName, String deploymentName, BatchDeploymentInner body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1283,26 +1039,15 @@ private Mono>> createOrUpdateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - deploymentName, - this.client.getApiVersion(), - body, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, endpointName, deploymentName, this.client.getApiVersion(), body, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates/updates a batch inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -1315,24 +1060,15 @@ private Mono>> createOrUpdateWithResponseAsync( * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - BatchDeploymentInner body, - Context context) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String endpointName, String deploymentName, BatchDeploymentInner body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1354,23 +1090,13 @@ private Mono>> createOrUpdateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - deploymentName, - this.client.getApiVersion(), - body, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, endpointName, deploymentName, this.client.getApiVersion(), body, accept, context); } /** * Creates/updates a batch inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -1383,26 +1109,17 @@ private Mono>> createOrUpdateWithResponseAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, BatchDeploymentInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, + String resourceGroupName, String workspaceName, String endpointName, String deploymentName, BatchDeploymentInner body) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - BatchDeploymentInner.class, - BatchDeploymentInner.class, - this.client.getContext()); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + BatchDeploymentInner.class, BatchDeploymentInner.class, this.client.getContext()); } /** * Creates/updates a batch inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -1416,25 +1133,18 @@ private PollerFlux, BatchDeploymentInner> begin */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, BatchDeploymentInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - BatchDeploymentInner body, - Context context) { + String resourceGroupName, String workspaceName, String endpointName, String deploymentName, + BatchDeploymentInner body, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, workspaceName, endpointName, deploymentName, body, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), BatchDeploymentInner.class, BatchDeploymentInner.class, context); + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, + endpointName, deploymentName, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + BatchDeploymentInner.class, BatchDeploymentInner.class, context); } /** * Creates/updates a batch inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -1447,19 +1157,15 @@ private PollerFlux, BatchDeploymentInner> begin */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, BatchDeploymentInner> beginCreateOrUpdate( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, + String resourceGroupName, String workspaceName, String endpointName, String deploymentName, BatchDeploymentInner body) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body) + return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body) .getSyncPoller(); } /** * Creates/updates a batch inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -1473,12 +1179,8 @@ public SyncPoller, BatchDeploymentInner> beginC */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, BatchDeploymentInner> beginCreateOrUpdate( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - BatchDeploymentInner body, - Context context) { + String resourceGroupName, String workspaceName, String endpointName, String deploymentName, + BatchDeploymentInner body, Context context) { return this .beginCreateOrUpdateAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body, context) .getSyncPoller(); @@ -1486,7 +1188,7 @@ public SyncPoller, BatchDeploymentInner> beginC /** * Creates/updates a batch inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -1498,20 +1200,15 @@ public SyncPoller, BatchDeploymentInner> beginC * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - BatchDeploymentInner body) { - return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body) - .last() + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String endpointName, String deploymentName, BatchDeploymentInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Creates/updates a batch inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -1524,13 +1221,8 @@ private Mono createOrUpdateAsync( * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - BatchDeploymentInner body, - Context context) { + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String endpointName, String deploymentName, BatchDeploymentInner body, Context context) { return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body, context) .last() .flatMap(this.client::getLroFinalResultOrError); @@ -1538,7 +1230,7 @@ private Mono createOrUpdateAsync( /** * Creates/updates a batch inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -1550,18 +1242,14 @@ private Mono createOrUpdateAsync( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BatchDeploymentInner createOrUpdate( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - BatchDeploymentInner body) { + public BatchDeploymentInner createOrUpdate(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName, BatchDeploymentInner body) { return createOrUpdateAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body).block(); } /** * Creates/updates a batch inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -1574,27 +1262,21 @@ public BatchDeploymentInner createOrUpdate( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BatchDeploymentInner createOrUpdate( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - BatchDeploymentInner body, - Context context) { + public BatchDeploymentInner createOrUpdate(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName, BatchDeploymentInner body, Context context) { return createOrUpdateAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body, context) .block(); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of BatchDeployment entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1602,37 +1284,26 @@ private Mono> listNextSinglePageAsync(String return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of BatchDeployment entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -1640,23 +1311,13 @@ private Mono> listNextSinglePageAsync(String return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/BatchDeploymentsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/BatchDeploymentsImpl.java index c1294dbb5c116..b6a201a6a73de 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/BatchDeploymentsImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/BatchDeploymentsImpl.java @@ -21,62 +21,50 @@ public final class BatchDeploymentsImpl implements BatchDeployments { private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - public BatchDeploymentsImpl( - BatchDeploymentsClient innerClient, + public BatchDeploymentsImpl(BatchDeploymentsClient innerClient, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list(String resourceGroupName, String workspaceName, String endpointName) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, workspaceName, endpointName); - return Utils.mapPage(inner, inner1 -> new BatchDeploymentImpl(inner1, this.manager())); + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, endpointName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BatchDeploymentImpl(inner1, this.manager())); } - public PagedIterable list( - String resourceGroupName, - String workspaceName, - String endpointName, - String orderBy, - Integer top, - String skip, - Context context) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, workspaceName, endpointName, orderBy, top, skip, context); - return Utils.mapPage(inner, inner1 -> new BatchDeploymentImpl(inner1, this.manager())); + public PagedIterable list(String resourceGroupName, String workspaceName, String endpointName, + String orderBy, Integer top, String skip, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, endpointName, orderBy, top, skip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BatchDeploymentImpl(inner1, this.manager())); } public void delete(String resourceGroupName, String workspaceName, String endpointName, String deploymentName) { this.serviceClient().delete(resourceGroupName, workspaceName, endpointName, deploymentName); } - public void delete( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName, Context context) { + public void delete(String resourceGroupName, String workspaceName, String endpointName, String deploymentName, + Context context) { this.serviceClient().delete(resourceGroupName, workspaceName, endpointName, deploymentName, context); } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName, Context context) { - Response inner = - this - .serviceClient() - .getWithResponse(resourceGroupName, workspaceName, endpointName, deploymentName, context); + public Response getWithResponse(String resourceGroupName, String workspaceName, + String endpointName, String deploymentName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, workspaceName, endpointName, deploymentName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new BatchDeploymentImpl(inner.getValue(), this.manager())); } else { return null; } } - public BatchDeployment get( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName) { - BatchDeploymentInner inner = - this.serviceClient().get(resourceGroupName, workspaceName, endpointName, deploymentName); + public BatchDeployment get(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName) { + BatchDeploymentInner inner + = this.serviceClient().get(resourceGroupName, workspaceName, endpointName, deploymentName); if (inner != null) { return new BatchDeploymentImpl(inner, this.manager()); } else { @@ -85,139 +73,98 @@ public BatchDeployment get( } public BatchDeployment getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String endpointName = Utils.getValueFromIdByName(id, "batchEndpoints"); + String endpointName = ResourceManagerUtils.getValueFromIdByName(id, "batchEndpoints"); if (endpointName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'batchEndpoints'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'batchEndpoints'.", id))); } - String deploymentName = Utils.getValueFromIdByName(id, "deployments"); + String deploymentName = ResourceManagerUtils.getValueFromIdByName(id, "deployments"); if (deploymentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); } - return this - .getWithResponse(resourceGroupName, workspaceName, endpointName, deploymentName, Context.NONE) + return this.getWithResponse(resourceGroupName, workspaceName, endpointName, deploymentName, Context.NONE) .getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String endpointName = Utils.getValueFromIdByName(id, "batchEndpoints"); + String endpointName = ResourceManagerUtils.getValueFromIdByName(id, "batchEndpoints"); if (endpointName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'batchEndpoints'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'batchEndpoints'.", id))); } - String deploymentName = Utils.getValueFromIdByName(id, "deployments"); + String deploymentName = ResourceManagerUtils.getValueFromIdByName(id, "deployments"); if (deploymentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); } return this.getWithResponse(resourceGroupName, workspaceName, endpointName, deploymentName, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String endpointName = Utils.getValueFromIdByName(id, "batchEndpoints"); + String endpointName = ResourceManagerUtils.getValueFromIdByName(id, "batchEndpoints"); if (endpointName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'batchEndpoints'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'batchEndpoints'.", id))); } - String deploymentName = Utils.getValueFromIdByName(id, "deployments"); + String deploymentName = ResourceManagerUtils.getValueFromIdByName(id, "deployments"); if (deploymentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); } this.delete(resourceGroupName, workspaceName, endpointName, deploymentName, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String endpointName = Utils.getValueFromIdByName(id, "batchEndpoints"); + String endpointName = ResourceManagerUtils.getValueFromIdByName(id, "batchEndpoints"); if (endpointName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'batchEndpoints'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'batchEndpoints'.", id))); } - String deploymentName = Utils.getValueFromIdByName(id, "deployments"); + String deploymentName = ResourceManagerUtils.getValueFromIdByName(id, "deployments"); if (deploymentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); } this.delete(resourceGroupName, workspaceName, endpointName, deploymentName, context); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/BatchEndpointImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/BatchEndpointImpl.java index 43e01217aecab..5f0f014d02c3a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/BatchEndpointImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/BatchEndpointImpl.java @@ -104,20 +104,16 @@ public BatchEndpointImpl withExistingWorkspace(String resourceGroupName, String } public BatchEndpoint create() { - this.innerObject = - serviceManager - .serviceClient() - .getBatchEndpoints() - .createOrUpdate(resourceGroupName, workspaceName, endpointName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getBatchEndpoints() + .createOrUpdate(resourceGroupName, workspaceName, endpointName, this.innerModel(), Context.NONE); return this; } public BatchEndpoint create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getBatchEndpoints() - .createOrUpdate(resourceGroupName, workspaceName, endpointName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient() + .getBatchEndpoints() + .createOrUpdate(resourceGroupName, workspaceName, endpointName, this.innerModel(), context); return this; } @@ -133,56 +129,46 @@ public BatchEndpointImpl update() { } public BatchEndpoint apply() { - this.innerObject = - serviceManager - .serviceClient() - .getBatchEndpoints() - .update(resourceGroupName, workspaceName, endpointName, updateBody, Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getBatchEndpoints() + .update(resourceGroupName, workspaceName, endpointName, updateBody, Context.NONE); return this; } public BatchEndpoint apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getBatchEndpoints() - .update(resourceGroupName, workspaceName, endpointName, updateBody, context); + this.innerObject = serviceManager.serviceClient() + .getBatchEndpoints() + .update(resourceGroupName, workspaceName, endpointName, updateBody, context); return this; } - BatchEndpointImpl( - BatchEndpointInner innerObject, + BatchEndpointImpl(BatchEndpointInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); - this.endpointName = Utils.getValueFromIdByName(innerObject.id(), "batchEndpoints"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.endpointName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "batchEndpoints"); } public BatchEndpoint refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getBatchEndpoints() - .getWithResponse(resourceGroupName, workspaceName, endpointName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getBatchEndpoints() + .getWithResponse(resourceGroupName, workspaceName, endpointName, Context.NONE) + .getValue(); return this; } public BatchEndpoint refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getBatchEndpoints() - .getWithResponse(resourceGroupName, workspaceName, endpointName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getBatchEndpoints() + .getWithResponse(resourceGroupName, workspaceName, endpointName, context) + .getValue(); return this; } public Response listKeysWithResponse(Context context) { - return serviceManager - .batchEndpoints() + return serviceManager.batchEndpoints() .listKeysWithResponse(resourceGroupName, workspaceName, endpointName, context); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/BatchEndpointsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/BatchEndpointsClientImpl.java index 9d00fdc12171a..0261070a77ac9 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/BatchEndpointsClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/BatchEndpointsClientImpl.java @@ -42,146 +42,112 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in BatchEndpointsClient. */ +/** + * An instance of this class provides access to all the operations defined in BatchEndpointsClient. + */ public final class BatchEndpointsClientImpl implements BatchEndpointsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final BatchEndpointsService service; - /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of BatchEndpointsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ - BatchEndpointsClientImpl(AzureMachineLearningWorkspacesImpl client) { - this.service = - RestProxy.create(BatchEndpointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + BatchEndpointsClientImpl(AzureMachineLearningServicesImpl client) { + this.service + = RestProxy.create(BatchEndpointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesBatchEndpoints to be used by the proxy + * The interface defining all the services for AzureMachineLearningServicesBatchEndpoints to be used by the proxy * service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AzureMachineLearning") public interface BatchEndpointsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, + Mono> list(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @QueryParam("api-version") String apiVersion, - @QueryParam("count") Integer count, - @QueryParam("$skip") String skip, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @QueryParam("count") Integer count, + @QueryParam("$skip") String skip, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}") - @ExpectedResponses({200, 202, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}") + @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, + Mono>> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("endpointName") String endpointName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("endpointName") String endpointName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("endpointName") String endpointName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("endpointName") String endpointName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}") - @ExpectedResponses({200, 202}) + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, + Mono>> update(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("endpointName") String endpointName, - @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("endpointName") String endpointName, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") PartialMinimalTrackedResourceWithIdentity body, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, + Mono>> createOrUpdate(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("endpointName") String endpointName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") BatchEndpointInner body, - @HeaderParam("Accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("endpointName") String endpointName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") BatchEndpointInner body, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}" - + "/listkeys") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listKeys( - @HostParam("$host") String endpoint, + Mono> listKeys(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("endpointName") String endpointName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("endpointName") String endpointName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Lists Batch inference endpoint in the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param count Number of endpoints to be retrieved in a page of results. @@ -190,22 +156,18 @@ Mono> listNext( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of BatchEndpoint entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String workspaceName, Integer count, String skip) { + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + Integer count, String skip) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -216,34 +178,16 @@ private Mono> listSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - this.client.getApiVersion(), - count, - skip, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), count, skip, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Lists Batch inference endpoint in the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param count Number of endpoints to be retrieved in a page of results. @@ -253,22 +197,18 @@ private Mono> listSinglePageAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of BatchEndpoint entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String workspaceName, Integer count, String skip, Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + Integer count, String skip, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -280,30 +220,15 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - this.client.getApiVersion(), - count, - skip, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + this.client.getApiVersion(), count, skip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Lists Batch inference endpoint in the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param count Number of endpoints to be retrieved in a page of results. @@ -314,16 +239,15 @@ private Mono> listSinglePageAsync( * @return a paginated list of BatchEndpoint entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String workspaceName, Integer count, String skip) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, count, skip), + private PagedFlux listAsync(String resourceGroupName, String workspaceName, Integer count, + String skip) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, count, skip), nextLink -> listNextSinglePageAsync(nextLink)); } /** * Lists Batch inference endpoint in the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -335,14 +259,13 @@ private PagedFlux listAsync( private PagedFlux listAsync(String resourceGroupName, String workspaceName) { final Integer count = null; final String skip = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, count, skip), + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, count, skip), nextLink -> listNextSinglePageAsync(nextLink)); } /** * Lists Batch inference endpoint in the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param count Number of endpoints to be retrieved in a page of results. @@ -354,16 +277,15 @@ private PagedFlux listAsync(String resourceGroupName, String * @return a paginated list of BatchEndpoint entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String workspaceName, Integer count, String skip, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, count, skip, context), + private PagedFlux listAsync(String resourceGroupName, String workspaceName, Integer count, + String skip, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, count, skip, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Lists Batch inference endpoint in the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -380,7 +302,7 @@ public PagedIterable list(String resourceGroupName, String w /** * Lists Batch inference endpoint in the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param count Number of endpoints to be retrieved in a page of results. @@ -392,14 +314,14 @@ public PagedIterable list(String resourceGroupName, String w * @return a paginated list of BatchEndpoint entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String workspaceName, Integer count, String skip, Context context) { + public PagedIterable list(String resourceGroupName, String workspaceName, Integer count, + String skip, Context context) { return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, count, skip, context)); } /** * Delete Batch Inference Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference Endpoint name. @@ -409,19 +331,15 @@ public PagedIterable list( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String endpointName) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String endpointName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -435,24 +353,14 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, endpointName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete Batch Inference Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference Endpoint name. @@ -463,19 +371,15 @@ private Mono>> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String endpointName, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String endpointName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -489,21 +393,13 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - this.client.getApiVersion(), - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, endpointName, this.client.getApiVersion(), accept, context); } /** * Delete Batch Inference Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference Endpoint name. @@ -513,18 +409,16 @@ private Mono>> deleteWithResponseAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String workspaceName, String endpointName) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, + String endpointName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName, endpointName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Delete Batch Inference Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference Endpoint name. @@ -535,19 +429,18 @@ private PollerFlux, Void> beginDeleteAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String workspaceName, String endpointName, Context context) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, + String endpointName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, workspaceName, endpointName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, workspaceName, endpointName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** * Delete Batch Inference Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference Endpoint name. @@ -557,14 +450,14 @@ private PollerFlux, Void> beginDeleteAsync( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String workspaceName, String endpointName) { + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, + String endpointName) { return this.beginDeleteAsync(resourceGroupName, workspaceName, endpointName).getSyncPoller(); } /** * Delete Batch Inference Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference Endpoint name. @@ -575,14 +468,14 @@ public SyncPoller, Void> beginDelete( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String workspaceName, String endpointName, Context context) { + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, + String endpointName, Context context) { return this.beginDeleteAsync(resourceGroupName, workspaceName, endpointName, context).getSyncPoller(); } /** * Delete Batch Inference Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference Endpoint name. @@ -593,14 +486,13 @@ public SyncPoller, Void> beginDelete( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String workspaceName, String endpointName) { - return beginDeleteAsync(resourceGroupName, workspaceName, endpointName) - .last() + return beginDeleteAsync(resourceGroupName, workspaceName, endpointName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete Batch Inference Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference Endpoint name. @@ -611,16 +503,15 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String workspaceName, String endpointName, Context context) { - return beginDeleteAsync(resourceGroupName, workspaceName, endpointName, context) - .last() + private Mono deleteAsync(String resourceGroupName, String workspaceName, String endpointName, + Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, endpointName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete Batch Inference Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference Endpoint name. @@ -635,7 +526,7 @@ public void delete(String resourceGroupName, String workspaceName, String endpoi /** * Delete Batch Inference Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference Endpoint name. @@ -651,7 +542,7 @@ public void delete(String resourceGroupName, String workspaceName, String endpoi /** * Gets a batch inference endpoint by name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Name for the Batch Endpoint. @@ -661,19 +552,15 @@ public void delete(String resourceGroupName, String workspaceName, String endpoi * @return a batch inference endpoint by name along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String endpointName) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String endpointName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -687,24 +574,14 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, endpointName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets a batch inference endpoint by name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Name for the Batch Endpoint. @@ -715,19 +592,15 @@ private Mono> getWithResponseAsync( * @return a batch inference endpoint by name along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String endpointName, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String endpointName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -741,21 +614,13 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - this.client.getApiVersion(), - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + endpointName, this.client.getApiVersion(), accept, context); } /** * Gets a batch inference endpoint by name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Name for the Batch Endpoint. @@ -772,7 +637,7 @@ private Mono getAsync(String resourceGroupName, String works /** * Gets a batch inference endpoint by name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Name for the Batch Endpoint. @@ -783,14 +648,14 @@ private Mono getAsync(String resourceGroupName, String works * @return a batch inference endpoint by name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String endpointName, Context context) { + public Response getWithResponse(String resourceGroupName, String workspaceName, + String endpointName, Context context) { return getWithResponseAsync(resourceGroupName, workspaceName, endpointName, context).block(); } /** * Gets a batch inference endpoint by name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Name for the Batch Endpoint. @@ -806,7 +671,7 @@ public BatchEndpointInner get(String resourceGroupName, String workspaceName, St /** * Update a batch inference endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Name for the Batch inference endpoint. @@ -817,22 +682,15 @@ public BatchEndpointInner get(String resourceGroupName, String workspaceName, St * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - PartialMinimalTrackedResourceWithIdentity body) { + private Mono>> updateWithResponseAsync(String resourceGroupName, String workspaceName, + String endpointName, PartialMinimalTrackedResourceWithIdentity body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -851,25 +709,14 @@ private Mono>> updateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - this.client.getApiVersion(), - body, - accept, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, endpointName, this.client.getApiVersion(), body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Update a batch inference endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Name for the Batch inference endpoint. @@ -881,23 +728,15 @@ private Mono>> updateWithResponseAsync( * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - PartialMinimalTrackedResourceWithIdentity body, - Context context) { + private Mono>> updateWithResponseAsync(String resourceGroupName, String workspaceName, + String endpointName, PartialMinimalTrackedResourceWithIdentity body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -916,22 +755,13 @@ private Mono>> updateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - this.client.getApiVersion(), - body, - accept, - context); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, endpointName, this.client.getApiVersion(), body, accept, context); } /** * Update a batch inference endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Name for the Batch inference endpoint. @@ -942,26 +772,17 @@ private Mono>> updateWithResponseAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, BatchEndpointInner> beginUpdateAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - PartialMinimalTrackedResourceWithIdentity body) { - Mono>> mono = - updateWithResponseAsync(resourceGroupName, workspaceName, endpointName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - BatchEndpointInner.class, - BatchEndpointInner.class, - this.client.getContext()); + private PollerFlux, BatchEndpointInner> beginUpdateAsync(String resourceGroupName, + String workspaceName, String endpointName, PartialMinimalTrackedResourceWithIdentity body) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, workspaceName, endpointName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + BatchEndpointInner.class, BatchEndpointInner.class, this.client.getContext()); } /** * Update a batch inference endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Name for the Batch inference endpoint. @@ -973,24 +794,18 @@ private PollerFlux, BatchEndpointInner> beginUpda * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, BatchEndpointInner> beginUpdateAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - PartialMinimalTrackedResourceWithIdentity body, - Context context) { + private PollerFlux, BatchEndpointInner> beginUpdateAsync(String resourceGroupName, + String workspaceName, String endpointName, PartialMinimalTrackedResourceWithIdentity body, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, workspaceName, endpointName, body, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), BatchEndpointInner.class, BatchEndpointInner.class, context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, workspaceName, endpointName, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + BatchEndpointInner.class, BatchEndpointInner.class, context); } /** * Update a batch inference endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Name for the Batch inference endpoint. @@ -1001,17 +816,14 @@ private PollerFlux, BatchEndpointInner> beginUpda * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, BatchEndpointInner> beginUpdate( - String resourceGroupName, - String workspaceName, - String endpointName, - PartialMinimalTrackedResourceWithIdentity body) { + public SyncPoller, BatchEndpointInner> beginUpdate(String resourceGroupName, + String workspaceName, String endpointName, PartialMinimalTrackedResourceWithIdentity body) { return this.beginUpdateAsync(resourceGroupName, workspaceName, endpointName, body).getSyncPoller(); } /** * Update a batch inference endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Name for the Batch inference endpoint. @@ -1023,18 +835,14 @@ public SyncPoller, BatchEndpointInner> beginUpdat * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, BatchEndpointInner> beginUpdate( - String resourceGroupName, - String workspaceName, - String endpointName, - PartialMinimalTrackedResourceWithIdentity body, - Context context) { + public SyncPoller, BatchEndpointInner> beginUpdate(String resourceGroupName, + String workspaceName, String endpointName, PartialMinimalTrackedResourceWithIdentity body, Context context) { return this.beginUpdateAsync(resourceGroupName, workspaceName, endpointName, body, context).getSyncPoller(); } /** * Update a batch inference endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Name for the Batch inference endpoint. @@ -1045,19 +853,15 @@ public SyncPoller, BatchEndpointInner> beginUpdat * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String workspaceName, - String endpointName, + private Mono updateAsync(String resourceGroupName, String workspaceName, String endpointName, PartialMinimalTrackedResourceWithIdentity body) { - return beginUpdateAsync(resourceGroupName, workspaceName, endpointName, body) - .last() + return beginUpdateAsync(resourceGroupName, workspaceName, endpointName, body).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Update a batch inference endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Name for the Batch inference endpoint. @@ -1069,20 +873,15 @@ private Mono updateAsync( * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - PartialMinimalTrackedResourceWithIdentity body, - Context context) { - return beginUpdateAsync(resourceGroupName, workspaceName, endpointName, body, context) - .last() + private Mono updateAsync(String resourceGroupName, String workspaceName, String endpointName, + PartialMinimalTrackedResourceWithIdentity body, Context context) { + return beginUpdateAsync(resourceGroupName, workspaceName, endpointName, body, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Update a batch inference endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Name for the Batch inference endpoint. @@ -1093,17 +892,14 @@ private Mono updateAsync( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BatchEndpointInner update( - String resourceGroupName, - String workspaceName, - String endpointName, + public BatchEndpointInner update(String resourceGroupName, String workspaceName, String endpointName, PartialMinimalTrackedResourceWithIdentity body) { return updateAsync(resourceGroupName, workspaceName, endpointName, body).block(); } /** * Update a batch inference endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Name for the Batch inference endpoint. @@ -1115,18 +911,14 @@ public BatchEndpointInner update( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BatchEndpointInner update( - String resourceGroupName, - String workspaceName, - String endpointName, - PartialMinimalTrackedResourceWithIdentity body, - Context context) { + public BatchEndpointInner update(String resourceGroupName, String workspaceName, String endpointName, + PartialMinimalTrackedResourceWithIdentity body, Context context) { return updateAsync(resourceGroupName, workspaceName, endpointName, body, context).block(); } /** * Creates a batch inference endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Name for the Batch inference endpoint. @@ -1137,19 +929,15 @@ public BatchEndpointInner update( * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String workspaceName, String endpointName, BatchEndpointInner body) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String endpointName, BatchEndpointInner body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1168,25 +956,14 @@ private Mono>> createOrUpdateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - this.client.getApiVersion(), - body, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, endpointName, this.client.getApiVersion(), body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates a batch inference endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Name for the Batch inference endpoint. @@ -1198,19 +975,15 @@ private Mono>> createOrUpdateWithResponseAsync( * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String workspaceName, String endpointName, BatchEndpointInner body, Context context) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String endpointName, BatchEndpointInner body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1229,22 +1002,13 @@ private Mono>> createOrUpdateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - this.client.getApiVersion(), - body, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, endpointName, this.client.getApiVersion(), body, accept, context); } /** * Creates a batch inference endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Name for the Batch inference endpoint. @@ -1257,21 +1021,15 @@ private Mono>> createOrUpdateWithResponseAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, BatchEndpointInner> beginCreateOrUpdateAsync( String resourceGroupName, String workspaceName, String endpointName, BatchEndpointInner body) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, endpointName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - BatchEndpointInner.class, - BatchEndpointInner.class, - this.client.getContext()); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, endpointName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + BatchEndpointInner.class, BatchEndpointInner.class, this.client.getContext()); } /** * Creates a batch inference endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Name for the Batch inference endpoint. @@ -1286,17 +1044,15 @@ private PollerFlux, BatchEndpointInner> beginCrea private PollerFlux, BatchEndpointInner> beginCreateOrUpdateAsync( String resourceGroupName, String workspaceName, String endpointName, BatchEndpointInner body, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, endpointName, body, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), BatchEndpointInner.class, BatchEndpointInner.class, context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, endpointName, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + BatchEndpointInner.class, BatchEndpointInner.class, context); } /** * Creates a batch inference endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Name for the Batch inference endpoint. @@ -1307,14 +1063,14 @@ private PollerFlux, BatchEndpointInner> beginCrea * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, BatchEndpointInner> beginCreateOrUpdate( - String resourceGroupName, String workspaceName, String endpointName, BatchEndpointInner body) { + public SyncPoller, BatchEndpointInner> beginCreateOrUpdate(String resourceGroupName, + String workspaceName, String endpointName, BatchEndpointInner body) { return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, endpointName, body).getSyncPoller(); } /** * Creates a batch inference endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Name for the Batch inference endpoint. @@ -1326,16 +1082,15 @@ public SyncPoller, BatchEndpointInner> beginCreat * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, BatchEndpointInner> beginCreateOrUpdate( - String resourceGroupName, String workspaceName, String endpointName, BatchEndpointInner body, Context context) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, workspaceName, endpointName, body, context) + public SyncPoller, BatchEndpointInner> beginCreateOrUpdate(String resourceGroupName, + String workspaceName, String endpointName, BatchEndpointInner body, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, endpointName, body, context) .getSyncPoller(); } /** * Creates a batch inference endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Name for the Batch inference endpoint. @@ -1346,16 +1101,15 @@ public SyncPoller, BatchEndpointInner> beginCreat * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String workspaceName, String endpointName, BatchEndpointInner body) { - return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, endpointName, body) - .last() + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String endpointName, BatchEndpointInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, endpointName, body).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Creates a batch inference endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Name for the Batch inference endpoint. @@ -1367,16 +1121,15 @@ private Mono createOrUpdateAsync( * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String workspaceName, String endpointName, BatchEndpointInner body, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, endpointName, body, context) - .last() + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String endpointName, BatchEndpointInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, endpointName, body, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Creates a batch inference endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Name for the Batch inference endpoint. @@ -1387,14 +1140,14 @@ private Mono createOrUpdateAsync( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BatchEndpointInner createOrUpdate( - String resourceGroupName, String workspaceName, String endpointName, BatchEndpointInner body) { + public BatchEndpointInner createOrUpdate(String resourceGroupName, String workspaceName, String endpointName, + BatchEndpointInner body) { return createOrUpdateAsync(resourceGroupName, workspaceName, endpointName, body).block(); } /** * Creates a batch inference endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Name for the Batch inference endpoint. @@ -1406,14 +1159,14 @@ public BatchEndpointInner createOrUpdate( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BatchEndpointInner createOrUpdate( - String resourceGroupName, String workspaceName, String endpointName, BatchEndpointInner body, Context context) { + public BatchEndpointInner createOrUpdate(String resourceGroupName, String workspaceName, String endpointName, + BatchEndpointInner body, Context context) { return createOrUpdateAsync(resourceGroupName, workspaceName, endpointName, body, context).block(); } /** * Lists batch Inference Endpoint keys. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference Endpoint name. @@ -1423,19 +1176,15 @@ public BatchEndpointInner createOrUpdate( * @return keys for endpoint authentication along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeysWithResponseAsync( - String resourceGroupName, String workspaceName, String endpointName) { + private Mono> listKeysWithResponseAsync(String resourceGroupName, + String workspaceName, String endpointName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1449,24 +1198,14 @@ private Mono> listKeysWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listKeys( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.listKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, endpointName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Lists batch Inference Endpoint keys. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference Endpoint name. @@ -1477,19 +1216,15 @@ private Mono> listKeysWithResponseAsync( * @return keys for endpoint authentication along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeysWithResponseAsync( - String resourceGroupName, String workspaceName, String endpointName, Context context) { + private Mono> listKeysWithResponseAsync(String resourceGroupName, + String workspaceName, String endpointName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1503,21 +1238,13 @@ private Mono> listKeysWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listKeys( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - this.client.getApiVersion(), - accept, - context); + return service.listKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, endpointName, this.client.getApiVersion(), accept, context); } /** * Lists batch Inference Endpoint keys. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference Endpoint name. @@ -1527,15 +1254,15 @@ private Mono> listKeysWithResponseAsync( * @return keys for endpoint authentication on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listKeysAsync( - String resourceGroupName, String workspaceName, String endpointName) { + private Mono listKeysAsync(String resourceGroupName, String workspaceName, + String endpointName) { return listKeysWithResponseAsync(resourceGroupName, workspaceName, endpointName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Lists batch Inference Endpoint keys. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference Endpoint name. @@ -1546,14 +1273,14 @@ private Mono listKeysAsync( * @return keys for endpoint authentication along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listKeysWithResponse( - String resourceGroupName, String workspaceName, String endpointName, Context context) { + public Response listKeysWithResponse(String resourceGroupName, String workspaceName, + String endpointName, Context context) { return listKeysWithResponseAsync(resourceGroupName, workspaceName, endpointName, context).block(); } /** * Lists batch Inference Endpoint keys. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference Endpoint name. @@ -1569,14 +1296,13 @@ public EndpointAuthKeysInner listKeys(String resourceGroupName, String workspace /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of BatchEndpoint entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1584,37 +1310,26 @@ private Mono> listNextSinglePageAsync(String n return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of BatchEndpoint entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -1622,23 +1337,13 @@ private Mono> listNextSinglePageAsync(String n return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/BatchEndpointsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/BatchEndpointsImpl.java index 111c2006d1972..f784fb27bdfd5 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/BatchEndpointsImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/BatchEndpointsImpl.java @@ -23,8 +23,7 @@ public final class BatchEndpointsImpl implements BatchEndpoints { private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - public BatchEndpointsImpl( - BatchEndpointsClient innerClient, + public BatchEndpointsImpl(BatchEndpointsClient innerClient, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -32,14 +31,14 @@ public BatchEndpointsImpl( public PagedIterable list(String resourceGroupName, String workspaceName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); - return Utils.mapPage(inner, inner1 -> new BatchEndpointImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BatchEndpointImpl(inner1, this.manager())); } - public PagedIterable list( - String resourceGroupName, String workspaceName, Integer count, String skip, Context context) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, workspaceName, count, skip, context); - return Utils.mapPage(inner, inner1 -> new BatchEndpointImpl(inner1, this.manager())); + public PagedIterable list(String resourceGroupName, String workspaceName, Integer count, String skip, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, count, skip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BatchEndpointImpl(inner1, this.manager())); } public void delete(String resourceGroupName, String workspaceName, String endpointName) { @@ -50,15 +49,12 @@ public void delete(String resourceGroupName, String workspaceName, String endpoi this.serviceClient().delete(resourceGroupName, workspaceName, endpointName, context); } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String endpointName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, workspaceName, endpointName, context); + public Response getWithResponse(String resourceGroupName, String workspaceName, String endpointName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, endpointName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new BatchEndpointImpl(inner.getValue(), this.manager())); } else { return null; @@ -74,15 +70,12 @@ public BatchEndpoint get(String resourceGroupName, String workspaceName, String } } - public Response listKeysWithResponse( - String resourceGroupName, String workspaceName, String endpointName, Context context) { - Response inner = - this.serviceClient().listKeysWithResponse(resourceGroupName, workspaceName, endpointName, context); + public Response listKeysWithResponse(String resourceGroupName, String workspaceName, + String endpointName, Context context) { + Response inner + = this.serviceClient().listKeysWithResponse(resourceGroupName, workspaceName, endpointName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new EndpointAuthKeysImpl(inner.getValue(), this.manager())); } else { return null; @@ -99,109 +92,77 @@ public EndpointAuthKeys listKeys(String resourceGroupName, String workspaceName, } public BatchEndpoint getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String endpointName = Utils.getValueFromIdByName(id, "batchEndpoints"); + String endpointName = ResourceManagerUtils.getValueFromIdByName(id, "batchEndpoints"); if (endpointName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'batchEndpoints'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'batchEndpoints'.", id))); } return this.getWithResponse(resourceGroupName, workspaceName, endpointName, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String endpointName = Utils.getValueFromIdByName(id, "batchEndpoints"); + String endpointName = ResourceManagerUtils.getValueFromIdByName(id, "batchEndpoints"); if (endpointName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'batchEndpoints'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'batchEndpoints'.", id))); } return this.getWithResponse(resourceGroupName, workspaceName, endpointName, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String endpointName = Utils.getValueFromIdByName(id, "batchEndpoints"); + String endpointName = ResourceManagerUtils.getValueFromIdByName(id, "batchEndpoints"); if (endpointName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'batchEndpoints'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'batchEndpoints'.", id))); } this.delete(resourceGroupName, workspaceName, endpointName, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String endpointName = Utils.getValueFromIdByName(id, "batchEndpoints"); + String endpointName = ResourceManagerUtils.getValueFromIdByName(id, "batchEndpoints"); if (endpointName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'batchEndpoints'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'batchEndpoints'.", id))); } this.delete(resourceGroupName, workspaceName, endpointName, context); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeContainerImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeContainerImpl.java index f739c63622acd..2c925457ce743 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeContainerImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeContainerImpl.java @@ -49,40 +49,34 @@ private com.azure.resourcemanager.machinelearning.MachineLearningManager manager private String resourceGroupName; - private String workspaceName; + private String registryName; - private String name; + private String codeName; - public CodeContainerImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + public CodeContainerImpl withExistingRegistry(String resourceGroupName, String registryName) { this.resourceGroupName = resourceGroupName; - this.workspaceName = workspaceName; + this.registryName = registryName; return this; } public CodeContainer create() { - this.innerObject = - serviceManager - .serviceClient() - .getCodeContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryCodeContainers() + .createOrUpdate(resourceGroupName, registryName, codeName, this.innerModel(), Context.NONE); return this; } public CodeContainer create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getCodeContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryCodeContainers() + .createOrUpdate(resourceGroupName, registryName, codeName, this.innerModel(), context); return this; } CodeContainerImpl(String name, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = new CodeContainerInner(); this.serviceManager = serviceManager; - this.name = name; + this.codeName = name; } public CodeContainerImpl update() { @@ -90,52 +84,41 @@ public CodeContainerImpl update() { } public CodeContainer apply() { - this.innerObject = - serviceManager - .serviceClient() - .getCodeContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryCodeContainers() + .createOrUpdate(resourceGroupName, registryName, codeName, this.innerModel(), Context.NONE); return this; } public CodeContainer apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getCodeContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryCodeContainers() + .createOrUpdate(resourceGroupName, registryName, codeName, this.innerModel(), context); return this; } - CodeContainerImpl( - CodeContainerInner innerObject, + CodeContainerImpl(CodeContainerInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); - this.name = Utils.getValueFromIdByName(innerObject.id(), "codes"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.registryName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "registries"); + this.codeName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "codes"); } public CodeContainer refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getCodeContainers() - .getWithResponse(resourceGroupName, workspaceName, name, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryCodeContainers() + .getWithResponse(resourceGroupName, registryName, codeName, Context.NONE) + .getValue(); return this; } public CodeContainer refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getCodeContainers() - .getWithResponse(resourceGroupName, workspaceName, name, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryCodeContainers() + .getWithResponse(resourceGroupName, registryName, codeName, context) + .getValue(); return this; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeContainersClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeContainersClientImpl.java index 019f7490ddf83..1dad2d29439d6 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeContainersClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeContainersClientImpl.java @@ -33,111 +33,91 @@ import com.azure.resourcemanager.machinelearning.models.CodeContainerResourceArmPaginatedResult; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in CodeContainersClient. */ +/** + * An instance of this class provides access to all the operations defined in CodeContainersClient. + */ public final class CodeContainersClientImpl implements CodeContainersClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final CodeContainersService service; - /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of CodeContainersClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ - CodeContainersClientImpl(AzureMachineLearningWorkspacesImpl client) { - this.service = - RestProxy.create(CodeContainersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + CodeContainersClientImpl(AzureMachineLearningServicesImpl client) { + this.service + = RestProxy.create(CodeContainersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesCodeContainers to be used by the proxy + * The interface defining all the services for AzureMachineLearningServicesCodeContainers to be used by the proxy * service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AzureMachineLearning") public interface CodeContainersService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, + Mono> list(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @QueryParam("api-version") String apiVersion, - @QueryParam("$skip") String skip, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @QueryParam("$skip") String skip, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, + Mono> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, + Mono> createOrUpdate(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CodeContainerInner body, - @HeaderParam("Accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CodeContainerInner body, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * List containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -145,22 +125,18 @@ Mono> listNext( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of CodeContainer entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String workspaceName, String skip) { + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String skip) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -171,33 +147,16 @@ private Mono> listSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - this.client.getApiVersion(), - skip, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), skip, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -206,22 +165,18 @@ private Mono> listSinglePageAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of CodeContainer entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String workspaceName, String skip, Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String skip, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -233,29 +188,15 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - this.client.getApiVersion(), - skip, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + this.client.getApiVersion(), skip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -266,14 +207,13 @@ private Mono> listSinglePageAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String workspaceName, String skip) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, skip), + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skip), nextLink -> listNextSinglePageAsync(nextLink)); } /** * List containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -284,14 +224,13 @@ private PagedFlux listAsync(String resourceGroupName, String @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String workspaceName) { final String skip = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, skip), + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skip), nextLink -> listNextSinglePageAsync(nextLink)); } /** * List containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -302,16 +241,15 @@ private PagedFlux listAsync(String resourceGroupName, String * @return a paginated list of CodeContainer entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String workspaceName, String skip, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, skip, context), + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String skip, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skip, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * List containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -327,7 +265,7 @@ public PagedIterable list(String resourceGroupName, String w /** * List containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -338,14 +276,14 @@ public PagedIterable list(String resourceGroupName, String w * @return a paginated list of CodeContainer entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String workspaceName, String skip, Context context) { + public PagedIterable list(String resourceGroupName, String workspaceName, String skip, + Context context) { return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, skip, context)); } /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -357,16 +295,12 @@ public PagedIterable list( @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, String name) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -380,24 +314,14 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -408,19 +332,15 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String name, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, String name, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -434,21 +354,13 @@ private Mono> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, this.client.getApiVersion(), accept, context); } /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -464,7 +376,7 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -475,14 +387,14 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String name, Context context) { + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String name, + Context context) { return deleteWithResponseAsync(resourceGroupName, workspaceName, name, context).block(); } /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -497,7 +409,7 @@ public void delete(String resourceGroupName, String workspaceName, String name) /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -507,19 +419,15 @@ public void delete(String resourceGroupName, String workspaceName, String name) * @return container along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String name) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String name) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -533,24 +441,14 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -561,19 +459,15 @@ private Mono> getWithResponseAsync( * @return container along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String name, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String name, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -587,21 +481,13 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + name, this.client.getApiVersion(), accept, context); } /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -618,7 +504,7 @@ private Mono getAsync(String resourceGroupName, String works /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -629,14 +515,14 @@ private Mono getAsync(String resourceGroupName, String works * @return container along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String name, Context context) { + public Response getWithResponse(String resourceGroupName, String workspaceName, String name, + Context context) { return getWithResponseAsync(resourceGroupName, workspaceName, name, context).block(); } /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -652,7 +538,7 @@ public CodeContainerInner get(String resourceGroupName, String workspaceName, St /** * Create or update container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -660,23 +546,19 @@ public CodeContainerInner get(String resourceGroupName, String workspaceName, St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link - * Mono}. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String workspaceName, String name, CodeContainerInner body) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String name, CodeContainerInner body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -695,25 +577,14 @@ private Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - body, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or update container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -722,23 +593,19 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link - * Mono}. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String workspaceName, String name, CodeContainerInner body, Context context) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String name, CodeContainerInner body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -757,22 +624,13 @@ private Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - body, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, this.client.getApiVersion(), body, accept, context); } /** * Create or update container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -783,15 +641,15 @@ private Mono> createOrUpdateWithResponseAsync( * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String workspaceName, String name, CodeContainerInner body) { + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, String name, + CodeContainerInner body) { return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, body) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Create or update container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -803,14 +661,14 @@ private Mono createOrUpdateAsync( * @return azure Resource Manager resource envelope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, String workspaceName, String name, CodeContainerInner body, Context context) { + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String name, CodeContainerInner body, Context context) { return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, body, context).block(); } /** * Create or update container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -821,21 +679,20 @@ public Response createOrUpdateWithResponse( * @return azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CodeContainerInner createOrUpdate( - String resourceGroupName, String workspaceName, String name, CodeContainerInner body) { + public CodeContainerInner createOrUpdate(String resourceGroupName, String workspaceName, String name, + CodeContainerInner body) { return createOrUpdateWithResponse(resourceGroupName, workspaceName, name, body, Context.NONE).getValue(); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of CodeContainer entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -843,37 +700,26 @@ private Mono> listNextSinglePageAsync(String n return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of CodeContainer entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -881,23 +727,13 @@ private Mono> listNextSinglePageAsync(String n return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeContainersImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeContainersImpl.java index 0202b27fb32c4..0f6a8f0490cf3 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeContainersImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeContainersImpl.java @@ -21,8 +21,7 @@ public final class CodeContainersImpl implements CodeContainers { private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - public CodeContainersImpl( - CodeContainersClient innerClient, + public CodeContainersImpl(CodeContainersClient innerClient, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -30,18 +29,18 @@ public CodeContainersImpl( public PagedIterable list(String resourceGroupName, String workspaceName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); - return Utils.mapPage(inner, inner1 -> new CodeContainerImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CodeContainerImpl(inner1, this.manager())); } - public PagedIterable list( - String resourceGroupName, String workspaceName, String skip, Context context) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, workspaceName, skip, context); - return Utils.mapPage(inner, inner1 -> new CodeContainerImpl(inner1, this.manager())); + public PagedIterable list(String resourceGroupName, String workspaceName, String skip, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, skip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CodeContainerImpl(inner1, this.manager())); } - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String name, Context context) { + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String name, + Context context) { return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, name, context); } @@ -49,15 +48,12 @@ public void delete(String resourceGroupName, String workspaceName, String name) this.serviceClient().delete(resourceGroupName, workspaceName, name); } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String name, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, workspaceName, name, context); + public Response getWithResponse(String resourceGroupName, String workspaceName, String name, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, name, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new CodeContainerImpl(inner.getValue(), this.manager())); } else { return null; @@ -73,108 +69,26 @@ public CodeContainer get(String resourceGroupName, String workspaceName, String } } - public CodeContainer getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "codes"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'codes'.", id))); - } - return this.getWithResponse(resourceGroupName, workspaceName, name, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "codes"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'codes'.", id))); - } - return this.getWithResponse(resourceGroupName, workspaceName, name, context); - } - - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "codes"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'codes'.", id))); + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String name, CodeContainerInner body, Context context) { + Response inner + = this.serviceClient().createOrUpdateWithResponse(resourceGroupName, workspaceName, name, body, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CodeContainerImpl(inner.getValue(), this.manager())); + } else { + return null; } - this.deleteWithResponse(resourceGroupName, workspaceName, name, Context.NONE); } - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "codes"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'codes'.", id))); + public CodeContainer createOrUpdate(String resourceGroupName, String workspaceName, String name, + CodeContainerInner body) { + CodeContainerInner inner = this.serviceClient().createOrUpdate(resourceGroupName, workspaceName, name, body); + if (inner != null) { + return new CodeContainerImpl(inner, this.manager()); + } else { + return null; } - return this.deleteWithResponse(resourceGroupName, workspaceName, name, context); } private CodeContainersClient serviceClient() { @@ -184,8 +98,4 @@ private CodeContainersClient serviceClient() { private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { return this.serviceManager; } - - public CodeContainerImpl define(String name) { - return new CodeContainerImpl(name, this.manager()); - } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeVersionImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeVersionImpl.java index daab7505f3ff6..ae5f52c3a26b5 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeVersionImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeVersionImpl.java @@ -4,11 +4,14 @@ package com.azure.resourcemanager.machinelearning.implementation; +import com.azure.core.http.rest.Response; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.machinelearning.fluent.models.CodeVersionInner; import com.azure.resourcemanager.machinelearning.models.CodeVersion; import com.azure.resourcemanager.machinelearning.models.CodeVersionProperties; +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; +import com.azure.resourcemanager.machinelearning.models.PendingUploadResponseDto; public final class CodeVersionImpl implements CodeVersion, CodeVersion.Definition, CodeVersion.Update { private CodeVersionInner innerObject; @@ -49,37 +52,30 @@ private com.azure.resourcemanager.machinelearning.MachineLearningManager manager private String resourceGroupName; - private String workspaceName; + private String registryName; - private String name; + private String codeName; private String version; - public CodeVersionImpl withExistingCode(String resourceGroupName, String workspaceName, String name) { + public CodeVersionImpl withExistingCode(String resourceGroupName, String registryName, String codeName) { this.resourceGroupName = resourceGroupName; - this.workspaceName = workspaceName; - this.name = name; + this.registryName = registryName; + this.codeName = codeName; return this; } public CodeVersion create() { - this.innerObject = - serviceManager - .serviceClient() - .getCodeVersions() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, name, version, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryCodeVersions() + .createOrUpdate(resourceGroupName, registryName, codeName, version, this.innerModel(), Context.NONE); return this; } public CodeVersion create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getCodeVersions() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, version, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryCodeVersions() + .createOrUpdate(resourceGroupName, registryName, codeName, version, this.innerModel(), context); return this; } @@ -94,56 +90,57 @@ public CodeVersionImpl update() { } public CodeVersion apply() { - this.innerObject = - serviceManager - .serviceClient() - .getCodeVersions() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, name, version, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryCodeVersions() + .createOrUpdate(resourceGroupName, registryName, codeName, version, this.innerModel(), Context.NONE); return this; } public CodeVersion apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getCodeVersions() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, version, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryCodeVersions() + .createOrUpdate(resourceGroupName, registryName, codeName, version, this.innerModel(), context); return this; } - CodeVersionImpl( - CodeVersionInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + CodeVersionImpl(CodeVersionInner innerObject, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); - this.name = Utils.getValueFromIdByName(innerObject.id(), "codes"); - this.version = Utils.getValueFromIdByName(innerObject.id(), "versions"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.registryName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "registries"); + this.codeName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "codes"); + this.version = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "versions"); } public CodeVersion refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getCodeVersions() - .getWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryCodeVersions() + .getWithResponse(resourceGroupName, registryName, codeName, version, Context.NONE) + .getValue(); return this; } public CodeVersion refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getCodeVersions() - .getWithResponse(resourceGroupName, workspaceName, name, version, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryCodeVersions() + .getWithResponse(resourceGroupName, registryName, codeName, version, context) + .getValue(); return this; } + public Response createOrGetStartPendingUploadWithResponse(PendingUploadRequestDto body, + Context context) { + return serviceManager.registryCodeVersions() + .createOrGetStartPendingUploadWithResponse(resourceGroupName, registryName, codeName, version, body, + context); + } + + public PendingUploadResponseDto createOrGetStartPendingUpload(PendingUploadRequestDto body) { + return serviceManager.registryCodeVersions() + .createOrGetStartPendingUpload(resourceGroupName, registryName, codeName, version, body); + } + public CodeVersionImpl withProperties(CodeVersionProperties properties) { this.innerModel().withProperties(properties); return this; diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeVersionsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeVersionsClientImpl.java index 5e0cdc080acdd..0431d1b10b6ed 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeVersionsClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeVersionsClientImpl.java @@ -13,6 +13,7 @@ import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -26,150 +27,154 @@ import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.machinelearning.fluent.CodeVersionsClient; import com.azure.resourcemanager.machinelearning.fluent.models.CodeVersionInner; +import com.azure.resourcemanager.machinelearning.fluent.models.PendingUploadResponseDtoInner; import com.azure.resourcemanager.machinelearning.models.CodeVersionResourceArmPaginatedResult; +import com.azure.resourcemanager.machinelearning.models.DestinationAsset; +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in CodeVersionsClient. */ +/** + * An instance of this class provides access to all the operations defined in CodeVersionsClient. + */ public final class CodeVersionsClientImpl implements CodeVersionsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final CodeVersionsService service; - /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of CodeVersionsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ - CodeVersionsClientImpl(AzureMachineLearningWorkspacesImpl client) { - this.service = - RestProxy.create(CodeVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + CodeVersionsClientImpl(AzureMachineLearningServicesImpl client) { + this.service + = RestProxy.create(CodeVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesCodeVersions to be used by the proxy + * The interface defining all the services for AzureMachineLearningServicesCodeVersions to be used by the proxy * service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AzureMachineLearning") public interface CodeVersionsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @QueryParam("$orderBy") String orderBy, @QueryParam("$top") Integer top, @QueryParam("$skip") String skip, + @QueryParam("hash") String hash, @QueryParam("hashVersion") String hashVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @QueryParam("$orderBy") String orderBy, - @QueryParam("$top") Integer top, - @QueryParam("$skip") String skip, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}") - @ExpectedResponses({200, 204}) + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, + Mono> createOrUpdate(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @PathParam("version") String version, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}") - @ExpectedResponses({200}) + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") CodeVersionInner body, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/publish") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono>> publish(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @PathParam("version") String version, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}") - @ExpectedResponses({200, 201}) + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") DestinationAsset body, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/startPendingUpload") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, + Mono> createOrGetStartPendingUpload(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @PathParam("version") String version, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CodeVersionInner body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") PendingUploadRequestDto body, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * List versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. * @param orderBy Ordering of list. * @param top Maximum number of records to return. * @param skip Continuation token for pagination. + * @param hash If specified, return CodeVersion assets with specified content hash value, regardless of name. + * @param hashVersion Hash algorithm version when listing by hash. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of CodeVersion entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String workspaceName, String name, String orderBy, Integer top, String skip) { + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String name, String orderBy, Integer top, String skip, String hash, String hashVersion) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -183,69 +188,42 @@ private Mono> listSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - orderBy, - top, - skip, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), orderBy, top, skip, hash, + hashVersion, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. * @param orderBy Ordering of list. * @param top Maximum number of records to return. * @param skip Continuation token for pagination. + * @param hash If specified, return CodeVersion assets with specified content hash value, regardless of name. + * @param hashVersion Hash algorithm version when listing by hash. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of CodeVersion entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String workspaceName, - String name, - String orderBy, - Integer top, - String skip, - Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String name, String orderBy, Integer top, String skip, String hash, String hashVersion, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -260,54 +238,39 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - orderBy, - top, - skip, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, name, + this.client.getApiVersion(), orderBy, top, skip, hash, hashVersion, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. * @param orderBy Ordering of list. * @param top Maximum number of records to return. * @param skip Continuation token for pagination. + * @param hash If specified, return CodeVersion assets with specified content hash value, regardless of name. + * @param hashVersion Hash algorithm version when listing by hash. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of CodeVersion entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String workspaceName, String name, String orderBy, Integer top, String skip) { + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String name, + String orderBy, Integer top, String skip, String hash, String hashVersion) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, name, orderBy, top, skip), + () -> listSinglePageAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, hash, hashVersion), nextLink -> listNextSinglePageAsync(nextLink)); } /** * List versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -321,20 +284,24 @@ private PagedFlux listAsync(String resourceGroupName, String w final String orderBy = null; final Integer top = null; final String skip = null; + final String hash = null; + final String hashVersion = null; return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, name, orderBy, top, skip), + () -> listSinglePageAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, hash, hashVersion), nextLink -> listNextSinglePageAsync(nextLink)); } /** * List versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. * @param orderBy Ordering of list. * @param top Maximum number of records to return. * @param skip Continuation token for pagination. + * @param hash If specified, return CodeVersion assets with specified content hash value, regardless of name. + * @param hashVersion Hash algorithm version when listing by hash. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -342,22 +309,15 @@ private PagedFlux listAsync(String resourceGroupName, String w * @return a paginated list of CodeVersion entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String workspaceName, - String name, - String orderBy, - Integer top, - String skip, - Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String name, + String orderBy, Integer top, String skip, String hash, String hashVersion, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, + hash, hashVersion, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * List versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -371,18 +331,23 @@ public PagedIterable list(String resourceGroupName, String wor final String orderBy = null; final Integer top = null; final String skip = null; - return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, name, orderBy, top, skip)); + final String hash = null; + final String hashVersion = null; + return new PagedIterable<>( + listAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, hash, hashVersion)); } /** * List versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. * @param orderBy Ordering of list. * @param top Maximum number of records to return. * @param skip Continuation token for pagination. + * @param hash If specified, return CodeVersion assets with specified content hash value, regardless of name. + * @param hashVersion Hash algorithm version when listing by hash. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -390,20 +355,15 @@ public PagedIterable list(String resourceGroupName, String wor * @return a paginated list of CodeVersion entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, - String workspaceName, - String name, - String orderBy, - Integer top, - String skip, - Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, context)); + public PagedIterable list(String resourceGroupName, String workspaceName, String name, + String orderBy, Integer top, String skip, String hash, String hashVersion, Context context) { + return new PagedIterable<>( + listAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, hash, hashVersion, context)); } /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -414,19 +374,15 @@ public PagedIterable list( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String name, String version) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, String name, + String version) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -443,25 +399,14 @@ private Mono> deleteWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - version, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, version, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -473,19 +418,15 @@ private Mono> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String name, String version, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, String name, + String version, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -502,22 +443,13 @@ private Mono> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - version, - this.client.getApiVersion(), - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, version, this.client.getApiVersion(), accept, context); } /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -535,7 +467,7 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -547,14 +479,14 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context) { + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String name, + String version, Context context) { return deleteWithResponseAsync(resourceGroupName, workspaceName, name, version, context).block(); } /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -570,7 +502,7 @@ public void delete(String resourceGroupName, String workspaceName, String name, /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -581,19 +513,15 @@ public void delete(String resourceGroupName, String workspaceName, String name, * @return version along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String name, String version) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String name, String version) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -610,25 +538,14 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - version, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, version, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -640,19 +557,15 @@ private Mono> getWithResponseAsync( * @return version along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String name, String version, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String name, String version, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -669,22 +582,13 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - version, - this.client.getApiVersion(), - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + name, version, this.client.getApiVersion(), accept, context); } /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -695,15 +599,15 @@ private Mono> getWithResponseAsync( * @return version on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String workspaceName, String name, String version) { + private Mono getAsync(String resourceGroupName, String workspaceName, String name, + String version) { return getWithResponseAsync(resourceGroupName, workspaceName, name, version) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -715,14 +619,14 @@ private Mono getAsync( * @return version along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context) { + public Response getWithResponse(String resourceGroupName, String workspaceName, String name, + String version, Context context) { return getWithResponseAsync(resourceGroupName, workspaceName, name, version, context).block(); } /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -739,7 +643,7 @@ public CodeVersionInner get(String resourceGroupName, String workspaceName, Stri /** * Create or update version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -748,23 +652,19 @@ public CodeVersionInner get(String resourceGroupName, String workspaceName, Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link - * Mono}. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String workspaceName, String name, String version, CodeVersionInner body) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String name, String version, CodeVersionInner body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -786,26 +686,14 @@ private Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - version, - this.client.getApiVersion(), - body, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, version, this.client.getApiVersion(), body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or update version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -815,28 +703,19 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link - * Mono}. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String workspaceName, - String name, - String version, - CodeVersionInner body, - Context context) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String name, String version, CodeVersionInner body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -858,23 +737,13 @@ private Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - version, - this.client.getApiVersion(), - body, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, version, this.client.getApiVersion(), body, accept, context); } /** * Create or update version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -886,15 +755,15 @@ private Mono> createOrUpdateWithResponseAsync( * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String workspaceName, String name, String version, CodeVersionInner body) { + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, String name, + String version, CodeVersionInner body) { return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, version, body) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Create or update version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -907,19 +776,14 @@ private Mono createOrUpdateAsync( * @return azure Resource Manager resource envelope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String name, - String version, - CodeVersionInner body, - Context context) { + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String name, String version, CodeVersionInner body, Context context) { return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, version, body, context).block(); } /** * Create or update version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -931,22 +795,443 @@ public Response createOrUpdateWithResponse( * @return azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CodeVersionInner createOrUpdate( - String resourceGroupName, String workspaceName, String name, String version, CodeVersionInner body) { + public CodeVersionInner createOrUpdate(String resourceGroupName, String workspaceName, String name, String version, + CodeVersionInner body) { return createOrUpdateWithResponse(resourceGroupName, workspaceName, name, version, body, Context.NONE) .getValue(); } + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> publishWithResponseAsync(String resourceGroupName, String workspaceName, + String name, String version, DestinationAsset body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.publish(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, version, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> publishWithResponseAsync(String resourceGroupName, String workspaceName, + String name, String version, DestinationAsset body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.publish(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, version, this.client.getApiVersion(), body, accept, context); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPublishAsync(String resourceGroupName, String workspaceName, + String name, String version, DestinationAsset body) { + Mono>> mono + = publishWithResponseAsync(resourceGroupName, workspaceName, name, version, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPublishAsync(String resourceGroupName, String workspaceName, + String name, String version, DestinationAsset body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = publishWithResponseAsync(resourceGroupName, workspaceName, name, version, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPublish(String resourceGroupName, String workspaceName, String name, + String version, DestinationAsset body) { + return this.beginPublishAsync(resourceGroupName, workspaceName, name, version, body).getSyncPoller(); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPublish(String resourceGroupName, String workspaceName, String name, + String version, DestinationAsset body, Context context) { + return this.beginPublishAsync(resourceGroupName, workspaceName, name, version, body, context).getSyncPoller(); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono publishAsync(String resourceGroupName, String workspaceName, String name, String version, + DestinationAsset body) { + return beginPublishAsync(resourceGroupName, workspaceName, name, version, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono publishAsync(String resourceGroupName, String workspaceName, String name, String version, + DestinationAsset body, Context context) { + return beginPublishAsync(resourceGroupName, workspaceName, name, version, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void publish(String resourceGroupName, String workspaceName, String name, String version, + DestinationAsset body) { + publishAsync(resourceGroupName, workspaceName, name, version, body).block(); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void publish(String resourceGroupName, String workspaceName, String name, String version, + DestinationAsset body, Context context) { + publishAsync(resourceGroupName, workspaceName, name, version, body, context).block(); + } + + /** + * Generate a storage location and credential for the client to upload a code asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrGetStartPendingUploadWithResponseAsync( + String resourceGroupName, String workspaceName, String name, String version, PendingUploadRequestDto body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrGetStartPendingUpload(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, name, version, + this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generate a storage location and credential for the client to upload a code asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrGetStartPendingUploadWithResponseAsync( + String resourceGroupName, String workspaceName, String name, String version, PendingUploadRequestDto body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrGetStartPendingUpload(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, version, this.client.getApiVersion(), body, accept, context); + } + + /** + * Generate a storage location and credential for the client to upload a code asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrGetStartPendingUploadAsync(String resourceGroupName, + String workspaceName, String name, String version, PendingUploadRequestDto body) { + return createOrGetStartPendingUploadWithResponseAsync(resourceGroupName, workspaceName, name, version, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Generate a storage location and credential for the client to upload a code asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrGetStartPendingUploadWithResponse(String resourceGroupName, + String workspaceName, String name, String version, PendingUploadRequestDto body, Context context) { + return createOrGetStartPendingUploadWithResponseAsync(resourceGroupName, workspaceName, name, version, body, + context).block(); + } + + /** + * Generate a storage location and credential for the client to upload a code asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PendingUploadResponseDtoInner createOrGetStartPendingUpload(String resourceGroupName, String workspaceName, + String name, String version, PendingUploadRequestDto body) { + return createOrGetStartPendingUploadWithResponse(resourceGroupName, workspaceName, name, version, body, + Context.NONE).getValue(); + } + /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of CodeVersion entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -954,37 +1239,26 @@ private Mono> listNextSinglePageAsync(String nex return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of CodeVersion entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -992,23 +1266,13 @@ private Mono> listNextSinglePageAsync(String nex return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeVersionsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeVersionsImpl.java index 49705d0a8abd7..f345b530a9c70 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeVersionsImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/CodeVersionsImpl.java @@ -11,8 +11,12 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.machinelearning.fluent.CodeVersionsClient; import com.azure.resourcemanager.machinelearning.fluent.models.CodeVersionInner; +import com.azure.resourcemanager.machinelearning.fluent.models.PendingUploadResponseDtoInner; import com.azure.resourcemanager.machinelearning.models.CodeVersion; import com.azure.resourcemanager.machinelearning.models.CodeVersions; +import com.azure.resourcemanager.machinelearning.models.DestinationAsset; +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; +import com.azure.resourcemanager.machinelearning.models.PendingUploadResponseDto; public final class CodeVersionsImpl implements CodeVersions { private static final ClientLogger LOGGER = new ClientLogger(CodeVersionsImpl.class); @@ -21,8 +25,7 @@ public final class CodeVersionsImpl implements CodeVersions { private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - public CodeVersionsImpl( - CodeVersionsClient innerClient, + public CodeVersionsImpl(CodeVersionsClient innerClient, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -30,24 +33,18 @@ public CodeVersionsImpl( public PagedIterable list(String resourceGroupName, String workspaceName, String name) { PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName, name); - return Utils.mapPage(inner, inner1 -> new CodeVersionImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CodeVersionImpl(inner1, this.manager())); } - public PagedIterable list( - String resourceGroupName, - String workspaceName, - String name, - String orderBy, - Integer top, - String skip, - Context context) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, workspaceName, name, orderBy, top, skip, context); - return Utils.mapPage(inner, inner1 -> new CodeVersionImpl(inner1, this.manager())); + public PagedIterable list(String resourceGroupName, String workspaceName, String name, String orderBy, + Integer top, String skip, String hash, String hashVersion, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, workspaceName, name, orderBy, top, skip, hash, hashVersion, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CodeVersionImpl(inner1, this.manager())); } - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context) { + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String name, + String version, Context context) { return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, name, version, context); } @@ -55,15 +52,12 @@ public void delete(String resourceGroupName, String workspaceName, String name, this.serviceClient().delete(resourceGroupName, workspaceName, name, version); } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, workspaceName, name, version, context); + public Response getWithResponse(String resourceGroupName, String workspaceName, String name, + String version, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, name, version, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new CodeVersionImpl(inner.getValue(), this.manager())); } else { return null; @@ -79,136 +73,60 @@ public CodeVersion get(String resourceGroupName, String workspaceName, String na } } - public CodeVersion getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "codes"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'codes'.", id))); - } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, String name, + String version, CodeVersionInner body, Context context) { + Response inner = this.serviceClient() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, version, body, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CodeVersionImpl(inner.getValue(), this.manager())); + } else { + return null; } - return this.getWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE).getValue(); } - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "codes"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'codes'.", id))); - } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + public CodeVersion createOrUpdate(String resourceGroupName, String workspaceName, String name, String version, + CodeVersionInner body) { + CodeVersionInner inner + = this.serviceClient().createOrUpdate(resourceGroupName, workspaceName, name, version, body); + if (inner != null) { + return new CodeVersionImpl(inner, this.manager()); + } else { + return null; } - return this.getWithResponse(resourceGroupName, workspaceName, name, version, context); } - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "codes"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'codes'.", id))); - } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); - } - this.deleteWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE); + public void publish(String resourceGroupName, String workspaceName, String name, String version, + DestinationAsset body) { + this.serviceClient().publish(resourceGroupName, workspaceName, name, version, body); } - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "codes"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'codes'.", id))); + public void publish(String resourceGroupName, String workspaceName, String name, String version, + DestinationAsset body, Context context) { + this.serviceClient().publish(resourceGroupName, workspaceName, name, version, body, context); + } + + public Response createOrGetStartPendingUploadWithResponse(String resourceGroupName, + String workspaceName, String name, String version, PendingUploadRequestDto body, Context context) { + Response inner = this.serviceClient() + .createOrGetStartPendingUploadWithResponse(resourceGroupName, workspaceName, name, version, body, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PendingUploadResponseDtoImpl(inner.getValue(), this.manager())); + } else { + return null; } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + + public PendingUploadResponseDto createOrGetStartPendingUpload(String resourceGroupName, String workspaceName, + String name, String version, PendingUploadRequestDto body) { + PendingUploadResponseDtoInner inner + = this.serviceClient().createOrGetStartPendingUpload(resourceGroupName, workspaceName, name, version, body); + if (inner != null) { + return new PendingUploadResponseDtoImpl(inner, this.manager()); + } else { + return null; } - return this.deleteWithResponse(resourceGroupName, workspaceName, name, version, context); } private CodeVersionsClient serviceClient() { @@ -218,8 +136,4 @@ private CodeVersionsClient serviceClient() { private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { return this.serviceManager; } - - public CodeVersionImpl define(String name) { - return new CodeVersionImpl(name, this.manager()); - } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentContainerImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentContainerImpl.java index 0208215c0403c..a7bc11c808fcf 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentContainerImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentContainerImpl.java @@ -50,41 +50,35 @@ private com.azure.resourcemanager.machinelearning.MachineLearningManager manager private String resourceGroupName; - private String workspaceName; + private String registryName; - private String name; + private String componentName; - public ComponentContainerImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + public ComponentContainerImpl withExistingRegistry(String resourceGroupName, String registryName) { this.resourceGroupName = resourceGroupName; - this.workspaceName = workspaceName; + this.registryName = registryName; return this; } public ComponentContainer create() { - this.innerObject = - serviceManager - .serviceClient() - .getComponentContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryComponentContainers() + .createOrUpdate(resourceGroupName, registryName, componentName, this.innerModel(), Context.NONE); return this; } public ComponentContainer create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getComponentContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryComponentContainers() + .createOrUpdate(resourceGroupName, registryName, componentName, this.innerModel(), context); return this; } - ComponentContainerImpl( - String name, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + ComponentContainerImpl(String name, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = new ComponentContainerInner(); this.serviceManager = serviceManager; - this.name = name; + this.componentName = name; } public ComponentContainerImpl update() { @@ -92,52 +86,41 @@ public ComponentContainerImpl update() { } public ComponentContainer apply() { - this.innerObject = - serviceManager - .serviceClient() - .getComponentContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryComponentContainers() + .createOrUpdate(resourceGroupName, registryName, componentName, this.innerModel(), Context.NONE); return this; } public ComponentContainer apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getComponentContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryComponentContainers() + .createOrUpdate(resourceGroupName, registryName, componentName, this.innerModel(), context); return this; } - ComponentContainerImpl( - ComponentContainerInner innerObject, + ComponentContainerImpl(ComponentContainerInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); - this.name = Utils.getValueFromIdByName(innerObject.id(), "components"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.registryName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "registries"); + this.componentName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "components"); } public ComponentContainer refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getComponentContainers() - .getWithResponse(resourceGroupName, workspaceName, name, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryComponentContainers() + .getWithResponse(resourceGroupName, registryName, componentName, Context.NONE) + .getValue(); return this; } public ComponentContainer refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getComponentContainers() - .getWithResponse(resourceGroupName, workspaceName, name, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryComponentContainers() + .getWithResponse(resourceGroupName, registryName, componentName, context) + .getValue(); return this; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentContainersClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentContainersClientImpl.java index 7c8593db5a972..f8b8edbff0b5f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentContainersClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentContainersClientImpl.java @@ -34,112 +34,92 @@ import com.azure.resourcemanager.machinelearning.models.ListViewType; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ComponentContainersClient. */ +/** + * An instance of this class provides access to all the operations defined in ComponentContainersClient. + */ public final class ComponentContainersClientImpl implements ComponentContainersClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final ComponentContainersService service; - /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of ComponentContainersClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ - ComponentContainersClientImpl(AzureMachineLearningWorkspacesImpl client) { - this.service = - RestProxy.create(ComponentContainersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + ComponentContainersClientImpl(AzureMachineLearningServicesImpl client) { + this.service = RestProxy.create(ComponentContainersService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesComponentContainers to be used by the + * The interface defining all the services for AzureMachineLearningServicesComponentContainers to be used by the * proxy service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AzureMachineLearning") public interface ComponentContainersService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, + Mono> list(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @QueryParam("api-version") String apiVersion, - @QueryParam("$skip") String skip, - @QueryParam("listViewType") ListViewType listViewType, - @HeaderParam("Accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @QueryParam("$skip") String skip, + @QueryParam("listViewType") ListViewType listViewType, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, + Mono> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, + Mono> createOrUpdate(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ComponentContainerInner body, - @HeaderParam("Accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ComponentContainerInner body, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * List component containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -148,22 +128,18 @@ Mono> listNext( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of ComponentContainer entities along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String workspaceName, String skip, ListViewType listViewType) { + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, String skip, ListViewType listViewType) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -174,34 +150,16 @@ private Mono> listSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - this.client.getApiVersion(), - skip, - listViewType, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), skip, listViewType, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List component containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -211,22 +169,18 @@ private Mono> listSinglePageAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of ComponentContainer entities along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String workspaceName, String skip, ListViewType listViewType, Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, String skip, ListViewType listViewType, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -238,30 +192,15 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - this.client.getApiVersion(), - skip, - listViewType, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + this.client.getApiVersion(), skip, listViewType, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List component containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -272,16 +211,15 @@ private Mono> listSinglePageAsync( * @return a paginated list of ComponentContainer entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String workspaceName, String skip, ListViewType listViewType) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, skip, listViewType), + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String skip, + ListViewType listViewType) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skip, listViewType), nextLink -> listNextSinglePageAsync(nextLink)); } /** * List component containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -293,14 +231,13 @@ private PagedFlux listAsync( private PagedFlux listAsync(String resourceGroupName, String workspaceName) { final String skip = null; final ListViewType listViewType = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, skip, listViewType), + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skip, listViewType), nextLink -> listNextSinglePageAsync(nextLink)); } /** * List component containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -312,16 +249,15 @@ private PagedFlux listAsync(String resourceGroupName, S * @return a paginated list of ComponentContainer entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String workspaceName, String skip, ListViewType listViewType, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, skip, listViewType, context), + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String skip, + ListViewType listViewType, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skip, listViewType, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * List component containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -338,7 +274,7 @@ public PagedIterable list(String resourceGroupName, Str /** * List component containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -350,14 +286,14 @@ public PagedIterable list(String resourceGroupName, Str * @return a paginated list of ComponentContainer entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String workspaceName, String skip, ListViewType listViewType, Context context) { + public PagedIterable list(String resourceGroupName, String workspaceName, String skip, + ListViewType listViewType, Context context) { return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, skip, listViewType, context)); } /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -369,16 +305,12 @@ public PagedIterable list( @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, String name) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -392,24 +324,14 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -420,19 +342,15 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String name, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, String name, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -446,21 +364,13 @@ private Mono> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, this.client.getApiVersion(), accept, context); } /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -476,7 +386,7 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -487,14 +397,14 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String name, Context context) { + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String name, + Context context) { return deleteWithResponseAsync(resourceGroupName, workspaceName, name, context).block(); } /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -509,7 +419,7 @@ public void delete(String resourceGroupName, String workspaceName, String name) /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -519,19 +429,15 @@ public void delete(String resourceGroupName, String workspaceName, String name) * @return container along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String name) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String name) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -545,24 +451,14 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -573,19 +469,15 @@ private Mono> getWithResponseAsync( * @return container along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String name, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String name, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -599,21 +491,13 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + name, this.client.getApiVersion(), accept, context); } /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -630,7 +514,7 @@ private Mono getAsync(String resourceGroupName, String /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -641,14 +525,14 @@ private Mono getAsync(String resourceGroupName, String * @return container along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String name, Context context) { + public Response getWithResponse(String resourceGroupName, String workspaceName, + String name, Context context) { return getWithResponseAsync(resourceGroupName, workspaceName, name, context).block(); } /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -664,7 +548,7 @@ public ComponentContainerInner get(String resourceGroupName, String workspaceNam /** * Create or update container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -672,23 +556,19 @@ public ComponentContainerInner get(String resourceGroupName, String workspaceNam * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link - * Mono}. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String workspaceName, String name, ComponentContainerInner body) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String name, ComponentContainerInner body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -707,25 +587,14 @@ private Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - body, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or update container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -734,23 +603,19 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link - * Mono}. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String workspaceName, String name, ComponentContainerInner body, Context context) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String name, ComponentContainerInner body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -769,22 +634,13 @@ private Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - body, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, this.client.getApiVersion(), body, accept, context); } /** * Create or update container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -795,15 +651,15 @@ private Mono> createOrUpdateWithResponseAsync( * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String workspaceName, String name, ComponentContainerInner body) { + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String name, ComponentContainerInner body) { return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, body) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Create or update container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -815,14 +671,14 @@ private Mono createOrUpdateAsync( * @return azure Resource Manager resource envelope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, String workspaceName, String name, ComponentContainerInner body, Context context) { + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String name, ComponentContainerInner body, Context context) { return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, body, context).block(); } /** * Create or update container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -833,21 +689,20 @@ public Response createOrUpdateWithResponse( * @return azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ComponentContainerInner createOrUpdate( - String resourceGroupName, String workspaceName, String name, ComponentContainerInner body) { + public ComponentContainerInner createOrUpdate(String resourceGroupName, String workspaceName, String name, + ComponentContainerInner body) { return createOrUpdateWithResponse(resourceGroupName, workspaceName, name, body, Context.NONE).getValue(); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of ComponentContainer entities along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -855,37 +710,26 @@ private Mono> listNextSinglePageAsync(Str return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of ComponentContainer entities along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -893,23 +737,13 @@ private Mono> listNextSinglePageAsync(Str return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentContainersImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentContainersImpl.java index b9bc5f40a732d..7d56afd099c11 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentContainersImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentContainersImpl.java @@ -22,8 +22,7 @@ public final class ComponentContainersImpl implements ComponentContainers { private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - public ComponentContainersImpl( - ComponentContainersClient innerClient, + public ComponentContainersImpl(ComponentContainersClient innerClient, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -31,18 +30,18 @@ public ComponentContainersImpl( public PagedIterable list(String resourceGroupName, String workspaceName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); - return Utils.mapPage(inner, inner1 -> new ComponentContainerImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ComponentContainerImpl(inner1, this.manager())); } - public PagedIterable list( - String resourceGroupName, String workspaceName, String skip, ListViewType listViewType, Context context) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, workspaceName, skip, listViewType, context); - return Utils.mapPage(inner, inner1 -> new ComponentContainerImpl(inner1, this.manager())); + public PagedIterable list(String resourceGroupName, String workspaceName, String skip, + ListViewType listViewType, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, skip, listViewType, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ComponentContainerImpl(inner1, this.manager())); } - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String name, Context context) { + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String name, + Context context) { return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, name, context); } @@ -50,15 +49,12 @@ public void delete(String resourceGroupName, String workspaceName, String name) this.serviceClient().delete(resourceGroupName, workspaceName, name); } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String name, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, workspaceName, name, context); + public Response getWithResponse(String resourceGroupName, String workspaceName, String name, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, name, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ComponentContainerImpl(inner.getValue(), this.manager())); } else { return null; @@ -74,108 +70,27 @@ public ComponentContainer get(String resourceGroupName, String workspaceName, St } } - public ComponentContainer getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "components"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id))); - } - return this.getWithResponse(resourceGroupName, workspaceName, name, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "components"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id))); - } - return this.getWithResponse(resourceGroupName, workspaceName, name, context); - } - - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "components"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id))); + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String name, ComponentContainerInner body, Context context) { + Response inner + = this.serviceClient().createOrUpdateWithResponse(resourceGroupName, workspaceName, name, body, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ComponentContainerImpl(inner.getValue(), this.manager())); + } else { + return null; } - this.deleteWithResponse(resourceGroupName, workspaceName, name, Context.NONE); } - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "components"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id))); + public ComponentContainer createOrUpdate(String resourceGroupName, String workspaceName, String name, + ComponentContainerInner body) { + ComponentContainerInner inner + = this.serviceClient().createOrUpdate(resourceGroupName, workspaceName, name, body); + if (inner != null) { + return new ComponentContainerImpl(inner, this.manager()); + } else { + return null; } - return this.deleteWithResponse(resourceGroupName, workspaceName, name, context); } private ComponentContainersClient serviceClient() { @@ -185,8 +100,4 @@ private ComponentContainersClient serviceClient() { private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { return this.serviceManager; } - - public ComponentContainerImpl define(String name) { - return new ComponentContainerImpl(name, this.manager()); - } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentVersionImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentVersionImpl.java index 2b90ee811ddbd..6cda961e14aa3 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentVersionImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentVersionImpl.java @@ -50,37 +50,31 @@ private com.azure.resourcemanager.machinelearning.MachineLearningManager manager private String resourceGroupName; - private String workspaceName; + private String registryName; - private String name; + private String componentName; private String version; - public ComponentVersionImpl withExistingComponent(String resourceGroupName, String workspaceName, String name) { + public ComponentVersionImpl withExistingComponent(String resourceGroupName, String registryName, + String componentName) { this.resourceGroupName = resourceGroupName; - this.workspaceName = workspaceName; - this.name = name; + this.registryName = registryName; + this.componentName = componentName; return this; } public ComponentVersion create() { - this.innerObject = - serviceManager - .serviceClient() - .getComponentVersions() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, name, version, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryComponentVersions() + .createOrUpdate(resourceGroupName, registryName, componentName, version, this.innerModel(), Context.NONE); return this; } public ComponentVersion create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getComponentVersions() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, version, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryComponentVersions() + .createOrUpdate(resourceGroupName, registryName, componentName, version, this.innerModel(), context); return this; } @@ -95,54 +89,42 @@ public ComponentVersionImpl update() { } public ComponentVersion apply() { - this.innerObject = - serviceManager - .serviceClient() - .getComponentVersions() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, name, version, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryComponentVersions() + .createOrUpdate(resourceGroupName, registryName, componentName, version, this.innerModel(), Context.NONE); return this; } public ComponentVersion apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getComponentVersions() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, version, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryComponentVersions() + .createOrUpdate(resourceGroupName, registryName, componentName, version, this.innerModel(), context); return this; } - ComponentVersionImpl( - ComponentVersionInner innerObject, + ComponentVersionImpl(ComponentVersionInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); - this.name = Utils.getValueFromIdByName(innerObject.id(), "components"); - this.version = Utils.getValueFromIdByName(innerObject.id(), "versions"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.registryName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "registries"); + this.componentName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "components"); + this.version = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "versions"); } public ComponentVersion refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getComponentVersions() - .getWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryComponentVersions() + .getWithResponse(resourceGroupName, registryName, componentName, version, Context.NONE) + .getValue(); return this; } public ComponentVersion refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getComponentVersions() - .getWithResponse(resourceGroupName, workspaceName, name, version, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryComponentVersions() + .getWithResponse(resourceGroupName, registryName, componentName, version, context) + .getValue(); return this; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentVersionsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentVersionsClientImpl.java index 4cfb98d8af644..6dc03ae5074ea 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentVersionsClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentVersionsClientImpl.java @@ -13,6 +13,7 @@ import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -26,126 +27,118 @@ import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.machinelearning.fluent.ComponentVersionsClient; import com.azure.resourcemanager.machinelearning.fluent.models.ComponentVersionInner; import com.azure.resourcemanager.machinelearning.models.ComponentVersionResourceArmPaginatedResult; +import com.azure.resourcemanager.machinelearning.models.DestinationAsset; import com.azure.resourcemanager.machinelearning.models.ListViewType; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ComponentVersionsClient. */ +/** + * An instance of this class provides access to all the operations defined in ComponentVersionsClient. + */ public final class ComponentVersionsClientImpl implements ComponentVersionsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final ComponentVersionsService service; - /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of ComponentVersionsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ - ComponentVersionsClientImpl(AzureMachineLearningWorkspacesImpl client) { - this.service = - RestProxy.create(ComponentVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + ComponentVersionsClientImpl(AzureMachineLearningServicesImpl client) { + this.service + = RestProxy.create(ComponentVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesComponentVersions to be used by the - * proxy service to perform REST calls. + * The interface defining all the services for AzureMachineLearningServicesComponentVersions to be used by the proxy + * service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AzureMachineLearning") public interface ComponentVersionsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, + Mono> list(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @QueryParam("$orderBy") String orderBy, - @QueryParam("$top") Integer top, - @QueryParam("$skip") String skip, - @QueryParam("listViewType") ListViewType listViewType, - @HeaderParam("Accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @QueryParam("$orderBy") String orderBy, @QueryParam("$top") Integer top, @QueryParam("$skip") String skip, + @QueryParam("listViewType") ListViewType listViewType, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, + Mono> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @PathParam("version") String version, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @PathParam("version") String version, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, + Mono> createOrUpdate(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @PathParam("version") String version, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ComponentVersionInner body, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") ComponentVersionInner body, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}/publish") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> publish(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") DestinationAsset body, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * List component versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Component name. @@ -157,28 +150,18 @@ Mono> listNext( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of ComponentVersion entities along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String workspaceName, - String name, - String orderBy, - Integer top, - String skip, - ListViewType listViewType) { + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, String name, String orderBy, Integer top, String skip, ListViewType listViewType) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -192,37 +175,17 @@ private Mono> listSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - orderBy, - top, - skip, - listViewType, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), orderBy, top, skip, listViewType, + accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List component versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Component name. @@ -235,29 +198,19 @@ private Mono> listSinglePageAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of ComponentVersion entities along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String workspaceName, - String name, - String orderBy, - Integer top, - String skip, - ListViewType listViewType, + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, String name, String orderBy, Integer top, String skip, ListViewType listViewType, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -272,33 +225,15 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - orderBy, - top, - skip, - listViewType, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, name, + this.client.getApiVersion(), orderBy, top, skip, listViewType, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List component versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Component name. @@ -312,14 +247,8 @@ private Mono> listSinglePageAsync( * @return a paginated list of ComponentVersion entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String workspaceName, - String name, - String orderBy, - Integer top, - String skip, - ListViewType listViewType) { + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String name, + String orderBy, Integer top, String skip, ListViewType listViewType) { return new PagedFlux<>( () -> listSinglePageAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType), nextLink -> listNextSinglePageAsync(nextLink)); @@ -327,7 +256,7 @@ private PagedFlux listAsync( /** * List component versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Component name. @@ -349,7 +278,7 @@ private PagedFlux listAsync(String resourceGroupName, Str /** * List component versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Component name. @@ -364,24 +293,15 @@ private PagedFlux listAsync(String resourceGroupName, Str * @return a paginated list of ComponentVersion entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String workspaceName, - String name, - String orderBy, - Integer top, - String skip, - ListViewType listViewType, - Context context) { - return new PagedFlux<>( - () -> - listSinglePageAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String name, + String orderBy, Integer top, String skip, ListViewType listViewType, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, + listViewType, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * List component versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Component name. @@ -401,7 +321,7 @@ public PagedIterable list(String resourceGroupName, Strin /** * List component versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Component name. @@ -416,22 +336,15 @@ public PagedIterable list(String resourceGroupName, Strin * @return a paginated list of ComponentVersion entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, - String workspaceName, - String name, - String orderBy, - Integer top, - String skip, - ListViewType listViewType, - Context context) { + public PagedIterable list(String resourceGroupName, String workspaceName, String name, + String orderBy, Integer top, String skip, ListViewType listViewType, Context context) { return new PagedIterable<>( listAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, context)); } /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -442,19 +355,15 @@ public PagedIterable list( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String name, String version) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, String name, + String version) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -471,25 +380,14 @@ private Mono> deleteWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - version, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, version, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -501,19 +399,15 @@ private Mono> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String name, String version, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, String name, + String version, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -530,22 +424,13 @@ private Mono> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - version, - this.client.getApiVersion(), - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, version, this.client.getApiVersion(), accept, context); } /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -563,7 +448,7 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -575,14 +460,14 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context) { + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String name, + String version, Context context) { return deleteWithResponseAsync(resourceGroupName, workspaceName, name, version, context).block(); } /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -598,7 +483,7 @@ public void delete(String resourceGroupName, String workspaceName, String name, /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -609,19 +494,15 @@ public void delete(String resourceGroupName, String workspaceName, String name, * @return version along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String name, String version) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String name, String version) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -638,25 +519,14 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - version, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, version, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -668,19 +538,15 @@ private Mono> getWithResponseAsync( * @return version along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String name, String version, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String name, String version, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -697,22 +563,13 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - version, - this.client.getApiVersion(), - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + name, version, this.client.getApiVersion(), accept, context); } /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -723,15 +580,15 @@ private Mono> getWithResponseAsync( * @return version on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String workspaceName, String name, String version) { + private Mono getAsync(String resourceGroupName, String workspaceName, String name, + String version) { return getWithResponseAsync(resourceGroupName, workspaceName, name, version) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -743,14 +600,14 @@ private Mono getAsync( * @return version along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context) { + public Response getWithResponse(String resourceGroupName, String workspaceName, String name, + String version, Context context) { return getWithResponseAsync(resourceGroupName, workspaceName, name, version, context).block(); } /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -767,7 +624,7 @@ public ComponentVersionInner get(String resourceGroupName, String workspaceName, /** * Create or update version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -776,23 +633,19 @@ public ComponentVersionInner get(String resourceGroupName, String workspaceName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link - * Mono}. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String workspaceName, String name, String version, ComponentVersionInner body) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String name, String version, ComponentVersionInner body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -814,26 +667,14 @@ private Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - version, - this.client.getApiVersion(), - body, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, version, this.client.getApiVersion(), body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or update version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -843,28 +684,19 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link - * Mono}. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String workspaceName, - String name, - String version, - ComponentVersionInner body, - Context context) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String name, String version, ComponentVersionInner body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -886,23 +718,13 @@ private Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - version, - this.client.getApiVersion(), - body, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, version, this.client.getApiVersion(), body, accept, context); } /** * Create or update version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -914,15 +736,15 @@ private Mono> createOrUpdateWithResponseAsync( * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String workspaceName, String name, String version, ComponentVersionInner body) { + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, String name, + String version, ComponentVersionInner body) { return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, version, body) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Create or update version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -935,19 +757,14 @@ private Mono createOrUpdateAsync( * @return azure Resource Manager resource envelope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String name, - String version, - ComponentVersionInner body, - Context context) { + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String name, String version, ComponentVersionInner body, Context context) { return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, version, body, context).block(); } /** * Create or update version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -959,22 +776,282 @@ public Response createOrUpdateWithResponse( * @return azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ComponentVersionInner createOrUpdate( - String resourceGroupName, String workspaceName, String name, String version, ComponentVersionInner body) { + public ComponentVersionInner createOrUpdate(String resourceGroupName, String workspaceName, String name, + String version, ComponentVersionInner body) { return createOrUpdateWithResponse(resourceGroupName, workspaceName, name, version, body, Context.NONE) .getValue(); } + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> publishWithResponseAsync(String resourceGroupName, String workspaceName, + String name, String version, DestinationAsset body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.publish(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, version, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> publishWithResponseAsync(String resourceGroupName, String workspaceName, + String name, String version, DestinationAsset body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.publish(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, version, this.client.getApiVersion(), body, accept, context); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPublishAsync(String resourceGroupName, String workspaceName, + String name, String version, DestinationAsset body) { + Mono>> mono + = publishWithResponseAsync(resourceGroupName, workspaceName, name, version, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPublishAsync(String resourceGroupName, String workspaceName, + String name, String version, DestinationAsset body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = publishWithResponseAsync(resourceGroupName, workspaceName, name, version, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPublish(String resourceGroupName, String workspaceName, String name, + String version, DestinationAsset body) { + return this.beginPublishAsync(resourceGroupName, workspaceName, name, version, body).getSyncPoller(); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPublish(String resourceGroupName, String workspaceName, String name, + String version, DestinationAsset body, Context context) { + return this.beginPublishAsync(resourceGroupName, workspaceName, name, version, body, context).getSyncPoller(); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono publishAsync(String resourceGroupName, String workspaceName, String name, String version, + DestinationAsset body) { + return beginPublishAsync(resourceGroupName, workspaceName, name, version, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono publishAsync(String resourceGroupName, String workspaceName, String name, String version, + DestinationAsset body, Context context) { + return beginPublishAsync(resourceGroupName, workspaceName, name, version, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void publish(String resourceGroupName, String workspaceName, String name, String version, + DestinationAsset body) { + publishAsync(resourceGroupName, workspaceName, name, version, body).block(); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void publish(String resourceGroupName, String workspaceName, String name, String version, + DestinationAsset body, Context context) { + publishAsync(resourceGroupName, workspaceName, name, version, body, context).block(); + } + /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of ComponentVersion entities along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -982,37 +1059,26 @@ private Mono> listNextSinglePageAsync(Strin return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of ComponentVersion entities along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -1020,23 +1086,13 @@ private Mono> listNextSinglePageAsync(Strin return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentVersionsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentVersionsImpl.java index b31d3e83102bb..dae94b8cf0c4c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentVersionsImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComponentVersionsImpl.java @@ -13,6 +13,7 @@ import com.azure.resourcemanager.machinelearning.fluent.models.ComponentVersionInner; import com.azure.resourcemanager.machinelearning.models.ComponentVersion; import com.azure.resourcemanager.machinelearning.models.ComponentVersions; +import com.azure.resourcemanager.machinelearning.models.DestinationAsset; import com.azure.resourcemanager.machinelearning.models.ListViewType; public final class ComponentVersionsImpl implements ComponentVersions { @@ -22,8 +23,7 @@ public final class ComponentVersionsImpl implements ComponentVersions { private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - public ComponentVersionsImpl( - ComponentVersionsClient innerClient, + public ComponentVersionsImpl(ComponentVersionsClient innerClient, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -31,27 +31,18 @@ public ComponentVersionsImpl( public PagedIterable list(String resourceGroupName, String workspaceName, String name) { PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName, name); - return Utils.mapPage(inner, inner1 -> new ComponentVersionImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ComponentVersionImpl(inner1, this.manager())); } - public PagedIterable list( - String resourceGroupName, - String workspaceName, - String name, - String orderBy, - Integer top, - String skip, - ListViewType listViewType, - Context context) { - PagedIterable inner = - this - .serviceClient() - .list(resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, context); - return Utils.mapPage(inner, inner1 -> new ComponentVersionImpl(inner1, this.manager())); + public PagedIterable list(String resourceGroupName, String workspaceName, String name, + String orderBy, Integer top, String skip, ListViewType listViewType, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ComponentVersionImpl(inner1, this.manager())); } - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context) { + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String name, + String version, Context context) { return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, name, version, context); } @@ -59,15 +50,12 @@ public void delete(String resourceGroupName, String workspaceName, String name, this.serviceClient().delete(resourceGroupName, workspaceName, name, version); } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, workspaceName, name, version, context); + public Response getWithResponse(String resourceGroupName, String workspaceName, String name, + String version, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, name, version, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ComponentVersionImpl(inner.getValue(), this.manager())); } else { return null; @@ -83,136 +71,37 @@ public ComponentVersion get(String resourceGroupName, String workspaceName, Stri } } - public ComponentVersion getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "components"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id))); - } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String name, String version, ComponentVersionInner body, Context context) { + Response inner = this.serviceClient() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, version, body, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ComponentVersionImpl(inner.getValue(), this.manager())); + } else { + return null; } - return this.getWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE).getValue(); } - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "components"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id))); - } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + public ComponentVersion createOrUpdate(String resourceGroupName, String workspaceName, String name, String version, + ComponentVersionInner body) { + ComponentVersionInner inner + = this.serviceClient().createOrUpdate(resourceGroupName, workspaceName, name, version, body); + if (inner != null) { + return new ComponentVersionImpl(inner, this.manager()); + } else { + return null; } - return this.getWithResponse(resourceGroupName, workspaceName, name, version, context); } - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "components"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id))); - } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); - } - this.deleteWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE); + public void publish(String resourceGroupName, String workspaceName, String name, String version, + DestinationAsset body) { + this.serviceClient().publish(resourceGroupName, workspaceName, name, version, body); } - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "components"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id))); - } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); - } - return this.deleteWithResponse(resourceGroupName, workspaceName, name, version, context); + public void publish(String resourceGroupName, String workspaceName, String name, String version, + DestinationAsset body, Context context) { + this.serviceClient().publish(resourceGroupName, workspaceName, name, version, body, context); } private ComponentVersionsClient serviceClient() { @@ -222,8 +111,4 @@ private ComponentVersionsClient serviceClient() { private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { return this.serviceManager; } - - public ComponentVersionImpl define(String name) { - return new ComponentVersionImpl(name, this.manager()); - } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComputeResourceImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComputeResourceImpl.java index 26ad7807900da..89ef140519cf4 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComputeResourceImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComputeResourceImpl.java @@ -102,20 +102,16 @@ public ComputeResourceImpl withExistingWorkspace(String resourceGroupName, Strin } public ComputeResource create() { - this.innerObject = - serviceManager - .serviceClient() - .getComputes() - .createOrUpdate(resourceGroupName, workspaceName, computeName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getComputes() + .createOrUpdate(resourceGroupName, workspaceName, computeName, this.innerModel(), Context.NONE); return this; } public ComputeResource create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getComputes() - .createOrUpdate(resourceGroupName, workspaceName, computeName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient() + .getComputes() + .createOrUpdate(resourceGroupName, workspaceName, computeName, this.innerModel(), context); return this; } @@ -131,50 +127,41 @@ public ComputeResourceImpl update() { } public ComputeResource apply() { - this.innerObject = - serviceManager - .serviceClient() - .getComputes() - .update(resourceGroupName, workspaceName, computeName, updateParameters, Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getComputes() + .update(resourceGroupName, workspaceName, computeName, updateParameters, Context.NONE); return this; } public ComputeResource apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getComputes() - .update(resourceGroupName, workspaceName, computeName, updateParameters, context); + this.innerObject = serviceManager.serviceClient() + .getComputes() + .update(resourceGroupName, workspaceName, computeName, updateParameters, context); return this; } - ComputeResourceImpl( - ComputeResourceInner innerObject, + ComputeResourceImpl(ComputeResourceInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); - this.computeName = Utils.getValueFromIdByName(innerObject.id(), "computes"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.computeName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "computes"); } public ComputeResource refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getComputes() - .getWithResponse(resourceGroupName, workspaceName, computeName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getComputes() + .getWithResponse(resourceGroupName, workspaceName, computeName, Context.NONE) + .getValue(); return this; } public ComputeResource refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getComputes() - .getWithResponse(resourceGroupName, workspaceName, computeName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getComputes() + .getWithResponse(resourceGroupName, workspaceName, computeName, context) + .getValue(); return this; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComputeSecretsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComputeSecretsImpl.java index 217d0a038ed72..d27df3a916c56 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComputeSecretsImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComputeSecretsImpl.java @@ -6,19 +6,23 @@ import com.azure.resourcemanager.machinelearning.fluent.models.ComputeSecretsInner; import com.azure.resourcemanager.machinelearning.models.ComputeSecrets; +import com.azure.resourcemanager.machinelearning.models.ComputeType; public final class ComputeSecretsImpl implements ComputeSecrets { private ComputeSecretsInner innerObject; private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - ComputeSecretsImpl( - ComputeSecretsInner innerObject, + ComputeSecretsImpl(ComputeSecretsInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } + public ComputeType computeType() { + return this.innerModel().computeType(); + } + public ComputeSecretsInner innerModel() { return this.innerObject; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComputesClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComputesClientImpl.java index 1502a033768b6..2e7db270fab71 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComputesClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComputesClientImpl.java @@ -45,241 +45,179 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ComputesClient. */ +/** + * An instance of this class provides access to all the operations defined in ComputesClient. + */ public final class ComputesClientImpl implements ComputesClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final ComputesService service; - /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of ComputesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ - ComputesClientImpl(AzureMachineLearningWorkspacesImpl client) { + ComputesClientImpl(AzureMachineLearningServicesImpl client) { this.service = RestProxy.create(ComputesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesComputes to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for AzureMachineLearningServicesComputes to be used by the proxy service + * to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AzureMachineLearning") public interface ComputesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, + Mono> list(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @QueryParam("api-version") String apiVersion, - @QueryParam("$skip") String skip, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @QueryParam("$skip") String skip, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("computeName") String computeName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("computeName") String computeName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, + Mono>> createOrUpdate(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("computeName") String computeName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ComputeResourceInner parameters, - @HeaderParam("Accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("computeName") String computeName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ComputeResourceInner parameters, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, + Mono>> update(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("computeName") String computeName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ClusterUpdateParameters parameters, - @HeaderParam("Accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("computeName") String computeName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ClusterUpdateParameters parameters, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}") - @ExpectedResponses({200, 202, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}") + @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, + Mono>> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("computeName") String computeName, - @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("computeName") String computeName, @QueryParam("api-version") String apiVersion, @QueryParam("underlyingResourceAction") UnderlyingResourceAction underlyingResourceAction, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNodes( - @HostParam("$host") String endpoint, + Mono> listNodes(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("computeName") String computeName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("computeName") String computeName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listKeys( - @HostParam("$host") String endpoint, + Mono> listKeys(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("computeName") String computeName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("computeName") String computeName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start") - @ExpectedResponses({202}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start") + @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> start( - @HostParam("$host") String endpoint, + Mono>> start(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("computeName") String computeName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("computeName") String computeName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop") - @ExpectedResponses({202}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop") + @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> stop( - @HostParam("$host") String endpoint, + Mono>> stop(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("computeName") String computeName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("computeName") String computeName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart") - @ExpectedResponses({202}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart") + @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> restart( - @HostParam("$host") String endpoint, + Mono>> restart(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("computeName") String computeName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("computeName") String computeName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNodesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Gets computes in specified workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return computes in specified workspace along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return computes in specified workspace along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String workspaceName, String skip) { + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, String skip) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -290,33 +228,16 @@ private Mono> listSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - this.client.getApiVersion(), - skip, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), skip, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets computes in specified workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -324,23 +245,19 @@ private Mono> listSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return computes in specified workspace along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return computes in specified workspace along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String workspaceName, String skip, Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, String skip, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -352,29 +269,15 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - this.client.getApiVersion(), - skip, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + this.client.getApiVersion(), skip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Gets computes in specified workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -385,14 +288,13 @@ private Mono> listSinglePageAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String workspaceName, String skip) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, skip), + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skip), nextLink -> listNextSinglePageAsync(nextLink)); } /** * Gets computes in specified workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -403,14 +305,13 @@ private PagedFlux listAsync(String resourceGroupName, Stri @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String workspaceName) { final String skip = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, skip), + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skip), nextLink -> listNextSinglePageAsync(nextLink)); } /** * Gets computes in specified workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -421,16 +322,15 @@ private PagedFlux listAsync(String resourceGroupName, Stri * @return computes in specified workspace as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String workspaceName, String skip, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, skip, context), + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String skip, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skip, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Gets computes in specified workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -446,7 +346,7 @@ public PagedIterable list(String resourceGroupName, String /** * Gets computes in specified workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -457,15 +357,15 @@ public PagedIterable list(String resourceGroupName, String * @return computes in specified workspace as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String workspaceName, String skip, Context context) { + public PagedIterable list(String resourceGroupName, String workspaceName, String skip, + Context context) { return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, skip, context)); } /** * Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are not returned - use * 'keys' nested resource to get them. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -475,19 +375,15 @@ public PagedIterable list( * @return compute definition by its name along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String computeName) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String computeName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -501,25 +397,15 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - computeName, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, computeName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are not returned - use * 'keys' nested resource to get them. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -530,19 +416,15 @@ private Mono> getWithResponseAsync( * @return compute definition by its name along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String computeName, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String computeName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -556,22 +438,14 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - computeName, - this.client.getApiVersion(), - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + computeName, this.client.getApiVersion(), accept, context); } /** * Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are not returned - use * 'keys' nested resource to get them. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -589,7 +463,7 @@ private Mono getAsync(String resourceGroupName, String wor /** * Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are not returned - use * 'keys' nested resource to get them. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -600,15 +474,15 @@ private Mono getAsync(String resourceGroupName, String wor * @return compute definition by its name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String computeName, Context context) { + public Response getWithResponse(String resourceGroupName, String workspaceName, + String computeName, Context context) { return getWithResponseAsync(resourceGroupName, workspaceName, computeName, context).block(); } /** * Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are not returned - use * 'keys' nested resource to get them. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -625,7 +499,7 @@ public ComputeResourceInner get(String resourceGroupName, String workspaceName, /** * Creates or updates compute. This call will overwrite a compute if it exists. This is a nonrecoverable operation. * If your intent is to create a new compute, do a GET first to verify that it does not exist yet. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -634,22 +508,18 @@ public ComputeResourceInner get(String resourceGroupName, String workspaceName, * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return machine Learning compute object wrapped into ARM resource envelope along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String workspaceName, String computeName, ComputeResourceInner parameters) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String computeName, ComputeResourceInner parameters) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -668,26 +538,16 @@ private Mono>> createOrUpdateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - computeName, - this.client.getApiVersion(), - parameters, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, computeName, this.client.getApiVersion(), parameters, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates or updates compute. This call will overwrite a compute if it exists. This is a nonrecoverable operation. * If your intent is to create a new compute, do a GET first to verify that it does not exist yet. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -697,26 +557,18 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return machine Learning compute object wrapped into ARM resource envelope along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String workspaceName, - String computeName, - ComputeResourceInner parameters, - Context context) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String computeName, ComputeResourceInner parameters, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -735,23 +587,14 @@ private Mono>> createOrUpdateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - computeName, - this.client.getApiVersion(), - parameters, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, computeName, this.client.getApiVersion(), parameters, accept, context); } /** * Creates or updates compute. This call will overwrite a compute if it exists. This is a nonrecoverable operation. * If your intent is to create a new compute, do a GET first to verify that it does not exist yet. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -764,22 +607,16 @@ private Mono>> createOrUpdateWithResponseAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ComputeResourceInner> beginCreateOrUpdateAsync( String resourceGroupName, String workspaceName, String computeName, ComputeResourceInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, computeName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ComputeResourceInner.class, - ComputeResourceInner.class, - this.client.getContext()); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, computeName, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ComputeResourceInner.class, ComputeResourceInner.class, this.client.getContext()); } /** * Creates or updates compute. This call will overwrite a compute if it exists. This is a nonrecoverable operation. * If your intent is to create a new compute, do a GET first to verify that it does not exist yet. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -792,24 +629,19 @@ private PollerFlux, ComputeResourceInner> begin */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ComputeResourceInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String workspaceName, - String computeName, - ComputeResourceInner parameters, + String resourceGroupName, String workspaceName, String computeName, ComputeResourceInner parameters, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, computeName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ComputeResourceInner.class, ComputeResourceInner.class, context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, computeName, parameters, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ComputeResourceInner.class, ComputeResourceInner.class, context); } /** * Creates or updates compute. This call will overwrite a compute if it exists. This is a nonrecoverable operation. * If your intent is to create a new compute, do a GET first to verify that it does not exist yet. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -828,7 +660,7 @@ public SyncPoller, ComputeResourceInner> beginC /** * Creates or updates compute. This call will overwrite a compute if it exists. This is a nonrecoverable operation. * If your intent is to create a new compute, do a GET first to verify that it does not exist yet. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -841,20 +673,16 @@ public SyncPoller, ComputeResourceInner> beginC */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ComputeResourceInner> beginCreateOrUpdate( - String resourceGroupName, - String workspaceName, - String computeName, - ComputeResourceInner parameters, + String resourceGroupName, String workspaceName, String computeName, ComputeResourceInner parameters, Context context) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, workspaceName, computeName, parameters, context) + return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, computeName, parameters, context) .getSyncPoller(); } /** * Creates or updates compute. This call will overwrite a compute if it exists. This is a nonrecoverable operation. * If your intent is to create a new compute, do a GET first to verify that it does not exist yet. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -862,21 +690,20 @@ public SyncPoller, ComputeResourceInner> beginC * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return machine Learning compute object wrapped into ARM resource envelope on successful completion of {@link - * Mono}. + * @return machine Learning compute object wrapped into ARM resource envelope on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String workspaceName, String computeName, ComputeResourceInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, computeName, parameters) - .last() + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String computeName, ComputeResourceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, computeName, parameters).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Creates or updates compute. This call will overwrite a compute if it exists. This is a nonrecoverable operation. * If your intent is to create a new compute, do a GET first to verify that it does not exist yet. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -885,25 +712,20 @@ private Mono createOrUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return machine Learning compute object wrapped into ARM resource envelope on successful completion of {@link - * Mono}. + * @return machine Learning compute object wrapped into ARM resource envelope on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String workspaceName, - String computeName, - ComputeResourceInner parameters, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, computeName, parameters, context) - .last() + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String computeName, ComputeResourceInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, computeName, parameters, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Creates or updates compute. This call will overwrite a compute if it exists. This is a nonrecoverable operation. * If your intent is to create a new compute, do a GET first to verify that it does not exist yet. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -914,15 +736,15 @@ private Mono createOrUpdateAsync( * @return machine Learning compute object wrapped into ARM resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ComputeResourceInner createOrUpdate( - String resourceGroupName, String workspaceName, String computeName, ComputeResourceInner parameters) { + public ComputeResourceInner createOrUpdate(String resourceGroupName, String workspaceName, String computeName, + ComputeResourceInner parameters) { return createOrUpdateAsync(resourceGroupName, workspaceName, computeName, parameters).block(); } /** * Creates or updates compute. This call will overwrite a compute if it exists. This is a nonrecoverable operation. * If your intent is to create a new compute, do a GET first to verify that it does not exist yet. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -934,19 +756,15 @@ public ComputeResourceInner createOrUpdate( * @return machine Learning compute object wrapped into ARM resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ComputeResourceInner createOrUpdate( - String resourceGroupName, - String workspaceName, - String computeName, - ComputeResourceInner parameters, - Context context) { + public ComputeResourceInner createOrUpdate(String resourceGroupName, String workspaceName, String computeName, + ComputeResourceInner parameters, Context context) { return createOrUpdateAsync(resourceGroupName, workspaceName, computeName, parameters, context).block(); } /** * Updates properties of a compute. This call will overwrite a compute if it exists. This is a nonrecoverable * operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -955,22 +773,18 @@ public ComputeResourceInner createOrUpdate( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return machine Learning compute object wrapped into ARM resource envelope along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String workspaceName, String computeName, ClusterUpdateParameters parameters) { + private Mono>> updateWithResponseAsync(String resourceGroupName, String workspaceName, + String computeName, ClusterUpdateParameters parameters) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -990,25 +804,15 @@ private Mono>> updateWithResponseAsync( final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - computeName, - this.client.getApiVersion(), - parameters, - accept, - context)) + context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, computeName, this.client.getApiVersion(), parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Updates properties of a compute. This call will overwrite a compute if it exists. This is a nonrecoverable * operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -1018,26 +822,18 @@ private Mono>> updateWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return machine Learning compute object wrapped into ARM resource envelope along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String workspaceName, - String computeName, - ClusterUpdateParameters parameters, - Context context) { + private Mono>> updateWithResponseAsync(String resourceGroupName, String workspaceName, + String computeName, ClusterUpdateParameters parameters, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1056,23 +852,14 @@ private Mono>> updateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - computeName, - this.client.getApiVersion(), - parameters, - accept, - context); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, computeName, this.client.getApiVersion(), parameters, accept, context); } /** * Updates properties of a compute. This call will overwrite a compute if it exists. This is a nonrecoverable * operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -1085,22 +872,16 @@ private Mono>> updateWithResponseAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ComputeResourceInner> beginUpdateAsync( String resourceGroupName, String workspaceName, String computeName, ClusterUpdateParameters parameters) { - Mono>> mono = - updateWithResponseAsync(resourceGroupName, workspaceName, computeName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ComputeResourceInner.class, - ComputeResourceInner.class, - this.client.getContext()); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, workspaceName, computeName, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ComputeResourceInner.class, ComputeResourceInner.class, this.client.getContext()); } /** * Updates properties of a compute. This call will overwrite a compute if it exists. This is a nonrecoverable * operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -1113,24 +894,19 @@ private PollerFlux, ComputeResourceInner> begin */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ComputeResourceInner> beginUpdateAsync( - String resourceGroupName, - String workspaceName, - String computeName, - ClusterUpdateParameters parameters, + String resourceGroupName, String workspaceName, String computeName, ClusterUpdateParameters parameters, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, workspaceName, computeName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ComputeResourceInner.class, ComputeResourceInner.class, context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, workspaceName, computeName, parameters, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ComputeResourceInner.class, ComputeResourceInner.class, context); } /** * Updates properties of a compute. This call will overwrite a compute if it exists. This is a nonrecoverable * operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -1141,15 +917,15 @@ private PollerFlux, ComputeResourceInner> begin * @return the {@link SyncPoller} for polling of machine Learning compute object wrapped into ARM resource envelope. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ComputeResourceInner> beginUpdate( - String resourceGroupName, String workspaceName, String computeName, ClusterUpdateParameters parameters) { + public SyncPoller, ComputeResourceInner> beginUpdate(String resourceGroupName, + String workspaceName, String computeName, ClusterUpdateParameters parameters) { return this.beginUpdateAsync(resourceGroupName, workspaceName, computeName, parameters).getSyncPoller(); } /** * Updates properties of a compute. This call will overwrite a compute if it exists. This is a nonrecoverable * operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -1161,21 +937,16 @@ public SyncPoller, ComputeResourceInner> beginU * @return the {@link SyncPoller} for polling of machine Learning compute object wrapped into ARM resource envelope. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ComputeResourceInner> beginUpdate( - String resourceGroupName, - String workspaceName, - String computeName, - ClusterUpdateParameters parameters, - Context context) { - return this - .beginUpdateAsync(resourceGroupName, workspaceName, computeName, parameters, context) + public SyncPoller, ComputeResourceInner> beginUpdate(String resourceGroupName, + String workspaceName, String computeName, ClusterUpdateParameters parameters, Context context) { + return this.beginUpdateAsync(resourceGroupName, workspaceName, computeName, parameters, context) .getSyncPoller(); } /** * Updates properties of a compute. This call will overwrite a compute if it exists. This is a nonrecoverable * operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -1183,21 +954,20 @@ public SyncPoller, ComputeResourceInner> beginU * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return machine Learning compute object wrapped into ARM resource envelope on successful completion of {@link - * Mono}. + * @return machine Learning compute object wrapped into ARM resource envelope on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String workspaceName, String computeName, ClusterUpdateParameters parameters) { - return beginUpdateAsync(resourceGroupName, workspaceName, computeName, parameters) - .last() + private Mono updateAsync(String resourceGroupName, String workspaceName, String computeName, + ClusterUpdateParameters parameters) { + return beginUpdateAsync(resourceGroupName, workspaceName, computeName, parameters).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Updates properties of a compute. This call will overwrite a compute if it exists. This is a nonrecoverable * operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -1206,25 +976,20 @@ private Mono updateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return machine Learning compute object wrapped into ARM resource envelope on successful completion of {@link - * Mono}. + * @return machine Learning compute object wrapped into ARM resource envelope on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String workspaceName, - String computeName, - ClusterUpdateParameters parameters, - Context context) { - return beginUpdateAsync(resourceGroupName, workspaceName, computeName, parameters, context) - .last() + private Mono updateAsync(String resourceGroupName, String workspaceName, String computeName, + ClusterUpdateParameters parameters, Context context) { + return beginUpdateAsync(resourceGroupName, workspaceName, computeName, parameters, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Updates properties of a compute. This call will overwrite a compute if it exists. This is a nonrecoverable * operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -1235,15 +1000,15 @@ private Mono updateAsync( * @return machine Learning compute object wrapped into ARM resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ComputeResourceInner update( - String resourceGroupName, String workspaceName, String computeName, ClusterUpdateParameters parameters) { + public ComputeResourceInner update(String resourceGroupName, String workspaceName, String computeName, + ClusterUpdateParameters parameters) { return updateAsync(resourceGroupName, workspaceName, computeName, parameters).block(); } /** * Updates properties of a compute. This call will overwrite a compute if it exists. This is a nonrecoverable * operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -1255,45 +1020,34 @@ public ComputeResourceInner update( * @return machine Learning compute object wrapped into ARM resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ComputeResourceInner update( - String resourceGroupName, - String workspaceName, - String computeName, - ClusterUpdateParameters parameters, - Context context) { + public ComputeResourceInner update(String resourceGroupName, String workspaceName, String computeName, + ClusterUpdateParameters parameters, Context context) { return updateAsync(resourceGroupName, workspaceName, computeName, parameters, context).block(); } /** * Deletes specified Machine Learning compute. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. * @param underlyingResourceAction Delete the underlying compute if 'Delete', or detach the underlying compute from - * workspace if 'Detach'. + * workspace if 'Detach'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, - String workspaceName, - String computeName, - UnderlyingResourceAction underlyingResourceAction) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String computeName, UnderlyingResourceAction underlyingResourceAction) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1306,36 +1060,25 @@ private Mono>> deleteWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter computeName is required and cannot be null.")); } if (underlyingResourceAction == null) { - return Mono - .error( - new IllegalArgumentException("Parameter underlyingResourceAction is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter underlyingResourceAction is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - computeName, - this.client.getApiVersion(), - underlyingResourceAction, - accept, - context)) + context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, computeName, this.client.getApiVersion(), underlyingResourceAction, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Deletes specified Machine Learning compute. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. * @param underlyingResourceAction Delete the underlying compute if 'Delete', or detach the underlying compute from - * workspace if 'Detach'. + * workspace if 'Detach'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1343,23 +1086,15 @@ private Mono>> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, - String workspaceName, - String computeName, - UnderlyingResourceAction underlyingResourceAction, - Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String computeName, UnderlyingResourceAction underlyingResourceAction, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1372,60 +1107,45 @@ private Mono>> deleteWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter computeName is required and cannot be null.")); } if (underlyingResourceAction == null) { - return Mono - .error( - new IllegalArgumentException("Parameter underlyingResourceAction is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter underlyingResourceAction is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - computeName, - this.client.getApiVersion(), - underlyingResourceAction, - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, computeName, this.client.getApiVersion(), underlyingResourceAction, accept, context); } /** * Deletes specified Machine Learning compute. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. * @param underlyingResourceAction Delete the underlying compute if 'Delete', or detach the underlying compute from - * workspace if 'Detach'. + * workspace if 'Detach'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, - String workspaceName, - String computeName, - UnderlyingResourceAction underlyingResourceAction) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, workspaceName, computeName, underlyingResourceAction); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, + String computeName, UnderlyingResourceAction underlyingResourceAction) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, workspaceName, computeName, underlyingResourceAction); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Deletes specified Machine Learning compute. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. * @param underlyingResourceAction Delete the underlying compute if 'Delete', or detach the underlying compute from - * workspace if 'Detach'. + * workspace if 'Detach'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1433,52 +1153,43 @@ private PollerFlux, Void> beginDeleteAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, - String workspaceName, - String computeName, - UnderlyingResourceAction underlyingResourceAction, - Context context) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, + String computeName, UnderlyingResourceAction underlyingResourceAction, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, workspaceName, computeName, underlyingResourceAction, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, workspaceName, computeName, underlyingResourceAction, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** * Deletes specified Machine Learning compute. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. * @param underlyingResourceAction Delete the underlying compute if 'Delete', or detach the underlying compute from - * workspace if 'Detach'. + * workspace if 'Detach'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, - String workspaceName, - String computeName, - UnderlyingResourceAction underlyingResourceAction) { - return this - .beginDeleteAsync(resourceGroupName, workspaceName, computeName, underlyingResourceAction) + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, + String computeName, UnderlyingResourceAction underlyingResourceAction) { + return this.beginDeleteAsync(resourceGroupName, workspaceName, computeName, underlyingResourceAction) .getSyncPoller(); } /** * Deletes specified Machine Learning compute. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. * @param underlyingResourceAction Delete the underlying compute if 'Delete', or detach the underlying compute from - * workspace if 'Detach'. + * workspace if 'Detach'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1486,49 +1197,40 @@ public SyncPoller, Void> beginDelete( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, - String workspaceName, - String computeName, - UnderlyingResourceAction underlyingResourceAction, - Context context) { - return this - .beginDeleteAsync(resourceGroupName, workspaceName, computeName, underlyingResourceAction, context) + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, + String computeName, UnderlyingResourceAction underlyingResourceAction, Context context) { + return this.beginDeleteAsync(resourceGroupName, workspaceName, computeName, underlyingResourceAction, context) .getSyncPoller(); } /** * Deletes specified Machine Learning compute. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. * @param underlyingResourceAction Delete the underlying compute if 'Delete', or detach the underlying compute from - * workspace if 'Detach'. + * workspace if 'Detach'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, - String workspaceName, - String computeName, + private Mono deleteAsync(String resourceGroupName, String workspaceName, String computeName, UnderlyingResourceAction underlyingResourceAction) { - return beginDeleteAsync(resourceGroupName, workspaceName, computeName, underlyingResourceAction) - .last() + return beginDeleteAsync(resourceGroupName, workspaceName, computeName, underlyingResourceAction).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Deletes specified Machine Learning compute. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. * @param underlyingResourceAction Delete the underlying compute if 'Delete', or detach the underlying compute from - * workspace if 'Detach'. + * workspace if 'Detach'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1536,87 +1238,71 @@ private Mono deleteAsync( * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, - String workspaceName, - String computeName, - UnderlyingResourceAction underlyingResourceAction, - Context context) { - return beginDeleteAsync(resourceGroupName, workspaceName, computeName, underlyingResourceAction, context) - .last() + private Mono deleteAsync(String resourceGroupName, String workspaceName, String computeName, + UnderlyingResourceAction underlyingResourceAction, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, computeName, underlyingResourceAction, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Deletes specified Machine Learning compute. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. * @param underlyingResourceAction Delete the underlying compute if 'Delete', or detach the underlying compute from - * workspace if 'Detach'. + * workspace if 'Detach'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete( - String resourceGroupName, - String workspaceName, - String computeName, + public void delete(String resourceGroupName, String workspaceName, String computeName, UnderlyingResourceAction underlyingResourceAction) { deleteAsync(resourceGroupName, workspaceName, computeName, underlyingResourceAction).block(); } /** * Deletes specified Machine Learning compute. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. * @param underlyingResourceAction Delete the underlying compute if 'Delete', or detach the underlying compute from - * workspace if 'Detach'. + * workspace if 'Detach'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete( - String resourceGroupName, - String workspaceName, - String computeName, - UnderlyingResourceAction underlyingResourceAction, - Context context) { + public void delete(String resourceGroupName, String workspaceName, String computeName, + UnderlyingResourceAction underlyingResourceAction, Context context) { deleteAsync(resourceGroupName, workspaceName, computeName, underlyingResourceAction, context).block(); } /** * Get the details (e.g IP address, port etc) of all the compute nodes in the compute. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details (e.g IP address, port etc) of all the compute nodes in the compute along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return the details (e.g IP address, port etc) of all the compute nodes in the compute along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNodesSinglePageAsync( - String resourceGroupName, String workspaceName, String computeName) { + private Mono> listNodesSinglePageAsync(String resourceGroupName, + String workspaceName, String computeName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1630,33 +1316,16 @@ private Mono> listNodesSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listNodes( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - computeName, - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().nodes(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listNodes(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, computeName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().nodes(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the details (e.g IP address, port etc) of all the compute nodes in the compute. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -1664,23 +1333,19 @@ private Mono> listNodesSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details (e.g IP address, port etc) of all the compute nodes in the compute along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return the details (e.g IP address, port etc) of all the compute nodes in the compute along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNodesSinglePageAsync( - String resourceGroupName, String workspaceName, String computeName, Context context) { + private Mono> listNodesSinglePageAsync(String resourceGroupName, + String workspaceName, String computeName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1695,29 +1360,15 @@ private Mono> listNodesSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listNodes( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - computeName, - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().nodes(), - res.getValue().nextLink(), - null)); + .listNodes(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + computeName, this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().nodes(), res.getValue().nextLink(), null)); } /** * Get the details (e.g IP address, port etc) of all the compute nodes in the compute. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -1725,19 +1376,18 @@ private Mono> listNodesSinglePageAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the details (e.g IP address, port etc) of all the compute nodes in the compute as paginated response with - * {@link PagedFlux}. + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listNodesAsync( - String resourceGroupName, String workspaceName, String computeName) { - return new PagedFlux<>( - () -> listNodesSinglePageAsync(resourceGroupName, workspaceName, computeName), + private PagedFlux listNodesAsync(String resourceGroupName, String workspaceName, + String computeName) { + return new PagedFlux<>(() -> listNodesSinglePageAsync(resourceGroupName, workspaceName, computeName), nextLink -> listNodesNextSinglePageAsync(nextLink)); } /** * Get the details (e.g IP address, port etc) of all the compute nodes in the compute. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -1746,19 +1396,18 @@ private PagedFlux listNodesAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the details (e.g IP address, port etc) of all the compute nodes in the compute as paginated response with - * {@link PagedFlux}. + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listNodesAsync( - String resourceGroupName, String workspaceName, String computeName, Context context) { - return new PagedFlux<>( - () -> listNodesSinglePageAsync(resourceGroupName, workspaceName, computeName, context), + private PagedFlux listNodesAsync(String resourceGroupName, String workspaceName, + String computeName, Context context) { + return new PagedFlux<>(() -> listNodesSinglePageAsync(resourceGroupName, workspaceName, computeName, context), nextLink -> listNodesNextSinglePageAsync(nextLink, context)); } /** * Get the details (e.g IP address, port etc) of all the compute nodes in the compute. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -1766,17 +1415,17 @@ private PagedFlux listNodesAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the details (e.g IP address, port etc) of all the compute nodes in the compute as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listNodes( - String resourceGroupName, String workspaceName, String computeName) { + public PagedIterable listNodes(String resourceGroupName, String workspaceName, + String computeName) { return new PagedIterable<>(listNodesAsync(resourceGroupName, workspaceName, computeName)); } /** * Get the details (e.g IP address, port etc) of all the compute nodes in the compute. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -1785,40 +1434,36 @@ public PagedIterable listNodes( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the details (e.g IP address, port etc) of all the compute nodes in the compute as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listNodes( - String resourceGroupName, String workspaceName, String computeName, Context context) { + public PagedIterable listNodes(String resourceGroupName, String workspaceName, + String computeName, Context context) { return new PagedIterable<>(listNodesAsync(resourceGroupName, workspaceName, computeName, context)); } /** * Gets secrets related to Machine Learning compute (storage keys, service credentials, etc). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secrets related to Machine Learning compute (storage keys, service credentials, etc) along with {@link - * Response} on successful completion of {@link Mono}. + * @return secrets related to Machine Learning compute (storage keys, service credentials, etc) along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeysWithResponseAsync( - String resourceGroupName, String workspaceName, String computeName) { + private Mono> listKeysWithResponseAsync(String resourceGroupName, + String workspaceName, String computeName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1832,24 +1477,14 @@ private Mono> listKeysWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listKeys( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - computeName, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.listKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, computeName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets secrets related to Machine Learning compute (storage keys, service credentials, etc). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -1857,23 +1492,19 @@ private Mono> listKeysWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secrets related to Machine Learning compute (storage keys, service credentials, etc) along with {@link - * Response} on successful completion of {@link Mono}. + * @return secrets related to Machine Learning compute (storage keys, service credentials, etc) along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeysWithResponseAsync( - String resourceGroupName, String workspaceName, String computeName, Context context) { + private Mono> listKeysWithResponseAsync(String resourceGroupName, + String workspaceName, String computeName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1887,21 +1518,13 @@ private Mono> listKeysWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listKeys( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - computeName, - this.client.getApiVersion(), - accept, - context); + return service.listKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, computeName, this.client.getApiVersion(), accept, context); } /** * Gets secrets related to Machine Learning compute (storage keys, service credentials, etc). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -1909,18 +1532,18 @@ private Mono> listKeysWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return secrets related to Machine Learning compute (storage keys, service credentials, etc) on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listKeysAsync( - String resourceGroupName, String workspaceName, String computeName) { + private Mono listKeysAsync(String resourceGroupName, String workspaceName, + String computeName) { return listKeysWithResponseAsync(resourceGroupName, workspaceName, computeName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets secrets related to Machine Learning compute (storage keys, service credentials, etc). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -1928,18 +1551,18 @@ private Mono listKeysAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secrets related to Machine Learning compute (storage keys, service credentials, etc) along with {@link - * Response}. + * @return secrets related to Machine Learning compute (storage keys, service credentials, etc) along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listKeysWithResponse( - String resourceGroupName, String workspaceName, String computeName, Context context) { + public Response listKeysWithResponse(String resourceGroupName, String workspaceName, + String computeName, Context context) { return listKeysWithResponseAsync(resourceGroupName, workspaceName, computeName, context).block(); } /** * Gets secrets related to Machine Learning compute (storage keys, service credentials, etc). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -1955,7 +1578,7 @@ public ComputeSecretsInner listKeys(String resourceGroupName, String workspaceNa /** * Posts a start action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -1965,19 +1588,15 @@ public ComputeSecretsInner listKeys(String resourceGroupName, String workspaceNa * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startWithResponseAsync( - String resourceGroupName, String workspaceName, String computeName) { + private Mono>> startWithResponseAsync(String resourceGroupName, String workspaceName, + String computeName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1991,24 +1610,14 @@ private Mono>> startWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .start( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - computeName, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.start(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, computeName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Posts a start action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -2019,19 +1628,15 @@ private Mono>> startWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startWithResponseAsync( - String resourceGroupName, String workspaceName, String computeName, Context context) { + private Mono>> startWithResponseAsync(String resourceGroupName, String workspaceName, + String computeName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2045,21 +1650,13 @@ private Mono>> startWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .start( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - computeName, - this.client.getApiVersion(), - accept, - context); + return service.start(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, computeName, this.client.getApiVersion(), accept, context); } /** * Posts a start action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -2069,18 +1666,16 @@ private Mono>> startWithResponseAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginStartAsync( - String resourceGroupName, String workspaceName, String computeName) { + private PollerFlux, Void> beginStartAsync(String resourceGroupName, String workspaceName, + String computeName) { Mono>> mono = startWithResponseAsync(resourceGroupName, workspaceName, computeName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Posts a start action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -2091,19 +1686,18 @@ private PollerFlux, Void> beginStartAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginStartAsync( - String resourceGroupName, String workspaceName, String computeName, Context context) { + private PollerFlux, Void> beginStartAsync(String resourceGroupName, String workspaceName, + String computeName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - startWithResponseAsync(resourceGroupName, workspaceName, computeName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + Mono>> mono + = startWithResponseAsync(resourceGroupName, workspaceName, computeName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** * Posts a start action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -2113,14 +1707,14 @@ private PollerFlux, Void> beginStartAsync( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginStart( - String resourceGroupName, String workspaceName, String computeName) { + public SyncPoller, Void> beginStart(String resourceGroupName, String workspaceName, + String computeName) { return this.beginStartAsync(resourceGroupName, workspaceName, computeName).getSyncPoller(); } /** * Posts a start action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -2131,14 +1725,14 @@ public SyncPoller, Void> beginStart( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginStart( - String resourceGroupName, String workspaceName, String computeName, Context context) { + public SyncPoller, Void> beginStart(String resourceGroupName, String workspaceName, + String computeName, Context context) { return this.beginStartAsync(resourceGroupName, workspaceName, computeName, context).getSyncPoller(); } /** * Posts a start action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -2149,14 +1743,13 @@ public SyncPoller, Void> beginStart( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono startAsync(String resourceGroupName, String workspaceName, String computeName) { - return beginStartAsync(resourceGroupName, workspaceName, computeName) - .last() + return beginStartAsync(resourceGroupName, workspaceName, computeName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Posts a start action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -2168,14 +1761,13 @@ private Mono startAsync(String resourceGroupName, String workspaceName, St */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono startAsync(String resourceGroupName, String workspaceName, String computeName, Context context) { - return beginStartAsync(resourceGroupName, workspaceName, computeName, context) - .last() + return beginStartAsync(resourceGroupName, workspaceName, computeName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Posts a start action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -2190,7 +1782,7 @@ public void start(String resourceGroupName, String workspaceName, String compute /** * Posts a start action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -2206,7 +1798,7 @@ public void start(String resourceGroupName, String workspaceName, String compute /** * Posts a stop action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -2216,19 +1808,15 @@ public void start(String resourceGroupName, String workspaceName, String compute * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> stopWithResponseAsync( - String resourceGroupName, String workspaceName, String computeName) { + private Mono>> stopWithResponseAsync(String resourceGroupName, String workspaceName, + String computeName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2242,24 +1830,14 @@ private Mono>> stopWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .stop( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - computeName, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.stop(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, computeName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Posts a stop action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -2270,19 +1848,15 @@ private Mono>> stopWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> stopWithResponseAsync( - String resourceGroupName, String workspaceName, String computeName, Context context) { + private Mono>> stopWithResponseAsync(String resourceGroupName, String workspaceName, + String computeName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2296,21 +1870,13 @@ private Mono>> stopWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .stop( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - computeName, - this.client.getApiVersion(), - accept, - context); + return service.stop(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, computeName, this.client.getApiVersion(), accept, context); } /** * Posts a stop action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -2320,18 +1886,16 @@ private Mono>> stopWithResponseAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginStopAsync( - String resourceGroupName, String workspaceName, String computeName) { + private PollerFlux, Void> beginStopAsync(String resourceGroupName, String workspaceName, + String computeName) { Mono>> mono = stopWithResponseAsync(resourceGroupName, workspaceName, computeName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Posts a stop action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -2342,19 +1906,18 @@ private PollerFlux, Void> beginStopAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginStopAsync( - String resourceGroupName, String workspaceName, String computeName, Context context) { + private PollerFlux, Void> beginStopAsync(String resourceGroupName, String workspaceName, + String computeName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - stopWithResponseAsync(resourceGroupName, workspaceName, computeName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + Mono>> mono + = stopWithResponseAsync(resourceGroupName, workspaceName, computeName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** * Posts a stop action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -2364,14 +1927,14 @@ private PollerFlux, Void> beginStopAsync( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginStop( - String resourceGroupName, String workspaceName, String computeName) { + public SyncPoller, Void> beginStop(String resourceGroupName, String workspaceName, + String computeName) { return this.beginStopAsync(resourceGroupName, workspaceName, computeName).getSyncPoller(); } /** * Posts a stop action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -2382,14 +1945,14 @@ public SyncPoller, Void> beginStop( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginStop( - String resourceGroupName, String workspaceName, String computeName, Context context) { + public SyncPoller, Void> beginStop(String resourceGroupName, String workspaceName, + String computeName, Context context) { return this.beginStopAsync(resourceGroupName, workspaceName, computeName, context).getSyncPoller(); } /** * Posts a stop action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -2400,14 +1963,13 @@ public SyncPoller, Void> beginStop( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono stopAsync(String resourceGroupName, String workspaceName, String computeName) { - return beginStopAsync(resourceGroupName, workspaceName, computeName) - .last() + return beginStopAsync(resourceGroupName, workspaceName, computeName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Posts a stop action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -2419,14 +1981,13 @@ private Mono stopAsync(String resourceGroupName, String workspaceName, Str */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono stopAsync(String resourceGroupName, String workspaceName, String computeName, Context context) { - return beginStopAsync(resourceGroupName, workspaceName, computeName, context) - .last() + return beginStopAsync(resourceGroupName, workspaceName, computeName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Posts a stop action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -2441,7 +2002,7 @@ public void stop(String resourceGroupName, String workspaceName, String computeN /** * Posts a stop action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -2457,7 +2018,7 @@ public void stop(String resourceGroupName, String workspaceName, String computeN /** * Posts a restart action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -2467,19 +2028,15 @@ public void stop(String resourceGroupName, String workspaceName, String computeN * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> restartWithResponseAsync( - String resourceGroupName, String workspaceName, String computeName) { + private Mono>> restartWithResponseAsync(String resourceGroupName, String workspaceName, + String computeName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2493,24 +2050,14 @@ private Mono>> restartWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .restart( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - computeName, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.restart(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, computeName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Posts a restart action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -2521,19 +2068,15 @@ private Mono>> restartWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> restartWithResponseAsync( - String resourceGroupName, String workspaceName, String computeName, Context context) { + private Mono>> restartWithResponseAsync(String resourceGroupName, String workspaceName, + String computeName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2547,21 +2090,13 @@ private Mono>> restartWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .restart( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - computeName, - this.client.getApiVersion(), - accept, - context); + return service.restart(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, computeName, this.client.getApiVersion(), accept, context); } /** * Posts a restart action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -2571,18 +2106,16 @@ private Mono>> restartWithResponseAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginRestartAsync( - String resourceGroupName, String workspaceName, String computeName) { + private PollerFlux, Void> beginRestartAsync(String resourceGroupName, String workspaceName, + String computeName) { Mono>> mono = restartWithResponseAsync(resourceGroupName, workspaceName, computeName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Posts a restart action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -2593,19 +2126,18 @@ private PollerFlux, Void> beginRestartAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginRestartAsync( - String resourceGroupName, String workspaceName, String computeName, Context context) { + private PollerFlux, Void> beginRestartAsync(String resourceGroupName, String workspaceName, + String computeName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - restartWithResponseAsync(resourceGroupName, workspaceName, computeName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + Mono>> mono + = restartWithResponseAsync(resourceGroupName, workspaceName, computeName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** * Posts a restart action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -2615,14 +2147,14 @@ private PollerFlux, Void> beginRestartAsync( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginRestart( - String resourceGroupName, String workspaceName, String computeName) { + public SyncPoller, Void> beginRestart(String resourceGroupName, String workspaceName, + String computeName) { return this.beginRestartAsync(resourceGroupName, workspaceName, computeName).getSyncPoller(); } /** * Posts a restart action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -2633,14 +2165,14 @@ public SyncPoller, Void> beginRestart( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginRestart( - String resourceGroupName, String workspaceName, String computeName, Context context) { + public SyncPoller, Void> beginRestart(String resourceGroupName, String workspaceName, + String computeName, Context context) { return this.beginRestartAsync(resourceGroupName, workspaceName, computeName, context).getSyncPoller(); } /** * Posts a restart action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -2651,14 +2183,13 @@ public SyncPoller, Void> beginRestart( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono restartAsync(String resourceGroupName, String workspaceName, String computeName) { - return beginRestartAsync(resourceGroupName, workspaceName, computeName) - .last() + return beginRestartAsync(resourceGroupName, workspaceName, computeName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Posts a restart action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -2669,16 +2200,15 @@ private Mono restartAsync(String resourceGroupName, String workspaceName, * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono restartAsync( - String resourceGroupName, String workspaceName, String computeName, Context context) { - return beginRestartAsync(resourceGroupName, workspaceName, computeName, context) - .last() + private Mono restartAsync(String resourceGroupName, String workspaceName, String computeName, + Context context) { + return beginRestartAsync(resourceGroupName, workspaceName, computeName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Posts a restart action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -2693,7 +2223,7 @@ public void restart(String resourceGroupName, String workspaceName, String compu /** * Posts a restart action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -2709,14 +2239,13 @@ public void restart(String resourceGroupName, String workspaceName, String compu /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paginated list of Machine Learning compute objects wrapped in ARM resource envelope along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return paginated list of Machine Learning compute objects wrapped in ARM resource envelope along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -2724,37 +2253,26 @@ private Mono> listNextSinglePageAsync(String return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paginated list of Machine Learning compute objects wrapped in ARM resource envelope along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return paginated list of Machine Learning compute objects wrapped in ARM resource envelope along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -2762,31 +2280,20 @@ private Mono> listNextSinglePageAsync(String return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -2798,31 +2305,21 @@ private Mono> listNodesNextSinglePageAs return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listNodesNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().nodes(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().nodes(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2830,29 +2327,19 @@ private Mono> listNodesNextSinglePageAs * @return result of AmlCompute Nodes along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNodesNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listNodesNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNodesNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().nodes(), - res.getValue().nextLink(), - null)); + return service.listNodesNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().nodes(), res.getValue().nextLink(), null)); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComputesImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComputesImpl.java index 9b3cc25f7885b..ceab9a7511a87 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComputesImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ComputesImpl.java @@ -14,8 +14,8 @@ import com.azure.resourcemanager.machinelearning.fluent.models.ComputeSecretsInner; import com.azure.resourcemanager.machinelearning.models.AmlComputeNodeInformation; import com.azure.resourcemanager.machinelearning.models.ComputeResource; -import com.azure.resourcemanager.machinelearning.models.ComputeSecrets; import com.azure.resourcemanager.machinelearning.models.Computes; +import com.azure.resourcemanager.machinelearning.models.ComputeSecrets; import com.azure.resourcemanager.machinelearning.models.UnderlyingResourceAction; public final class ComputesImpl implements Computes { @@ -25,33 +25,30 @@ public final class ComputesImpl implements Computes { private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - public ComputesImpl( - ComputesClient innerClient, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + public ComputesImpl(ComputesClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list(String resourceGroupName, String workspaceName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); - return Utils.mapPage(inner, inner1 -> new ComputeResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ComputeResourceImpl(inner1, this.manager())); } - public PagedIterable list( - String resourceGroupName, String workspaceName, String skip, Context context) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, workspaceName, skip, context); - return Utils.mapPage(inner, inner1 -> new ComputeResourceImpl(inner1, this.manager())); + public PagedIterable list(String resourceGroupName, String workspaceName, String skip, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, skip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ComputeResourceImpl(inner1, this.manager())); } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String computeName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, workspaceName, computeName, context); + public Response getWithResponse(String resourceGroupName, String workspaceName, String computeName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, computeName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ComputeResourceImpl(inner.getValue(), this.manager())); } else { return null; @@ -67,42 +64,32 @@ public ComputeResource get(String resourceGroupName, String workspaceName, Strin } } - public void delete( - String resourceGroupName, - String workspaceName, - String computeName, + public void delete(String resourceGroupName, String workspaceName, String computeName, UnderlyingResourceAction underlyingResourceAction) { this.serviceClient().delete(resourceGroupName, workspaceName, computeName, underlyingResourceAction); } - public void delete( - String resourceGroupName, - String workspaceName, - String computeName, - UnderlyingResourceAction underlyingResourceAction, - Context context) { + public void delete(String resourceGroupName, String workspaceName, String computeName, + UnderlyingResourceAction underlyingResourceAction, Context context) { this.serviceClient().delete(resourceGroupName, workspaceName, computeName, underlyingResourceAction, context); } - public PagedIterable listNodes( - String resourceGroupName, String workspaceName, String computeName) { + public PagedIterable listNodes(String resourceGroupName, String workspaceName, + String computeName) { return this.serviceClient().listNodes(resourceGroupName, workspaceName, computeName); } - public PagedIterable listNodes( - String resourceGroupName, String workspaceName, String computeName, Context context) { + public PagedIterable listNodes(String resourceGroupName, String workspaceName, + String computeName, Context context) { return this.serviceClient().listNodes(resourceGroupName, workspaceName, computeName, context); } - public Response listKeysWithResponse( - String resourceGroupName, String workspaceName, String computeName, Context context) { - Response inner = - this.serviceClient().listKeysWithResponse(resourceGroupName, workspaceName, computeName, context); + public Response listKeysWithResponse(String resourceGroupName, String workspaceName, + String computeName, Context context) { + Response inner + = this.serviceClient().listKeysWithResponse(resourceGroupName, workspaceName, computeName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ComputeSecretsImpl(inner.getValue(), this.manager())); } else { return null; @@ -143,53 +130,39 @@ public void restart(String resourceGroupName, String workspaceName, String compu } public ComputeResource getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String computeName = Utils.getValueFromIdByName(id, "computes"); + String computeName = ResourceManagerUtils.getValueFromIdByName(id, "computes"); if (computeName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'computes'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'computes'.", id))); } return this.getWithResponse(resourceGroupName, workspaceName, computeName, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String computeName = Utils.getValueFromIdByName(id, "computes"); + String computeName = ResourceManagerUtils.getValueFromIdByName(id, "computes"); if (computeName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'computes'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'computes'.", id))); } return this.getWithResponse(resourceGroupName, workspaceName, computeName, context); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataContainerImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataContainerImpl.java index 226bd04ddbb2d..048b169c07f6f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataContainerImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataContainerImpl.java @@ -49,33 +49,27 @@ private com.azure.resourcemanager.machinelearning.MachineLearningManager manager private String resourceGroupName; - private String workspaceName; + private String registryName; private String name; - public DataContainerImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + public DataContainerImpl withExistingRegistry(String resourceGroupName, String registryName) { this.resourceGroupName = resourceGroupName; - this.workspaceName = workspaceName; + this.registryName = registryName; return this; } public DataContainer create() { - this.innerObject = - serviceManager - .serviceClient() - .getDataContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryDataContainers() + .createOrUpdate(resourceGroupName, registryName, name, this.innerModel(), Context.NONE); return this; } public DataContainer create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getDataContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryDataContainers() + .createOrUpdate(resourceGroupName, registryName, name, this.innerModel(), context); return this; } @@ -90,52 +84,41 @@ public DataContainerImpl update() { } public DataContainer apply() { - this.innerObject = - serviceManager - .serviceClient() - .getDataContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryDataContainers() + .createOrUpdate(resourceGroupName, registryName, name, this.innerModel(), Context.NONE); return this; } public DataContainer apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getDataContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryDataContainers() + .createOrUpdate(resourceGroupName, registryName, name, this.innerModel(), context); return this; } - DataContainerImpl( - DataContainerInner innerObject, + DataContainerImpl(DataContainerInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); - this.name = Utils.getValueFromIdByName(innerObject.id(), "data"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.registryName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "registries"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "data"); } public DataContainer refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getDataContainers() - .getWithResponse(resourceGroupName, workspaceName, name, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryDataContainers() + .getWithResponse(resourceGroupName, registryName, name, Context.NONE) + .getValue(); return this; } public DataContainer refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getDataContainers() - .getWithResponse(resourceGroupName, workspaceName, name, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryDataContainers() + .getWithResponse(resourceGroupName, registryName, name, context) + .getValue(); return this; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataContainersClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataContainersClientImpl.java index ce1b750a11dec..f7b5eed23e6f5 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataContainersClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataContainersClientImpl.java @@ -34,112 +34,92 @@ import com.azure.resourcemanager.machinelearning.models.ListViewType; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in DataContainersClient. */ +/** + * An instance of this class provides access to all the operations defined in DataContainersClient. + */ public final class DataContainersClientImpl implements DataContainersClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final DataContainersService service; - /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of DataContainersClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ - DataContainersClientImpl(AzureMachineLearningWorkspacesImpl client) { - this.service = - RestProxy.create(DataContainersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + DataContainersClientImpl(AzureMachineLearningServicesImpl client) { + this.service + = RestProxy.create(DataContainersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesDataContainers to be used by the proxy + * The interface defining all the services for AzureMachineLearningServicesDataContainers to be used by the proxy * service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AzureMachineLearning") public interface DataContainersService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, + Mono> list(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @QueryParam("api-version") String apiVersion, - @QueryParam("$skip") String skip, - @QueryParam("listViewType") ListViewType listViewType, - @HeaderParam("Accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @QueryParam("$skip") String skip, + @QueryParam("listViewType") ListViewType listViewType, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, + Mono> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, + Mono> createOrUpdate(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DataContainerInner body, - @HeaderParam("Accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DataContainerInner body, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * List data containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -148,22 +128,18 @@ Mono> listNext( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of DataContainer entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String workspaceName, String skip, ListViewType listViewType) { + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String skip, ListViewType listViewType) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -174,34 +150,16 @@ private Mono> listSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - this.client.getApiVersion(), - skip, - listViewType, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), skip, listViewType, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List data containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -211,22 +169,18 @@ private Mono> listSinglePageAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of DataContainer entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String workspaceName, String skip, ListViewType listViewType, Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String skip, ListViewType listViewType, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -238,30 +192,15 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - this.client.getApiVersion(), - skip, - listViewType, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + this.client.getApiVersion(), skip, listViewType, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List data containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -272,16 +211,15 @@ private Mono> listSinglePageAsync( * @return a paginated list of DataContainer entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String workspaceName, String skip, ListViewType listViewType) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, skip, listViewType), + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String skip, + ListViewType listViewType) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skip, listViewType), nextLink -> listNextSinglePageAsync(nextLink)); } /** * List data containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -293,14 +231,13 @@ private PagedFlux listAsync( private PagedFlux listAsync(String resourceGroupName, String workspaceName) { final String skip = null; final ListViewType listViewType = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, skip, listViewType), + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skip, listViewType), nextLink -> listNextSinglePageAsync(nextLink)); } /** * List data containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -312,16 +249,15 @@ private PagedFlux listAsync(String resourceGroupName, String * @return a paginated list of DataContainer entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String workspaceName, String skip, ListViewType listViewType, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, skip, listViewType, context), + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String skip, + ListViewType listViewType, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skip, listViewType, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * List data containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -338,7 +274,7 @@ public PagedIterable list(String resourceGroupName, String w /** * List data containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -350,14 +286,14 @@ public PagedIterable list(String resourceGroupName, String w * @return a paginated list of DataContainer entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String workspaceName, String skip, ListViewType listViewType, Context context) { + public PagedIterable list(String resourceGroupName, String workspaceName, String skip, + ListViewType listViewType, Context context) { return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, skip, listViewType, context)); } /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -369,16 +305,12 @@ public PagedIterable list( @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, String name) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -392,24 +324,14 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -420,19 +342,15 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String name, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, String name, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -446,21 +364,13 @@ private Mono> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, this.client.getApiVersion(), accept, context); } /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -476,7 +386,7 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -487,14 +397,14 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String name, Context context) { + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String name, + Context context) { return deleteWithResponseAsync(resourceGroupName, workspaceName, name, context).block(); } /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -509,7 +419,7 @@ public void delete(String resourceGroupName, String workspaceName, String name) /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -519,19 +429,15 @@ public void delete(String resourceGroupName, String workspaceName, String name) * @return container along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String name) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String name) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -545,24 +451,14 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -573,19 +469,15 @@ private Mono> getWithResponseAsync( * @return container along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String name, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String name, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -599,21 +491,13 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + name, this.client.getApiVersion(), accept, context); } /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -630,7 +514,7 @@ private Mono getAsync(String resourceGroupName, String works /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -641,14 +525,14 @@ private Mono getAsync(String resourceGroupName, String works * @return container along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String name, Context context) { + public Response getWithResponse(String resourceGroupName, String workspaceName, String name, + Context context) { return getWithResponseAsync(resourceGroupName, workspaceName, name, context).block(); } /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -664,7 +548,7 @@ public DataContainerInner get(String resourceGroupName, String workspaceName, St /** * Create or update container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -672,23 +556,19 @@ public DataContainerInner get(String resourceGroupName, String workspaceName, St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link - * Mono}. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String workspaceName, String name, DataContainerInner body) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String name, DataContainerInner body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -707,25 +587,14 @@ private Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - body, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or update container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -734,23 +603,19 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link - * Mono}. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String workspaceName, String name, DataContainerInner body, Context context) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String name, DataContainerInner body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -769,22 +634,13 @@ private Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - body, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, this.client.getApiVersion(), body, accept, context); } /** * Create or update container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -795,15 +651,15 @@ private Mono> createOrUpdateWithResponseAsync( * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String workspaceName, String name, DataContainerInner body) { + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, String name, + DataContainerInner body) { return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, body) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Create or update container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -815,14 +671,14 @@ private Mono createOrUpdateAsync( * @return azure Resource Manager resource envelope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, String workspaceName, String name, DataContainerInner body, Context context) { + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String name, DataContainerInner body, Context context) { return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, body, context).block(); } /** * Create or update container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -833,21 +689,20 @@ public Response createOrUpdateWithResponse( * @return azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DataContainerInner createOrUpdate( - String resourceGroupName, String workspaceName, String name, DataContainerInner body) { + public DataContainerInner createOrUpdate(String resourceGroupName, String workspaceName, String name, + DataContainerInner body) { return createOrUpdateWithResponse(resourceGroupName, workspaceName, name, body, Context.NONE).getValue(); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of DataContainer entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -855,37 +710,26 @@ private Mono> listNextSinglePageAsync(String n return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of DataContainer entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -893,23 +737,13 @@ private Mono> listNextSinglePageAsync(String n return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataContainersImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataContainersImpl.java index 2bc8ef7ece530..c24b2208cad14 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataContainersImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataContainersImpl.java @@ -22,8 +22,7 @@ public final class DataContainersImpl implements DataContainers { private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - public DataContainersImpl( - DataContainersClient innerClient, + public DataContainersImpl(DataContainersClient innerClient, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -31,18 +30,18 @@ public DataContainersImpl( public PagedIterable list(String resourceGroupName, String workspaceName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); - return Utils.mapPage(inner, inner1 -> new DataContainerImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DataContainerImpl(inner1, this.manager())); } - public PagedIterable list( - String resourceGroupName, String workspaceName, String skip, ListViewType listViewType, Context context) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, workspaceName, skip, listViewType, context); - return Utils.mapPage(inner, inner1 -> new DataContainerImpl(inner1, this.manager())); + public PagedIterable list(String resourceGroupName, String workspaceName, String skip, + ListViewType listViewType, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, skip, listViewType, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DataContainerImpl(inner1, this.manager())); } - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String name, Context context) { + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String name, + Context context) { return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, name, context); } @@ -50,15 +49,12 @@ public void delete(String resourceGroupName, String workspaceName, String name) this.serviceClient().delete(resourceGroupName, workspaceName, name); } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String name, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, workspaceName, name, context); + public Response getWithResponse(String resourceGroupName, String workspaceName, String name, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, name, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new DataContainerImpl(inner.getValue(), this.manager())); } else { return null; @@ -74,108 +70,26 @@ public DataContainer get(String resourceGroupName, String workspaceName, String } } - public DataContainer getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "data"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'data'.", id))); - } - return this.getWithResponse(resourceGroupName, workspaceName, name, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "data"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'data'.", id))); - } - return this.getWithResponse(resourceGroupName, workspaceName, name, context); - } - - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "data"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'data'.", id))); + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String name, DataContainerInner body, Context context) { + Response inner + = this.serviceClient().createOrUpdateWithResponse(resourceGroupName, workspaceName, name, body, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DataContainerImpl(inner.getValue(), this.manager())); + } else { + return null; } - this.deleteWithResponse(resourceGroupName, workspaceName, name, Context.NONE); } - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "data"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'data'.", id))); + public DataContainer createOrUpdate(String resourceGroupName, String workspaceName, String name, + DataContainerInner body) { + DataContainerInner inner = this.serviceClient().createOrUpdate(resourceGroupName, workspaceName, name, body); + if (inner != null) { + return new DataContainerImpl(inner, this.manager()); + } else { + return null; } - return this.deleteWithResponse(resourceGroupName, workspaceName, name, context); } private DataContainersClient serviceClient() { @@ -185,8 +99,4 @@ private DataContainersClient serviceClient() { private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { return this.serviceManager; } - - public DataContainerImpl define(String name) { - return new DataContainerImpl(name, this.manager()); - } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataVersionBaseImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataVersionBaseImpl.java index 00c2cd10b3754..5a2b41cd2b147 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataVersionBaseImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataVersionBaseImpl.java @@ -4,11 +4,14 @@ package com.azure.resourcemanager.machinelearning.implementation; +import com.azure.core.http.rest.Response; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.machinelearning.fluent.models.DataVersionBaseInner; import com.azure.resourcemanager.machinelearning.models.DataVersionBase; import com.azure.resourcemanager.machinelearning.models.DataVersionBaseProperties; +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; +import com.azure.resourcemanager.machinelearning.models.PendingUploadResponseDto; public final class DataVersionBaseImpl implements DataVersionBase, DataVersionBase.Definition, DataVersionBase.Update { private DataVersionBaseInner innerObject; @@ -49,37 +52,30 @@ private com.azure.resourcemanager.machinelearning.MachineLearningManager manager private String resourceGroupName; - private String workspaceName; + private String registryName; private String name; private String version; - public DataVersionBaseImpl withExistingData(String resourceGroupName, String workspaceName, String name) { + public DataVersionBaseImpl withExistingData(String resourceGroupName, String registryName, String name) { this.resourceGroupName = resourceGroupName; - this.workspaceName = workspaceName; + this.registryName = registryName; this.name = name; return this; } public DataVersionBase create() { - this.innerObject = - serviceManager - .serviceClient() - .getDataVersions() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, name, version, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryDataVersions() + .createOrUpdate(resourceGroupName, registryName, name, version, this.innerModel(), Context.NONE); return this; } public DataVersionBase create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getDataVersions() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, version, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryDataVersions() + .createOrUpdate(resourceGroupName, registryName, name, version, this.innerModel(), context); return this; } @@ -94,57 +90,56 @@ public DataVersionBaseImpl update() { } public DataVersionBase apply() { - this.innerObject = - serviceManager - .serviceClient() - .getDataVersions() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, name, version, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryDataVersions() + .createOrUpdate(resourceGroupName, registryName, name, version, this.innerModel(), Context.NONE); return this; } public DataVersionBase apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getDataVersions() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, version, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryDataVersions() + .createOrUpdate(resourceGroupName, registryName, name, version, this.innerModel(), context); return this; } - DataVersionBaseImpl( - DataVersionBaseInner innerObject, + DataVersionBaseImpl(DataVersionBaseInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); - this.name = Utils.getValueFromIdByName(innerObject.id(), "data"); - this.version = Utils.getValueFromIdByName(innerObject.id(), "versions"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.registryName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "registries"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "data"); + this.version = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "versions"); } public DataVersionBase refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getDataVersions() - .getWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryDataVersions() + .getWithResponse(resourceGroupName, registryName, name, version, Context.NONE) + .getValue(); return this; } public DataVersionBase refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getDataVersions() - .getWithResponse(resourceGroupName, workspaceName, name, version, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryDataVersions() + .getWithResponse(resourceGroupName, registryName, name, version, context) + .getValue(); return this; } + public Response createOrGetStartPendingUploadWithResponse(PendingUploadRequestDto body, + Context context) { + return serviceManager.registryDataVersions() + .createOrGetStartPendingUploadWithResponse(resourceGroupName, registryName, name, version, body, context); + } + + public PendingUploadResponseDto createOrGetStartPendingUpload(PendingUploadRequestDto body) { + return serviceManager.registryDataVersions() + .createOrGetStartPendingUpload(resourceGroupName, registryName, name, version, body); + } + public DataVersionBaseImpl withProperties(DataVersionBaseProperties properties) { this.innerModel().withProperties(properties); return this; diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataVersionsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataVersionsClientImpl.java index 3a6cbe8f79548..571d77ea4bd0d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataVersionsClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataVersionsClientImpl.java @@ -13,6 +13,7 @@ import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -26,164 +27,145 @@ import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.machinelearning.fluent.DataVersionsClient; import com.azure.resourcemanager.machinelearning.fluent.models.DataVersionBaseInner; import com.azure.resourcemanager.machinelearning.models.DataVersionBaseResourceArmPaginatedResult; +import com.azure.resourcemanager.machinelearning.models.DestinationAsset; import com.azure.resourcemanager.machinelearning.models.ListViewType; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in DataVersionsClient. */ +/** + * An instance of this class provides access to all the operations defined in DataVersionsClient. + */ public final class DataVersionsClientImpl implements DataVersionsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final DataVersionsService service; - /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of DataVersionsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ - DataVersionsClientImpl(AzureMachineLearningWorkspacesImpl client) { - this.service = - RestProxy.create(DataVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + DataVersionsClientImpl(AzureMachineLearningServicesImpl client) { + this.service + = RestProxy.create(DataVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesDataVersions to be used by the proxy + * The interface defining all the services for AzureMachineLearningServicesDataVersions to be used by the proxy * service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AzureMachineLearning") public interface DataVersionsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @QueryParam("$orderBy") String orderBy, @QueryParam("$top") Integer top, @QueryParam("$skip") String skip, + @QueryParam("$tags") String tags, @QueryParam("listViewType") ListViewType listViewType, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, + Mono> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @QueryParam("$orderBy") String orderBy, - @QueryParam("$top") Integer top, - @QueryParam("$skip") String skip, - @QueryParam("$tags") String tags, - @QueryParam("listViewType") ListViewType listViewType, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @PathParam("version") String version, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> createOrUpdate(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @PathParam("version") String version, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") DataVersionBaseInner body, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}/publish") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, + Mono>> publish(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @PathParam("version") String version, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DataVersionBaseInner body, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") DestinationAsset body, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * List data versions in the data container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Data container's name. * @param orderBy Please choose OrderBy value from ['createdtime', 'modifiedtime']. - * @param top 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. + * @param top 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. * @param skip Continuation token for pagination. * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for - * including/excluding (for example) archived entities. + * including/excluding (for example) archived entities. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of DataVersionBase entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String workspaceName, - String name, - String orderBy, - Integer top, - String skip, - String tags, + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, String name, String orderBy, Integer top, String skip, String tags, ListViewType listViewType) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -197,77 +179,45 @@ private Mono> listSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - orderBy, - top, - skip, - tags, - listViewType, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), orderBy, top, skip, tags, + listViewType, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List data versions in the data container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Data container's name. * @param orderBy Please choose OrderBy value from ['createdtime', 'modifiedtime']. - * @param top 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. + * @param top 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. * @param skip Continuation token for pagination. * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for - * including/excluding (for example) archived entities. + * including/excluding (for example) archived entities. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of DataVersionBase entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String workspaceName, - String name, - String orderBy, - Integer top, - String skip, - String tags, - ListViewType listViewType, - Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, String name, String orderBy, Integer top, String skip, String tags, + ListViewType listViewType, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -282,59 +232,33 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - orderBy, - top, - skip, - tags, - listViewType, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, name, + this.client.getApiVersion(), orderBy, top, skip, tags, listViewType, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List data versions in the data container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Data container's name. * @param orderBy Please choose OrderBy value from ['createdtime', 'modifiedtime']. - * @param top 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. + * @param top 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. * @param skip Continuation token for pagination. * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for - * including/excluding (for example) archived entities. + * including/excluding (for example) archived entities. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of DataVersionBase entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String workspaceName, - String name, - String orderBy, - Integer top, - String skip, - String tags, - ListViewType listViewType) { + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String name, + String orderBy, Integer top, String skip, String tags, ListViewType listViewType) { return new PagedFlux<>( () -> listSinglePageAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, tags, listViewType), nextLink -> listNextSinglePageAsync(nextLink)); @@ -342,7 +266,7 @@ private PagedFlux listAsync( /** * List data versions in the data container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Data container's name. @@ -365,17 +289,17 @@ private PagedFlux listAsync(String resourceGroupName, Stri /** * List data versions in the data container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Data container's name. * @param orderBy Please choose OrderBy value from ['createdtime', 'modifiedtime']. - * @param top 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. + * @param top 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. * @param skip Continuation token for pagination. * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for - * including/excluding (for example) archived entities. + * including/excluding (for example) archived entities. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -383,26 +307,15 @@ private PagedFlux listAsync(String resourceGroupName, Stri * @return a paginated list of DataVersionBase entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String workspaceName, - String name, - String orderBy, - Integer top, - String skip, - String tags, - ListViewType listViewType, - Context context) { - return new PagedFlux<>( - () -> - listSinglePageAsync( - resourceGroupName, workspaceName, name, orderBy, top, skip, tags, listViewType, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String name, + String orderBy, Integer top, String skip, String tags, ListViewType listViewType, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, + tags, listViewType, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * List data versions in the data container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Data container's name. @@ -424,17 +337,17 @@ public PagedIterable list(String resourceGroupName, String /** * List data versions in the data container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Data container's name. * @param orderBy Please choose OrderBy value from ['createdtime', 'modifiedtime']. - * @param top 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. + * @param top 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. * @param skip Continuation token for pagination. * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for - * including/excluding (for example) archived entities. + * including/excluding (for example) archived entities. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -442,23 +355,15 @@ public PagedIterable list(String resourceGroupName, String * @return a paginated list of DataVersionBase entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, - String workspaceName, - String name, - String orderBy, - Integer top, - String skip, - String tags, - ListViewType listViewType, - Context context) { + public PagedIterable list(String resourceGroupName, String workspaceName, String name, + String orderBy, Integer top, String skip, String tags, ListViewType listViewType, Context context) { return new PagedIterable<>( listAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, tags, listViewType, context)); } /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -469,19 +374,15 @@ public PagedIterable list( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String name, String version) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, String name, + String version) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -498,25 +399,14 @@ private Mono> deleteWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - version, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, version, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -528,19 +418,15 @@ private Mono> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String name, String version, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, String name, + String version, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -557,22 +443,13 @@ private Mono> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - version, - this.client.getApiVersion(), - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, version, this.client.getApiVersion(), accept, context); } /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -590,7 +467,7 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -602,14 +479,14 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context) { + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String name, + String version, Context context) { return deleteWithResponseAsync(resourceGroupName, workspaceName, name, version, context).block(); } /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -625,7 +502,7 @@ public void delete(String resourceGroupName, String workspaceName, String name, /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -636,19 +513,15 @@ public void delete(String resourceGroupName, String workspaceName, String name, * @return version along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String name, String version) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String name, String version) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -665,25 +538,14 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - version, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, version, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -695,19 +557,15 @@ private Mono> getWithResponseAsync( * @return version along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String name, String version, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String name, String version, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -724,22 +582,13 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - version, - this.client.getApiVersion(), - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + name, version, this.client.getApiVersion(), accept, context); } /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -750,15 +599,15 @@ private Mono> getWithResponseAsync( * @return version on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String workspaceName, String name, String version) { + private Mono getAsync(String resourceGroupName, String workspaceName, String name, + String version) { return getWithResponseAsync(resourceGroupName, workspaceName, name, version) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -770,14 +619,14 @@ private Mono getAsync( * @return version along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context) { + public Response getWithResponse(String resourceGroupName, String workspaceName, String name, + String version, Context context) { return getWithResponseAsync(resourceGroupName, workspaceName, name, version, context).block(); } /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -794,7 +643,7 @@ public DataVersionBaseInner get(String resourceGroupName, String workspaceName, /** * Create or update version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -803,23 +652,19 @@ public DataVersionBaseInner get(String resourceGroupName, String workspaceName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link - * Mono}. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String workspaceName, String name, String version, DataVersionBaseInner body) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String name, String version, DataVersionBaseInner body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -841,26 +686,14 @@ private Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - version, - this.client.getApiVersion(), - body, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, version, this.client.getApiVersion(), body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or update version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -870,28 +703,19 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link - * Mono}. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String workspaceName, - String name, - String version, - DataVersionBaseInner body, - Context context) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String name, String version, DataVersionBaseInner body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -913,23 +737,13 @@ private Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - version, - this.client.getApiVersion(), - body, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, version, this.client.getApiVersion(), body, accept, context); } /** * Create or update version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -941,15 +755,15 @@ private Mono> createOrUpdateWithResponseAsync( * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String workspaceName, String name, String version, DataVersionBaseInner body) { + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, String name, + String version, DataVersionBaseInner body) { return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, version, body) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Create or update version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -962,19 +776,14 @@ private Mono createOrUpdateAsync( * @return azure Resource Manager resource envelope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String name, - String version, - DataVersionBaseInner body, - Context context) { + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String name, String version, DataVersionBaseInner body, Context context) { return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, version, body, context).block(); } /** * Create or update version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -986,22 +795,282 @@ public Response createOrUpdateWithResponse( * @return azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DataVersionBaseInner createOrUpdate( - String resourceGroupName, String workspaceName, String name, String version, DataVersionBaseInner body) { + public DataVersionBaseInner createOrUpdate(String resourceGroupName, String workspaceName, String name, + String version, DataVersionBaseInner body) { return createOrUpdateWithResponse(resourceGroupName, workspaceName, name, version, body, Context.NONE) .getValue(); } + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> publishWithResponseAsync(String resourceGroupName, String workspaceName, + String name, String version, DestinationAsset body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.publish(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, version, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> publishWithResponseAsync(String resourceGroupName, String workspaceName, + String name, String version, DestinationAsset body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.publish(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, version, this.client.getApiVersion(), body, accept, context); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPublishAsync(String resourceGroupName, String workspaceName, + String name, String version, DestinationAsset body) { + Mono>> mono + = publishWithResponseAsync(resourceGroupName, workspaceName, name, version, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPublishAsync(String resourceGroupName, String workspaceName, + String name, String version, DestinationAsset body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = publishWithResponseAsync(resourceGroupName, workspaceName, name, version, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPublish(String resourceGroupName, String workspaceName, String name, + String version, DestinationAsset body) { + return this.beginPublishAsync(resourceGroupName, workspaceName, name, version, body).getSyncPoller(); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPublish(String resourceGroupName, String workspaceName, String name, + String version, DestinationAsset body, Context context) { + return this.beginPublishAsync(resourceGroupName, workspaceName, name, version, body, context).getSyncPoller(); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono publishAsync(String resourceGroupName, String workspaceName, String name, String version, + DestinationAsset body) { + return beginPublishAsync(resourceGroupName, workspaceName, name, version, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono publishAsync(String resourceGroupName, String workspaceName, String name, String version, + DestinationAsset body, Context context) { + return beginPublishAsync(resourceGroupName, workspaceName, name, version, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void publish(String resourceGroupName, String workspaceName, String name, String version, + DestinationAsset body) { + publishAsync(resourceGroupName, workspaceName, name, version, body).block(); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void publish(String resourceGroupName, String workspaceName, String name, String version, + DestinationAsset body, Context context) { + publishAsync(resourceGroupName, workspaceName, name, version, body, context).block(); + } + /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of DataVersionBase entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1009,37 +1078,26 @@ private Mono> listNextSinglePageAsync(String return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of DataVersionBase entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -1047,23 +1105,13 @@ private Mono> listNextSinglePageAsync(String return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataVersionsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataVersionsImpl.java index 09fc917310d6b..58a42367235ab 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataVersionsImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DataVersionsImpl.java @@ -13,6 +13,7 @@ import com.azure.resourcemanager.machinelearning.fluent.models.DataVersionBaseInner; import com.azure.resourcemanager.machinelearning.models.DataVersionBase; import com.azure.resourcemanager.machinelearning.models.DataVersions; +import com.azure.resourcemanager.machinelearning.models.DestinationAsset; import com.azure.resourcemanager.machinelearning.models.ListViewType; public final class DataVersionsImpl implements DataVersions { @@ -22,8 +23,7 @@ public final class DataVersionsImpl implements DataVersions { private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - public DataVersionsImpl( - DataVersionsClient innerClient, + public DataVersionsImpl(DataVersionsClient innerClient, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -31,28 +31,18 @@ public DataVersionsImpl( public PagedIterable list(String resourceGroupName, String workspaceName, String name) { PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName, name); - return Utils.mapPage(inner, inner1 -> new DataVersionBaseImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DataVersionBaseImpl(inner1, this.manager())); } - public PagedIterable list( - String resourceGroupName, - String workspaceName, - String name, - String orderBy, - Integer top, - String skip, - String tags, - ListViewType listViewType, - Context context) { - PagedIterable inner = - this - .serviceClient() - .list(resourceGroupName, workspaceName, name, orderBy, top, skip, tags, listViewType, context); - return Utils.mapPage(inner, inner1 -> new DataVersionBaseImpl(inner1, this.manager())); + public PagedIterable list(String resourceGroupName, String workspaceName, String name, + String orderBy, Integer top, String skip, String tags, ListViewType listViewType, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, workspaceName, name, orderBy, top, skip, tags, listViewType, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DataVersionBaseImpl(inner1, this.manager())); } - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context) { + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String name, + String version, Context context) { return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, name, version, context); } @@ -60,15 +50,12 @@ public void delete(String resourceGroupName, String workspaceName, String name, this.serviceClient().delete(resourceGroupName, workspaceName, name, version); } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, workspaceName, name, version, context); + public Response getWithResponse(String resourceGroupName, String workspaceName, String name, + String version, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, name, version, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new DataVersionBaseImpl(inner.getValue(), this.manager())); } else { return null; @@ -84,136 +71,37 @@ public DataVersionBase get(String resourceGroupName, String workspaceName, Strin } } - public DataVersionBase getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "data"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'data'.", id))); - } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String name, String version, DataVersionBaseInner body, Context context) { + Response inner = this.serviceClient() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, version, body, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DataVersionBaseImpl(inner.getValue(), this.manager())); + } else { + return null; } - return this.getWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE).getValue(); } - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "data"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'data'.", id))); - } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + public DataVersionBase createOrUpdate(String resourceGroupName, String workspaceName, String name, String version, + DataVersionBaseInner body) { + DataVersionBaseInner inner + = this.serviceClient().createOrUpdate(resourceGroupName, workspaceName, name, version, body); + if (inner != null) { + return new DataVersionBaseImpl(inner, this.manager()); + } else { + return null; } - return this.getWithResponse(resourceGroupName, workspaceName, name, version, context); } - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "data"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'data'.", id))); - } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); - } - this.deleteWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE); + public void publish(String resourceGroupName, String workspaceName, String name, String version, + DestinationAsset body) { + this.serviceClient().publish(resourceGroupName, workspaceName, name, version, body); } - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "data"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'data'.", id))); - } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); - } - return this.deleteWithResponse(resourceGroupName, workspaceName, name, version, context); + public void publish(String resourceGroupName, String workspaceName, String name, String version, + DestinationAsset body, Context context) { + this.serviceClient().publish(resourceGroupName, workspaceName, name, version, body, context); } private DataVersionsClient serviceClient() { @@ -223,8 +111,4 @@ private DataVersionsClient serviceClient() { private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { return this.serviceManager; } - - public DataVersionBaseImpl define(String name) { - return new DataVersionBaseImpl(name, this.manager()); - } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DatastoreImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DatastoreImpl.java index e1686a7722121..9c4a909137829 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DatastoreImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DatastoreImpl.java @@ -11,6 +11,7 @@ import com.azure.resourcemanager.machinelearning.models.Datastore; import com.azure.resourcemanager.machinelearning.models.DatastoreProperties; import com.azure.resourcemanager.machinelearning.models.DatastoreSecrets; +import com.azure.resourcemanager.machinelearning.models.SecretExpiry; public final class DatastoreImpl implements Datastore, Datastore.Definition, Datastore.Update { private DatastoreInner innerObject; @@ -66,24 +67,20 @@ public DatastoreImpl withExistingWorkspace(String resourceGroupName, String work } public Datastore create() { - this.innerObject = - serviceManager - .serviceClient() - .getDatastores() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, name, this.innerModel(), createSkipValidation, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getDatastores() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), createSkipValidation, + Context.NONE) + .getValue(); return this; } public Datastore create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getDatastores() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, name, this.innerModel(), createSkipValidation, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getDatastores() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), createSkipValidation, + context) + .getValue(); return this; } @@ -100,58 +97,51 @@ public DatastoreImpl update() { } public Datastore apply() { - this.innerObject = - serviceManager - .serviceClient() - .getDatastores() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, name, this.innerModel(), updateSkipValidation, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getDatastores() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), updateSkipValidation, + Context.NONE) + .getValue(); return this; } public Datastore apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getDatastores() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, name, this.innerModel(), updateSkipValidation, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getDatastores() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), updateSkipValidation, + context) + .getValue(); return this; } - DatastoreImpl( - DatastoreInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + DatastoreImpl(DatastoreInner innerObject, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); - this.name = Utils.getValueFromIdByName(innerObject.id(), "datastores"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "datastores"); } public Datastore refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getDatastores() - .getWithResponse(resourceGroupName, workspaceName, name, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getDatastores() + .getWithResponse(resourceGroupName, workspaceName, name, Context.NONE) + .getValue(); return this; } public Datastore refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getDatastores() - .getWithResponse(resourceGroupName, workspaceName, name, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getDatastores() + .getWithResponse(resourceGroupName, workspaceName, name, context) + .getValue(); return this; } - public Response listSecretsWithResponse(Context context) { - return serviceManager.datastores().listSecretsWithResponse(resourceGroupName, workspaceName, name, context); + public Response listSecretsWithResponse(SecretExpiry body, Context context) { + return serviceManager.datastores() + .listSecretsWithResponse(resourceGroupName, workspaceName, name, body, context); } public DatastoreSecrets listSecrets() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DatastoreSecretsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DatastoreSecretsImpl.java index e2678170c2311..e54cb14dbd117 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DatastoreSecretsImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DatastoreSecretsImpl.java @@ -6,19 +6,23 @@ import com.azure.resourcemanager.machinelearning.fluent.models.DatastoreSecretsInner; import com.azure.resourcemanager.machinelearning.models.DatastoreSecrets; +import com.azure.resourcemanager.machinelearning.models.SecretsType; public final class DatastoreSecretsImpl implements DatastoreSecrets { private DatastoreSecretsInner innerObject; private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - DatastoreSecretsImpl( - DatastoreSecretsInner innerObject, + DatastoreSecretsImpl(DatastoreSecretsInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } + public SecretsType secretsType() { + return this.innerModel().secretsType(); + } + public DatastoreSecretsInner innerModel() { return this.innerObject; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DatastoresClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DatastoresClientImpl.java index 62f960a4c3aec..321ee483ad3c8 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DatastoresClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DatastoresClientImpl.java @@ -33,139 +33,110 @@ import com.azure.resourcemanager.machinelearning.fluent.models.DatastoreInner; import com.azure.resourcemanager.machinelearning.fluent.models.DatastoreSecretsInner; import com.azure.resourcemanager.machinelearning.models.DatastoreResourceArmPaginatedResult; +import com.azure.resourcemanager.machinelearning.models.SecretExpiry; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in DatastoresClient. */ +/** + * An instance of this class provides access to all the operations defined in DatastoresClient. + */ public final class DatastoresClientImpl implements DatastoresClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final DatastoresService service; - /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of DatastoresClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ - DatastoresClientImpl(AzureMachineLearningWorkspacesImpl client) { - this.service = - RestProxy.create(DatastoresService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + DatastoresClientImpl(AzureMachineLearningServicesImpl client) { + this.service + = RestProxy.create(DatastoresService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesDatastores to be used by the proxy + * The interface defining all the services for AzureMachineLearningServicesDatastores to be used by the proxy * service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AzureMachineLearning") public interface DatastoresService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, + Mono> list(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @QueryParam("api-version") String apiVersion, - @QueryParam("$skip") String skip, - @QueryParam("count") Integer count, - @QueryParam("isDefault") Boolean isDefault, - @QueryParam("names") String names, - @QueryParam("searchText") String searchText, - @QueryParam("orderBy") String orderBy, - @QueryParam("orderByAsc") Boolean orderByAsc, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}") - @ExpectedResponses({200, 204}) + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @QueryParam("$skip") String skip, + @QueryParam("count") Integer count, @QueryParam("isDefault") Boolean isDefault, + @QueryParam("names") String names, @QueryParam("searchText") String searchText, + @QueryParam("orderBy") String orderBy, @QueryParam("orderByAsc") Boolean orderByAsc, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, + Mono> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, + Mono> createOrUpdate(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @QueryParam("skipValidation") Boolean skipValidation, - @BodyParam("application/json") DatastoreInner body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets") - @ExpectedResponses({200}) + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @QueryParam("skipValidation") Boolean skipValidation, @BodyParam("application/json") DatastoreInner body, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listSecrets( - @HostParam("$host") String endpoint, + Mono> listSecrets(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SecretExpiry body, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * List datastores. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -179,30 +150,19 @@ Mono> listNext( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of Datastore entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String workspaceName, - String skip, - Integer count, - Boolean isDefault, - List names, - String searchText, - String orderBy, + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String skip, Integer count, Boolean isDefault, List names, String searchText, String orderBy, Boolean orderByAsc) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -212,44 +172,23 @@ private Mono> listSinglePageAsync( return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } final String accept = "application/json"; - String namesConverted = - (names == null) - ? null - : names.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(",")); + String namesConverted = (names == null) + ? null + : names.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")); return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - this.client.getApiVersion(), - skip, - count, - isDefault, - namesConverted, - searchText, - orderBy, - orderByAsc, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), skip, count, isDefault, namesConverted, + searchText, orderBy, orderByAsc, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List datastores. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -264,31 +203,19 @@ private Mono> listSinglePageAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of Datastore entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String workspaceName, - String skip, - Integer count, - Boolean isDefault, - List names, - String searchText, - String orderBy, - Boolean orderByAsc, - Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String skip, Integer count, Boolean isDefault, List names, String searchText, String orderBy, + Boolean orderByAsc, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -298,41 +225,23 @@ private Mono> listSinglePageAsync( return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } final String accept = "application/json"; - String namesConverted = - (names == null) - ? null - : names.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(",")); + String namesConverted = (names == null) + ? null + : names.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")); context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - this.client.getApiVersion(), - skip, - count, - isDefault, - namesConverted, - searchText, - orderBy, - orderByAsc, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + this.client.getApiVersion(), skip, count, isDefault, namesConverted, searchText, orderBy, orderByAsc, + accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List datastores. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -348,26 +257,15 @@ private Mono> listSinglePageAsync( * @return a paginated list of Datastore entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String workspaceName, - String skip, - Integer count, - Boolean isDefault, - List names, - String searchText, - String orderBy, - Boolean orderByAsc) { - return new PagedFlux<>( - () -> - listSinglePageAsync( - resourceGroupName, workspaceName, skip, count, isDefault, names, searchText, orderBy, orderByAsc), - nextLink -> listNextSinglePageAsync(nextLink)); + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String skip, + Integer count, Boolean isDefault, List names, String searchText, String orderBy, Boolean orderByAsc) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skip, count, isDefault, + names, searchText, orderBy, orderByAsc), nextLink -> listNextSinglePageAsync(nextLink)); } /** * List datastores. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -384,16 +282,13 @@ private PagedFlux listAsync(String resourceGroupName, String wor final String searchText = null; final String orderBy = null; final Boolean orderByAsc = null; - return new PagedFlux<>( - () -> - listSinglePageAsync( - resourceGroupName, workspaceName, skip, count, isDefault, names, searchText, orderBy, orderByAsc), - nextLink -> listNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skip, count, isDefault, + names, searchText, orderBy, orderByAsc), nextLink -> listNextSinglePageAsync(nextLink)); } /** * List datastores. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -410,36 +305,16 @@ private PagedFlux listAsync(String resourceGroupName, String wor * @return a paginated list of Datastore entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String workspaceName, - String skip, - Integer count, - Boolean isDefault, - List names, - String searchText, - String orderBy, - Boolean orderByAsc, + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String skip, + Integer count, Boolean isDefault, List names, String searchText, String orderBy, Boolean orderByAsc, Context context) { - return new PagedFlux<>( - () -> - listSinglePageAsync( - resourceGroupName, - workspaceName, - skip, - count, - isDefault, - names, - searchText, - orderBy, - orderByAsc, - context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skip, count, isDefault, + names, searchText, orderBy, orderByAsc, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * List datastores. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -456,14 +331,13 @@ public PagedIterable list(String resourceGroupName, String works final String searchText = null; final String orderBy = null; final Boolean orderByAsc = null; - return new PagedIterable<>( - listAsync( - resourceGroupName, workspaceName, skip, count, isDefault, names, searchText, orderBy, orderByAsc)); + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, skip, count, isDefault, names, + searchText, orderBy, orderByAsc)); } /** * List datastores. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -480,34 +354,16 @@ public PagedIterable list(String resourceGroupName, String works * @return a paginated list of Datastore entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, - String workspaceName, - String skip, - Integer count, - Boolean isDefault, - List names, - String searchText, - String orderBy, - Boolean orderByAsc, + public PagedIterable list(String resourceGroupName, String workspaceName, String skip, + Integer count, Boolean isDefault, List names, String searchText, String orderBy, Boolean orderByAsc, Context context) { - return new PagedIterable<>( - listAsync( - resourceGroupName, - workspaceName, - skip, - count, - isDefault, - names, - searchText, - orderBy, - orderByAsc, - context)); + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, skip, count, isDefault, names, + searchText, orderBy, orderByAsc, context)); } /** * Delete datastore. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Datastore name. @@ -519,16 +375,12 @@ public PagedIterable list( @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, String name) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -542,24 +394,14 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete datastore. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Datastore name. @@ -570,19 +412,15 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String name, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, String name, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -596,21 +434,13 @@ private Mono> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, this.client.getApiVersion(), accept, context); } /** * Delete datastore. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Datastore name. @@ -626,7 +456,7 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S /** * Delete datastore. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Datastore name. @@ -637,14 +467,14 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String name, Context context) { + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String name, + Context context) { return deleteWithResponseAsync(resourceGroupName, workspaceName, name, context).block(); } /** * Delete datastore. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Datastore name. @@ -659,7 +489,7 @@ public void delete(String resourceGroupName, String workspaceName, String name) /** * Get datastore. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Datastore name. @@ -669,19 +499,15 @@ public void delete(String resourceGroupName, String workspaceName, String name) * @return datastore along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String name) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String name) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -695,24 +521,14 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get datastore. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Datastore name. @@ -723,19 +539,15 @@ private Mono> getWithResponseAsync( * @return datastore along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String name, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String name, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -749,21 +561,13 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + name, this.client.getApiVersion(), accept, context); } /** * Get datastore. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Datastore name. @@ -780,7 +584,7 @@ private Mono getAsync(String resourceGroupName, String workspace /** * Get datastore. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Datastore name. @@ -791,14 +595,14 @@ private Mono getAsync(String resourceGroupName, String workspace * @return datastore along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String name, Context context) { + public Response getWithResponse(String resourceGroupName, String workspaceName, String name, + Context context) { return getWithResponseAsync(resourceGroupName, workspaceName, name, context).block(); } /** * Get datastore. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Datastore name. @@ -814,7 +618,7 @@ public DatastoreInner get(String resourceGroupName, String workspaceName, String /** * Create or update datastore. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Datastore name. @@ -823,23 +627,19 @@ public DatastoreInner get(String resourceGroupName, String workspaceName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link - * Mono}. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String workspaceName, String name, DatastoreInner body, Boolean skipValidation) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String name, DatastoreInner body, Boolean skipValidation) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -858,26 +658,15 @@ private Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - skipValidation, - body, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), skipValidation, body, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or update datastore. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Datastore name. @@ -887,28 +676,19 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link - * Mono}. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String workspaceName, - String name, - DatastoreInner body, - Boolean skipValidation, - Context context) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String name, DatastoreInner body, Boolean skipValidation, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -927,23 +707,13 @@ private Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - skipValidation, - body, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, this.client.getApiVersion(), skipValidation, body, accept, context); } /** * Create or update datastore. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Datastore name. @@ -954,8 +724,8 @@ private Mono> createOrUpdateWithResponseAsync( * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String workspaceName, String name, DatastoreInner body) { + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, String name, + DatastoreInner body) { final Boolean skipValidation = null; return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, body, skipValidation) .flatMap(res -> Mono.justOrEmpty(res.getValue())); @@ -963,7 +733,7 @@ private Mono createOrUpdateAsync( /** * Create or update datastore. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Datastore name. @@ -976,20 +746,15 @@ private Mono createOrUpdateAsync( * @return azure Resource Manager resource envelope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String name, - DatastoreInner body, - Boolean skipValidation, - Context context) { + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String name, DatastoreInner body, Boolean skipValidation, Context context) { return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, body, skipValidation, context) .block(); } /** * Create or update datastore. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Datastore name. @@ -1000,8 +765,8 @@ public Response createOrUpdateWithResponse( * @return azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DatastoreInner createOrUpdate( - String resourceGroupName, String workspaceName, String name, DatastoreInner body) { + public DatastoreInner createOrUpdate(String resourceGroupName, String workspaceName, String name, + DatastoreInner body) { final Boolean skipValidation = null; return createOrUpdateWithResponse(resourceGroupName, workspaceName, name, body, skipValidation, Context.NONE) .getValue(); @@ -1009,29 +774,26 @@ public DatastoreInner createOrUpdate( /** * Get datastore secrets. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Datastore name. + * @param body Secret expiry information. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return datastore secrets along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSecretsWithResponseAsync( - String resourceGroupName, String workspaceName, String name) { + private Mono> listSecretsWithResponseAsync(String resourceGroupName, + String workspaceName, String name, SecretExpiry body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1043,29 +805,23 @@ private Mono> listSecretsWithResponseAsync( if (name == null) { return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); } + if (body != null) { + body.validate(); + } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listSecrets( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.listSecrets(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get datastore secrets. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Datastore name. + * @param body Secret expiry information. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1073,19 +829,15 @@ private Mono> listSecretsWithResponseAsync( * @return datastore secrets along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSecretsWithResponseAsync( - String resourceGroupName, String workspaceName, String name, Context context) { + private Mono> listSecretsWithResponseAsync(String resourceGroupName, + String workspaceName, String name, SecretExpiry body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1097,23 +849,18 @@ private Mono> listSecretsWithResponseAsync( if (name == null) { return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); } + if (body != null) { + body.validate(); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listSecrets( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - accept, - context); + return service.listSecrets(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, this.client.getApiVersion(), body, accept, context); } /** * Get datastore secrets. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Datastore name. @@ -1124,16 +871,18 @@ private Mono> listSecretsWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono listSecretsAsync(String resourceGroupName, String workspaceName, String name) { - return listSecretsWithResponseAsync(resourceGroupName, workspaceName, name) + final SecretExpiry body = null; + return listSecretsWithResponseAsync(resourceGroupName, workspaceName, name, body) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Get datastore secrets. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Datastore name. + * @param body Secret expiry information. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1141,14 +890,14 @@ private Mono listSecretsAsync(String resourceGroupName, S * @return datastore secrets along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listSecretsWithResponse( - String resourceGroupName, String workspaceName, String name, Context context) { - return listSecretsWithResponseAsync(resourceGroupName, workspaceName, name, context).block(); + public Response listSecretsWithResponse(String resourceGroupName, String workspaceName, + String name, SecretExpiry body, Context context) { + return listSecretsWithResponseAsync(resourceGroupName, workspaceName, name, body, context).block(); } /** * Get datastore secrets. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Datastore name. @@ -1159,19 +908,19 @@ public Response listSecretsWithResponse( */ @ServiceMethod(returns = ReturnType.SINGLE) public DatastoreSecretsInner listSecrets(String resourceGroupName, String workspaceName, String name) { - return listSecretsWithResponse(resourceGroupName, workspaceName, name, Context.NONE).getValue(); + final SecretExpiry body = null; + return listSecretsWithResponse(resourceGroupName, workspaceName, name, body, Context.NONE).getValue(); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of Datastore entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1179,37 +928,26 @@ private Mono> listNextSinglePageAsync(String nextL return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of Datastore entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -1217,23 +955,13 @@ private Mono> listNextSinglePageAsync(String nextL return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DatastoresImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DatastoresImpl.java index bc059720b005c..05ec44e55440a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DatastoresImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DatastoresImpl.java @@ -13,8 +13,9 @@ import com.azure.resourcemanager.machinelearning.fluent.models.DatastoreInner; import com.azure.resourcemanager.machinelearning.fluent.models.DatastoreSecretsInner; import com.azure.resourcemanager.machinelearning.models.Datastore; -import com.azure.resourcemanager.machinelearning.models.DatastoreSecrets; import com.azure.resourcemanager.machinelearning.models.Datastores; +import com.azure.resourcemanager.machinelearning.models.DatastoreSecrets; +import com.azure.resourcemanager.machinelearning.models.SecretExpiry; import java.util.List; public final class DatastoresImpl implements Datastores { @@ -24,47 +25,27 @@ public final class DatastoresImpl implements Datastores { private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - public DatastoresImpl( - DatastoresClient innerClient, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + public DatastoresImpl(DatastoresClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list(String resourceGroupName, String workspaceName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); - return Utils.mapPage(inner, inner1 -> new DatastoreImpl(inner1, this.manager())); - } - - public PagedIterable list( - String resourceGroupName, - String workspaceName, - String skip, - Integer count, - Boolean isDefault, - List names, - String searchText, - String orderBy, - Boolean orderByAsc, + return ResourceManagerUtils.mapPage(inner, inner1 -> new DatastoreImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String skip, Integer count, + Boolean isDefault, List names, String searchText, String orderBy, Boolean orderByAsc, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, workspaceName, skip, count, isDefault, names, searchText, orderBy, orderByAsc, + context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DatastoreImpl(inner1, this.manager())); + } + + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String name, Context context) { - PagedIterable inner = - this - .serviceClient() - .list( - resourceGroupName, - workspaceName, - skip, - count, - isDefault, - names, - searchText, - orderBy, - orderByAsc, - context); - return Utils.mapPage(inner, inner1 -> new DatastoreImpl(inner1, this.manager())); - } - - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String name, Context context) { return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, name, context); } @@ -72,15 +53,12 @@ public void delete(String resourceGroupName, String workspaceName, String name) this.serviceClient().delete(resourceGroupName, workspaceName, name); } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String name, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, workspaceName, name, context); + public Response getWithResponse(String resourceGroupName, String workspaceName, String name, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, name, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new DatastoreImpl(inner.getValue(), this.manager())); } else { return null; @@ -96,15 +74,12 @@ public Datastore get(String resourceGroupName, String workspaceName, String name } } - public Response listSecretsWithResponse( - String resourceGroupName, String workspaceName, String name, Context context) { - Response inner = - this.serviceClient().listSecretsWithResponse(resourceGroupName, workspaceName, name, context); + public Response listSecretsWithResponse(String resourceGroupName, String workspaceName, + String name, SecretExpiry body, Context context) { + Response inner + = this.serviceClient().listSecretsWithResponse(resourceGroupName, workspaceName, name, body, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new DatastoreSecretsImpl(inner.getValue(), this.manager())); } else { return null; @@ -121,105 +96,77 @@ public DatastoreSecrets listSecrets(String resourceGroupName, String workspaceNa } public Datastore getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String name = Utils.getValueFromIdByName(id, "datastores"); + String name = ResourceManagerUtils.getValueFromIdByName(id, "datastores"); if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'datastores'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'datastores'.", id))); } return this.getWithResponse(resourceGroupName, workspaceName, name, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String name = Utils.getValueFromIdByName(id, "datastores"); + String name = ResourceManagerUtils.getValueFromIdByName(id, "datastores"); if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'datastores'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'datastores'.", id))); } return this.getWithResponse(resourceGroupName, workspaceName, name, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String name = Utils.getValueFromIdByName(id, "datastores"); + String name = ResourceManagerUtils.getValueFromIdByName(id, "datastores"); if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'datastores'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'datastores'.", id))); } this.deleteWithResponse(resourceGroupName, workspaceName, name, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String name = Utils.getValueFromIdByName(id, "datastores"); + String name = ResourceManagerUtils.getValueFromIdByName(id, "datastores"); if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'datastores'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'datastores'.", id))); } return this.deleteWithResponse(resourceGroupName, workspaceName, name, context); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DeploymentLogsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DeploymentLogsImpl.java index e3f96c2eabf72..c4e57feffea92 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DeploymentLogsImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DeploymentLogsImpl.java @@ -12,8 +12,7 @@ public final class DeploymentLogsImpl implements DeploymentLogs { private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - DeploymentLogsImpl( - DeploymentLogsInner innerObject, + DeploymentLogsImpl(DeploymentLogsInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DiagnoseResponseResultImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DiagnoseResponseResultImpl.java index 7b4dfe310adac..887a49f6b5cc1 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DiagnoseResponseResultImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/DiagnoseResponseResultImpl.java @@ -13,8 +13,7 @@ public final class DiagnoseResponseResultImpl implements DiagnoseResponseResult private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - DiagnoseResponseResultImpl( - DiagnoseResponseResultInner innerObject, + DiagnoseResponseResultImpl(DiagnoseResponseResultInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EndpointAuthKeysImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EndpointAuthKeysImpl.java index 5cd99472c86a0..d407a063e1c66 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EndpointAuthKeysImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EndpointAuthKeysImpl.java @@ -12,8 +12,7 @@ public final class EndpointAuthKeysImpl implements EndpointAuthKeys { private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - EndpointAuthKeysImpl( - EndpointAuthKeysInner innerObject, + EndpointAuthKeysImpl(EndpointAuthKeysInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EndpointAuthTokenImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EndpointAuthTokenImpl.java index 2bb22886310c2..c3b96d3617e53 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EndpointAuthTokenImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EndpointAuthTokenImpl.java @@ -12,8 +12,7 @@ public final class EndpointAuthTokenImpl implements EndpointAuthToken { private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - EndpointAuthTokenImpl( - EndpointAuthTokenInner innerObject, + EndpointAuthTokenImpl(EndpointAuthTokenInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EndpointPropertiesBaseImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EndpointPropertiesBaseImpl.java index 72da8064892e2..6ed2d488ad9ac 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EndpointPropertiesBaseImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EndpointPropertiesBaseImpl.java @@ -17,8 +17,7 @@ public final class EndpointPropertiesBaseImpl implements EndpointPropertiesBase private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - EndpointPropertiesBaseImpl( - EndpointPropertiesBaseInner innerObject, + EndpointPropertiesBaseImpl(EndpointPropertiesBaseInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentContainerImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentContainerImpl.java index 4ee12b6fd24e6..19b2d2a571f73 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentContainerImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentContainerImpl.java @@ -50,41 +50,35 @@ private com.azure.resourcemanager.machinelearning.MachineLearningManager manager private String resourceGroupName; - private String workspaceName; + private String registryName; - private String name; + private String environmentName; - public EnvironmentContainerImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + public EnvironmentContainerImpl withExistingRegistry(String resourceGroupName, String registryName) { this.resourceGroupName = resourceGroupName; - this.workspaceName = workspaceName; + this.registryName = registryName; return this; } public EnvironmentContainer create() { - this.innerObject = - serviceManager - .serviceClient() - .getEnvironmentContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryEnvironmentContainers() + .createOrUpdate(resourceGroupName, registryName, environmentName, this.innerModel(), Context.NONE); return this; } public EnvironmentContainer create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getEnvironmentContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryEnvironmentContainers() + .createOrUpdate(resourceGroupName, registryName, environmentName, this.innerModel(), context); return this; } - EnvironmentContainerImpl( - String name, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + EnvironmentContainerImpl(String name, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = new EnvironmentContainerInner(); this.serviceManager = serviceManager; - this.name = name; + this.environmentName = name; } public EnvironmentContainerImpl update() { @@ -92,52 +86,41 @@ public EnvironmentContainerImpl update() { } public EnvironmentContainer apply() { - this.innerObject = - serviceManager - .serviceClient() - .getEnvironmentContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryEnvironmentContainers() + .createOrUpdate(resourceGroupName, registryName, environmentName, this.innerModel(), Context.NONE); return this; } public EnvironmentContainer apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getEnvironmentContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryEnvironmentContainers() + .createOrUpdate(resourceGroupName, registryName, environmentName, this.innerModel(), context); return this; } - EnvironmentContainerImpl( - EnvironmentContainerInner innerObject, + EnvironmentContainerImpl(EnvironmentContainerInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); - this.name = Utils.getValueFromIdByName(innerObject.id(), "environments"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.registryName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "registries"); + this.environmentName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "environments"); } public EnvironmentContainer refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getEnvironmentContainers() - .getWithResponse(resourceGroupName, workspaceName, name, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryEnvironmentContainers() + .getWithResponse(resourceGroupName, registryName, environmentName, Context.NONE) + .getValue(); return this; } public EnvironmentContainer refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getEnvironmentContainers() - .getWithResponse(resourceGroupName, workspaceName, name, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryEnvironmentContainers() + .getWithResponse(resourceGroupName, registryName, environmentName, context) + .getValue(); return this; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentContainersClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentContainersClientImpl.java index d569783d4fc89..9a25903d62270 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentContainersClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentContainersClientImpl.java @@ -34,113 +34,92 @@ import com.azure.resourcemanager.machinelearning.models.ListViewType; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in EnvironmentContainersClient. */ +/** + * An instance of this class provides access to all the operations defined in EnvironmentContainersClient. + */ public final class EnvironmentContainersClientImpl implements EnvironmentContainersClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final EnvironmentContainersService service; - /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of EnvironmentContainersClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ - EnvironmentContainersClientImpl(AzureMachineLearningWorkspacesImpl client) { - this.service = - RestProxy - .create(EnvironmentContainersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + EnvironmentContainersClientImpl(AzureMachineLearningServicesImpl client) { + this.service = RestProxy.create(EnvironmentContainersService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesEnvironmentContainers to be used by the + * The interface defining all the services for AzureMachineLearningServicesEnvironmentContainers to be used by the * proxy service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AzureMachineLearning") public interface EnvironmentContainersService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, + Mono> list(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @QueryParam("api-version") String apiVersion, - @QueryParam("$skip") String skip, - @QueryParam("listViewType") ListViewType listViewType, - @HeaderParam("Accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @QueryParam("$skip") String skip, + @QueryParam("listViewType") ListViewType listViewType, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, + Mono> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, + Mono> createOrUpdate(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") EnvironmentContainerInner body, - @HeaderParam("Accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") EnvironmentContainerInner body, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * List environment containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -149,22 +128,18 @@ Mono> listNext( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of EnvironmentContainer entities along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String workspaceName, String skip, ListViewType listViewType) { + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, String skip, ListViewType listViewType) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -175,34 +150,16 @@ private Mono> listSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - this.client.getApiVersion(), - skip, - listViewType, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), skip, listViewType, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List environment containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -212,22 +169,18 @@ private Mono> listSinglePageAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of EnvironmentContainer entities along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String workspaceName, String skip, ListViewType listViewType, Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, String skip, ListViewType listViewType, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -239,30 +192,15 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - this.client.getApiVersion(), - skip, - listViewType, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + this.client.getApiVersion(), skip, listViewType, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List environment containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -273,16 +211,15 @@ private Mono> listSinglePageAsync( * @return a paginated list of EnvironmentContainer entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String workspaceName, String skip, ListViewType listViewType) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, skip, listViewType), + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String skip, + ListViewType listViewType) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skip, listViewType), nextLink -> listNextSinglePageAsync(nextLink)); } /** * List environment containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -294,14 +231,13 @@ private PagedFlux listAsync( private PagedFlux listAsync(String resourceGroupName, String workspaceName) { final String skip = null; final ListViewType listViewType = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, skip, listViewType), + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skip, listViewType), nextLink -> listNextSinglePageAsync(nextLink)); } /** * List environment containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -313,16 +249,15 @@ private PagedFlux listAsync(String resourceGroupName, * @return a paginated list of EnvironmentContainer entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String workspaceName, String skip, ListViewType listViewType, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, skip, listViewType, context), + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String skip, + ListViewType listViewType, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skip, listViewType, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * List environment containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -339,7 +274,7 @@ public PagedIterable list(String resourceGroupName, S /** * List environment containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -351,14 +286,14 @@ public PagedIterable list(String resourceGroupName, S * @return a paginated list of EnvironmentContainer entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String workspaceName, String skip, ListViewType listViewType, Context context) { + public PagedIterable list(String resourceGroupName, String workspaceName, String skip, + ListViewType listViewType, Context context) { return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, skip, listViewType, context)); } /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -370,16 +305,12 @@ public PagedIterable list( @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, String name) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -393,24 +324,14 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -421,19 +342,15 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String name, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, String name, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -447,21 +364,13 @@ private Mono> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, this.client.getApiVersion(), accept, context); } /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -477,7 +386,7 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -488,14 +397,14 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String name, Context context) { + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String name, + Context context) { return deleteWithResponseAsync(resourceGroupName, workspaceName, name, context).block(); } /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -510,7 +419,7 @@ public void delete(String resourceGroupName, String workspaceName, String name) /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -520,19 +429,15 @@ public void delete(String resourceGroupName, String workspaceName, String name) * @return container along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String name) { + private Mono> getWithResponseAsync(String resourceGroupName, + String workspaceName, String name) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -546,24 +451,14 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -574,19 +469,15 @@ private Mono> getWithResponseAsync( * @return container along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String name, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, + String workspaceName, String name, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -600,21 +491,13 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + name, this.client.getApiVersion(), accept, context); } /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -631,7 +514,7 @@ private Mono getAsync(String resourceGroupName, Strin /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -642,14 +525,14 @@ private Mono getAsync(String resourceGroupName, Strin * @return container along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String name, Context context) { + public Response getWithResponse(String resourceGroupName, String workspaceName, + String name, Context context) { return getWithResponseAsync(resourceGroupName, workspaceName, name, context).block(); } /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -665,7 +548,7 @@ public EnvironmentContainerInner get(String resourceGroupName, String workspaceN /** * Create or update container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -673,23 +556,19 @@ public EnvironmentContainerInner get(String resourceGroupName, String workspaceN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link - * Mono}. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String workspaceName, String name, EnvironmentContainerInner body) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String name, EnvironmentContainerInner body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -708,25 +587,14 @@ private Mono> createOrUpdateWithResponseAsyn } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - body, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or update container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -735,23 +603,19 @@ private Mono> createOrUpdateWithResponseAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link - * Mono}. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String workspaceName, String name, EnvironmentContainerInner body, Context context) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String name, EnvironmentContainerInner body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -770,22 +634,13 @@ private Mono> createOrUpdateWithResponseAsyn } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - body, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, this.client.getApiVersion(), body, accept, context); } /** * Create or update container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -796,15 +651,15 @@ private Mono> createOrUpdateWithResponseAsyn * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String workspaceName, String name, EnvironmentContainerInner body) { + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String name, EnvironmentContainerInner body) { return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, body) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Create or update container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -816,14 +671,14 @@ private Mono createOrUpdateAsync( * @return azure Resource Manager resource envelope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, String workspaceName, String name, EnvironmentContainerInner body, Context context) { + public Response createOrUpdateWithResponse(String resourceGroupName, + String workspaceName, String name, EnvironmentContainerInner body, Context context) { return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, body, context).block(); } /** * Create or update container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -834,21 +689,20 @@ public Response createOrUpdateWithResponse( * @return azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - public EnvironmentContainerInner createOrUpdate( - String resourceGroupName, String workspaceName, String name, EnvironmentContainerInner body) { + public EnvironmentContainerInner createOrUpdate(String resourceGroupName, String workspaceName, String name, + EnvironmentContainerInner body) { return createOrUpdateWithResponse(resourceGroupName, workspaceName, name, body, Context.NONE).getValue(); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of EnvironmentContainer entities along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -856,37 +710,26 @@ private Mono> listNextSinglePageAsync(S return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of EnvironmentContainer entities along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -894,23 +737,13 @@ private Mono> listNextSinglePageAsync(S return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentContainersImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentContainersImpl.java index acbe2b72b83e8..2fc436a988624 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentContainersImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentContainersImpl.java @@ -22,8 +22,7 @@ public final class EnvironmentContainersImpl implements EnvironmentContainers { private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - public EnvironmentContainersImpl( - EnvironmentContainersClient innerClient, + public EnvironmentContainersImpl(EnvironmentContainersClient innerClient, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -31,18 +30,18 @@ public EnvironmentContainersImpl( public PagedIterable list(String resourceGroupName, String workspaceName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); - return Utils.mapPage(inner, inner1 -> new EnvironmentContainerImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EnvironmentContainerImpl(inner1, this.manager())); } - public PagedIterable list( - String resourceGroupName, String workspaceName, String skip, ListViewType listViewType, Context context) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, workspaceName, skip, listViewType, context); - return Utils.mapPage(inner, inner1 -> new EnvironmentContainerImpl(inner1, this.manager())); + public PagedIterable list(String resourceGroupName, String workspaceName, String skip, + ListViewType listViewType, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, skip, listViewType, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EnvironmentContainerImpl(inner1, this.manager())); } - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String name, Context context) { + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String name, + Context context) { return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, name, context); } @@ -50,15 +49,12 @@ public void delete(String resourceGroupName, String workspaceName, String name) this.serviceClient().delete(resourceGroupName, workspaceName, name); } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String name, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, workspaceName, name, context); + public Response getWithResponse(String resourceGroupName, String workspaceName, String name, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, name, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new EnvironmentContainerImpl(inner.getValue(), this.manager())); } else { return null; @@ -74,108 +70,27 @@ public EnvironmentContainer get(String resourceGroupName, String workspaceName, } } - public EnvironmentContainer getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "environments"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); - } - return this.getWithResponse(resourceGroupName, workspaceName, name, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "environments"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); - } - return this.getWithResponse(resourceGroupName, workspaceName, name, context); - } - - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "environments"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String name, EnvironmentContainerInner body, Context context) { + Response inner + = this.serviceClient().createOrUpdateWithResponse(resourceGroupName, workspaceName, name, body, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EnvironmentContainerImpl(inner.getValue(), this.manager())); + } else { + return null; } - this.deleteWithResponse(resourceGroupName, workspaceName, name, Context.NONE); } - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "environments"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); + public EnvironmentContainer createOrUpdate(String resourceGroupName, String workspaceName, String name, + EnvironmentContainerInner body) { + EnvironmentContainerInner inner + = this.serviceClient().createOrUpdate(resourceGroupName, workspaceName, name, body); + if (inner != null) { + return new EnvironmentContainerImpl(inner, this.manager()); + } else { + return null; } - return this.deleteWithResponse(resourceGroupName, workspaceName, name, context); } private EnvironmentContainersClient serviceClient() { @@ -185,8 +100,4 @@ private EnvironmentContainersClient serviceClient() { private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { return this.serviceManager; } - - public EnvironmentContainerImpl define(String name) { - return new EnvironmentContainerImpl(name, this.manager()); - } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentVersionImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentVersionImpl.java index 653ef01782d9e..b289025c96c28 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentVersionImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentVersionImpl.java @@ -50,42 +50,36 @@ private com.azure.resourcemanager.machinelearning.MachineLearningManager manager private String resourceGroupName; - private String workspaceName; + private String registryName; - private String name; + private String environmentName; private String version; - public EnvironmentVersionImpl withExistingEnvironment(String resourceGroupName, String workspaceName, String name) { + public EnvironmentVersionImpl withExistingEnvironment(String resourceGroupName, String registryName, + String environmentName) { this.resourceGroupName = resourceGroupName; - this.workspaceName = workspaceName; - this.name = name; + this.registryName = registryName; + this.environmentName = environmentName; return this; } public EnvironmentVersion create() { - this.innerObject = - serviceManager - .serviceClient() - .getEnvironmentVersions() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, name, version, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryEnvironmentVersions() + .createOrUpdate(resourceGroupName, registryName, environmentName, version, this.innerModel(), Context.NONE); return this; } public EnvironmentVersion create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getEnvironmentVersions() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, version, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryEnvironmentVersions() + .createOrUpdate(resourceGroupName, registryName, environmentName, version, this.innerModel(), context); return this; } - EnvironmentVersionImpl( - String name, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + EnvironmentVersionImpl(String name, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = new EnvironmentVersionInner(); this.serviceManager = serviceManager; this.version = name; @@ -96,54 +90,42 @@ public EnvironmentVersionImpl update() { } public EnvironmentVersion apply() { - this.innerObject = - serviceManager - .serviceClient() - .getEnvironmentVersions() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, name, version, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryEnvironmentVersions() + .createOrUpdate(resourceGroupName, registryName, environmentName, version, this.innerModel(), Context.NONE); return this; } public EnvironmentVersion apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getEnvironmentVersions() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, version, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryEnvironmentVersions() + .createOrUpdate(resourceGroupName, registryName, environmentName, version, this.innerModel(), context); return this; } - EnvironmentVersionImpl( - EnvironmentVersionInner innerObject, + EnvironmentVersionImpl(EnvironmentVersionInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); - this.name = Utils.getValueFromIdByName(innerObject.id(), "environments"); - this.version = Utils.getValueFromIdByName(innerObject.id(), "versions"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.registryName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "registries"); + this.environmentName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "environments"); + this.version = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "versions"); } public EnvironmentVersion refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getEnvironmentVersions() - .getWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryEnvironmentVersions() + .getWithResponse(resourceGroupName, registryName, environmentName, version, Context.NONE) + .getValue(); return this; } public EnvironmentVersion refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getEnvironmentVersions() - .getWithResponse(resourceGroupName, workspaceName, name, version, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryEnvironmentVersions() + .getWithResponse(resourceGroupName, registryName, environmentName, version, context) + .getValue(); return this; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentVersionsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentVersionsClientImpl.java index 0f6b8a58aa6d2..0244634a05fdb 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentVersionsClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentVersionsClientImpl.java @@ -13,6 +13,7 @@ import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -26,129 +27,118 @@ import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.machinelearning.fluent.EnvironmentVersionsClient; import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentVersionInner; +import com.azure.resourcemanager.machinelearning.models.DestinationAsset; import com.azure.resourcemanager.machinelearning.models.EnvironmentVersionResourceArmPaginatedResult; import com.azure.resourcemanager.machinelearning.models.ListViewType; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in EnvironmentVersionsClient. */ +/** + * An instance of this class provides access to all the operations defined in EnvironmentVersionsClient. + */ public final class EnvironmentVersionsClientImpl implements EnvironmentVersionsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final EnvironmentVersionsService service; - /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of EnvironmentVersionsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ - EnvironmentVersionsClientImpl(AzureMachineLearningWorkspacesImpl client) { - this.service = - RestProxy.create(EnvironmentVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + EnvironmentVersionsClientImpl(AzureMachineLearningServicesImpl client) { + this.service = RestProxy.create(EnvironmentVersionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesEnvironmentVersions to be used by the + * The interface defining all the services for AzureMachineLearningServicesEnvironmentVersions to be used by the * proxy service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AzureMachineLearning") public interface EnvironmentVersionsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, + Mono> list(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @QueryParam("$orderBy") String orderBy, - @QueryParam("$top") Integer top, - @QueryParam("$skip") String skip, - @QueryParam("listViewType") ListViewType listViewType, - @HeaderParam("Accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @QueryParam("$orderBy") String orderBy, @QueryParam("$top") Integer top, @QueryParam("$skip") String skip, + @QueryParam("listViewType") ListViewType listViewType, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions" - + "/{version}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, + Mono> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @PathParam("version") String version, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions" - + "/{version}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @PathParam("version") String version, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions" - + "/{version}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, + Mono> createOrUpdate(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @PathParam("version") String version, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") EnvironmentVersionInner body, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") EnvironmentVersionInner body, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}/publish") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> publish(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") DestinationAsset body, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * List versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -160,28 +150,18 @@ Mono> listNext( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of EnvironmentVersion entities along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String workspaceName, - String name, - String orderBy, - Integer top, - String skip, - ListViewType listViewType) { + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, String name, String orderBy, Integer top, String skip, ListViewType listViewType) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -195,37 +175,17 @@ private Mono> listSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - orderBy, - top, - skip, - listViewType, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), orderBy, top, skip, listViewType, + accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -238,29 +198,19 @@ private Mono> listSinglePageAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of EnvironmentVersion entities along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String workspaceName, - String name, - String orderBy, - Integer top, - String skip, - ListViewType listViewType, + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, String name, String orderBy, Integer top, String skip, ListViewType listViewType, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -275,33 +225,15 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - orderBy, - top, - skip, - listViewType, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, name, + this.client.getApiVersion(), orderBy, top, skip, listViewType, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -315,14 +247,8 @@ private Mono> listSinglePageAsync( * @return a paginated list of EnvironmentVersion entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String workspaceName, - String name, - String orderBy, - Integer top, - String skip, - ListViewType listViewType) { + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String name, + String orderBy, Integer top, String skip, ListViewType listViewType) { return new PagedFlux<>( () -> listSinglePageAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType), nextLink -> listNextSinglePageAsync(nextLink)); @@ -330,7 +256,7 @@ private PagedFlux listAsync( /** * List versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -352,7 +278,7 @@ private PagedFlux listAsync(String resourceGroupName, S /** * List versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -367,24 +293,15 @@ private PagedFlux listAsync(String resourceGroupName, S * @return a paginated list of EnvironmentVersion entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String workspaceName, - String name, - String orderBy, - Integer top, - String skip, - ListViewType listViewType, - Context context) { - return new PagedFlux<>( - () -> - listSinglePageAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String name, + String orderBy, Integer top, String skip, ListViewType listViewType, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, + listViewType, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * List versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -404,7 +321,7 @@ public PagedIterable list(String resourceGroupName, Str /** * List versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -419,22 +336,15 @@ public PagedIterable list(String resourceGroupName, Str * @return a paginated list of EnvironmentVersion entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, - String workspaceName, - String name, - String orderBy, - Integer top, - String skip, - ListViewType listViewType, - Context context) { + public PagedIterable list(String resourceGroupName, String workspaceName, String name, + String orderBy, Integer top, String skip, ListViewType listViewType, Context context) { return new PagedIterable<>( listAsync(resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, context)); } /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -445,19 +355,15 @@ public PagedIterable list( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String name, String version) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, String name, + String version) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -474,25 +380,14 @@ private Mono> deleteWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - version, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, version, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -504,19 +399,15 @@ private Mono> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String name, String version, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, String name, + String version, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -533,22 +424,13 @@ private Mono> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - version, - this.client.getApiVersion(), - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, version, this.client.getApiVersion(), accept, context); } /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -566,7 +448,7 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -578,14 +460,14 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context) { + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String name, + String version, Context context) { return deleteWithResponseAsync(resourceGroupName, workspaceName, name, version, context).block(); } /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -601,7 +483,7 @@ public void delete(String resourceGroupName, String workspaceName, String name, /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -612,19 +494,15 @@ public void delete(String resourceGroupName, String workspaceName, String name, * @return version along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String name, String version) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String name, String version) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -641,25 +519,14 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - version, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, version, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -671,19 +538,15 @@ private Mono> getWithResponseAsync( * @return version along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String name, String version, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String name, String version, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -700,22 +563,13 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - version, - this.client.getApiVersion(), - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + name, version, this.client.getApiVersion(), accept, context); } /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -726,15 +580,15 @@ private Mono> getWithResponseAsync( * @return version on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String workspaceName, String name, String version) { + private Mono getAsync(String resourceGroupName, String workspaceName, String name, + String version) { return getWithResponseAsync(resourceGroupName, workspaceName, name, version) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -746,14 +600,14 @@ private Mono getAsync( * @return version along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context) { + public Response getWithResponse(String resourceGroupName, String workspaceName, + String name, String version, Context context) { return getWithResponseAsync(resourceGroupName, workspaceName, name, version, context).block(); } /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -770,7 +624,7 @@ public EnvironmentVersionInner get(String resourceGroupName, String workspaceNam /** * Creates or updates an EnvironmentVersion. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Name of EnvironmentVersion. This is case-sensitive. @@ -779,23 +633,19 @@ public EnvironmentVersionInner get(String resourceGroupName, String workspaceNam * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link - * Mono}. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String workspaceName, String name, String version, EnvironmentVersionInner body) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String name, String version, EnvironmentVersionInner body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -817,26 +667,14 @@ private Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - version, - this.client.getApiVersion(), - body, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, version, this.client.getApiVersion(), body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates or updates an EnvironmentVersion. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Name of EnvironmentVersion. This is case-sensitive. @@ -846,28 +684,19 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link - * Mono}. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String workspaceName, - String name, - String version, - EnvironmentVersionInner body, - Context context) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String name, String version, EnvironmentVersionInner body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -889,23 +718,13 @@ private Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - version, - this.client.getApiVersion(), - body, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, version, this.client.getApiVersion(), body, accept, context); } /** * Creates or updates an EnvironmentVersion. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Name of EnvironmentVersion. This is case-sensitive. @@ -917,15 +736,15 @@ private Mono> createOrUpdateWithResponseAsync( * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String workspaceName, String name, String version, EnvironmentVersionInner body) { + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String name, String version, EnvironmentVersionInner body) { return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, version, body) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Creates or updates an EnvironmentVersion. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Name of EnvironmentVersion. This is case-sensitive. @@ -938,19 +757,14 @@ private Mono createOrUpdateAsync( * @return azure Resource Manager resource envelope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String name, - String version, - EnvironmentVersionInner body, - Context context) { + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String name, String version, EnvironmentVersionInner body, Context context) { return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, version, body, context).block(); } /** * Creates or updates an EnvironmentVersion. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Name of EnvironmentVersion. This is case-sensitive. @@ -962,22 +776,282 @@ public Response createOrUpdateWithResponse( * @return azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - public EnvironmentVersionInner createOrUpdate( - String resourceGroupName, String workspaceName, String name, String version, EnvironmentVersionInner body) { + public EnvironmentVersionInner createOrUpdate(String resourceGroupName, String workspaceName, String name, + String version, EnvironmentVersionInner body) { return createOrUpdateWithResponse(resourceGroupName, workspaceName, name, version, body, Context.NONE) .getValue(); } + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> publishWithResponseAsync(String resourceGroupName, String workspaceName, + String name, String version, DestinationAsset body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.publish(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, version, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> publishWithResponseAsync(String resourceGroupName, String workspaceName, + String name, String version, DestinationAsset body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.publish(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, version, this.client.getApiVersion(), body, accept, context); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPublishAsync(String resourceGroupName, String workspaceName, + String name, String version, DestinationAsset body) { + Mono>> mono + = publishWithResponseAsync(resourceGroupName, workspaceName, name, version, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPublishAsync(String resourceGroupName, String workspaceName, + String name, String version, DestinationAsset body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = publishWithResponseAsync(resourceGroupName, workspaceName, name, version, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPublish(String resourceGroupName, String workspaceName, String name, + String version, DestinationAsset body) { + return this.beginPublishAsync(resourceGroupName, workspaceName, name, version, body).getSyncPoller(); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPublish(String resourceGroupName, String workspaceName, String name, + String version, DestinationAsset body, Context context) { + return this.beginPublishAsync(resourceGroupName, workspaceName, name, version, body, context).getSyncPoller(); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono publishAsync(String resourceGroupName, String workspaceName, String name, String version, + DestinationAsset body) { + return beginPublishAsync(resourceGroupName, workspaceName, name, version, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono publishAsync(String resourceGroupName, String workspaceName, String name, String version, + DestinationAsset body, Context context) { + return beginPublishAsync(resourceGroupName, workspaceName, name, version, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void publish(String resourceGroupName, String workspaceName, String name, String version, + DestinationAsset body) { + publishAsync(resourceGroupName, workspaceName, name, version, body).block(); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void publish(String resourceGroupName, String workspaceName, String name, String version, + DestinationAsset body, Context context) { + publishAsync(resourceGroupName, workspaceName, name, version, body, context).block(); + } + /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of EnvironmentVersion entities along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -985,37 +1059,26 @@ private Mono> listNextSinglePageAsync(Str return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of EnvironmentVersion entities along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -1023,23 +1086,13 @@ private Mono> listNextSinglePageAsync(Str return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentVersionsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentVersionsImpl.java index 3c075afbe0d9c..0d34616954173 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentVersionsImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/EnvironmentVersionsImpl.java @@ -11,6 +11,7 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.machinelearning.fluent.EnvironmentVersionsClient; import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentVersionInner; +import com.azure.resourcemanager.machinelearning.models.DestinationAsset; import com.azure.resourcemanager.machinelearning.models.EnvironmentVersion; import com.azure.resourcemanager.machinelearning.models.EnvironmentVersions; import com.azure.resourcemanager.machinelearning.models.ListViewType; @@ -22,37 +23,27 @@ public final class EnvironmentVersionsImpl implements EnvironmentVersions { private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - public EnvironmentVersionsImpl( - EnvironmentVersionsClient innerClient, + public EnvironmentVersionsImpl(EnvironmentVersionsClient innerClient, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list(String resourceGroupName, String workspaceName, String name) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, workspaceName, name); - return Utils.mapPage(inner, inner1 -> new EnvironmentVersionImpl(inner1, this.manager())); + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, name); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EnvironmentVersionImpl(inner1, this.manager())); } - public PagedIterable list( - String resourceGroupName, - String workspaceName, - String name, - String orderBy, - Integer top, - String skip, - ListViewType listViewType, - Context context) { - PagedIterable inner = - this - .serviceClient() - .list(resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, context); - return Utils.mapPage(inner, inner1 -> new EnvironmentVersionImpl(inner1, this.manager())); + public PagedIterable list(String resourceGroupName, String workspaceName, String name, + String orderBy, Integer top, String skip, ListViewType listViewType, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, workspaceName, name, orderBy, top, skip, listViewType, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EnvironmentVersionImpl(inner1, this.manager())); } - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context) { + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String name, + String version, Context context) { return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, name, version, context); } @@ -60,15 +51,12 @@ public void delete(String resourceGroupName, String workspaceName, String name, this.serviceClient().delete(resourceGroupName, workspaceName, name, version); } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, workspaceName, name, version, context); + public Response getWithResponse(String resourceGroupName, String workspaceName, String name, + String version, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, name, version, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new EnvironmentVersionImpl(inner.getValue(), this.manager())); } else { return null; @@ -84,136 +72,37 @@ public EnvironmentVersion get(String resourceGroupName, String workspaceName, St } } - public EnvironmentVersion getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "environments"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); - } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String name, String version, EnvironmentVersionInner body, Context context) { + Response inner = this.serviceClient() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, version, body, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EnvironmentVersionImpl(inner.getValue(), this.manager())); + } else { + return null; } - return this.getWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE).getValue(); } - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "environments"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); - } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + public EnvironmentVersion createOrUpdate(String resourceGroupName, String workspaceName, String name, + String version, EnvironmentVersionInner body) { + EnvironmentVersionInner inner + = this.serviceClient().createOrUpdate(resourceGroupName, workspaceName, name, version, body); + if (inner != null) { + return new EnvironmentVersionImpl(inner, this.manager()); + } else { + return null; } - return this.getWithResponse(resourceGroupName, workspaceName, name, version, context); } - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "environments"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); - } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); - } - this.deleteWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE); + public void publish(String resourceGroupName, String workspaceName, String name, String version, + DestinationAsset body) { + this.serviceClient().publish(resourceGroupName, workspaceName, name, version, body); } - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "environments"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); - } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); - } - return this.deleteWithResponse(resourceGroupName, workspaceName, name, version, context); + public void publish(String resourceGroupName, String workspaceName, String name, String version, + DestinationAsset body, Context context) { + this.serviceClient().publish(resourceGroupName, workspaceName, name, version, body, context); } private EnvironmentVersionsClient serviceClient() { @@ -223,8 +112,4 @@ private EnvironmentVersionsClient serviceClient() { private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { return this.serviceManager; } - - public EnvironmentVersionImpl define(String name) { - return new EnvironmentVersionImpl(name, this.manager()); - } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ExternalFqdnResponseImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ExternalFqdnResponseImpl.java index 7f27891cd16a6..230f8d479695d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ExternalFqdnResponseImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ExternalFqdnResponseImpl.java @@ -15,8 +15,7 @@ public final class ExternalFqdnResponseImpl implements ExternalFqdnResponse { private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - ExternalFqdnResponseImpl( - ExternalFqdnResponseInner innerObject, + ExternalFqdnResponseImpl(ExternalFqdnResponseInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeatureImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeatureImpl.java new file mode 100644 index 0000000000000..547f0617bbd32 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeatureImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.machinelearning.fluent.models.FeatureInner; +import com.azure.resourcemanager.machinelearning.models.Feature; +import com.azure.resourcemanager.machinelearning.models.FeatureProperties; + +public final class FeatureImpl implements Feature { + private FeatureInner innerObject; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + FeatureImpl(FeatureInner innerObject, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public FeatureProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public FeatureInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesClientImpl.java new file mode 100644 index 0000000000000..7dd17ea48d6a9 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesClientImpl.java @@ -0,0 +1,559 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.machinelearning.fluent.FeaturesClient; +import com.azure.resourcemanager.machinelearning.fluent.models.FeatureInner; +import com.azure.resourcemanager.machinelearning.models.FeatureResourceArmPaginatedResult; +import com.azure.resourcemanager.machinelearning.models.ListViewType; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in FeaturesClient. + */ +public final class FeaturesClientImpl implements FeaturesClient { + /** + * The proxy service used to perform REST calls. + */ + private final FeaturesService service; + + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of FeaturesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FeaturesClientImpl(AzureMachineLearningServicesImpl client) { + this.service = RestProxy.create(FeaturesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesFeatures to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface FeaturesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("featuresetName") String featuresetName, + @PathParam("featuresetVersion") String featuresetVersion, @QueryParam("api-version") String apiVersion, + @QueryParam("$skip") String skip, @QueryParam("tags") String tags, + @QueryParam("featureName") String featureName, @QueryParam("description") String description, + @QueryParam("listViewType") ListViewType listViewType, @QueryParam("pageSize") Integer pageSize, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features/{featureName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("featuresetName") String featuresetName, + @PathParam("featuresetVersion") String featuresetVersion, @PathParam("featureName") String featureName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List Features. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Featureset name. This is case-sensitive. + * @param featuresetVersion Featureset Version identifier. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param featureName feature name. + * @param description Description of the featureset. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize Page size. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Feature entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String featuresetName, String featuresetVersion, String skip, String tags, String featureName, + String description, ListViewType listViewType, Integer pageSize) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (featuresetName == null) { + return Mono.error(new IllegalArgumentException("Parameter featuresetName is required and cannot be null.")); + } + if (featuresetVersion == null) { + return Mono + .error(new IllegalArgumentException("Parameter featuresetVersion is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, featuresetName, featuresetVersion, this.client.getApiVersion(), skip, + tags, featureName, description, listViewType, pageSize, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Features. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Featureset name. This is case-sensitive. + * @param featuresetVersion Featureset Version identifier. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param featureName feature name. + * @param description Description of the featureset. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize Page size. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Feature entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String featuresetName, String featuresetVersion, String skip, String tags, String featureName, + String description, ListViewType listViewType, Integer pageSize, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (featuresetName == null) { + return Mono.error(new IllegalArgumentException("Parameter featuresetName is required and cannot be null.")); + } + if (featuresetVersion == null) { + return Mono + .error(new IllegalArgumentException("Parameter featuresetVersion is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + featuresetName, featuresetVersion, this.client.getApiVersion(), skip, tags, featureName, description, + listViewType, pageSize, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Features. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Featureset name. This is case-sensitive. + * @param featuresetVersion Featureset Version identifier. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param featureName feature name. + * @param description Description of the featureset. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize Page size. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Feature entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String featuresetName, + String featuresetVersion, String skip, String tags, String featureName, String description, + ListViewType listViewType, Integer pageSize) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, featuresetName, + featuresetVersion, skip, tags, featureName, description, listViewType, pageSize), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List Features. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Featureset name. This is case-sensitive. + * @param featuresetVersion Featureset Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Feature entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String featuresetName, + String featuresetVersion) { + final String skip = null; + final String tags = null; + final String featureName = null; + final String description = null; + final ListViewType listViewType = null; + final Integer pageSize = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, featuresetName, + featuresetVersion, skip, tags, featureName, description, listViewType, pageSize), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List Features. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Featureset name. This is case-sensitive. + * @param featuresetVersion Featureset Version identifier. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param featureName feature name. + * @param description Description of the featureset. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize Page size. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Feature entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String featuresetName, + String featuresetVersion, String skip, String tags, String featureName, String description, + ListViewType listViewType, Integer pageSize, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, featuresetName, featuresetVersion, skip, tags, + featureName, description, listViewType, pageSize, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List Features. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Featureset name. This is case-sensitive. + * @param featuresetVersion Featureset Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Feature entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, String featuresetName, + String featuresetVersion) { + final String skip = null; + final String tags = null; + final String featureName = null; + final String description = null; + final ListViewType listViewType = null; + final Integer pageSize = null; + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, featuresetName, featuresetVersion, skip, + tags, featureName, description, listViewType, pageSize)); + } + + /** + * List Features. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Featureset name. This is case-sensitive. + * @param featuresetVersion Featureset Version identifier. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param featureName feature name. + * @param description Description of the featureset. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize Page size. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Feature entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, String featuresetName, + String featuresetVersion, String skip, String tags, String featureName, String description, + ListViewType listViewType, Integer pageSize, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, featuresetName, featuresetVersion, skip, + tags, featureName, description, listViewType, pageSize, context)); + } + + /** + * Get feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Feature set name. This is case-sensitive. + * @param featuresetVersion Feature set version identifier. This is case-sensitive. + * @param featureName Feature Name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return feature along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String featuresetName, String featuresetVersion, String featureName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (featuresetName == null) { + return Mono.error(new IllegalArgumentException("Parameter featuresetName is required and cannot be null.")); + } + if (featuresetVersion == null) { + return Mono + .error(new IllegalArgumentException("Parameter featuresetVersion is required and cannot be null.")); + } + if (featureName == null) { + return Mono.error(new IllegalArgumentException("Parameter featureName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, featuresetName, featuresetVersion, featureName, + this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Feature set name. This is case-sensitive. + * @param featuresetVersion Feature set version identifier. This is case-sensitive. + * @param featureName Feature Name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return feature along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String featuresetName, String featuresetVersion, String featureName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (featuresetName == null) { + return Mono.error(new IllegalArgumentException("Parameter featuresetName is required and cannot be null.")); + } + if (featuresetVersion == null) { + return Mono + .error(new IllegalArgumentException("Parameter featuresetVersion is required and cannot be null.")); + } + if (featureName == null) { + return Mono.error(new IllegalArgumentException("Parameter featureName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + featuresetName, featuresetVersion, featureName, this.client.getApiVersion(), accept, context); + } + + /** + * Get feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Feature set name. This is case-sensitive. + * @param featuresetVersion Feature set version identifier. This is case-sensitive. + * @param featureName Feature Name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return feature on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String featuresetName, + String featuresetVersion, String featureName) { + return getWithResponseAsync(resourceGroupName, workspaceName, featuresetName, featuresetVersion, featureName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Feature set name. This is case-sensitive. + * @param featuresetVersion Feature set version identifier. This is case-sensitive. + * @param featureName Feature Name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return feature along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String workspaceName, String featuresetName, + String featuresetVersion, String featureName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, featuresetName, featuresetVersion, featureName, + context).block(); + } + + /** + * Get feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Feature set name. This is case-sensitive. + * @param featuresetVersion Feature set version identifier. This is case-sensitive. + * @param featureName Feature Name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return feature. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FeatureInner get(String resourceGroupName, String workspaceName, String featuresetName, + String featuresetVersion, String featureName) { + return getWithResponse(resourceGroupName, workspaceName, featuresetName, featuresetVersion, featureName, + Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Feature entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Feature entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesImpl.java new file mode 100644 index 0000000000000..537bedc6a1a27 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesImpl.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.FeaturesClient; +import com.azure.resourcemanager.machinelearning.fluent.models.FeatureInner; +import com.azure.resourcemanager.machinelearning.models.Feature; +import com.azure.resourcemanager.machinelearning.models.Features; +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +public final class FeaturesImpl implements Features { + private static final ClientLogger LOGGER = new ClientLogger(FeaturesImpl.class); + + private final FeaturesClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public FeaturesImpl(FeaturesClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String featuresetName, + String featuresetVersion) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, featuresetName, featuresetVersion); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FeatureImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String featuresetName, + String featuresetVersion, String skip, String tags, String featureName, String description, + ListViewType listViewType, Integer pageSize, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, workspaceName, featuresetName, featuresetVersion, skip, tags, featureName, + description, listViewType, pageSize, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FeatureImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String workspaceName, String featuresetName, + String featuresetVersion, String featureName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, workspaceName, featuresetName, featuresetVersion, featureName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new FeatureImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Feature get(String resourceGroupName, String workspaceName, String featuresetName, String featuresetVersion, + String featureName) { + FeatureInner inner = this.serviceClient() + .get(resourceGroupName, workspaceName, featuresetName, featuresetVersion, featureName); + if (inner != null) { + return new FeatureImpl(inner, this.manager()); + } else { + return null; + } + } + + private FeaturesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetContainerImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetContainerImpl.java new file mode 100644 index 0000000000000..9d51268e1f83e --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetContainerImpl.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetContainerInner; +import com.azure.resourcemanager.machinelearning.models.FeaturesetContainer; +import com.azure.resourcemanager.machinelearning.models.FeaturesetContainerProperties; + +public final class FeaturesetContainerImpl + implements FeaturesetContainer, FeaturesetContainer.Definition, FeaturesetContainer.Update { + private FeaturesetContainerInner innerObject; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public FeaturesetContainerProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public FeaturesetContainerInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String name; + + public FeaturesetContainerImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public FeaturesetContainer create() { + this.innerObject = serviceManager.serviceClient() + .getFeaturesetContainers() + .createOrUpdate(resourceGroupName, workspaceName, name, this.innerModel(), Context.NONE); + return this; + } + + public FeaturesetContainer create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFeaturesetContainers() + .createOrUpdate(resourceGroupName, workspaceName, name, this.innerModel(), context); + return this; + } + + FeaturesetContainerImpl(String name, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = new FeaturesetContainerInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public FeaturesetContainerImpl update() { + return this; + } + + public FeaturesetContainer apply() { + this.innerObject = serviceManager.serviceClient() + .getFeaturesetContainers() + .createOrUpdate(resourceGroupName, workspaceName, name, this.innerModel(), Context.NONE); + return this; + } + + public FeaturesetContainer apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFeaturesetContainers() + .createOrUpdate(resourceGroupName, workspaceName, name, this.innerModel(), context); + return this; + } + + FeaturesetContainerImpl(FeaturesetContainerInner innerObject, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "featuresets"); + } + + public FeaturesetContainer refresh() { + this.innerObject = serviceManager.serviceClient() + .getFeaturesetContainers() + .getEntityWithResponse(resourceGroupName, workspaceName, name, Context.NONE) + .getValue(); + return this; + } + + public FeaturesetContainer refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFeaturesetContainers() + .getEntityWithResponse(resourceGroupName, workspaceName, name, context) + .getValue(); + return this; + } + + public FeaturesetContainerImpl withProperties(FeaturesetContainerProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetContainersClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetContainersClientImpl.java new file mode 100644 index 0000000000000..9f6620fde471d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetContainersClientImpl.java @@ -0,0 +1,999 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.FeaturesetContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetContainerInner; +import com.azure.resourcemanager.machinelearning.models.FeaturesetContainerResourceArmPaginatedResult; +import com.azure.resourcemanager.machinelearning.models.ListViewType; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in FeaturesetContainersClient. + */ +public final class FeaturesetContainersClientImpl implements FeaturesetContainersClient { + /** + * The proxy service used to perform REST calls. + */ + private final FeaturesetContainersService service; + + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of FeaturesetContainersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FeaturesetContainersClientImpl(AzureMachineLearningServicesImpl client) { + this.service = RestProxy.create(FeaturesetContainersService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesFeaturesetContainers to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface FeaturesetContainersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @QueryParam("$skip") String skip, + @QueryParam("tags") String tags, @QueryParam("listViewType") ListViewType listViewType, + @QueryParam("pageSize") Integer pageSize, @QueryParam("name") String name, + @QueryParam("description") String description, @QueryParam("createdBy") String createdBy, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getEntity(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") FeaturesetContainerInner body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param name name for the featureset. + * @param description description for the feature set. + * @param createdBy createdBy user name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetContainer entities along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, String skip, String tags, ListViewType listViewType, Integer pageSize, String name, + String description, String createdBy) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), skip, tags, listViewType, pageSize, name, + description, createdBy, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param name name for the featureset. + * @param description description for the feature set. + * @param createdBy createdBy user name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetContainer entities along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, String skip, String tags, ListViewType listViewType, Integer pageSize, String name, + String description, String createdBy, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + this.client.getApiVersion(), skip, tags, listViewType, pageSize, name, description, createdBy, accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param name name for the featureset. + * @param description description for the feature set. + * @param createdBy createdBy user name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String skip, + String tags, ListViewType listViewType, Integer pageSize, String name, String description, String createdBy) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skip, tags, listViewType, + pageSize, name, description, createdBy), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + final String skip = null; + final String tags = null; + final ListViewType listViewType = null; + final Integer pageSize = null; + final String name = null; + final String description = null; + final String createdBy = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skip, tags, listViewType, + pageSize, name, description, createdBy), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param name name for the featureset. + * @param description description for the feature set. + * @param createdBy createdBy user name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String skip, + String tags, ListViewType listViewType, Integer pageSize, String name, String description, String createdBy, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skip, tags, listViewType, + pageSize, name, description, createdBy, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + final String skip = null; + final String tags = null; + final ListViewType listViewType = null; + final Integer pageSize = null; + final String name = null; + final String description = null; + final String createdBy = null; + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, skip, tags, listViewType, pageSize, name, + description, createdBy)); + } + + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param name name for the featureset. + * @param description description for the feature set. + * @param createdBy createdBy user name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, String skip, + String tags, ListViewType listViewType, Integer pageSize, String name, String description, String createdBy, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, skip, tags, listViewType, pageSize, name, + description, createdBy, context)); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, this.client.getApiVersion(), accept, context); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, + String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, + String name, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, workspaceName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String name) { + return this.beginDeleteAsync(resourceGroupName, workspaceName, name).getSyncPoller(); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String name, + Context context) { + return this.beginDeleteAsync(resourceGroupName, workspaceName, name, context).getSyncPoller(); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String name) { + return beginDeleteAsync(resourceGroupName, workspaceName, name).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, name, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String name) { + deleteAsync(resourceGroupName, workspaceName, name).block(); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String name, Context context) { + deleteAsync(resourceGroupName, workspaceName, name, context).block(); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getEntityWithResponseAsync(String resourceGroupName, + String workspaceName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getEntity(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getEntityWithResponseAsync(String resourceGroupName, + String workspaceName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getEntity(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, this.client.getApiVersion(), accept, context); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityAsync(String resourceGroupName, String workspaceName, String name) { + return getEntityWithResponseAsync(resourceGroupName, workspaceName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityWithResponse(String resourceGroupName, String workspaceName, + String name, Context context) { + return getEntityWithResponseAsync(resourceGroupName, workspaceName, name, context).block(); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FeaturesetContainerInner getEntity(String resourceGroupName, String workspaceName, String name) { + return getEntityWithResponse(resourceGroupName, workspaceName, name, Context.NONE).getValue(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String name, FeaturesetContainerInner body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String name, FeaturesetContainerInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, this.client.getApiVersion(), body, accept, context); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FeaturesetContainerInner> beginCreateOrUpdateAsync( + String resourceGroupName, String workspaceName, String name, FeaturesetContainerInner body) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), FeaturesetContainerInner.class, FeaturesetContainerInner.class, + this.client.getContext()); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FeaturesetContainerInner> beginCreateOrUpdateAsync( + String resourceGroupName, String workspaceName, String name, FeaturesetContainerInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), FeaturesetContainerInner.class, FeaturesetContainerInner.class, context); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FeaturesetContainerInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String name, FeaturesetContainerInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, body).getSyncPoller(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FeaturesetContainerInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String name, FeaturesetContainerInner body, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, body, context).getSyncPoller(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String name, FeaturesetContainerInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String name, FeaturesetContainerInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FeaturesetContainerInner createOrUpdate(String resourceGroupName, String workspaceName, String name, + FeaturesetContainerInner body) { + return createOrUpdateAsync(resourceGroupName, workspaceName, name, body).block(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FeaturesetContainerInner createOrUpdate(String resourceGroupName, String workspaceName, String name, + FeaturesetContainerInner body, Context context) { + return createOrUpdateAsync(resourceGroupName, workspaceName, name, body, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetContainer entities along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetContainer entities along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetContainersImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetContainersImpl.java new file mode 100644 index 0000000000000..122e2a41360d3 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetContainersImpl.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.FeaturesetContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetContainerInner; +import com.azure.resourcemanager.machinelearning.models.FeaturesetContainer; +import com.azure.resourcemanager.machinelearning.models.FeaturesetContainers; +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +public final class FeaturesetContainersImpl implements FeaturesetContainers { + private static final ClientLogger LOGGER = new ClientLogger(FeaturesetContainersImpl.class); + + private final FeaturesetContainersClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public FeaturesetContainersImpl(FeaturesetContainersClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FeaturesetContainerImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String skip, + String tags, ListViewType listViewType, Integer pageSize, String name, String description, String createdBy, + Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, workspaceName, skip, tags, listViewType, pageSize, name, description, createdBy, + context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FeaturesetContainerImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String workspaceName, String name) { + this.serviceClient().delete(resourceGroupName, workspaceName, name); + } + + public void delete(String resourceGroupName, String workspaceName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, workspaceName, name, context); + } + + public Response getEntityWithResponse(String resourceGroupName, String workspaceName, + String name, Context context) { + Response inner + = this.serviceClient().getEntityWithResponse(resourceGroupName, workspaceName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new FeaturesetContainerImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public FeaturesetContainer getEntity(String resourceGroupName, String workspaceName, String name) { + FeaturesetContainerInner inner = this.serviceClient().getEntity(resourceGroupName, workspaceName, name); + if (inner != null) { + return new FeaturesetContainerImpl(inner, this.manager()); + } else { + return null; + } + } + + public FeaturesetContainer getEntityById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "featuresets"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'featuresets'.", id))); + } + return this.getEntityWithResponse(resourceGroupName, workspaceName, name, Context.NONE).getValue(); + } + + public Response getEntityByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "featuresets"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'featuresets'.", id))); + } + return this.getEntityWithResponse(resourceGroupName, workspaceName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "featuresets"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'featuresets'.", id))); + } + this.delete(resourceGroupName, workspaceName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "featuresets"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'featuresets'.", id))); + } + this.delete(resourceGroupName, workspaceName, name, context); + } + + private FeaturesetContainersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + public FeaturesetContainerImpl define(String name) { + return new FeaturesetContainerImpl(name, this.manager()); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetVersionBackfillResponseImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetVersionBackfillResponseImpl.java new file mode 100644 index 0000000000000..274f7f04de241 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetVersionBackfillResponseImpl.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetVersionBackfillResponseInner; +import com.azure.resourcemanager.machinelearning.models.FeaturesetVersionBackfillResponse; +import java.util.Collections; +import java.util.List; + +public final class FeaturesetVersionBackfillResponseImpl implements FeaturesetVersionBackfillResponse { + private FeaturesetVersionBackfillResponseInner innerObject; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + FeaturesetVersionBackfillResponseImpl(FeaturesetVersionBackfillResponseInner innerObject, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List jobIds() { + List inner = this.innerModel().jobIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public FeaturesetVersionBackfillResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetVersionImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetVersionImpl.java new file mode 100644 index 0000000000000..79b10298eb8fc --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetVersionImpl.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetVersionInner; +import com.azure.resourcemanager.machinelearning.models.FeaturesetVersion; +import com.azure.resourcemanager.machinelearning.models.FeaturesetVersionBackfillRequest; +import com.azure.resourcemanager.machinelearning.models.FeaturesetVersionBackfillResponse; +import com.azure.resourcemanager.machinelearning.models.FeaturesetVersionProperties; + +public final class FeaturesetVersionImpl + implements FeaturesetVersion, FeaturesetVersion.Definition, FeaturesetVersion.Update { + private FeaturesetVersionInner innerObject; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public FeaturesetVersionProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public FeaturesetVersionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String name; + + private String version; + + public FeaturesetVersionImpl withExistingFeatureset(String resourceGroupName, String workspaceName, String name) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + this.name = name; + return this; + } + + public FeaturesetVersion create() { + this.innerObject = serviceManager.serviceClient() + .getFeaturesetVersions() + .createOrUpdate(resourceGroupName, workspaceName, name, version, this.innerModel(), Context.NONE); + return this; + } + + public FeaturesetVersion create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFeaturesetVersions() + .createOrUpdate(resourceGroupName, workspaceName, name, version, this.innerModel(), context); + return this; + } + + FeaturesetVersionImpl(String name, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = new FeaturesetVersionInner(); + this.serviceManager = serviceManager; + this.version = name; + } + + public FeaturesetVersionImpl update() { + return this; + } + + public FeaturesetVersion apply() { + this.innerObject = serviceManager.serviceClient() + .getFeaturesetVersions() + .createOrUpdate(resourceGroupName, workspaceName, name, version, this.innerModel(), Context.NONE); + return this; + } + + public FeaturesetVersion apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFeaturesetVersions() + .createOrUpdate(resourceGroupName, workspaceName, name, version, this.innerModel(), context); + return this; + } + + FeaturesetVersionImpl(FeaturesetVersionInner innerObject, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "featuresets"); + this.version = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "versions"); + } + + public FeaturesetVersion refresh() { + this.innerObject = serviceManager.serviceClient() + .getFeaturesetVersions() + .getWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE) + .getValue(); + return this; + } + + public FeaturesetVersion refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFeaturesetVersions() + .getWithResponse(resourceGroupName, workspaceName, name, version, context) + .getValue(); + return this; + } + + public FeaturesetVersionBackfillResponse backfill(FeaturesetVersionBackfillRequest body) { + return serviceManager.featuresetVersions().backfill(resourceGroupName, workspaceName, name, version, body); + } + + public FeaturesetVersionBackfillResponse backfill(FeaturesetVersionBackfillRequest body, Context context) { + return serviceManager.featuresetVersions() + .backfill(resourceGroupName, workspaceName, name, version, body, context); + } + + public FeaturesetVersionImpl withProperties(FeaturesetVersionProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetVersionsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetVersionsClientImpl.java new file mode 100644 index 0000000000000..2e96628cee728 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetVersionsClientImpl.java @@ -0,0 +1,1374 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.FeaturesetVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetVersionBackfillResponseInner; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetVersionInner; +import com.azure.resourcemanager.machinelearning.models.FeaturesetVersionBackfillRequest; +import com.azure.resourcemanager.machinelearning.models.FeaturesetVersionResourceArmPaginatedResult; +import com.azure.resourcemanager.machinelearning.models.ListViewType; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in FeaturesetVersionsClient. + */ +public final class FeaturesetVersionsClientImpl implements FeaturesetVersionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final FeaturesetVersionsService service; + + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of FeaturesetVersionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FeaturesetVersionsClientImpl(AzureMachineLearningServicesImpl client) { + this.service = RestProxy.create(FeaturesetVersionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesFeaturesetVersions to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface FeaturesetVersionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @QueryParam("$skip") String skip, @QueryParam("tags") String tags, + @QueryParam("listViewType") ListViewType listViewType, @QueryParam("pageSize") Integer pageSize, + @QueryParam("versionName") String versionName, @QueryParam("version") String version, + @QueryParam("description") String description, @QueryParam("createdBy") String createdBy, + @QueryParam("stage") String stage, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") FeaturesetVersionInner body, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> backfill(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") FeaturesetVersionBackfillRequest body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Featureset name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param versionName name for the featureset version. + * @param version featureset version. + * @param description description for the feature set version. + * @param createdBy createdBy user name. + * @param stage Specifies the featurestore stage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetVersion entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, String name, String skip, String tags, ListViewType listViewType, Integer pageSize, + String versionName, String version, String description, String createdBy, String stage) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), skip, tags, listViewType, pageSize, + versionName, version, description, createdBy, stage, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Featureset name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param versionName name for the featureset version. + * @param version featureset version. + * @param description description for the feature set version. + * @param createdBy createdBy user name. + * @param stage Specifies the featurestore stage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetVersion entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, String name, String skip, String tags, ListViewType listViewType, Integer pageSize, + String versionName, String version, String description, String createdBy, String stage, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, name, + this.client.getApiVersion(), skip, tags, listViewType, pageSize, versionName, version, description, + createdBy, stage, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Featureset name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param versionName name for the featureset version. + * @param version featureset version. + * @param description description for the feature set version. + * @param createdBy createdBy user name. + * @param stage Specifies the featurestore stage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetVersion entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String name, + String skip, String tags, ListViewType listViewType, Integer pageSize, String versionName, String version, + String description, String createdBy, String stage) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, name, skip, tags, + listViewType, pageSize, versionName, version, description, createdBy, stage), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Featureset name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetVersion entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String name) { + final String skip = null; + final String tags = null; + final ListViewType listViewType = null; + final Integer pageSize = null; + final String versionName = null; + final String version = null; + final String description = null; + final String createdBy = null; + final String stage = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, name, skip, tags, + listViewType, pageSize, versionName, version, description, createdBy, stage), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Featureset name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param versionName name for the featureset version. + * @param version featureset version. + * @param description description for the feature set version. + * @param createdBy createdBy user name. + * @param stage Specifies the featurestore stage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetVersion entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String name, + String skip, String tags, ListViewType listViewType, Integer pageSize, String versionName, String version, + String description, String createdBy, String stage, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, name, skip, tags, listViewType, pageSize, + versionName, version, description, createdBy, stage, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Featureset name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, String name) { + final String skip = null; + final String tags = null; + final ListViewType listViewType = null; + final Integer pageSize = null; + final String versionName = null; + final String version = null; + final String description = null; + final String createdBy = null; + final String stage = null; + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, name, skip, tags, listViewType, pageSize, + versionName, version, description, createdBy, stage)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Featureset name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param versionName name for the featureset version. + * @param version featureset version. + * @param description description for the feature set version. + * @param createdBy createdBy user name. + * @param stage Specifies the featurestore stage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, String name, + String skip, String tags, ListViewType listViewType, Integer pageSize, String versionName, String version, + String description, String createdBy, String stage, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, name, skip, tags, listViewType, pageSize, + versionName, version, description, createdBy, stage, context)); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String name, String version) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, version, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String name, String version, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, version, this.client.getApiVersion(), accept, context); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, + String name, String version) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, workspaceName, name, version); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, + String name, String version, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, workspaceName, name, version, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String name, + String version) { + return this.beginDeleteAsync(resourceGroupName, workspaceName, name, version).getSyncPoller(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String name, + String version, Context context) { + return this.beginDeleteAsync(resourceGroupName, workspaceName, name, version, context).getSyncPoller(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String name, String version) { + return beginDeleteAsync(resourceGroupName, workspaceName, name, version).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String name, String version, + Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, name, version, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String name, String version) { + deleteAsync(resourceGroupName, workspaceName, name, version).block(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String name, String version, Context context) { + deleteAsync(resourceGroupName, workspaceName, name, version, context).block(); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String name, String version) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, version, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String name, String version, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + name, version, this.client.getApiVersion(), accept, context); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String name, + String version) { + return getWithResponseAsync(resourceGroupName, workspaceName, name, version) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String workspaceName, String name, + String version, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, name, version, context).block(); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FeaturesetVersionInner get(String resourceGroupName, String workspaceName, String name, String version) { + return getWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE).getValue(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String name, String version, FeaturesetVersionInner body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, version, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String name, String version, FeaturesetVersionInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, version, this.client.getApiVersion(), body, accept, context); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FeaturesetVersionInner> beginCreateOrUpdateAsync( + String resourceGroupName, String workspaceName, String name, String version, FeaturesetVersionInner body) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, version, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), FeaturesetVersionInner.class, FeaturesetVersionInner.class, + this.client.getContext()); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FeaturesetVersionInner> beginCreateOrUpdateAsync( + String resourceGroupName, String workspaceName, String name, String version, FeaturesetVersionInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, version, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), FeaturesetVersionInner.class, FeaturesetVersionInner.class, context); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FeaturesetVersionInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String name, String version, FeaturesetVersionInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, version, body).getSyncPoller(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FeaturesetVersionInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String name, String version, FeaturesetVersionInner body, + Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, version, body, context) + .getSyncPoller(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String name, String version, FeaturesetVersionInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, version, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String name, String version, FeaturesetVersionInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, version, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FeaturesetVersionInner createOrUpdate(String resourceGroupName, String workspaceName, String name, + String version, FeaturesetVersionInner body) { + return createOrUpdateAsync(resourceGroupName, workspaceName, name, version, body).block(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FeaturesetVersionInner createOrUpdate(String resourceGroupName, String workspaceName, String name, + String version, FeaturesetVersionInner body, Context context) { + return createOrUpdateAsync(resourceGroupName, workspaceName, name, version, body, context).block(); + } + + /** + * Backfill. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Feature set version backfill request entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response payload for creating a backfill request for a given feature set version along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> backfillWithResponseAsync(String resourceGroupName, String workspaceName, + String name, String version, FeaturesetVersionBackfillRequest body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.backfill(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, version, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Backfill. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Feature set version backfill request entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response payload for creating a backfill request for a given feature set version along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> backfillWithResponseAsync(String resourceGroupName, String workspaceName, + String name, String version, FeaturesetVersionBackfillRequest body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.backfill(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, version, this.client.getApiVersion(), body, accept, context); + } + + /** + * Backfill. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Feature set version backfill request entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of response payload for creating a backfill request for a given + * feature set version. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FeaturesetVersionBackfillResponseInner> + beginBackfillAsync(String resourceGroupName, String workspaceName, String name, String version, + FeaturesetVersionBackfillRequest body) { + Mono>> mono + = backfillWithResponseAsync(resourceGroupName, workspaceName, name, version, body); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), FeaturesetVersionBackfillResponseInner.class, + FeaturesetVersionBackfillResponseInner.class, this.client.getContext()); + } + + /** + * Backfill. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Feature set version backfill request entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of response payload for creating a backfill request for a given + * feature set version. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FeaturesetVersionBackfillResponseInner> + beginBackfillAsync(String resourceGroupName, String workspaceName, String name, String version, + FeaturesetVersionBackfillRequest body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = backfillWithResponseAsync(resourceGroupName, workspaceName, name, version, body, context); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), FeaturesetVersionBackfillResponseInner.class, + FeaturesetVersionBackfillResponseInner.class, context); + } + + /** + * Backfill. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Feature set version backfill request entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of response payload for creating a backfill request for a given + * feature set version. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FeaturesetVersionBackfillResponseInner> + beginBackfill(String resourceGroupName, String workspaceName, String name, String version, + FeaturesetVersionBackfillRequest body) { + return this.beginBackfillAsync(resourceGroupName, workspaceName, name, version, body).getSyncPoller(); + } + + /** + * Backfill. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Feature set version backfill request entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of response payload for creating a backfill request for a given + * feature set version. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FeaturesetVersionBackfillResponseInner> + beginBackfill(String resourceGroupName, String workspaceName, String name, String version, + FeaturesetVersionBackfillRequest body, Context context) { + return this.beginBackfillAsync(resourceGroupName, workspaceName, name, version, body, context).getSyncPoller(); + } + + /** + * Backfill. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Feature set version backfill request entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response payload for creating a backfill request for a given feature set version on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono backfillAsync(String resourceGroupName, String workspaceName, + String name, String version, FeaturesetVersionBackfillRequest body) { + return beginBackfillAsync(resourceGroupName, workspaceName, name, version, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Backfill. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Feature set version backfill request entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response payload for creating a backfill request for a given feature set version on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono backfillAsync(String resourceGroupName, String workspaceName, + String name, String version, FeaturesetVersionBackfillRequest body, Context context) { + return beginBackfillAsync(resourceGroupName, workspaceName, name, version, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Backfill. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Feature set version backfill request entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response payload for creating a backfill request for a given feature set version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FeaturesetVersionBackfillResponseInner backfill(String resourceGroupName, String workspaceName, String name, + String version, FeaturesetVersionBackfillRequest body) { + return backfillAsync(resourceGroupName, workspaceName, name, version, body).block(); + } + + /** + * Backfill. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Feature set version backfill request entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response payload for creating a backfill request for a given feature set version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FeaturesetVersionBackfillResponseInner backfill(String resourceGroupName, String workspaceName, String name, + String version, FeaturesetVersionBackfillRequest body, Context context) { + return backfillAsync(resourceGroupName, workspaceName, name, version, body, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetVersion entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetVersion entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetVersionsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetVersionsImpl.java new file mode 100644 index 0000000000000..cba5f48c169d0 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturesetVersionsImpl.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.FeaturesetVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetVersionBackfillResponseInner; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetVersionInner; +import com.azure.resourcemanager.machinelearning.models.FeaturesetVersion; +import com.azure.resourcemanager.machinelearning.models.FeaturesetVersionBackfillRequest; +import com.azure.resourcemanager.machinelearning.models.FeaturesetVersionBackfillResponse; +import com.azure.resourcemanager.machinelearning.models.FeaturesetVersions; +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +public final class FeaturesetVersionsImpl implements FeaturesetVersions { + private static final ClientLogger LOGGER = new ClientLogger(FeaturesetVersionsImpl.class); + + private final FeaturesetVersionsClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public FeaturesetVersionsImpl(FeaturesetVersionsClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String name) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName, name); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FeaturesetVersionImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String name, + String skip, String tags, ListViewType listViewType, Integer pageSize, String versionName, String version, + String description, String createdBy, String stage, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, workspaceName, name, skip, tags, listViewType, pageSize, versionName, version, + description, createdBy, stage, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FeaturesetVersionImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String workspaceName, String name, String version) { + this.serviceClient().delete(resourceGroupName, workspaceName, name, version); + } + + public void delete(String resourceGroupName, String workspaceName, String name, String version, Context context) { + this.serviceClient().delete(resourceGroupName, workspaceName, name, version, context); + } + + public Response getWithResponse(String resourceGroupName, String workspaceName, String name, + String version, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, name, version, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new FeaturesetVersionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public FeaturesetVersion get(String resourceGroupName, String workspaceName, String name, String version) { + FeaturesetVersionInner inner = this.serviceClient().get(resourceGroupName, workspaceName, name, version); + if (inner != null) { + return new FeaturesetVersionImpl(inner, this.manager()); + } else { + return null; + } + } + + public FeaturesetVersionBackfillResponse backfill(String resourceGroupName, String workspaceName, String name, + String version, FeaturesetVersionBackfillRequest body) { + FeaturesetVersionBackfillResponseInner inner + = this.serviceClient().backfill(resourceGroupName, workspaceName, name, version, body); + if (inner != null) { + return new FeaturesetVersionBackfillResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public FeaturesetVersionBackfillResponse backfill(String resourceGroupName, String workspaceName, String name, + String version, FeaturesetVersionBackfillRequest body, Context context) { + FeaturesetVersionBackfillResponseInner inner + = this.serviceClient().backfill(resourceGroupName, workspaceName, name, version, body, context); + if (inner != null) { + return new FeaturesetVersionBackfillResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public FeaturesetVersion getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "featuresets"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'featuresets'.", id))); + } + String version = ResourceManagerUtils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "featuresets"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'featuresets'.", id))); + } + String version = ResourceManagerUtils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, name, version, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "featuresets"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'featuresets'.", id))); + } + String version = ResourceManagerUtils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + this.delete(resourceGroupName, workspaceName, name, version, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "featuresets"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'featuresets'.", id))); + } + String version = ResourceManagerUtils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + this.delete(resourceGroupName, workspaceName, name, version, context); + } + + private FeaturesetVersionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + public FeaturesetVersionImpl define(String name) { + return new FeaturesetVersionImpl(name, this.manager()); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturestoreEntityContainerImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturestoreEntityContainerImpl.java new file mode 100644 index 0000000000000..a6a9c1374e6cb --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturestoreEntityContainerImpl.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturestoreEntityContainerInner; +import com.azure.resourcemanager.machinelearning.models.FeaturestoreEntityContainer; +import com.azure.resourcemanager.machinelearning.models.FeaturestoreEntityContainerProperties; + +public final class FeaturestoreEntityContainerImpl + implements FeaturestoreEntityContainer, FeaturestoreEntityContainer.Definition, FeaturestoreEntityContainer.Update { + private FeaturestoreEntityContainerInner innerObject; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public FeaturestoreEntityContainerProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public FeaturestoreEntityContainerInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String name; + + public FeaturestoreEntityContainerImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public FeaturestoreEntityContainer create() { + this.innerObject = serviceManager.serviceClient() + .getFeaturestoreEntityContainers() + .createOrUpdate(resourceGroupName, workspaceName, name, this.innerModel(), Context.NONE); + return this; + } + + public FeaturestoreEntityContainer create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFeaturestoreEntityContainers() + .createOrUpdate(resourceGroupName, workspaceName, name, this.innerModel(), context); + return this; + } + + FeaturestoreEntityContainerImpl(String name, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = new FeaturestoreEntityContainerInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public FeaturestoreEntityContainerImpl update() { + return this; + } + + public FeaturestoreEntityContainer apply() { + this.innerObject = serviceManager.serviceClient() + .getFeaturestoreEntityContainers() + .createOrUpdate(resourceGroupName, workspaceName, name, this.innerModel(), Context.NONE); + return this; + } + + public FeaturestoreEntityContainer apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFeaturestoreEntityContainers() + .createOrUpdate(resourceGroupName, workspaceName, name, this.innerModel(), context); + return this; + } + + FeaturestoreEntityContainerImpl(FeaturestoreEntityContainerInner innerObject, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "featurestoreEntities"); + } + + public FeaturestoreEntityContainer refresh() { + this.innerObject = serviceManager.serviceClient() + .getFeaturestoreEntityContainers() + .getEntityWithResponse(resourceGroupName, workspaceName, name, Context.NONE) + .getValue(); + return this; + } + + public FeaturestoreEntityContainer refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFeaturestoreEntityContainers() + .getEntityWithResponse(resourceGroupName, workspaceName, name, context) + .getValue(); + return this; + } + + public FeaturestoreEntityContainerImpl withProperties(FeaturestoreEntityContainerProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturestoreEntityContainersClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturestoreEntityContainersClientImpl.java new file mode 100644 index 0000000000000..58d9a432cf605 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturestoreEntityContainersClientImpl.java @@ -0,0 +1,1009 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.FeaturestoreEntityContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturestoreEntityContainerInner; +import com.azure.resourcemanager.machinelearning.models.FeaturestoreEntityContainerResourceArmPaginatedResult; +import com.azure.resourcemanager.machinelearning.models.ListViewType; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in FeaturestoreEntityContainersClient. + */ +public final class FeaturestoreEntityContainersClientImpl implements FeaturestoreEntityContainersClient { + /** + * The proxy service used to perform REST calls. + */ + private final FeaturestoreEntityContainersService service; + + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of FeaturestoreEntityContainersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FeaturestoreEntityContainersClientImpl(AzureMachineLearningServicesImpl client) { + this.service = RestProxy.create(FeaturestoreEntityContainersService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesFeaturestoreEntityContainers to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface FeaturestoreEntityContainersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @QueryParam("$skip") String skip, + @QueryParam("tags") String tags, @QueryParam("listViewType") ListViewType listViewType, + @QueryParam("pageSize") Integer pageSize, @QueryParam("name") String name, + @QueryParam("description") String description, @QueryParam("createdBy") String createdBy, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getEntity(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") FeaturestoreEntityContainerInner body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param name name for the featurestore entity. + * @param description description for the featurestore entity. + * @param createdBy createdBy user name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityContainer entities along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, String skip, String tags, ListViewType listViewType, Integer pageSize, String name, + String description, String createdBy) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), skip, tags, listViewType, pageSize, name, + description, createdBy, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param name name for the featurestore entity. + * @param description description for the featurestore entity. + * @param createdBy createdBy user name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityContainer entities along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, String skip, String tags, ListViewType listViewType, Integer pageSize, String name, + String description, String createdBy, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + this.client.getApiVersion(), skip, tags, listViewType, pageSize, name, description, createdBy, accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param name name for the featurestore entity. + * @param description description for the featurestore entity. + * @param createdBy createdBy user name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + String skip, String tags, ListViewType listViewType, Integer pageSize, String name, String description, + String createdBy) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skip, tags, listViewType, + pageSize, name, description, createdBy), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + final String skip = null; + final String tags = null; + final ListViewType listViewType = null; + final Integer pageSize = null; + final String name = null; + final String description = null; + final String createdBy = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skip, tags, listViewType, + pageSize, name, description, createdBy), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param name name for the featurestore entity. + * @param description description for the featurestore entity. + * @param createdBy createdBy user name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + String skip, String tags, ListViewType listViewType, Integer pageSize, String name, String description, + String createdBy, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skip, tags, listViewType, + pageSize, name, description, createdBy, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityContainer entities as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + final String skip = null; + final String tags = null; + final ListViewType listViewType = null; + final Integer pageSize = null; + final String name = null; + final String description = null; + final String createdBy = null; + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, skip, tags, listViewType, pageSize, name, + description, createdBy)); + } + + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param name name for the featurestore entity. + * @param description description for the featurestore entity. + * @param createdBy createdBy user name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityContainer entities as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, + String skip, String tags, ListViewType listViewType, Integer pageSize, String name, String description, + String createdBy, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, skip, tags, listViewType, pageSize, name, + description, createdBy, context)); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, this.client.getApiVersion(), accept, context); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, + String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, + String name, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, workspaceName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String name) { + return this.beginDeleteAsync(resourceGroupName, workspaceName, name).getSyncPoller(); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String name, + Context context) { + return this.beginDeleteAsync(resourceGroupName, workspaceName, name, context).getSyncPoller(); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String name) { + return beginDeleteAsync(resourceGroupName, workspaceName, name).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, name, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String name) { + deleteAsync(resourceGroupName, workspaceName, name).block(); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String name, Context context) { + deleteAsync(resourceGroupName, workspaceName, name, context).block(); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getEntityWithResponseAsync(String resourceGroupName, + String workspaceName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getEntity(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getEntityWithResponseAsync(String resourceGroupName, + String workspaceName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getEntity(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, this.client.getApiVersion(), accept, context); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityAsync(String resourceGroupName, String workspaceName, + String name) { + return getEntityWithResponseAsync(resourceGroupName, workspaceName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityWithResponse(String resourceGroupName, + String workspaceName, String name, Context context) { + return getEntityWithResponseAsync(resourceGroupName, workspaceName, name, context).block(); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FeaturestoreEntityContainerInner getEntity(String resourceGroupName, String workspaceName, String name) { + return getEntityWithResponse(resourceGroupName, workspaceName, name, Context.NONE).getValue(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String name, FeaturestoreEntityContainerInner body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String name, FeaturestoreEntityContainerInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, this.client.getApiVersion(), body, accept, context); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FeaturestoreEntityContainerInner> + beginCreateOrUpdateAsync(String resourceGroupName, String workspaceName, String name, + FeaturestoreEntityContainerInner body) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), FeaturestoreEntityContainerInner.class, + FeaturestoreEntityContainerInner.class, this.client.getContext()); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FeaturestoreEntityContainerInner> + beginCreateOrUpdateAsync(String resourceGroupName, String workspaceName, String name, + FeaturestoreEntityContainerInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), FeaturestoreEntityContainerInner.class, + FeaturestoreEntityContainerInner.class, context); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FeaturestoreEntityContainerInner> + beginCreateOrUpdate(String resourceGroupName, String workspaceName, String name, + FeaturestoreEntityContainerInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, body).getSyncPoller(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FeaturestoreEntityContainerInner> + beginCreateOrUpdate(String resourceGroupName, String workspaceName, String name, + FeaturestoreEntityContainerInner body, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, body, context).getSyncPoller(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String name, FeaturestoreEntityContainerInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String name, FeaturestoreEntityContainerInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FeaturestoreEntityContainerInner createOrUpdate(String resourceGroupName, String workspaceName, String name, + FeaturestoreEntityContainerInner body) { + return createOrUpdateAsync(resourceGroupName, workspaceName, name, body).block(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FeaturestoreEntityContainerInner createOrUpdate(String resourceGroupName, String workspaceName, String name, + FeaturestoreEntityContainerInner body, Context context) { + return createOrUpdateAsync(resourceGroupName, workspaceName, name, body, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityContainer entities along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityContainer entities along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturestoreEntityContainersImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturestoreEntityContainersImpl.java new file mode 100644 index 0000000000000..0c435229ee6ee --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturestoreEntityContainersImpl.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.FeaturestoreEntityContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturestoreEntityContainerInner; +import com.azure.resourcemanager.machinelearning.models.FeaturestoreEntityContainer; +import com.azure.resourcemanager.machinelearning.models.FeaturestoreEntityContainers; +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +public final class FeaturestoreEntityContainersImpl implements FeaturestoreEntityContainers { + private static final ClientLogger LOGGER = new ClientLogger(FeaturestoreEntityContainersImpl.class); + + private final FeaturestoreEntityContainersClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public FeaturestoreEntityContainersImpl(FeaturestoreEntityContainersClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new FeaturestoreEntityContainerImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String skip, + String tags, ListViewType listViewType, Integer pageSize, String name, String description, String createdBy, + Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, workspaceName, skip, tags, listViewType, pageSize, name, description, createdBy, + context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new FeaturestoreEntityContainerImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String workspaceName, String name) { + this.serviceClient().delete(resourceGroupName, workspaceName, name); + } + + public void delete(String resourceGroupName, String workspaceName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, workspaceName, name, context); + } + + public Response getEntityWithResponse(String resourceGroupName, String workspaceName, + String name, Context context) { + Response inner + = this.serviceClient().getEntityWithResponse(resourceGroupName, workspaceName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new FeaturestoreEntityContainerImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public FeaturestoreEntityContainer getEntity(String resourceGroupName, String workspaceName, String name) { + FeaturestoreEntityContainerInner inner = this.serviceClient().getEntity(resourceGroupName, workspaceName, name); + if (inner != null) { + return new FeaturestoreEntityContainerImpl(inner, this.manager()); + } else { + return null; + } + } + + public FeaturestoreEntityContainer getEntityById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "featurestoreEntities"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'featurestoreEntities'.", id))); + } + return this.getEntityWithResponse(resourceGroupName, workspaceName, name, Context.NONE).getValue(); + } + + public Response getEntityByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "featurestoreEntities"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'featurestoreEntities'.", id))); + } + return this.getEntityWithResponse(resourceGroupName, workspaceName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "featurestoreEntities"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'featurestoreEntities'.", id))); + } + this.delete(resourceGroupName, workspaceName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "featurestoreEntities"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'featurestoreEntities'.", id))); + } + this.delete(resourceGroupName, workspaceName, name, context); + } + + private FeaturestoreEntityContainersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + public FeaturestoreEntityContainerImpl define(String name) { + return new FeaturestoreEntityContainerImpl(name, this.manager()); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturestoreEntityVersionImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturestoreEntityVersionImpl.java new file mode 100644 index 0000000000000..077a40278446a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturestoreEntityVersionImpl.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturestoreEntityVersionInner; +import com.azure.resourcemanager.machinelearning.models.FeaturestoreEntityVersion; +import com.azure.resourcemanager.machinelearning.models.FeaturestoreEntityVersionProperties; + +public final class FeaturestoreEntityVersionImpl + implements FeaturestoreEntityVersion, FeaturestoreEntityVersion.Definition, FeaturestoreEntityVersion.Update { + private FeaturestoreEntityVersionInner innerObject; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public FeaturestoreEntityVersionProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public FeaturestoreEntityVersionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String name; + + private String version; + + public FeaturestoreEntityVersionImpl withExistingFeaturestoreEntity(String resourceGroupName, String workspaceName, + String name) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + this.name = name; + return this; + } + + public FeaturestoreEntityVersion create() { + this.innerObject = serviceManager.serviceClient() + .getFeaturestoreEntityVersions() + .createOrUpdate(resourceGroupName, workspaceName, name, version, this.innerModel(), Context.NONE); + return this; + } + + public FeaturestoreEntityVersion create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFeaturestoreEntityVersions() + .createOrUpdate(resourceGroupName, workspaceName, name, version, this.innerModel(), context); + return this; + } + + FeaturestoreEntityVersionImpl(String name, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = new FeaturestoreEntityVersionInner(); + this.serviceManager = serviceManager; + this.version = name; + } + + public FeaturestoreEntityVersionImpl update() { + return this; + } + + public FeaturestoreEntityVersion apply() { + this.innerObject = serviceManager.serviceClient() + .getFeaturestoreEntityVersions() + .createOrUpdate(resourceGroupName, workspaceName, name, version, this.innerModel(), Context.NONE); + return this; + } + + public FeaturestoreEntityVersion apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFeaturestoreEntityVersions() + .createOrUpdate(resourceGroupName, workspaceName, name, version, this.innerModel(), context); + return this; + } + + FeaturestoreEntityVersionImpl(FeaturestoreEntityVersionInner innerObject, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "featurestoreEntities"); + this.version = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "versions"); + } + + public FeaturestoreEntityVersion refresh() { + this.innerObject = serviceManager.serviceClient() + .getFeaturestoreEntityVersions() + .getWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE) + .getValue(); + return this; + } + + public FeaturestoreEntityVersion refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFeaturestoreEntityVersions() + .getWithResponse(resourceGroupName, workspaceName, name, version, context) + .getValue(); + return this; + } + + public FeaturestoreEntityVersionImpl withProperties(FeaturestoreEntityVersionProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturestoreEntityVersionsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturestoreEntityVersionsClientImpl.java new file mode 100644 index 0000000000000..136872b04117f --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturestoreEntityVersionsClientImpl.java @@ -0,0 +1,1090 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.FeaturestoreEntityVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturestoreEntityVersionInner; +import com.azure.resourcemanager.machinelearning.models.FeaturestoreEntityVersionResourceArmPaginatedResult; +import com.azure.resourcemanager.machinelearning.models.ListViewType; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in FeaturestoreEntityVersionsClient. + */ +public final class FeaturestoreEntityVersionsClientImpl implements FeaturestoreEntityVersionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final FeaturestoreEntityVersionsService service; + + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of FeaturestoreEntityVersionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FeaturestoreEntityVersionsClientImpl(AzureMachineLearningServicesImpl client) { + this.service = RestProxy.create(FeaturestoreEntityVersionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesFeaturestoreEntityVersions to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface FeaturestoreEntityVersionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @QueryParam("$skip") String skip, @QueryParam("tags") String tags, + @QueryParam("listViewType") ListViewType listViewType, @QueryParam("pageSize") Integer pageSize, + @QueryParam("versionName") String versionName, @QueryParam("version") String version, + @QueryParam("description") String description, @QueryParam("createdBy") String createdBy, + @QueryParam("stage") String stage, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") FeaturestoreEntityVersionInner body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Feature entity name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param versionName name for the featurestore entity version. + * @param version featurestore entity version. + * @param description description for the feature entity version. + * @param createdBy createdBy user name. + * @param stage Specifies the featurestore stage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityVersion entities along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, String name, String skip, String tags, ListViewType listViewType, Integer pageSize, + String versionName, String version, String description, String createdBy, String stage) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), skip, tags, listViewType, pageSize, + versionName, version, description, createdBy, stage, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Feature entity name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param versionName name for the featurestore entity version. + * @param version featurestore entity version. + * @param description description for the feature entity version. + * @param createdBy createdBy user name. + * @param stage Specifies the featurestore stage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityVersion entities along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, String name, String skip, String tags, ListViewType listViewType, Integer pageSize, + String versionName, String version, String description, String createdBy, String stage, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, name, + this.client.getApiVersion(), skip, tags, listViewType, pageSize, versionName, version, description, + createdBy, stage, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Feature entity name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param versionName name for the featurestore entity version. + * @param version featurestore entity version. + * @param description description for the feature entity version. + * @param createdBy createdBy user name. + * @param stage Specifies the featurestore stage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityVersion entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + String name, String skip, String tags, ListViewType listViewType, Integer pageSize, String versionName, + String version, String description, String createdBy, String stage) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, name, skip, tags, + listViewType, pageSize, versionName, version, description, createdBy, stage), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Feature entity name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityVersion entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + String name) { + final String skip = null; + final String tags = null; + final ListViewType listViewType = null; + final Integer pageSize = null; + final String versionName = null; + final String version = null; + final String description = null; + final String createdBy = null; + final String stage = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, name, skip, tags, + listViewType, pageSize, versionName, version, description, createdBy, stage), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Feature entity name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param versionName name for the featurestore entity version. + * @param version featurestore entity version. + * @param description description for the feature entity version. + * @param createdBy createdBy user name. + * @param stage Specifies the featurestore stage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityVersion entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + String name, String skip, String tags, ListViewType listViewType, Integer pageSize, String versionName, + String version, String description, String createdBy, String stage, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, name, skip, tags, listViewType, pageSize, + versionName, version, description, createdBy, stage, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Feature entity name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, + String name) { + final String skip = null; + final String tags = null; + final ListViewType listViewType = null; + final Integer pageSize = null; + final String versionName = null; + final String version = null; + final String description = null; + final String createdBy = null; + final String stage = null; + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, name, skip, tags, listViewType, pageSize, + versionName, version, description, createdBy, stage)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Feature entity name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param versionName name for the featurestore entity version. + * @param version featurestore entity version. + * @param description description for the feature entity version. + * @param createdBy createdBy user name. + * @param stage Specifies the featurestore stage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, + String name, String skip, String tags, ListViewType listViewType, Integer pageSize, String versionName, + String version, String description, String createdBy, String stage, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, name, skip, tags, listViewType, pageSize, + versionName, version, description, createdBy, stage, context)); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String name, String version) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, version, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String name, String version, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, version, this.client.getApiVersion(), accept, context); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, + String name, String version) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, workspaceName, name, version); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, + String name, String version, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, workspaceName, name, version, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String name, + String version) { + return this.beginDeleteAsync(resourceGroupName, workspaceName, name, version).getSyncPoller(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String name, + String version, Context context) { + return this.beginDeleteAsync(resourceGroupName, workspaceName, name, version, context).getSyncPoller(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String name, String version) { + return beginDeleteAsync(resourceGroupName, workspaceName, name, version).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String name, String version, + Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, name, version, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String name, String version) { + deleteAsync(resourceGroupName, workspaceName, name, version).block(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String name, String version, Context context) { + deleteAsync(resourceGroupName, workspaceName, name, version, context).block(); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String workspaceName, String name, String version) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, version, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String workspaceName, String name, String version, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + name, version, this.client.getApiVersion(), accept, context); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String name, + String version) { + return getWithResponseAsync(resourceGroupName, workspaceName, name, version) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String workspaceName, + String name, String version, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, name, version, context).block(); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FeaturestoreEntityVersionInner get(String resourceGroupName, String workspaceName, String name, + String version) { + return getWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE).getValue(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String name, String version, FeaturestoreEntityVersionInner body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, version, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String name, String version, FeaturestoreEntityVersionInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, version, this.client.getApiVersion(), body, accept, context); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FeaturestoreEntityVersionInner> + beginCreateOrUpdateAsync(String resourceGroupName, String workspaceName, String name, String version, + FeaturestoreEntityVersionInner body) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, version, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), FeaturestoreEntityVersionInner.class, FeaturestoreEntityVersionInner.class, + this.client.getContext()); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FeaturestoreEntityVersionInner> + beginCreateOrUpdateAsync(String resourceGroupName, String workspaceName, String name, String version, + FeaturestoreEntityVersionInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, version, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), FeaturestoreEntityVersionInner.class, FeaturestoreEntityVersionInner.class, + context); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FeaturestoreEntityVersionInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String name, String version, + FeaturestoreEntityVersionInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, version, body).getSyncPoller(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FeaturestoreEntityVersionInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String name, String version, + FeaturestoreEntityVersionInner body, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, version, body, context) + .getSyncPoller(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String name, String version, FeaturestoreEntityVersionInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, version, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String name, String version, FeaturestoreEntityVersionInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, version, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FeaturestoreEntityVersionInner createOrUpdate(String resourceGroupName, String workspaceName, String name, + String version, FeaturestoreEntityVersionInner body) { + return createOrUpdateAsync(resourceGroupName, workspaceName, name, version, body).block(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FeaturestoreEntityVersionInner createOrUpdate(String resourceGroupName, String workspaceName, String name, + String version, FeaturestoreEntityVersionInner body, Context context) { + return createOrUpdateAsync(resourceGroupName, workspaceName, name, version, body, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityVersion entities along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityVersion entities along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturestoreEntityVersionsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturestoreEntityVersionsImpl.java new file mode 100644 index 0000000000000..10ad272b5a596 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/FeaturestoreEntityVersionsImpl.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.FeaturestoreEntityVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturestoreEntityVersionInner; +import com.azure.resourcemanager.machinelearning.models.FeaturestoreEntityVersion; +import com.azure.resourcemanager.machinelearning.models.FeaturestoreEntityVersions; +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +public final class FeaturestoreEntityVersionsImpl implements FeaturestoreEntityVersions { + private static final ClientLogger LOGGER = new ClientLogger(FeaturestoreEntityVersionsImpl.class); + + private final FeaturestoreEntityVersionsClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public FeaturestoreEntityVersionsImpl(FeaturestoreEntityVersionsClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String name) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, name); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FeaturestoreEntityVersionImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String name, + String skip, String tags, ListViewType listViewType, Integer pageSize, String versionName, String version, + String description, String createdBy, String stage, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, workspaceName, name, skip, tags, listViewType, pageSize, versionName, version, + description, createdBy, stage, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FeaturestoreEntityVersionImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String workspaceName, String name, String version) { + this.serviceClient().delete(resourceGroupName, workspaceName, name, version); + } + + public void delete(String resourceGroupName, String workspaceName, String name, String version, Context context) { + this.serviceClient().delete(resourceGroupName, workspaceName, name, version, context); + } + + public Response getWithResponse(String resourceGroupName, String workspaceName, + String name, String version, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, name, version, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new FeaturestoreEntityVersionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public FeaturestoreEntityVersion get(String resourceGroupName, String workspaceName, String name, String version) { + FeaturestoreEntityVersionInner inner + = this.serviceClient().get(resourceGroupName, workspaceName, name, version); + if (inner != null) { + return new FeaturestoreEntityVersionImpl(inner, this.manager()); + } else { + return null; + } + } + + public FeaturestoreEntityVersion getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "featurestoreEntities"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'featurestoreEntities'.", id))); + } + String version = ResourceManagerUtils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "featurestoreEntities"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'featurestoreEntities'.", id))); + } + String version = ResourceManagerUtils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, name, version, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "featurestoreEntities"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'featurestoreEntities'.", id))); + } + String version = ResourceManagerUtils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + this.delete(resourceGroupName, workspaceName, name, version, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "featurestoreEntities"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'featurestoreEntities'.", id))); + } + String version = ResourceManagerUtils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + this.delete(resourceGroupName, workspaceName, name, version, context); + } + + private FeaturestoreEntityVersionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + public FeaturestoreEntityVersionImpl define(String name) { + return new FeaturestoreEntityVersionImpl(name, this.manager()); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/GetBlobReferenceSasResponseDtoImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/GetBlobReferenceSasResponseDtoImpl.java new file mode 100644 index 0000000000000..a27f24baf480a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/GetBlobReferenceSasResponseDtoImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.resourcemanager.machinelearning.fluent.models.GetBlobReferenceSasResponseDtoInner; +import com.azure.resourcemanager.machinelearning.models.GetBlobReferenceForConsumptionDto; +import com.azure.resourcemanager.machinelearning.models.GetBlobReferenceSasResponseDto; + +public final class GetBlobReferenceSasResponseDtoImpl implements GetBlobReferenceSasResponseDto { + private GetBlobReferenceSasResponseDtoInner innerObject; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + GetBlobReferenceSasResponseDtoImpl(GetBlobReferenceSasResponseDtoInner innerObject, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public GetBlobReferenceForConsumptionDto blobReferenceForConsumption() { + return this.innerModel().blobReferenceForConsumption(); + } + + public GetBlobReferenceSasResponseDtoInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/JobBaseImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/JobBaseImpl.java index 1b26fd5f42d47..c17a0899f164c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/JobBaseImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/JobBaseImpl.java @@ -60,22 +60,18 @@ public JobBaseImpl withExistingWorkspace(String resourceGroupName, String worksp } public JobBase create() { - this.innerObject = - serviceManager - .serviceClient() - .getJobs() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, id, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getJobs() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, id, this.innerModel(), Context.NONE) + .getValue(); return this; } public JobBase create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getJobs() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, id, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getJobs() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, id, this.innerModel(), context) + .getValue(); return this; } @@ -90,51 +86,43 @@ public JobBaseImpl update() { } public JobBase apply() { - this.innerObject = - serviceManager - .serviceClient() - .getJobs() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, id, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getJobs() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, id, this.innerModel(), Context.NONE) + .getValue(); return this; } public JobBase apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getJobs() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, id, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getJobs() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, id, this.innerModel(), context) + .getValue(); return this; } - JobBaseImpl( - JobBaseInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + JobBaseImpl(JobBaseInner innerObject, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); - this.id = Utils.getValueFromIdByName(innerObject.id(), "jobs"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.id = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "jobs"); } public JobBase refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getJobs() - .getWithResponse(resourceGroupName, workspaceName, id, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getJobs() + .getWithResponse(resourceGroupName, workspaceName, id, Context.NONE) + .getValue(); return this; } public JobBase refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getJobs() - .getWithResponse(resourceGroupName, workspaceName, id, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getJobs() + .getWithResponse(resourceGroupName, workspaceName, id, context) + .getValue(); return this; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/JobsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/JobsClientImpl.java index f19ceaef9cf49..6a8c2967eb27a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/JobsClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/JobsClientImpl.java @@ -40,160 +40,125 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in JobsClient. */ +/** + * An instance of this class provides access to all the operations defined in JobsClient. + */ public final class JobsClientImpl implements JobsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final JobsService service; - /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of JobsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ - JobsClientImpl(AzureMachineLearningWorkspacesImpl client) { + JobsClientImpl(AzureMachineLearningServicesImpl client) { this.service = RestProxy.create(JobsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesJobs to be used by the proxy service to + * The interface defining all the services for AzureMachineLearningServicesJobs to be used by the proxy service to * perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AzureMachineLearning") public interface JobsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, + Mono> list(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @QueryParam("api-version") String apiVersion, - @QueryParam("$skip") String skip, - @QueryParam("jobType") String jobType, - @QueryParam("tag") String tag, - @QueryParam("listViewType") ListViewType listViewType, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @QueryParam("$skip") String skip, + @QueryParam("jobType") String jobType, @QueryParam("tag") String tag, + @QueryParam("listViewType") ListViewType listViewType, @QueryParam("properties") String properties, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}") - @ExpectedResponses({200, 202, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}") + @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, + Mono>> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("id") String id, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("id") String id, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("id") String id, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("id") String id, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, + Mono> createOrUpdate(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("id") String id, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") JobBaseInner body, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("id") String id, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") JobBaseInner body, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel") - @ExpectedResponses({200, 202}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> cancel( - @HostParam("$host") String endpoint, + Mono>> cancel(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("id") String id, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("id") String id, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Lists Jobs in the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. * @param jobType Type of job to be returned. * @param tag Jobs returned will have this tag key. * @param listViewType View type for including/excluding (for example) archived entities. + * @param properties Comma-separated list of user property names (and optionally values). Example: + * prop1,prop2=value2. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a paginated list of JobBase entities along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return a paginated list of JobBase entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String workspaceName, - String skip, - String jobType, - String tag, - ListViewType listViewType) { + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String skip, String jobType, String tag, ListViewType listViewType, String properties) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -204,69 +169,42 @@ private Mono> listSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - this.client.getApiVersion(), - skip, - jobType, - tag, - listViewType, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), skip, jobType, tag, listViewType, + properties, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Lists Jobs in the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. * @param jobType Type of job to be returned. * @param tag Jobs returned will have this tag key. * @param listViewType View type for including/excluding (for example) archived entities. + * @param properties Comma-separated list of user property names (and optionally values). Example: + * prop1,prop2=value2. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a paginated list of JobBase entities along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return a paginated list of JobBase entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String workspaceName, - String skip, - String jobType, - String tag, - ListViewType listViewType, - Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String skip, String jobType, String tag, ListViewType listViewType, String properties, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -278,59 +216,39 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - this.client.getApiVersion(), - skip, - jobType, - tag, - listViewType, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + this.client.getApiVersion(), skip, jobType, tag, listViewType, properties, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Lists Jobs in the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. * @param jobType Type of job to be returned. * @param tag Jobs returned will have this tag key. * @param listViewType View type for including/excluding (for example) archived entities. + * @param properties Comma-separated list of user property names (and optionally values). Example: + * prop1,prop2=value2. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of JobBase entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String workspaceName, - String skip, - String jobType, - String tag, - ListViewType listViewType) { + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String skip, + String jobType, String tag, ListViewType listViewType, String properties) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, skip, jobType, tag, listViewType), + () -> listSinglePageAsync(resourceGroupName, workspaceName, skip, jobType, tag, listViewType, properties), nextLink -> listNextSinglePageAsync(nextLink)); } /** * Lists Jobs in the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -344,20 +262,23 @@ private PagedFlux listAsync(String resourceGroupName, String works final String jobType = null; final String tag = null; final ListViewType listViewType = null; + final String properties = null; return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, skip, jobType, tag, listViewType), + () -> listSinglePageAsync(resourceGroupName, workspaceName, skip, jobType, tag, listViewType, properties), nextLink -> listNextSinglePageAsync(nextLink)); } /** * Lists Jobs in the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. * @param jobType Type of job to be returned. * @param tag Jobs returned will have this tag key. * @param listViewType View type for including/excluding (for example) archived entities. + * @param properties Comma-separated list of user property names (and optionally values). Example: + * prop1,prop2=value2. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -365,22 +286,15 @@ private PagedFlux listAsync(String resourceGroupName, String works * @return a paginated list of JobBase entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String workspaceName, - String skip, - String jobType, - String tag, - ListViewType listViewType, - Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, skip, jobType, tag, listViewType, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String skip, + String jobType, String tag, ListViewType listViewType, String properties, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skip, jobType, tag, + listViewType, properties, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Lists Jobs in the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -394,18 +308,22 @@ public PagedIterable list(String resourceGroupName, String workspa final String jobType = null; final String tag = null; final ListViewType listViewType = null; - return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, skip, jobType, tag, listViewType)); + final String properties = null; + return new PagedIterable<>( + listAsync(resourceGroupName, workspaceName, skip, jobType, tag, listViewType, properties)); } /** * Lists Jobs in the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. * @param jobType Type of job to be returned. * @param tag Jobs returned will have this tag key. * @param listViewType View type for including/excluding (for example) archived entities. + * @param properties Comma-separated list of user property names (and optionally values). Example: + * prop1,prop2=value2. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -413,21 +331,15 @@ public PagedIterable list(String resourceGroupName, String workspa * @return a paginated list of JobBase entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, - String workspaceName, - String skip, - String jobType, - String tag, - ListViewType listViewType, - Context context) { + public PagedIterable list(String resourceGroupName, String workspaceName, String skip, String jobType, + String tag, ListViewType listViewType, String properties, Context context) { return new PagedIterable<>( - listAsync(resourceGroupName, workspaceName, skip, jobType, tag, listViewType, context)); + listAsync(resourceGroupName, workspaceName, skip, jobType, tag, listViewType, properties, context)); } /** * Deletes a Job (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -437,19 +349,15 @@ public PagedIterable list( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String id) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String id) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -463,24 +371,14 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - id, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, id, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Deletes a Job (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -491,19 +389,15 @@ private Mono>> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String id, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String id, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -517,21 +411,13 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - id, - this.client.getApiVersion(), - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, id, this.client.getApiVersion(), accept, context); } /** * Deletes a Job (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -541,18 +427,16 @@ private Mono>> deleteWithResponseAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String workspaceName, String id) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, + String id) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName, id); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Deletes a Job (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -563,18 +447,17 @@ private PollerFlux, Void> beginDeleteAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String workspaceName, String id, Context context) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, + String id, Context context) { context = this.client.mergeContext(context); Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName, id, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** * Deletes a Job (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -590,7 +473,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, /** * Deletes a Job (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -601,14 +484,14 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String workspaceName, String id, Context context) { + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String id, + Context context) { return this.beginDeleteAsync(resourceGroupName, workspaceName, id, context).getSyncPoller(); } /** * Deletes a Job (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -619,14 +502,13 @@ public SyncPoller, Void> beginDelete( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String workspaceName, String id) { - return beginDeleteAsync(resourceGroupName, workspaceName, id) - .last() + return beginDeleteAsync(resourceGroupName, workspaceName, id).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Deletes a Job (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -638,14 +520,13 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String workspaceName, String id, Context context) { - return beginDeleteAsync(resourceGroupName, workspaceName, id, context) - .last() + return beginDeleteAsync(resourceGroupName, workspaceName, id, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Deletes a Job (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -660,7 +541,7 @@ public void delete(String resourceGroupName, String workspaceName, String id) { /** * Deletes a Job (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -676,7 +557,7 @@ public void delete(String resourceGroupName, String workspaceName, String id, Co /** * Gets a Job by name/id. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -686,19 +567,15 @@ public void delete(String resourceGroupName, String workspaceName, String id, Co * @return a Job by name/id along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String id) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String id) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -712,24 +589,14 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - id, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, id, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets a Job by name/id. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -740,19 +607,15 @@ private Mono> getWithResponseAsync( * @return a Job by name/id along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String id, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, String id, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -766,21 +629,13 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - id, - this.client.getApiVersion(), - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + id, this.client.getApiVersion(), accept, context); } /** * Gets a Job by name/id. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -797,7 +652,7 @@ private Mono getAsync(String resourceGroupName, String workspaceNa /** * Gets a Job by name/id. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -808,14 +663,14 @@ private Mono getAsync(String resourceGroupName, String workspaceNa * @return a Job by name/id along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String id, Context context) { + public Response getWithResponse(String resourceGroupName, String workspaceName, String id, + Context context) { return getWithResponseAsync(resourceGroupName, workspaceName, id, context).block(); } /** * Gets a Job by name/id. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -831,7 +686,8 @@ public JobBaseInner get(String resourceGroupName, String workspaceName, String i /** * Creates and executes a Job. - * + * For update case, the Tags in the definition passed in will replace Tags in the existing job. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -839,23 +695,19 @@ public JobBaseInner get(String resourceGroupName, String workspaceName, String i * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link - * Mono}. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String workspaceName, String id, JobBaseInner body) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String workspaceName, + String id, JobBaseInner body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -874,25 +726,15 @@ private Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - id, - this.client.getApiVersion(), - body, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, id, this.client.getApiVersion(), body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates and executes a Job. - * + * For update case, the Tags in the definition passed in will replace Tags in the existing job. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -901,23 +743,19 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link - * Mono}. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String workspaceName, String id, JobBaseInner body, Context context) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String workspaceName, + String id, JobBaseInner body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -936,22 +774,14 @@ private Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - id, - this.client.getApiVersion(), - body, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, id, this.client.getApiVersion(), body, accept, context); } /** * Creates and executes a Job. - * + * For update case, the Tags in the definition passed in will replace Tags in the existing job. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -962,15 +792,16 @@ private Mono> createOrUpdateWithResponseAsync( * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String workspaceName, String id, JobBaseInner body) { + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, String id, + JobBaseInner body) { return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, id, body) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Creates and executes a Job. - * + * For update case, the Tags in the definition passed in will replace Tags in the existing job. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -982,14 +813,15 @@ private Mono createOrUpdateAsync( * @return azure Resource Manager resource envelope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, String workspaceName, String id, JobBaseInner body, Context context) { + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, String id, + JobBaseInner body, Context context) { return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, id, body, context).block(); } /** * Creates and executes a Job. - * + * For update case, the Tags in the definition passed in will replace Tags in the existing job. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -1006,7 +838,7 @@ public JobBaseInner createOrUpdate(String resourceGroupName, String workspaceNam /** * Cancels a Job (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -1016,19 +848,15 @@ public JobBaseInner createOrUpdate(String resourceGroupName, String workspaceNam * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> cancelWithResponseAsync( - String resourceGroupName, String workspaceName, String id) { + private Mono>> cancelWithResponseAsync(String resourceGroupName, String workspaceName, + String id) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1042,24 +870,14 @@ private Mono>> cancelWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .cancel( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - id, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.cancel(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, id, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Cancels a Job (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -1070,19 +888,15 @@ private Mono>> cancelWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> cancelWithResponseAsync( - String resourceGroupName, String workspaceName, String id, Context context) { + private Mono>> cancelWithResponseAsync(String resourceGroupName, String workspaceName, + String id, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1096,21 +910,13 @@ private Mono>> cancelWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .cancel( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - id, - this.client.getApiVersion(), - accept, - context); + return service.cancel(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, id, this.client.getApiVersion(), accept, context); } /** * Cancels a Job (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -1120,18 +926,16 @@ private Mono>> cancelWithResponseAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginCancelAsync( - String resourceGroupName, String workspaceName, String id) { + private PollerFlux, Void> beginCancelAsync(String resourceGroupName, String workspaceName, + String id) { Mono>> mono = cancelWithResponseAsync(resourceGroupName, workspaceName, id); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Cancels a Job (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -1142,18 +946,17 @@ private PollerFlux, Void> beginCancelAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginCancelAsync( - String resourceGroupName, String workspaceName, String id, Context context) { + private PollerFlux, Void> beginCancelAsync(String resourceGroupName, String workspaceName, + String id, Context context) { context = this.client.mergeContext(context); Mono>> mono = cancelWithResponseAsync(resourceGroupName, workspaceName, id, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** * Cancels a Job (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -1169,7 +972,7 @@ public SyncPoller, Void> beginCancel(String resourceGroupName, /** * Cancels a Job (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -1180,14 +983,14 @@ public SyncPoller, Void> beginCancel(String resourceGroupName, * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginCancel( - String resourceGroupName, String workspaceName, String id, Context context) { + public SyncPoller, Void> beginCancel(String resourceGroupName, String workspaceName, String id, + Context context) { return this.beginCancelAsync(resourceGroupName, workspaceName, id, context).getSyncPoller(); } /** * Cancels a Job (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -1198,14 +1001,13 @@ public SyncPoller, Void> beginCancel( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono cancelAsync(String resourceGroupName, String workspaceName, String id) { - return beginCancelAsync(resourceGroupName, workspaceName, id) - .last() + return beginCancelAsync(resourceGroupName, workspaceName, id).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Cancels a Job (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -1217,14 +1019,13 @@ private Mono cancelAsync(String resourceGroupName, String workspaceName, S */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono cancelAsync(String resourceGroupName, String workspaceName, String id, Context context) { - return beginCancelAsync(resourceGroupName, workspaceName, id, context) - .last() + return beginCancelAsync(resourceGroupName, workspaceName, id, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Cancels a Job (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -1239,7 +1040,7 @@ public void cancel(String resourceGroupName, String workspaceName, String id) { /** * Cancels a Job (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -1255,14 +1056,13 @@ public void cancel(String resourceGroupName, String workspaceName, String id, Co /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a paginated list of JobBase entities along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return a paginated list of JobBase entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1270,37 +1070,26 @@ private Mono> listNextSinglePageAsync(String nextLin return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a paginated list of JobBase entities along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return a paginated list of JobBase entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -1308,23 +1097,13 @@ private Mono> listNextSinglePageAsync(String nextLin return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/JobsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/JobsImpl.java index 8acf713adc9b9..47f39f713b945 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/JobsImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/JobsImpl.java @@ -22,28 +22,22 @@ public final class JobsImpl implements Jobs { private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - public JobsImpl( - JobsClient innerClient, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + public JobsImpl(JobsClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list(String resourceGroupName, String workspaceName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); - return Utils.mapPage(inner, inner1 -> new JobBaseImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new JobBaseImpl(inner1, this.manager())); } - public PagedIterable list( - String resourceGroupName, - String workspaceName, - String skip, - String jobType, - String tag, - ListViewType listViewType, - Context context) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, workspaceName, skip, jobType, tag, listViewType, context); - return Utils.mapPage(inner, inner1 -> new JobBaseImpl(inner1, this.manager())); + public PagedIterable list(String resourceGroupName, String workspaceName, String skip, String jobType, + String tag, ListViewType listViewType, String properties, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, workspaceName, skip, jobType, tag, listViewType, properties, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new JobBaseImpl(inner1, this.manager())); } public void delete(String resourceGroupName, String workspaceName, String id) { @@ -54,15 +48,12 @@ public void delete(String resourceGroupName, String workspaceName, String id, Co this.serviceClient().delete(resourceGroupName, workspaceName, id, context); } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String id, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, workspaceName, id, context); + public Response getWithResponse(String resourceGroupName, String workspaceName, String id, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, id, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new JobBaseImpl(inner.getValue(), this.manager())); } else { return null; @@ -87,105 +78,77 @@ public void cancel(String resourceGroupName, String workspaceName, String id, Co } public JobBase getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String varId = Utils.getValueFromIdByName(id, "jobs"); + String varId = ResourceManagerUtils.getValueFromIdByName(id, "jobs"); if (varId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'jobs'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'jobs'.", id))); } return this.getWithResponse(resourceGroupName, workspaceName, varId, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String varId = Utils.getValueFromIdByName(id, "jobs"); + String varId = ResourceManagerUtils.getValueFromIdByName(id, "jobs"); if (varId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'jobs'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'jobs'.", id))); } return this.getWithResponse(resourceGroupName, workspaceName, varId, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String varId = Utils.getValueFromIdByName(id, "jobs"); + String varId = ResourceManagerUtils.getValueFromIdByName(id, "jobs"); if (varId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'jobs'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'jobs'.", id))); } this.delete(resourceGroupName, workspaceName, varId, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String varId = Utils.getValueFromIdByName(id, "jobs"); + String varId = ResourceManagerUtils.getValueFromIdByName(id, "jobs"); if (varId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'jobs'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'jobs'.", id))); } this.delete(resourceGroupName, workspaceName, varId, context); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ListNotebookKeysResultImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ListNotebookKeysResultImpl.java index 66fa88be97b17..9202fd672f04a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ListNotebookKeysResultImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ListNotebookKeysResultImpl.java @@ -12,8 +12,7 @@ public final class ListNotebookKeysResultImpl implements ListNotebookKeysResult private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - ListNotebookKeysResultImpl( - ListNotebookKeysResultInner innerObject, + ListNotebookKeysResultImpl(ListNotebookKeysResultInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ListStorageAccountKeysResultImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ListStorageAccountKeysResultImpl.java index 5b7e3b40f651a..ed94a54767279 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ListStorageAccountKeysResultImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ListStorageAccountKeysResultImpl.java @@ -12,8 +12,7 @@ public final class ListStorageAccountKeysResultImpl implements ListStorageAccoun private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - ListStorageAccountKeysResultImpl( - ListStorageAccountKeysResultInner innerObject, + ListStorageAccountKeysResultImpl(ListStorageAccountKeysResultInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ListWorkspaceKeysResultImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ListWorkspaceKeysResultImpl.java index 02beede5a627c..9e7be2fa5cb3e 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ListWorkspaceKeysResultImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ListWorkspaceKeysResultImpl.java @@ -15,8 +15,7 @@ public final class ListWorkspaceKeysResultImpl implements ListWorkspaceKeysResul private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - ListWorkspaceKeysResultImpl( - ListWorkspaceKeysResultInner innerObject, + ListWorkspaceKeysResultImpl(ListWorkspaceKeysResultInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ManagedNetworkProvisionStatusImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ManagedNetworkProvisionStatusImpl.java new file mode 100644 index 0000000000000..1f1709890f1af --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ManagedNetworkProvisionStatusImpl.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.resourcemanager.machinelearning.fluent.models.ManagedNetworkProvisionStatusInner; +import com.azure.resourcemanager.machinelearning.models.ManagedNetworkProvisionStatus; +import com.azure.resourcemanager.machinelearning.models.ManagedNetworkStatus; + +public final class ManagedNetworkProvisionStatusImpl implements ManagedNetworkProvisionStatus { + private ManagedNetworkProvisionStatusInner innerObject; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + ManagedNetworkProvisionStatusImpl(ManagedNetworkProvisionStatusInner innerObject, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean sparkReady() { + return this.innerModel().sparkReady(); + } + + public ManagedNetworkStatus status() { + return this.innerModel().status(); + } + + public ManagedNetworkProvisionStatusInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ManagedNetworkProvisionsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ManagedNetworkProvisionsClientImpl.java new file mode 100644 index 0000000000000..116a06278d5e7 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ManagedNetworkProvisionsClientImpl.java @@ -0,0 +1,359 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.ManagedNetworkProvisionsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.ManagedNetworkProvisionStatusInner; +import com.azure.resourcemanager.machinelearning.models.ManagedNetworkProvisionOptions; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ManagedNetworkProvisionsClient. + */ +public final class ManagedNetworkProvisionsClientImpl implements ManagedNetworkProvisionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ManagedNetworkProvisionsService service; + + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of ManagedNetworkProvisionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ManagedNetworkProvisionsClientImpl(AzureMachineLearningServicesImpl client) { + this.service = RestProxy.create(ManagedNetworkProvisionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesManagedNetworkProvisions to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface ManagedNetworkProvisionsService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> provisionManagedNetwork(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ManagedNetworkProvisionOptions body, @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Provisions the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param body Managed Network Provisioning Options for a machine learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of the Provisioning for the managed network of a machine learning workspace along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> provisionManagedNetworkWithResponseAsync(String resourceGroupName, + String workspaceName, ManagedNetworkProvisionOptions body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.provisionManagedNetwork(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Provisions the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param body Managed Network Provisioning Options for a machine learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of the Provisioning for the managed network of a machine learning workspace along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> provisionManagedNetworkWithResponseAsync(String resourceGroupName, + String workspaceName, ManagedNetworkProvisionOptions body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.provisionManagedNetwork(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), body, accept, context); + } + + /** + * Provisions the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param body Managed Network Provisioning Options for a machine learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of status of the Provisioning for the managed network of a machine + * learning workspace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ManagedNetworkProvisionStatusInner> + beginProvisionManagedNetworkAsync(String resourceGroupName, String workspaceName, + ManagedNetworkProvisionOptions body) { + Mono>> mono + = provisionManagedNetworkWithResponseAsync(resourceGroupName, workspaceName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ManagedNetworkProvisionStatusInner.class, + ManagedNetworkProvisionStatusInner.class, this.client.getContext()); + } + + /** + * Provisions the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of status of the Provisioning for the managed network of a machine + * learning workspace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ManagedNetworkProvisionStatusInner> + beginProvisionManagedNetworkAsync(String resourceGroupName, String workspaceName) { + final ManagedNetworkProvisionOptions body = null; + Mono>> mono + = provisionManagedNetworkWithResponseAsync(resourceGroupName, workspaceName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ManagedNetworkProvisionStatusInner.class, + ManagedNetworkProvisionStatusInner.class, this.client.getContext()); + } + + /** + * Provisions the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param body Managed Network Provisioning Options for a machine learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of status of the Provisioning for the managed network of a machine + * learning workspace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ManagedNetworkProvisionStatusInner> + beginProvisionManagedNetworkAsync(String resourceGroupName, String workspaceName, + ManagedNetworkProvisionOptions body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = provisionManagedNetworkWithResponseAsync(resourceGroupName, workspaceName, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ManagedNetworkProvisionStatusInner.class, + ManagedNetworkProvisionStatusInner.class, context); + } + + /** + * Provisions the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of status of the Provisioning for the managed network of a machine + * learning workspace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ManagedNetworkProvisionStatusInner> + beginProvisionManagedNetwork(String resourceGroupName, String workspaceName) { + final ManagedNetworkProvisionOptions body = null; + return this.beginProvisionManagedNetworkAsync(resourceGroupName, workspaceName, body).getSyncPoller(); + } + + /** + * Provisions the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param body Managed Network Provisioning Options for a machine learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of status of the Provisioning for the managed network of a machine + * learning workspace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ManagedNetworkProvisionStatusInner> + beginProvisionManagedNetwork(String resourceGroupName, String workspaceName, + ManagedNetworkProvisionOptions body, Context context) { + return this.beginProvisionManagedNetworkAsync(resourceGroupName, workspaceName, body, context).getSyncPoller(); + } + + /** + * Provisions the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param body Managed Network Provisioning Options for a machine learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of the Provisioning for the managed network of a machine learning workspace on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono provisionManagedNetworkAsync(String resourceGroupName, + String workspaceName, ManagedNetworkProvisionOptions body) { + return beginProvisionManagedNetworkAsync(resourceGroupName, workspaceName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Provisions the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of the Provisioning for the managed network of a machine learning workspace on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono provisionManagedNetworkAsync(String resourceGroupName, + String workspaceName) { + final ManagedNetworkProvisionOptions body = null; + return beginProvisionManagedNetworkAsync(resourceGroupName, workspaceName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Provisions the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param body Managed Network Provisioning Options for a machine learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of the Provisioning for the managed network of a machine learning workspace on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono provisionManagedNetworkAsync(String resourceGroupName, + String workspaceName, ManagedNetworkProvisionOptions body, Context context) { + return beginProvisionManagedNetworkAsync(resourceGroupName, workspaceName, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Provisions the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of the Provisioning for the managed network of a machine learning workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedNetworkProvisionStatusInner provisionManagedNetwork(String resourceGroupName, String workspaceName) { + final ManagedNetworkProvisionOptions body = null; + return provisionManagedNetworkAsync(resourceGroupName, workspaceName, body).block(); + } + + /** + * Provisions the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param body Managed Network Provisioning Options for a machine learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of the Provisioning for the managed network of a machine learning workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedNetworkProvisionStatusInner provisionManagedNetwork(String resourceGroupName, String workspaceName, + ManagedNetworkProvisionOptions body, Context context) { + return provisionManagedNetworkAsync(resourceGroupName, workspaceName, body, context).block(); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ManagedNetworkProvisionsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ManagedNetworkProvisionsImpl.java new file mode 100644 index 0000000000000..f4cf1d1ea9aa9 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ManagedNetworkProvisionsImpl.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.ManagedNetworkProvisionsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.ManagedNetworkProvisionStatusInner; +import com.azure.resourcemanager.machinelearning.models.ManagedNetworkProvisionOptions; +import com.azure.resourcemanager.machinelearning.models.ManagedNetworkProvisions; +import com.azure.resourcemanager.machinelearning.models.ManagedNetworkProvisionStatus; + +public final class ManagedNetworkProvisionsImpl implements ManagedNetworkProvisions { + private static final ClientLogger LOGGER = new ClientLogger(ManagedNetworkProvisionsImpl.class); + + private final ManagedNetworkProvisionsClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public ManagedNetworkProvisionsImpl(ManagedNetworkProvisionsClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ManagedNetworkProvisionStatus provisionManagedNetwork(String resourceGroupName, String workspaceName) { + ManagedNetworkProvisionStatusInner inner + = this.serviceClient().provisionManagedNetwork(resourceGroupName, workspaceName); + if (inner != null) { + return new ManagedNetworkProvisionStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public ManagedNetworkProvisionStatus provisionManagedNetwork(String resourceGroupName, String workspaceName, + ManagedNetworkProvisionOptions body, Context context) { + ManagedNetworkProvisionStatusInner inner + = this.serviceClient().provisionManagedNetwork(resourceGroupName, workspaceName, body, context); + if (inner != null) { + return new ManagedNetworkProvisionStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + private ManagedNetworkProvisionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ManagedNetworkSettingsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ManagedNetworkSettingsImpl.java new file mode 100644 index 0000000000000..5f961f3216330 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ManagedNetworkSettingsImpl.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.resourcemanager.machinelearning.fluent.models.ManagedNetworkProvisionStatusInner; +import com.azure.resourcemanager.machinelearning.fluent.models.ManagedNetworkSettingsInner; +import com.azure.resourcemanager.machinelearning.models.IsolationMode; +import com.azure.resourcemanager.machinelearning.models.ManagedNetworkProvisionStatus; +import com.azure.resourcemanager.machinelearning.models.ManagedNetworkSettings; +import com.azure.resourcemanager.machinelearning.models.OutboundRule; +import java.util.Collections; +import java.util.Map; + +public final class ManagedNetworkSettingsImpl implements ManagedNetworkSettings { + private ManagedNetworkSettingsInner innerObject; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + ManagedNetworkSettingsImpl(ManagedNetworkSettingsInner innerObject, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public IsolationMode isolationMode() { + return this.innerModel().isolationMode(); + } + + public String networkId() { + return this.innerModel().networkId(); + } + + public Map outboundRules() { + Map inner = this.innerModel().outboundRules(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ManagedNetworkProvisionStatus status() { + ManagedNetworkProvisionStatusInner inner = this.innerModel().status(); + if (inner != null) { + return new ManagedNetworkProvisionStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public ManagedNetworkSettingsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ManagedNetworkSettingsRulesClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ManagedNetworkSettingsRulesClientImpl.java new file mode 100644 index 0000000000000..1e79c9d26ece4 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ManagedNetworkSettingsRulesClientImpl.java @@ -0,0 +1,934 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.ManagedNetworkSettingsRulesClient; +import com.azure.resourcemanager.machinelearning.fluent.models.OutboundRuleBasicResourceInner; +import com.azure.resourcemanager.machinelearning.models.OutboundRuleListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ManagedNetworkSettingsRulesClient. + */ +public final class ManagedNetworkSettingsRulesClientImpl implements ManagedNetworkSettingsRulesClient { + /** + * The proxy service used to perform REST calls. + */ + private final ManagedNetworkSettingsRulesService service; + + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of ManagedNetworkSettingsRulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ManagedNetworkSettingsRulesClientImpl(AzureMachineLearningServicesImpl client) { + this.service = RestProxy.create(ManagedNetworkSettingsRulesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesManagedNetworkSettingsRules to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface ManagedNetworkSettingsRulesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("ruleName") String ruleName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("ruleName") String ruleName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("ruleName") String ruleName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") OutboundRuleBasicResourceInner body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists the managed network outbound rules for a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of outbound rules for the managed network of a machine learning workspace along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the managed network outbound rules for a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of outbound rules for the managed network of a machine learning workspace along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists the managed network outbound rules for a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of outbound rules for the managed network of a machine learning workspace as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the managed network outbound rules for a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of outbound rules for the managed network of a machine learning workspace as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the managed network outbound rules for a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of outbound rules for the managed network of a machine learning workspace as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName)); + } + + /** + * Lists the managed network outbound rules for a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of outbound rules for the managed network of a machine learning workspace as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, context)); + } + + /** + * Deletes an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String ruleName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, ruleName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String ruleName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, ruleName, this.client.getApiVersion(), accept, context); + } + + /** + * Deletes an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, + String ruleName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName, ruleName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, + String ruleName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, workspaceName, ruleName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, + String ruleName) { + return this.beginDeleteAsync(resourceGroupName, workspaceName, ruleName).getSyncPoller(); + } + + /** + * Deletes an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, + String ruleName, Context context) { + return this.beginDeleteAsync(resourceGroupName, workspaceName, ruleName, context).getSyncPoller(); + } + + /** + * Deletes an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String ruleName) { + return beginDeleteAsync(resourceGroupName, workspaceName, ruleName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String ruleName, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, ruleName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String ruleName) { + deleteAsync(resourceGroupName, workspaceName, ruleName).block(); + } + + /** + * Deletes an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String ruleName, Context context) { + deleteAsync(resourceGroupName, workspaceName, ruleName, context).block(); + } + + /** + * Gets an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an outbound rule from the managed network of a machine learning workspace along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String workspaceName, String ruleName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, ruleName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an outbound rule from the managed network of a machine learning workspace along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String workspaceName, String ruleName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + ruleName, this.client.getApiVersion(), accept, context); + } + + /** + * Gets an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an outbound rule from the managed network of a machine learning workspace on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, + String ruleName) { + return getWithResponseAsync(resourceGroupName, workspaceName, ruleName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an outbound rule from the managed network of a machine learning workspace along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String workspaceName, + String ruleName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, ruleName, context).block(); + } + + /** + * Gets an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an outbound rule from the managed network of a machine learning workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OutboundRuleBasicResourceInner get(String resourceGroupName, String workspaceName, String ruleName) { + return getWithResponse(resourceGroupName, workspaceName, ruleName, Context.NONE).getValue(); + } + + /** + * Creates or updates an outbound rule in the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param body Outbound Rule to be created or updated in the managed network of a machine learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return outbound Rule Basic Resource for the managed network of a machine learning workspace along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String ruleName, OutboundRuleBasicResourceInner body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, ruleName, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an outbound rule in the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param body Outbound Rule to be created or updated in the managed network of a machine learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return outbound Rule Basic Resource for the managed network of a machine learning workspace along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String ruleName, OutboundRuleBasicResourceInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, ruleName, this.client.getApiVersion(), body, accept, context); + } + + /** + * Creates or updates an outbound rule in the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param body Outbound Rule to be created or updated in the managed network of a machine learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of outbound Rule Basic Resource for the managed network of a machine + * learning workspace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OutboundRuleBasicResourceInner> + beginCreateOrUpdateAsync(String resourceGroupName, String workspaceName, String ruleName, + OutboundRuleBasicResourceInner body) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, ruleName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OutboundRuleBasicResourceInner.class, OutboundRuleBasicResourceInner.class, + this.client.getContext()); + } + + /** + * Creates or updates an outbound rule in the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param body Outbound Rule to be created or updated in the managed network of a machine learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of outbound Rule Basic Resource for the managed network of a machine + * learning workspace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OutboundRuleBasicResourceInner> + beginCreateOrUpdateAsync(String resourceGroupName, String workspaceName, String ruleName, + OutboundRuleBasicResourceInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, ruleName, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OutboundRuleBasicResourceInner.class, OutboundRuleBasicResourceInner.class, + context); + } + + /** + * Creates or updates an outbound rule in the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param body Outbound Rule to be created or updated in the managed network of a machine learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of outbound Rule Basic Resource for the managed network of a machine + * learning workspace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OutboundRuleBasicResourceInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String ruleName, OutboundRuleBasicResourceInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, ruleName, body).getSyncPoller(); + } + + /** + * Creates or updates an outbound rule in the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param body Outbound Rule to be created or updated in the managed network of a machine learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of outbound Rule Basic Resource for the managed network of a machine + * learning workspace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OutboundRuleBasicResourceInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String ruleName, OutboundRuleBasicResourceInner body, + Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, ruleName, body, context).getSyncPoller(); + } + + /** + * Creates or updates an outbound rule in the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param body Outbound Rule to be created or updated in the managed network of a machine learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return outbound Rule Basic Resource for the managed network of a machine learning workspace on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String ruleName, OutboundRuleBasicResourceInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, ruleName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an outbound rule in the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param body Outbound Rule to be created or updated in the managed network of a machine learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return outbound Rule Basic Resource for the managed network of a machine learning workspace on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String ruleName, OutboundRuleBasicResourceInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, ruleName, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an outbound rule in the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param body Outbound Rule to be created or updated in the managed network of a machine learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return outbound Rule Basic Resource for the managed network of a machine learning workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OutboundRuleBasicResourceInner createOrUpdate(String resourceGroupName, String workspaceName, + String ruleName, OutboundRuleBasicResourceInner body) { + return createOrUpdateAsync(resourceGroupName, workspaceName, ruleName, body).block(); + } + + /** + * Creates or updates an outbound rule in the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param body Outbound Rule to be created or updated in the managed network of a machine learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return outbound Rule Basic Resource for the managed network of a machine learning workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OutboundRuleBasicResourceInner createOrUpdate(String resourceGroupName, String workspaceName, + String ruleName, OutboundRuleBasicResourceInner body, Context context) { + return createOrUpdateAsync(resourceGroupName, workspaceName, ruleName, body, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of outbound rules for the managed network of a machine learning workspace along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of outbound rules for the managed network of a machine learning workspace along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ManagedNetworkSettingsRulesImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ManagedNetworkSettingsRulesImpl.java new file mode 100644 index 0000000000000..4e0e44e021e66 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ManagedNetworkSettingsRulesImpl.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.ManagedNetworkSettingsRulesClient; +import com.azure.resourcemanager.machinelearning.fluent.models.OutboundRuleBasicResourceInner; +import com.azure.resourcemanager.machinelearning.models.ManagedNetworkSettingsRules; +import com.azure.resourcemanager.machinelearning.models.OutboundRuleBasicResource; + +public final class ManagedNetworkSettingsRulesImpl implements ManagedNetworkSettingsRules { + private static final ClientLogger LOGGER = new ClientLogger(ManagedNetworkSettingsRulesImpl.class); + + private final ManagedNetworkSettingsRulesClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public ManagedNetworkSettingsRulesImpl(ManagedNetworkSettingsRulesClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OutboundRuleBasicResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OutboundRuleBasicResourceImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String workspaceName, String ruleName) { + this.serviceClient().delete(resourceGroupName, workspaceName, ruleName); + } + + public void delete(String resourceGroupName, String workspaceName, String ruleName, Context context) { + this.serviceClient().delete(resourceGroupName, workspaceName, ruleName, context); + } + + public Response getWithResponse(String resourceGroupName, String workspaceName, + String ruleName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, ruleName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new OutboundRuleBasicResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public OutboundRuleBasicResource get(String resourceGroupName, String workspaceName, String ruleName) { + OutboundRuleBasicResourceInner inner = this.serviceClient().get(resourceGroupName, workspaceName, ruleName); + if (inner != null) { + return new OutboundRuleBasicResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public OutboundRuleBasicResource getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String ruleName = ResourceManagerUtils.getValueFromIdByName(id, "outboundRules"); + if (ruleName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'outboundRules'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, ruleName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String ruleName = ResourceManagerUtils.getValueFromIdByName(id, "outboundRules"); + if (ruleName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'outboundRules'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, ruleName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String ruleName = ResourceManagerUtils.getValueFromIdByName(id, "outboundRules"); + if (ruleName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'outboundRules'.", id))); + } + this.delete(resourceGroupName, workspaceName, ruleName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String ruleName = ResourceManagerUtils.getValueFromIdByName(id, "outboundRules"); + if (ruleName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'outboundRules'.", id))); + } + this.delete(resourceGroupName, workspaceName, ruleName, context); + } + + private ManagedNetworkSettingsRulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + public OutboundRuleBasicResourceImpl define(String name) { + return new OutboundRuleBasicResourceImpl(name, this.manager()); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/MarketplaceSubscriptionImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/MarketplaceSubscriptionImpl.java new file mode 100644 index 0000000000000..57985f853d60c --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/MarketplaceSubscriptionImpl.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.MarketplaceSubscriptionInner; +import com.azure.resourcemanager.machinelearning.models.MarketplaceSubscription; +import com.azure.resourcemanager.machinelearning.models.MarketplaceSubscriptionProperties; + +public final class MarketplaceSubscriptionImpl + implements MarketplaceSubscription, MarketplaceSubscription.Definition, MarketplaceSubscription.Update { + private MarketplaceSubscriptionInner innerObject; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public MarketplaceSubscriptionProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public MarketplaceSubscriptionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String name; + + public MarketplaceSubscriptionImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public MarketplaceSubscription create() { + this.innerObject = serviceManager.serviceClient() + .getMarketplaceSubscriptions() + .createOrUpdate(resourceGroupName, workspaceName, name, this.innerModel(), Context.NONE); + return this; + } + + public MarketplaceSubscription create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getMarketplaceSubscriptions() + .createOrUpdate(resourceGroupName, workspaceName, name, this.innerModel(), context); + return this; + } + + MarketplaceSubscriptionImpl(String name, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = new MarketplaceSubscriptionInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public MarketplaceSubscriptionImpl update() { + return this; + } + + public MarketplaceSubscription apply() { + this.innerObject = serviceManager.serviceClient() + .getMarketplaceSubscriptions() + .createOrUpdate(resourceGroupName, workspaceName, name, this.innerModel(), Context.NONE); + return this; + } + + public MarketplaceSubscription apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getMarketplaceSubscriptions() + .createOrUpdate(resourceGroupName, workspaceName, name, this.innerModel(), context); + return this; + } + + MarketplaceSubscriptionImpl(MarketplaceSubscriptionInner innerObject, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "marketplaceSubscriptions"); + } + + public MarketplaceSubscription refresh() { + this.innerObject = serviceManager.serviceClient() + .getMarketplaceSubscriptions() + .getWithResponse(resourceGroupName, workspaceName, name, Context.NONE) + .getValue(); + return this; + } + + public MarketplaceSubscription refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getMarketplaceSubscriptions() + .getWithResponse(resourceGroupName, workspaceName, name, context) + .getValue(); + return this; + } + + public MarketplaceSubscriptionImpl withProperties(MarketplaceSubscriptionProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/MarketplaceSubscriptionsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/MarketplaceSubscriptionsClientImpl.java new file mode 100644 index 0000000000000..1aa823de82c2c --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/MarketplaceSubscriptionsClientImpl.java @@ -0,0 +1,944 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.MarketplaceSubscriptionsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.MarketplaceSubscriptionInner; +import com.azure.resourcemanager.machinelearning.models.MarketplaceSubscriptionResourceArmPaginatedResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in MarketplaceSubscriptionsClient. + */ +public final class MarketplaceSubscriptionsClientImpl implements MarketplaceSubscriptionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final MarketplaceSubscriptionsService service; + + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of MarketplaceSubscriptionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MarketplaceSubscriptionsClientImpl(AzureMachineLearningServicesImpl client) { + this.service = RestProxy.create(MarketplaceSubscriptionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesMarketplaceSubscriptions to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface MarketplaceSubscriptionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @QueryParam("$skip") String skip, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") MarketplaceSubscriptionInner body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of MarketplaceSubscription entities along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, String skip) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), skip, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of MarketplaceSubscription entities along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, String skip, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + this.client.getApiVersion(), skip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of MarketplaceSubscription entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + String skip) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skip), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of MarketplaceSubscription entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + final String skip = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skip), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of MarketplaceSubscription entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + String skip, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skip, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of MarketplaceSubscription entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + final String skip = null; + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, skip)); + } + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of MarketplaceSubscription entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, String skip, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, skip, context)); + } + + /** + * Delete Marketplace Subscription (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Marketplace Subscription name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete Marketplace Subscription (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Marketplace Subscription name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, this.client.getApiVersion(), accept, context); + } + + /** + * Delete Marketplace Subscription (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Marketplace Subscription name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, + String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete Marketplace Subscription (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Marketplace Subscription name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, + String name, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, workspaceName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete Marketplace Subscription (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Marketplace Subscription name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String name) { + return this.beginDeleteAsync(resourceGroupName, workspaceName, name).getSyncPoller(); + } + + /** + * Delete Marketplace Subscription (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Marketplace Subscription name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String name, + Context context) { + return this.beginDeleteAsync(resourceGroupName, workspaceName, name, context).getSyncPoller(); + } + + /** + * Delete Marketplace Subscription (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Marketplace Subscription name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String name) { + return beginDeleteAsync(resourceGroupName, workspaceName, name).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete Marketplace Subscription (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Marketplace Subscription name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, name, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete Marketplace Subscription (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Marketplace Subscription name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String name) { + deleteAsync(resourceGroupName, workspaceName, name).block(); + } + + /** + * Delete Marketplace Subscription (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Marketplace Subscription name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String name, Context context) { + deleteAsync(resourceGroupName, workspaceName, name, context).block(); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String workspaceName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String workspaceName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + name, this.client.getApiVersion(), accept, context); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String name) { + return getWithResponseAsync(resourceGroupName, workspaceName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String workspaceName, + String name, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, name, context).block(); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MarketplaceSubscriptionInner get(String resourceGroupName, String workspaceName, String name) { + return getWithResponse(resourceGroupName, workspaceName, name, Context.NONE).getValue(); + } + + /** + * Create or update Marketplace Subscription (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Marketplace Subscription name. + * @param body Marketplace Subscription entity to apply during operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String name, MarketplaceSubscriptionInner body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update Marketplace Subscription (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Marketplace Subscription name. + * @param body Marketplace Subscription entity to apply during operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String name, MarketplaceSubscriptionInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, this.client.getApiVersion(), body, accept, context); + } + + /** + * Create or update Marketplace Subscription (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Marketplace Subscription name. + * @param body Marketplace Subscription entity to apply during operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MarketplaceSubscriptionInner> beginCreateOrUpdateAsync( + String resourceGroupName, String workspaceName, String name, MarketplaceSubscriptionInner body) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), MarketplaceSubscriptionInner.class, MarketplaceSubscriptionInner.class, + this.client.getContext()); + } + + /** + * Create or update Marketplace Subscription (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Marketplace Subscription name. + * @param body Marketplace Subscription entity to apply during operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MarketplaceSubscriptionInner> beginCreateOrUpdateAsync( + String resourceGroupName, String workspaceName, String name, MarketplaceSubscriptionInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), MarketplaceSubscriptionInner.class, MarketplaceSubscriptionInner.class, + context); + } + + /** + * Create or update Marketplace Subscription (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Marketplace Subscription name. + * @param body Marketplace Subscription entity to apply during operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MarketplaceSubscriptionInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String name, MarketplaceSubscriptionInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, body).getSyncPoller(); + } + + /** + * Create or update Marketplace Subscription (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Marketplace Subscription name. + * @param body Marketplace Subscription entity to apply during operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MarketplaceSubscriptionInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String name, MarketplaceSubscriptionInner body, + Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, body, context).getSyncPoller(); + } + + /** + * Create or update Marketplace Subscription (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Marketplace Subscription name. + * @param body Marketplace Subscription entity to apply during operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String name, MarketplaceSubscriptionInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update Marketplace Subscription (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Marketplace Subscription name. + * @param body Marketplace Subscription entity to apply during operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String name, MarketplaceSubscriptionInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update Marketplace Subscription (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Marketplace Subscription name. + * @param body Marketplace Subscription entity to apply during operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MarketplaceSubscriptionInner createOrUpdate(String resourceGroupName, String workspaceName, String name, + MarketplaceSubscriptionInner body) { + return createOrUpdateAsync(resourceGroupName, workspaceName, name, body).block(); + } + + /** + * Create or update Marketplace Subscription (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Marketplace Subscription name. + * @param body Marketplace Subscription entity to apply during operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MarketplaceSubscriptionInner createOrUpdate(String resourceGroupName, String workspaceName, String name, + MarketplaceSubscriptionInner body, Context context) { + return createOrUpdateAsync(resourceGroupName, workspaceName, name, body, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of MarketplaceSubscription entities along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of MarketplaceSubscription entities along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/MarketplaceSubscriptionsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/MarketplaceSubscriptionsImpl.java new file mode 100644 index 0000000000000..6ff1a2cd38b08 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/MarketplaceSubscriptionsImpl.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.MarketplaceSubscriptionsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.MarketplaceSubscriptionInner; +import com.azure.resourcemanager.machinelearning.models.MarketplaceSubscription; +import com.azure.resourcemanager.machinelearning.models.MarketplaceSubscriptions; + +public final class MarketplaceSubscriptionsImpl implements MarketplaceSubscriptions { + private static final ClientLogger LOGGER = new ClientLogger(MarketplaceSubscriptionsImpl.class); + + private final MarketplaceSubscriptionsClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public MarketplaceSubscriptionsImpl(MarketplaceSubscriptionsClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MarketplaceSubscriptionImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String skip, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, skip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MarketplaceSubscriptionImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String workspaceName, String name) { + this.serviceClient().delete(resourceGroupName, workspaceName, name); + } + + public void delete(String resourceGroupName, String workspaceName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, workspaceName, name, context); + } + + public Response getWithResponse(String resourceGroupName, String workspaceName, + String name, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new MarketplaceSubscriptionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public MarketplaceSubscription get(String resourceGroupName, String workspaceName, String name) { + MarketplaceSubscriptionInner inner = this.serviceClient().get(resourceGroupName, workspaceName, name); + if (inner != null) { + return new MarketplaceSubscriptionImpl(inner, this.manager()); + } else { + return null; + } + } + + public MarketplaceSubscription getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "marketplaceSubscriptions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'marketplaceSubscriptions'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "marketplaceSubscriptions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'marketplaceSubscriptions'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "marketplaceSubscriptions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'marketplaceSubscriptions'.", id))); + } + this.delete(resourceGroupName, workspaceName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "marketplaceSubscriptions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'marketplaceSubscriptions'.", id))); + } + this.delete(resourceGroupName, workspaceName, name, context); + } + + private MarketplaceSubscriptionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + public MarketplaceSubscriptionImpl define(String name) { + return new MarketplaceSubscriptionImpl(name, this.manager()); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelContainerImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelContainerImpl.java index dc2e9e476a07f..470818200770d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelContainerImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelContainerImpl.java @@ -49,40 +49,34 @@ private com.azure.resourcemanager.machinelearning.MachineLearningManager manager private String resourceGroupName; - private String workspaceName; + private String registryName; - private String name; + private String modelName; - public ModelContainerImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + public ModelContainerImpl withExistingRegistry(String resourceGroupName, String registryName) { this.resourceGroupName = resourceGroupName; - this.workspaceName = workspaceName; + this.registryName = registryName; return this; } public ModelContainer create() { - this.innerObject = - serviceManager - .serviceClient() - .getModelContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryModelContainers() + .createOrUpdate(resourceGroupName, registryName, modelName, this.innerModel(), Context.NONE); return this; } public ModelContainer create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getModelContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryModelContainers() + .createOrUpdate(resourceGroupName, registryName, modelName, this.innerModel(), context); return this; } ModelContainerImpl(String name, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = new ModelContainerInner(); this.serviceManager = serviceManager; - this.name = name; + this.modelName = name; } public ModelContainerImpl update() { @@ -90,52 +84,41 @@ public ModelContainerImpl update() { } public ModelContainer apply() { - this.innerObject = - serviceManager - .serviceClient() - .getModelContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryModelContainers() + .createOrUpdate(resourceGroupName, registryName, modelName, this.innerModel(), Context.NONE); return this; } public ModelContainer apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getModelContainers() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryModelContainers() + .createOrUpdate(resourceGroupName, registryName, modelName, this.innerModel(), context); return this; } - ModelContainerImpl( - ModelContainerInner innerObject, + ModelContainerImpl(ModelContainerInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); - this.name = Utils.getValueFromIdByName(innerObject.id(), "models"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.registryName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "registries"); + this.modelName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "models"); } public ModelContainer refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getModelContainers() - .getWithResponse(resourceGroupName, workspaceName, name, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryModelContainers() + .getWithResponse(resourceGroupName, registryName, modelName, Context.NONE) + .getValue(); return this; } public ModelContainer refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getModelContainers() - .getWithResponse(resourceGroupName, workspaceName, name, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryModelContainers() + .getWithResponse(resourceGroupName, registryName, modelName, context) + .getValue(); return this; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelContainersClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelContainersClientImpl.java index 85257b0ad80f5..2b2b2453c96eb 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelContainersClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelContainersClientImpl.java @@ -34,113 +34,92 @@ import com.azure.resourcemanager.machinelearning.models.ModelContainerResourceArmPaginatedResult; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ModelContainersClient. */ +/** + * An instance of this class provides access to all the operations defined in ModelContainersClient. + */ public final class ModelContainersClientImpl implements ModelContainersClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final ModelContainersService service; - /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of ModelContainersClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ - ModelContainersClientImpl(AzureMachineLearningWorkspacesImpl client) { - this.service = - RestProxy.create(ModelContainersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + ModelContainersClientImpl(AzureMachineLearningServicesImpl client) { + this.service + = RestProxy.create(ModelContainersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesModelContainers to be used by the proxy + * The interface defining all the services for AzureMachineLearningServicesModelContainers to be used by the proxy * service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AzureMachineLearning") public interface ModelContainersService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, + Mono> list(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @QueryParam("api-version") String apiVersion, - @QueryParam("$skip") String skip, - @QueryParam("count") Integer count, - @QueryParam("listViewType") ListViewType listViewType, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}") - @ExpectedResponses({200, 204}) + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @QueryParam("$skip") String skip, + @QueryParam("count") Integer count, @QueryParam("listViewType") ListViewType listViewType, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, + Mono> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, + Mono> createOrUpdate(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ModelContainerInner body, - @HeaderParam("Accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ModelContainerInner body, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * List model containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -150,22 +129,18 @@ Mono> listNext( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of ModelContainer entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String workspaceName, String skip, Integer count, ListViewType listViewType) { + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String skip, Integer count, ListViewType listViewType) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -177,34 +152,16 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - this.client.getApiVersion(), - skip, - count, - listViewType, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), skip, count, listViewType, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List model containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -215,27 +172,18 @@ private Mono> listSinglePageAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of ModelContainer entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String workspaceName, - String skip, - Integer count, - ListViewType listViewType, - Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String skip, Integer count, ListViewType listViewType, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -247,31 +195,15 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - this.client.getApiVersion(), - skip, - count, - listViewType, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + this.client.getApiVersion(), skip, count, listViewType, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List model containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -283,16 +215,15 @@ private Mono> listSinglePageAsync( * @return a paginated list of ModelContainer entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String workspaceName, String skip, Integer count, ListViewType listViewType) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, skip, count, listViewType), + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String skip, + Integer count, ListViewType listViewType) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skip, count, listViewType), nextLink -> listNextSinglePageAsync(nextLink)); } /** * List model containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -305,14 +236,13 @@ private PagedFlux listAsync(String resourceGroupName, Strin final String skip = null; final Integer count = null; final ListViewType listViewType = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, skip, count, listViewType), + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skip, count, listViewType), nextLink -> listNextSinglePageAsync(nextLink)); } /** * List model containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -325,13 +255,8 @@ private PagedFlux listAsync(String resourceGroupName, Strin * @return a paginated list of ModelContainer entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String workspaceName, - String skip, - Integer count, - ListViewType listViewType, - Context context) { + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String skip, + Integer count, ListViewType listViewType, Context context) { return new PagedFlux<>( () -> listSinglePageAsync(resourceGroupName, workspaceName, skip, count, listViewType, context), nextLink -> listNextSinglePageAsync(nextLink, context)); @@ -339,7 +264,7 @@ private PagedFlux listAsync( /** * List model containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -357,7 +282,7 @@ public PagedIterable list(String resourceGroupName, String /** * List model containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -370,19 +295,14 @@ public PagedIterable list(String resourceGroupName, String * @return a paginated list of ModelContainer entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, - String workspaceName, - String skip, - Integer count, - ListViewType listViewType, - Context context) { + public PagedIterable list(String resourceGroupName, String workspaceName, String skip, + Integer count, ListViewType listViewType, Context context) { return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, skip, count, listViewType, context)); } /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -394,16 +314,12 @@ public PagedIterable list( @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, String name) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -417,24 +333,14 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -445,19 +351,15 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String name, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, String name, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -471,21 +373,13 @@ private Mono> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, this.client.getApiVersion(), accept, context); } /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -501,7 +395,7 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -512,14 +406,14 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String name, Context context) { + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String name, + Context context) { return deleteWithResponseAsync(resourceGroupName, workspaceName, name, context).block(); } /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -534,7 +428,7 @@ public void delete(String resourceGroupName, String workspaceName, String name) /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -544,19 +438,15 @@ public void delete(String resourceGroupName, String workspaceName, String name) * @return container along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String name) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String name) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -570,24 +460,14 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -598,19 +478,15 @@ private Mono> getWithResponseAsync( * @return container along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String name, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String name, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -624,21 +500,13 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + name, this.client.getApiVersion(), accept, context); } /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -655,7 +523,7 @@ private Mono getAsync(String resourceGroupName, String work /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -666,14 +534,14 @@ private Mono getAsync(String resourceGroupName, String work * @return container along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String name, Context context) { + public Response getWithResponse(String resourceGroupName, String workspaceName, String name, + Context context) { return getWithResponseAsync(resourceGroupName, workspaceName, name, context).block(); } /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -689,7 +557,7 @@ public ModelContainerInner get(String resourceGroupName, String workspaceName, S /** * Create or update container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -697,23 +565,19 @@ public ModelContainerInner get(String resourceGroupName, String workspaceName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link - * Mono}. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String workspaceName, String name, ModelContainerInner body) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String name, ModelContainerInner body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -732,25 +596,14 @@ private Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - body, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or update container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -759,23 +612,19 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link - * Mono}. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String workspaceName, String name, ModelContainerInner body, Context context) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String name, ModelContainerInner body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -794,22 +643,13 @@ private Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - body, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, this.client.getApiVersion(), body, accept, context); } /** * Create or update container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -820,15 +660,15 @@ private Mono> createOrUpdateWithResponseAsync( * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String workspaceName, String name, ModelContainerInner body) { + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, String name, + ModelContainerInner body) { return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, body) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Create or update container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -840,14 +680,14 @@ private Mono createOrUpdateAsync( * @return azure Resource Manager resource envelope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, String workspaceName, String name, ModelContainerInner body, Context context) { + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String name, ModelContainerInner body, Context context) { return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, body, context).block(); } /** * Create or update container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -858,21 +698,20 @@ public Response createOrUpdateWithResponse( * @return azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ModelContainerInner createOrUpdate( - String resourceGroupName, String workspaceName, String name, ModelContainerInner body) { + public ModelContainerInner createOrUpdate(String resourceGroupName, String workspaceName, String name, + ModelContainerInner body) { return createOrUpdateWithResponse(resourceGroupName, workspaceName, name, body, Context.NONE).getValue(); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of ModelContainer entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -880,37 +719,26 @@ private Mono> listNextSinglePageAsync(String return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of ModelContainer entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -918,23 +746,13 @@ private Mono> listNextSinglePageAsync(String return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelContainersImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelContainersImpl.java index d45d40ce56ae0..d306fddea8716 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelContainersImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelContainersImpl.java @@ -22,8 +22,7 @@ public final class ModelContainersImpl implements ModelContainers { private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - public ModelContainersImpl( - ModelContainersClient innerClient, + public ModelContainersImpl(ModelContainersClient innerClient, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -31,23 +30,18 @@ public ModelContainersImpl( public PagedIterable list(String resourceGroupName, String workspaceName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); - return Utils.mapPage(inner, inner1 -> new ModelContainerImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ModelContainerImpl(inner1, this.manager())); } - public PagedIterable list( - String resourceGroupName, - String workspaceName, - String skip, - Integer count, - ListViewType listViewType, - Context context) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, workspaceName, skip, count, listViewType, context); - return Utils.mapPage(inner, inner1 -> new ModelContainerImpl(inner1, this.manager())); + public PagedIterable list(String resourceGroupName, String workspaceName, String skip, + Integer count, ListViewType listViewType, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, skip, count, listViewType, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ModelContainerImpl(inner1, this.manager())); } - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String name, Context context) { + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String name, + Context context) { return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, name, context); } @@ -55,15 +49,12 @@ public void delete(String resourceGroupName, String workspaceName, String name) this.serviceClient().delete(resourceGroupName, workspaceName, name); } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String name, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, workspaceName, name, context); + public Response getWithResponse(String resourceGroupName, String workspaceName, String name, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, name, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ModelContainerImpl(inner.getValue(), this.manager())); } else { return null; @@ -79,108 +70,26 @@ public ModelContainer get(String resourceGroupName, String workspaceName, String } } - public ModelContainer getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "models"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'models'.", id))); - } - return this.getWithResponse(resourceGroupName, workspaceName, name, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "models"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'models'.", id))); - } - return this.getWithResponse(resourceGroupName, workspaceName, name, context); - } - - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "models"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'models'.", id))); + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String name, ModelContainerInner body, Context context) { + Response inner + = this.serviceClient().createOrUpdateWithResponse(resourceGroupName, workspaceName, name, body, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ModelContainerImpl(inner.getValue(), this.manager())); + } else { + return null; } - this.deleteWithResponse(resourceGroupName, workspaceName, name, Context.NONE); } - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "models"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'models'.", id))); + public ModelContainer createOrUpdate(String resourceGroupName, String workspaceName, String name, + ModelContainerInner body) { + ModelContainerInner inner = this.serviceClient().createOrUpdate(resourceGroupName, workspaceName, name, body); + if (inner != null) { + return new ModelContainerImpl(inner, this.manager()); + } else { + return null; } - return this.deleteWithResponse(resourceGroupName, workspaceName, name, context); } private ModelContainersClient serviceClient() { @@ -190,8 +99,4 @@ private ModelContainersClient serviceClient() { private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { return this.serviceManager; } - - public ModelContainerImpl define(String name) { - return new ModelContainerImpl(name, this.manager()); - } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelVersionImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelVersionImpl.java index 8d4bf21616863..3af95506f6504 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelVersionImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelVersionImpl.java @@ -4,11 +4,14 @@ package com.azure.resourcemanager.machinelearning.implementation; +import com.azure.core.http.rest.Response; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.machinelearning.fluent.models.ModelVersionInner; import com.azure.resourcemanager.machinelearning.models.ModelVersion; import com.azure.resourcemanager.machinelearning.models.ModelVersionProperties; +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; +import com.azure.resourcemanager.machinelearning.models.PendingUploadResponseDto; public final class ModelVersionImpl implements ModelVersion, ModelVersion.Definition, ModelVersion.Update { private ModelVersionInner innerObject; @@ -49,37 +52,30 @@ private com.azure.resourcemanager.machinelearning.MachineLearningManager manager private String resourceGroupName; - private String workspaceName; + private String registryName; - private String name; + private String modelName; private String version; - public ModelVersionImpl withExistingModel(String resourceGroupName, String workspaceName, String name) { + public ModelVersionImpl withExistingModel(String resourceGroupName, String registryName, String modelName) { this.resourceGroupName = resourceGroupName; - this.workspaceName = workspaceName; - this.name = name; + this.registryName = registryName; + this.modelName = modelName; return this; } public ModelVersion create() { - this.innerObject = - serviceManager - .serviceClient() - .getModelVersions() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, name, version, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryModelVersions() + .createOrUpdate(resourceGroupName, registryName, modelName, version, this.innerModel(), Context.NONE); return this; } public ModelVersion create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getModelVersions() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, version, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryModelVersions() + .createOrUpdate(resourceGroupName, registryName, modelName, version, this.innerModel(), context); return this; } @@ -94,57 +90,57 @@ public ModelVersionImpl update() { } public ModelVersion apply() { - this.innerObject = - serviceManager - .serviceClient() - .getModelVersions() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, name, version, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryModelVersions() + .createOrUpdate(resourceGroupName, registryName, modelName, version, this.innerModel(), Context.NONE); return this; } public ModelVersion apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getModelVersions() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, version, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryModelVersions() + .createOrUpdate(resourceGroupName, registryName, modelName, version, this.innerModel(), context); return this; } - ModelVersionImpl( - ModelVersionInner innerObject, + ModelVersionImpl(ModelVersionInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); - this.name = Utils.getValueFromIdByName(innerObject.id(), "models"); - this.version = Utils.getValueFromIdByName(innerObject.id(), "versions"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.registryName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "registries"); + this.modelName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "models"); + this.version = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "versions"); } public ModelVersion refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getModelVersions() - .getWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryModelVersions() + .getWithResponse(resourceGroupName, registryName, modelName, version, Context.NONE) + .getValue(); return this; } public ModelVersion refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getModelVersions() - .getWithResponse(resourceGroupName, workspaceName, name, version, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getRegistryModelVersions() + .getWithResponse(resourceGroupName, registryName, modelName, version, context) + .getValue(); return this; } + public Response createOrGetStartPendingUploadWithResponse(PendingUploadRequestDto body, + Context context) { + return serviceManager.registryModelVersions() + .createOrGetStartPendingUploadWithResponse(resourceGroupName, registryName, modelName, version, body, + context); + } + + public PendingUploadResponseDto createOrGetStartPendingUpload(PendingUploadRequestDto body) { + return serviceManager.registryModelVersions() + .createOrGetStartPendingUpload(resourceGroupName, registryName, modelName, version, body); + } + public ModelVersionImpl withProperties(ModelVersionProperties properties) { this.innerModel().withProperties(properties); return this; diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelVersionsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelVersionsClientImpl.java index 7c3ba0c615b06..552a03580e906 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelVersionsClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelVersionsClientImpl.java @@ -13,6 +13,7 @@ import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -26,132 +27,121 @@ import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.machinelearning.fluent.ModelVersionsClient; import com.azure.resourcemanager.machinelearning.fluent.models.ModelVersionInner; +import com.azure.resourcemanager.machinelearning.models.DestinationAsset; import com.azure.resourcemanager.machinelearning.models.ListViewType; import com.azure.resourcemanager.machinelearning.models.ModelVersionResourceArmPaginatedResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ModelVersionsClient. */ +/** + * An instance of this class provides access to all the operations defined in ModelVersionsClient. + */ public final class ModelVersionsClientImpl implements ModelVersionsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final ModelVersionsService service; - /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of ModelVersionsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ - ModelVersionsClientImpl(AzureMachineLearningWorkspacesImpl client) { - this.service = - RestProxy.create(ModelVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + ModelVersionsClientImpl(AzureMachineLearningServicesImpl client) { + this.service + = RestProxy.create(ModelVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesModelVersions to be used by the proxy + * The interface defining all the services for AzureMachineLearningServicesModelVersions to be used by the proxy * service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AzureMachineLearning") public interface ModelVersionsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, + Mono> list(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @QueryParam("$skip") String skip, - @QueryParam("$orderBy") String orderBy, - @QueryParam("$top") Integer top, - @QueryParam("version") String version, - @QueryParam("description") String description, - @QueryParam("offset") Integer offset, - @QueryParam("tags") String tags, - @QueryParam("properties") String properties, - @QueryParam("feed") String feed, - @QueryParam("listViewType") ListViewType listViewType, - @HeaderParam("Accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @QueryParam("$skip") String skip, @QueryParam("$orderBy") String orderBy, @QueryParam("$top") Integer top, + @QueryParam("version") String version, @QueryParam("description") String description, + @QueryParam("offset") Integer offset, @QueryParam("tags") String tags, + @QueryParam("properties") String properties, @QueryParam("feed") String feed, + @QueryParam("listViewType") ListViewType listViewType, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, + Mono> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @PathParam("version") String version, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @PathParam("version") String version, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, + Mono> createOrUpdate(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @PathParam("version") String version, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ModelVersionInner body, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") ModelVersionInner body, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/publish") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> publish(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") DestinationAsset body, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * List model versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Model name. This is case-sensitive. @@ -169,34 +159,19 @@ Mono> listNext( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of ModelVersion entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String workspaceName, - String name, - String skip, - String orderBy, - Integer top, - String version, - String description, - Integer offset, - String tags, - String properties, - String feed, - ListViewType listViewType) { + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String name, String skip, String orderBy, Integer top, String version, String description, Integer offset, + String tags, String properties, String feed, ListViewType listViewType) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -210,43 +185,17 @@ private Mono> listSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - skip, - orderBy, - top, - version, - description, - offset, - tags, - properties, - feed, - listViewType, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), skip, orderBy, top, version, + description, offset, tags, properties, feed, listViewType, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List model versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Model name. This is case-sensitive. @@ -265,35 +214,19 @@ private Mono> listSinglePageAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of ModelVersion entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String workspaceName, - String name, - String skip, - String orderBy, - Integer top, - String version, - String description, - Integer offset, - String tags, - String properties, - String feed, - ListViewType listViewType, - Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String name, String skip, String orderBy, Integer top, String version, String description, Integer offset, + String tags, String properties, String feed, ListViewType listViewType, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -308,39 +241,16 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - skip, - orderBy, - top, - version, - description, - offset, - tags, - properties, - feed, - listViewType, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, name, + this.client.getApiVersion(), skip, orderBy, top, version, description, offset, tags, properties, feed, + listViewType, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List model versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Model name. This is case-sensitive. @@ -360,42 +270,17 @@ private Mono> listSinglePageAsync( * @return a paginated list of ModelVersion entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String workspaceName, - String name, - String skip, - String orderBy, - Integer top, - String version, - String description, - Integer offset, - String tags, - String properties, - String feed, - ListViewType listViewType) { - return new PagedFlux<>( - () -> - listSinglePageAsync( - resourceGroupName, - workspaceName, - name, - skip, - orderBy, - top, - version, - description, - offset, - tags, - properties, - feed, - listViewType), + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String name, + String skip, String orderBy, Integer top, String version, String description, Integer offset, String tags, + String properties, String feed, ListViewType listViewType) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, name, skip, orderBy, top, + version, description, offset, tags, properties, feed, listViewType), nextLink -> listNextSinglePageAsync(nextLink)); } /** * List model versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Model name. This is case-sensitive. @@ -416,28 +301,14 @@ private PagedFlux listAsync(String resourceGroupName, String final String properties = null; final String feed = null; final ListViewType listViewType = null; - return new PagedFlux<>( - () -> - listSinglePageAsync( - resourceGroupName, - workspaceName, - name, - skip, - orderBy, - top, - version, - description, - offset, - tags, - properties, - feed, - listViewType), + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, name, skip, orderBy, top, + version, description, offset, tags, properties, feed, listViewType), nextLink -> listNextSinglePageAsync(nextLink)); } /** * List model versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Model name. This is case-sensitive. @@ -458,44 +329,18 @@ private PagedFlux listAsync(String resourceGroupName, String * @return a paginated list of ModelVersion entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String workspaceName, - String name, - String skip, - String orderBy, - Integer top, - String version, - String description, - Integer offset, - String tags, - String properties, - String feed, - ListViewType listViewType, - Context context) { + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String name, + String skip, String orderBy, Integer top, String version, String description, Integer offset, String tags, + String properties, String feed, ListViewType listViewType, Context context) { return new PagedFlux<>( - () -> - listSinglePageAsync( - resourceGroupName, - workspaceName, - name, - skip, - orderBy, - top, - version, - description, - offset, - tags, - properties, - feed, - listViewType, - context), + () -> listSinglePageAsync(resourceGroupName, workspaceName, name, skip, orderBy, top, version, description, + offset, tags, properties, feed, listViewType, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * List model versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Model name. This is case-sensitive. @@ -516,26 +361,13 @@ public PagedIterable list(String resourceGroupName, String wo final String properties = null; final String feed = null; final ListViewType listViewType = null; - return new PagedIterable<>( - listAsync( - resourceGroupName, - workspaceName, - name, - skip, - orderBy, - top, - version, - description, - offset, - tags, - properties, - feed, - listViewType)); + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, name, skip, orderBy, top, version, + description, offset, tags, properties, feed, listViewType)); } /** * List model versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Model name. This is case-sensitive. @@ -556,42 +388,16 @@ public PagedIterable list(String resourceGroupName, String wo * @return a paginated list of ModelVersion entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, - String workspaceName, - String name, - String skip, - String orderBy, - Integer top, - String version, - String description, - Integer offset, - String tags, - String properties, - String feed, - ListViewType listViewType, - Context context) { - return new PagedIterable<>( - listAsync( - resourceGroupName, - workspaceName, - name, - skip, - orderBy, - top, - version, - description, - offset, - tags, - properties, - feed, - listViewType, - context)); + public PagedIterable list(String resourceGroupName, String workspaceName, String name, + String skip, String orderBy, Integer top, String version, String description, Integer offset, String tags, + String properties, String feed, ListViewType listViewType, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, name, skip, orderBy, top, version, + description, offset, tags, properties, feed, listViewType, context)); } /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -602,19 +408,15 @@ public PagedIterable list( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String name, String version) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, String name, + String version) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -631,25 +433,14 @@ private Mono> deleteWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - version, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, version, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -661,19 +452,15 @@ private Mono> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String name, String version, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, String name, + String version, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -690,22 +477,13 @@ private Mono> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - version, - this.client.getApiVersion(), - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, version, this.client.getApiVersion(), accept, context); } /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -723,7 +501,7 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -735,14 +513,14 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context) { + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String name, + String version, Context context) { return deleteWithResponseAsync(resourceGroupName, workspaceName, name, version, context).block(); } /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -758,7 +536,7 @@ public void delete(String resourceGroupName, String workspaceName, String name, /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -769,19 +547,15 @@ public void delete(String resourceGroupName, String workspaceName, String name, * @return version along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String name, String version) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String name, String version) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -798,25 +572,14 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - version, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, version, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -828,19 +591,15 @@ private Mono> getWithResponseAsync( * @return version along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String name, String version, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String name, String version, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -857,22 +616,13 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - version, - this.client.getApiVersion(), - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + name, version, this.client.getApiVersion(), accept, context); } /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -883,15 +633,15 @@ private Mono> getWithResponseAsync( * @return version on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String workspaceName, String name, String version) { + private Mono getAsync(String resourceGroupName, String workspaceName, String name, + String version) { return getWithResponseAsync(resourceGroupName, workspaceName, name, version) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -903,14 +653,14 @@ private Mono getAsync( * @return version along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context) { + public Response getWithResponse(String resourceGroupName, String workspaceName, String name, + String version, Context context) { return getWithResponseAsync(resourceGroupName, workspaceName, name, version, context).block(); } /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -927,7 +677,7 @@ public ModelVersionInner get(String resourceGroupName, String workspaceName, Str /** * Create or update version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -936,23 +686,19 @@ public ModelVersionInner get(String resourceGroupName, String workspaceName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link - * Mono}. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String workspaceName, String name, String version, ModelVersionInner body) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String name, String version, ModelVersionInner body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -974,26 +720,14 @@ private Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - version, - this.client.getApiVersion(), - body, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, version, this.client.getApiVersion(), body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or update version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -1003,28 +737,19 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link - * Mono}. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String workspaceName, - String name, - String version, - ModelVersionInner body, - Context context) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String name, String version, ModelVersionInner body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1046,23 +771,13 @@ private Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - version, - this.client.getApiVersion(), - body, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, version, this.client.getApiVersion(), body, accept, context); } /** * Create or update version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -1074,15 +789,15 @@ private Mono> createOrUpdateWithResponseAsync( * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String workspaceName, String name, String version, ModelVersionInner body) { + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, String name, + String version, ModelVersionInner body) { return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, version, body) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Create or update version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -1095,19 +810,14 @@ private Mono createOrUpdateAsync( * @return azure Resource Manager resource envelope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String name, - String version, - ModelVersionInner body, - Context context) { + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String name, String version, ModelVersionInner body, Context context) { return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, version, body, context).block(); } /** * Create or update version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -1119,22 +829,282 @@ public Response createOrUpdateWithResponse( * @return azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ModelVersionInner createOrUpdate( - String resourceGroupName, String workspaceName, String name, String version, ModelVersionInner body) { + public ModelVersionInner createOrUpdate(String resourceGroupName, String workspaceName, String name, String version, + ModelVersionInner body) { return createOrUpdateWithResponse(resourceGroupName, workspaceName, name, version, body, Context.NONE) .getValue(); } + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> publishWithResponseAsync(String resourceGroupName, String workspaceName, + String name, String version, DestinationAsset body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.publish(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, version, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> publishWithResponseAsync(String resourceGroupName, String workspaceName, + String name, String version, DestinationAsset body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.publish(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, version, this.client.getApiVersion(), body, accept, context); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPublishAsync(String resourceGroupName, String workspaceName, + String name, String version, DestinationAsset body) { + Mono>> mono + = publishWithResponseAsync(resourceGroupName, workspaceName, name, version, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPublishAsync(String resourceGroupName, String workspaceName, + String name, String version, DestinationAsset body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = publishWithResponseAsync(resourceGroupName, workspaceName, name, version, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPublish(String resourceGroupName, String workspaceName, String name, + String version, DestinationAsset body) { + return this.beginPublishAsync(resourceGroupName, workspaceName, name, version, body).getSyncPoller(); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPublish(String resourceGroupName, String workspaceName, String name, + String version, DestinationAsset body, Context context) { + return this.beginPublishAsync(resourceGroupName, workspaceName, name, version, body, context).getSyncPoller(); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono publishAsync(String resourceGroupName, String workspaceName, String name, String version, + DestinationAsset body) { + return beginPublishAsync(resourceGroupName, workspaceName, name, version, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono publishAsync(String resourceGroupName, String workspaceName, String name, String version, + DestinationAsset body, Context context) { + return beginPublishAsync(resourceGroupName, workspaceName, name, version, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void publish(String resourceGroupName, String workspaceName, String name, String version, + DestinationAsset body) { + publishAsync(resourceGroupName, workspaceName, name, version, body).block(); + } + + /** + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void publish(String resourceGroupName, String workspaceName, String name, String version, + DestinationAsset body, Context context) { + publishAsync(resourceGroupName, workspaceName, name, version, body, context).block(); + } + /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of ModelVersion entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1142,37 +1112,26 @@ private Mono> listNextSinglePageAsync(String ne return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of ModelVersion entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -1180,23 +1139,13 @@ private Mono> listNextSinglePageAsync(String ne return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelVersionsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelVersionsImpl.java index c592838cdb9c1..7858ec43de304 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelVersionsImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ModelVersionsImpl.java @@ -11,6 +11,7 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.machinelearning.fluent.ModelVersionsClient; import com.azure.resourcemanager.machinelearning.fluent.models.ModelVersionInner; +import com.azure.resourcemanager.machinelearning.models.DestinationAsset; import com.azure.resourcemanager.machinelearning.models.ListViewType; import com.azure.resourcemanager.machinelearning.models.ModelVersion; import com.azure.resourcemanager.machinelearning.models.ModelVersions; @@ -22,8 +23,7 @@ public final class ModelVersionsImpl implements ModelVersions { private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - public ModelVersionsImpl( - ModelVersionsClient innerClient, + public ModelVersionsImpl(ModelVersionsClient innerClient, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -31,47 +31,20 @@ public ModelVersionsImpl( public PagedIterable list(String resourceGroupName, String workspaceName, String name) { PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName, name); - return Utils.mapPage(inner, inner1 -> new ModelVersionImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ModelVersionImpl(inner1, this.manager())); } - public PagedIterable list( - String resourceGroupName, - String workspaceName, - String name, - String skip, - String orderBy, - Integer top, - String version, - String description, - Integer offset, - String tags, - String properties, - String feed, - ListViewType listViewType, - Context context) { - PagedIterable inner = - this - .serviceClient() - .list( - resourceGroupName, - workspaceName, - name, - skip, - orderBy, - top, - version, - description, - offset, - tags, - properties, - feed, - listViewType, - context); - return Utils.mapPage(inner, inner1 -> new ModelVersionImpl(inner1, this.manager())); + public PagedIterable list(String resourceGroupName, String workspaceName, String name, String skip, + String orderBy, Integer top, String version, String description, Integer offset, String tags, String properties, + String feed, ListViewType listViewType, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, workspaceName, name, skip, orderBy, top, version, description, offset, tags, + properties, feed, listViewType, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ModelVersionImpl(inner1, this.manager())); } - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context) { + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String name, + String version, Context context) { return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, name, version, context); } @@ -79,15 +52,12 @@ public void delete(String resourceGroupName, String workspaceName, String name, this.serviceClient().delete(resourceGroupName, workspaceName, name, version); } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, workspaceName, name, version, context); + public Response getWithResponse(String resourceGroupName, String workspaceName, String name, + String version, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, name, version, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ModelVersionImpl(inner.getValue(), this.manager())); } else { return null; @@ -103,136 +73,37 @@ public ModelVersion get(String resourceGroupName, String workspaceName, String n } } - public ModelVersion getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "models"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'models'.", id))); - } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String name, String version, ModelVersionInner body, Context context) { + Response inner = this.serviceClient() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, name, version, body, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ModelVersionImpl(inner.getValue(), this.manager())); + } else { + return null; } - return this.getWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE).getValue(); } - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "models"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'models'.", id))); - } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + public ModelVersion createOrUpdate(String resourceGroupName, String workspaceName, String name, String version, + ModelVersionInner body) { + ModelVersionInner inner + = this.serviceClient().createOrUpdate(resourceGroupName, workspaceName, name, version, body); + if (inner != null) { + return new ModelVersionImpl(inner, this.manager()); + } else { + return null; } - return this.getWithResponse(resourceGroupName, workspaceName, name, version, context); } - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "models"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'models'.", id))); - } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); - } - this.deleteWithResponse(resourceGroupName, workspaceName, name, version, Context.NONE); + public void publish(String resourceGroupName, String workspaceName, String name, String version, + DestinationAsset body) { + this.serviceClient().publish(resourceGroupName, workspaceName, name, version, body); } - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String name = Utils.getValueFromIdByName(id, "models"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'models'.", id))); - } - String version = Utils.getValueFromIdByName(id, "versions"); - if (version == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); - } - return this.deleteWithResponse(resourceGroupName, workspaceName, name, version, context); + public void publish(String resourceGroupName, String workspaceName, String name, String version, + DestinationAsset body, Context context) { + this.serviceClient().publish(resourceGroupName, workspaceName, name, version, body, context); } private ModelVersionsClient serviceClient() { @@ -242,8 +113,4 @@ private ModelVersionsClient serviceClient() { private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { return this.serviceManager; } - - public ModelVersionImpl define(String name) { - return new ModelVersionImpl(name, this.manager()); - } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/NotebookAccessTokenResultImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/NotebookAccessTokenResultImpl.java index 56f19f2680b1c..d606c9997543e 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/NotebookAccessTokenResultImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/NotebookAccessTokenResultImpl.java @@ -12,8 +12,7 @@ public final class NotebookAccessTokenResultImpl implements NotebookAccessTokenR private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - NotebookAccessTokenResultImpl( - NotebookAccessTokenResultInner innerObject, + NotebookAccessTokenResultImpl(NotebookAccessTokenResultInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/NotebookResourceInfoImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/NotebookResourceInfoImpl.java index 79a6782c20d9b..a4f232ff10d32 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/NotebookResourceInfoImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/NotebookResourceInfoImpl.java @@ -13,8 +13,7 @@ public final class NotebookResourceInfoImpl implements NotebookResourceInfo { private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - NotebookResourceInfoImpl( - NotebookResourceInfoInner innerObject, + NotebookResourceInfoImpl(NotebookResourceInfoInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OnlineDeploymentImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OnlineDeploymentImpl.java index d6f213d3eda47..cac2d85bd3ab9 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OnlineDeploymentImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OnlineDeploymentImpl.java @@ -101,8 +101,8 @@ private com.azure.resourcemanager.machinelearning.MachineLearningManager manager private PartialMinimalTrackedResourceWithSku updateBody; - public OnlineDeploymentImpl withExistingOnlineEndpoint( - String resourceGroupName, String workspaceName, String endpointName) { + public OnlineDeploymentImpl withExistingOnlineEndpoint(String resourceGroupName, String workspaceName, + String endpointName) { this.resourceGroupName = resourceGroupName; this.workspaceName = workspaceName; this.endpointName = endpointName; @@ -110,22 +110,17 @@ public OnlineDeploymentImpl withExistingOnlineEndpoint( } public OnlineDeployment create() { - this.innerObject = - serviceManager - .serviceClient() - .getOnlineDeployments() - .createOrUpdate( - resourceGroupName, workspaceName, endpointName, deploymentName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getOnlineDeployments() + .createOrUpdate(resourceGroupName, workspaceName, endpointName, deploymentName, this.innerModel(), + Context.NONE); return this; } public OnlineDeployment create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getOnlineDeployments() - .createOrUpdate( - resourceGroupName, workspaceName, endpointName, deploymentName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient() + .getOnlineDeployments() + .createOrUpdate(resourceGroupName, workspaceName, endpointName, deploymentName, this.innerModel(), context); return this; } @@ -141,63 +136,52 @@ public OnlineDeploymentImpl update() { } public OnlineDeployment apply() { - this.innerObject = - serviceManager - .serviceClient() - .getOnlineDeployments() - .update(resourceGroupName, workspaceName, endpointName, deploymentName, updateBody, Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getOnlineDeployments() + .update(resourceGroupName, workspaceName, endpointName, deploymentName, updateBody, Context.NONE); return this; } public OnlineDeployment apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getOnlineDeployments() - .update(resourceGroupName, workspaceName, endpointName, deploymentName, updateBody, context); + this.innerObject = serviceManager.serviceClient() + .getOnlineDeployments() + .update(resourceGroupName, workspaceName, endpointName, deploymentName, updateBody, context); return this; } - OnlineDeploymentImpl( - OnlineDeploymentInner innerObject, + OnlineDeploymentImpl(OnlineDeploymentInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); - this.endpointName = Utils.getValueFromIdByName(innerObject.id(), "onlineEndpoints"); - this.deploymentName = Utils.getValueFromIdByName(innerObject.id(), "deployments"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.endpointName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "onlineEndpoints"); + this.deploymentName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "deployments"); } public OnlineDeployment refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getOnlineDeployments() - .getWithResponse(resourceGroupName, workspaceName, endpointName, deploymentName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getOnlineDeployments() + .getWithResponse(resourceGroupName, workspaceName, endpointName, deploymentName, Context.NONE) + .getValue(); return this; } public OnlineDeployment refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getOnlineDeployments() - .getWithResponse(resourceGroupName, workspaceName, endpointName, deploymentName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getOnlineDeployments() + .getWithResponse(resourceGroupName, workspaceName, endpointName, deploymentName, context) + .getValue(); return this; } public Response getLogsWithResponse(DeploymentLogsRequest body, Context context) { - return serviceManager - .onlineDeployments() + return serviceManager.onlineDeployments() .getLogsWithResponse(resourceGroupName, workspaceName, endpointName, deploymentName, body, context); } public DeploymentLogs getLogs(DeploymentLogsRequest body) { - return serviceManager - .onlineDeployments() + return serviceManager.onlineDeployments() .getLogs(resourceGroupName, workspaceName, endpointName, deploymentName, body); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OnlineDeploymentsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OnlineDeploymentsClientImpl.java index 8008e9361ade5..231d456c8563c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OnlineDeploymentsClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OnlineDeploymentsClientImpl.java @@ -45,189 +45,134 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in OnlineDeploymentsClient. */ +/** + * An instance of this class provides access to all the operations defined in OnlineDeploymentsClient. + */ public final class OnlineDeploymentsClientImpl implements OnlineDeploymentsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final OnlineDeploymentsService service; - /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of OnlineDeploymentsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ - OnlineDeploymentsClientImpl(AzureMachineLearningWorkspacesImpl client) { - this.service = - RestProxy.create(OnlineDeploymentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + OnlineDeploymentsClientImpl(AzureMachineLearningServicesImpl client) { + this.service + = RestProxy.create(OnlineDeploymentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesOnlineDeployments to be used by the - * proxy service to perform REST calls. + * The interface defining all the services for AzureMachineLearningServicesOnlineDeployments to be used by the proxy + * service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AzureMachineLearning") public interface OnlineDeploymentsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}" - + "/deployments") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, + Mono> list(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("endpointName") String endpointName, - @QueryParam("api-version") String apiVersion, - @QueryParam("$orderBy") String orderBy, - @QueryParam("$top") Integer top, - @QueryParam("$skip") String skip, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}" - + "/deployments/{deploymentName}") - @ExpectedResponses({200, 202, 204}) + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("endpointName") String endpointName, @QueryParam("api-version") String apiVersion, + @QueryParam("$orderBy") String orderBy, @QueryParam("$top") Integer top, @QueryParam("$skip") String skip, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}") + @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, + Mono>> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("endpointName") String endpointName, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}" - + "/deployments/{deploymentName}") - @ExpectedResponses({200}) + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("endpointName") String endpointName, @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("endpointName") String endpointName, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}" - + "/deployments/{deploymentName}") - @ExpectedResponses({200, 202}) + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("endpointName") String endpointName, @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, + Mono>> update(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("endpointName") String endpointName, - @PathParam("deploymentName") String deploymentName, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("endpointName") String endpointName, @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") PartialMinimalTrackedResourceWithSku body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}" - + "/deployments/{deploymentName}") - @ExpectedResponses({200, 201}) + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, + Mono>> createOrUpdate(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("endpointName") String endpointName, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") OnlineDeploymentInner body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}" - + "/deployments/{deploymentName}/getLogs") - @ExpectedResponses({200}) + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("endpointName") String endpointName, @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") OnlineDeploymentInner body, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getLogs( - @HostParam("$host") String endpoint, + Mono> getLogs(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("endpointName") String endpointName, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DeploymentLogsRequest body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}" - + "/deployments/{deploymentName}/skus") - @ExpectedResponses({200}) + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("endpointName") String endpointName, @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") DeploymentLogsRequest body, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listSkus( - @HostParam("$host") String endpoint, + Mono> listSkus(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("endpointName") String endpointName, - @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @QueryParam("count") Integer count, - @QueryParam("$skip") String skip, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("endpointName") String endpointName, @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, @QueryParam("count") Integer count, + @QueryParam("$skip") String skip, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listSkusNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * List Inference Endpoint Deployments. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -238,22 +183,18 @@ Mono> listSkusNext( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of OnlineDeployment entities along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String workspaceName, String endpointName, String orderBy, Integer top, String skip) { + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, String endpointName, String orderBy, Integer top, String skip) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -268,35 +209,16 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - this.client.getApiVersion(), - orderBy, - top, - skip, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, endpointName, this.client.getApiVersion(), orderBy, top, skip, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List Inference Endpoint Deployments. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -308,28 +230,18 @@ private Mono> listSinglePageAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of OnlineDeployment entities along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - String orderBy, - Integer top, - String skip, - Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, String endpointName, String orderBy, Integer top, String skip, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -344,32 +256,15 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - this.client.getApiVersion(), - orderBy, - top, - skip, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + endpointName, this.client.getApiVersion(), orderBy, top, skip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List Inference Endpoint Deployments. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -382,8 +277,8 @@ private Mono> listSinglePageAsync( * @return a paginated list of OnlineDeployment entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String workspaceName, String endpointName, String orderBy, Integer top, String skip) { + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + String endpointName, String orderBy, Integer top, String skip) { return new PagedFlux<>( () -> listSinglePageAsync(resourceGroupName, workspaceName, endpointName, orderBy, top, skip), nextLink -> listNextSinglePageAsync(nextLink)); @@ -391,7 +286,7 @@ private PagedFlux listAsync( /** * List Inference Endpoint Deployments. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -401,8 +296,8 @@ private PagedFlux listAsync( * @return a paginated list of OnlineDeployment entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String workspaceName, String endpointName) { + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + String endpointName) { final String orderBy = null; final Integer top = null; final String skip = null; @@ -413,7 +308,7 @@ private PagedFlux listAsync( /** * List Inference Endpoint Deployments. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -427,14 +322,8 @@ private PagedFlux listAsync( * @return a paginated list of OnlineDeployment entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - String orderBy, - Integer top, - String skip, - Context context) { + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + String endpointName, String orderBy, Integer top, String skip, Context context) { return new PagedFlux<>( () -> listSinglePageAsync(resourceGroupName, workspaceName, endpointName, orderBy, top, skip, context), nextLink -> listNextSinglePageAsync(nextLink, context)); @@ -442,7 +331,7 @@ private PagedFlux listAsync( /** * List Inference Endpoint Deployments. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -452,8 +341,8 @@ private PagedFlux listAsync( * @return a paginated list of OnlineDeployment entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String workspaceName, String endpointName) { + public PagedIterable list(String resourceGroupName, String workspaceName, + String endpointName) { final String orderBy = null; final Integer top = null; final String skip = null; @@ -462,7 +351,7 @@ public PagedIterable list( /** * List Inference Endpoint Deployments. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -476,21 +365,15 @@ public PagedIterable list( * @return a paginated list of OnlineDeployment entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, - String workspaceName, - String endpointName, - String orderBy, - Integer top, - String skip, - Context context) { + public PagedIterable list(String resourceGroupName, String workspaceName, + String endpointName, String orderBy, Integer top, String skip, Context context) { return new PagedIterable<>( listAsync(resourceGroupName, workspaceName, endpointName, orderBy, top, skip, context)); } /** * Delete Inference Endpoint Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -501,19 +384,15 @@ public PagedIterable list( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String endpointName, String deploymentName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -531,24 +410,14 @@ private Mono>> deleteWithResponseAsync( final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - deploymentName, - this.client.getApiVersion(), - accept, - context)) + context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, endpointName, deploymentName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete Inference Endpoint Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -560,19 +429,15 @@ private Mono>> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String endpointName, String deploymentName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -589,22 +454,13 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - deploymentName, - this.client.getApiVersion(), - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, endpointName, deploymentName, this.client.getApiVersion(), accept, context); } /** * Delete Inference Endpoint Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -615,19 +471,17 @@ private Mono>> deleteWithResponseAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, workspaceName, endpointName, deploymentName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, + String endpointName, String deploymentName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, workspaceName, endpointName, deploymentName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Delete Inference Endpoint Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -639,19 +493,18 @@ private PollerFlux, Void> beginDeleteAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName, Context context) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, + String endpointName, String deploymentName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, workspaceName, endpointName, deploymentName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, workspaceName, endpointName, deploymentName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** * Delete Inference Endpoint Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -662,14 +515,14 @@ private PollerFlux, Void> beginDeleteAsync( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName) { + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, + String endpointName, String deploymentName) { return this.beginDeleteAsync(resourceGroupName, workspaceName, endpointName, deploymentName).getSyncPoller(); } /** * Delete Inference Endpoint Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -681,16 +534,15 @@ public SyncPoller, Void> beginDelete( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName, Context context) { - return this - .beginDeleteAsync(resourceGroupName, workspaceName, endpointName, deploymentName, context) + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, + String endpointName, String deploymentName, Context context) { + return this.beginDeleteAsync(resourceGroupName, workspaceName, endpointName, deploymentName, context) .getSyncPoller(); } /** * Delete Inference Endpoint Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -701,16 +553,15 @@ public SyncPoller, Void> beginDelete( * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName) { - return beginDeleteAsync(resourceGroupName, workspaceName, endpointName, deploymentName) - .last() + private Mono deleteAsync(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName) { + return beginDeleteAsync(resourceGroupName, workspaceName, endpointName, deploymentName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete Inference Endpoint Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -722,16 +573,15 @@ private Mono deleteAsync( * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName, Context context) { - return beginDeleteAsync(resourceGroupName, workspaceName, endpointName, deploymentName, context) - .last() + private Mono deleteAsync(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, endpointName, deploymentName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete Inference Endpoint Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -747,7 +597,7 @@ public void delete(String resourceGroupName, String workspaceName, String endpoi /** * Delete Inference Endpoint Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -758,14 +608,14 @@ public void delete(String resourceGroupName, String workspaceName, String endpoi * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName, Context context) { + public void delete(String resourceGroupName, String workspaceName, String endpointName, String deploymentName, + Context context) { deleteAsync(resourceGroupName, workspaceName, endpointName, deploymentName, context).block(); } /** * Get Inference Deployment Deployment. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -776,19 +626,15 @@ public void delete( * @return inference Deployment Deployment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String endpointName, String deploymentName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -806,24 +652,14 @@ private Mono> getWithResponseAsync( final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - deploymentName, - this.client.getApiVersion(), - accept, - context)) + context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, endpointName, deploymentName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get Inference Deployment Deployment. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -835,19 +671,15 @@ private Mono> getWithResponseAsync( * @return inference Deployment Deployment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String endpointName, String deploymentName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -864,22 +696,13 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - deploymentName, - this.client.getApiVersion(), - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + endpointName, deploymentName, this.client.getApiVersion(), accept, context); } /** * Get Inference Deployment Deployment. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -890,15 +713,15 @@ private Mono> getWithResponseAsync( * @return inference Deployment Deployment on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName) { + private Mono getAsync(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName) { return getWithResponseAsync(resourceGroupName, workspaceName, endpointName, deploymentName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Get Inference Deployment Deployment. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -910,14 +733,14 @@ private Mono getAsync( * @return inference Deployment Deployment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName, Context context) { + public Response getWithResponse(String resourceGroupName, String workspaceName, + String endpointName, String deploymentName, Context context) { return getWithResponseAsync(resourceGroupName, workspaceName, endpointName, deploymentName, context).block(); } /** * Get Inference Deployment Deployment. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -928,14 +751,14 @@ public Response getWithResponse( * @return inference Deployment Deployment. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OnlineDeploymentInner get( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName) { + public OnlineDeploymentInner get(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName) { return getWithResponse(resourceGroupName, workspaceName, endpointName, deploymentName, Context.NONE).getValue(); } /** * Update Online Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -947,23 +770,15 @@ public OnlineDeploymentInner get( * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - PartialMinimalTrackedResourceWithSku body) { + private Mono>> updateWithResponseAsync(String resourceGroupName, String workspaceName, + String endpointName, String deploymentName, PartialMinimalTrackedResourceWithSku body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -986,25 +801,14 @@ private Mono>> updateWithResponseAsync( final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - deploymentName, - this.client.getApiVersion(), - body, - accept, - context)) + context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, endpointName, deploymentName, this.client.getApiVersion(), body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Update Online Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1017,24 +821,15 @@ private Mono>> updateWithResponseAsync( * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - PartialMinimalTrackedResourceWithSku body, - Context context) { + private Mono>> updateWithResponseAsync(String resourceGroupName, String workspaceName, + String endpointName, String deploymentName, PartialMinimalTrackedResourceWithSku body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1056,23 +851,13 @@ private Mono>> updateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - deploymentName, - this.client.getApiVersion(), - body, - accept, - context); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, endpointName, deploymentName, this.client.getApiVersion(), body, accept, context); } /** * Update Online Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1085,26 +870,18 @@ private Mono>> updateWithResponseAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, OnlineDeploymentInner> beginUpdateAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, + String resourceGroupName, String workspaceName, String endpointName, String deploymentName, PartialMinimalTrackedResourceWithSku body) { - Mono>> mono = - updateWithResponseAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OnlineDeploymentInner.class, - OnlineDeploymentInner.class, - this.client.getContext()); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OnlineDeploymentInner.class, OnlineDeploymentInner.class, + this.client.getContext()); } /** * Update Online Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1118,24 +895,18 @@ private PollerFlux, OnlineDeploymentInner> beg */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, OnlineDeploymentInner> beginUpdateAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - PartialMinimalTrackedResourceWithSku body, - Context context) { + String resourceGroupName, String workspaceName, String endpointName, String deploymentName, + PartialMinimalTrackedResourceWithSku body, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), OnlineDeploymentInner.class, OnlineDeploymentInner.class, context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OnlineDeploymentInner.class, OnlineDeploymentInner.class, context); } /** * Update Online Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1147,20 +918,15 @@ private PollerFlux, OnlineDeploymentInner> beg * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, OnlineDeploymentInner> beginUpdate( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - PartialMinimalTrackedResourceWithSku body) { - return this - .beginUpdateAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body) + public SyncPoller, OnlineDeploymentInner> beginUpdate(String resourceGroupName, + String workspaceName, String endpointName, String deploymentName, PartialMinimalTrackedResourceWithSku body) { + return this.beginUpdateAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body) .getSyncPoller(); } /** * Update Online Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1173,21 +939,16 @@ public SyncPoller, OnlineDeploymentInner> begi * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, OnlineDeploymentInner> beginUpdate( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - PartialMinimalTrackedResourceWithSku body, + public SyncPoller, OnlineDeploymentInner> beginUpdate(String resourceGroupName, + String workspaceName, String endpointName, String deploymentName, PartialMinimalTrackedResourceWithSku body, Context context) { - return this - .beginUpdateAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body, context) + return this.beginUpdateAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body, context) .getSyncPoller(); } /** * Update Online Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1199,20 +960,15 @@ public SyncPoller, OnlineDeploymentInner> begi * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - PartialMinimalTrackedResourceWithSku body) { - return beginUpdateAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body) - .last() + private Mono updateAsync(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName, PartialMinimalTrackedResourceWithSku body) { + return beginUpdateAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Update Online Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1225,21 +981,15 @@ private Mono updateAsync( * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - PartialMinimalTrackedResourceWithSku body, - Context context) { - return beginUpdateAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body, context) - .last() + private Mono updateAsync(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName, PartialMinimalTrackedResourceWithSku body, Context context) { + return beginUpdateAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Update Online Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1251,18 +1001,14 @@ private Mono updateAsync( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OnlineDeploymentInner update( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - PartialMinimalTrackedResourceWithSku body) { + public OnlineDeploymentInner update(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName, PartialMinimalTrackedResourceWithSku body) { return updateAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body).block(); } /** * Update Online Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1275,19 +1021,14 @@ public OnlineDeploymentInner update( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OnlineDeploymentInner update( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - PartialMinimalTrackedResourceWithSku body, - Context context) { + public OnlineDeploymentInner update(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName, PartialMinimalTrackedResourceWithSku body, Context context) { return updateAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body, context).block(); } /** * Create or update Inference Endpoint Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -1299,23 +1040,15 @@ public OnlineDeploymentInner update( * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - OnlineDeploymentInner body) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String endpointName, String deploymentName, OnlineDeploymentInner body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1337,26 +1070,15 @@ private Mono>> createOrUpdateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - deploymentName, - this.client.getApiVersion(), - body, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, endpointName, deploymentName, this.client.getApiVersion(), body, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or update Inference Endpoint Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -1369,24 +1091,15 @@ private Mono>> createOrUpdateWithResponseAsync( * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - OnlineDeploymentInner body, - Context context) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String endpointName, String deploymentName, OnlineDeploymentInner body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1408,23 +1121,13 @@ private Mono>> createOrUpdateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - deploymentName, - this.client.getApiVersion(), - body, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, endpointName, deploymentName, this.client.getApiVersion(), body, accept, context); } /** * Create or update Inference Endpoint Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -1437,26 +1140,18 @@ private Mono>> createOrUpdateWithResponseAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, OnlineDeploymentInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, + String resourceGroupName, String workspaceName, String endpointName, String deploymentName, OnlineDeploymentInner body) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OnlineDeploymentInner.class, - OnlineDeploymentInner.class, - this.client.getContext()); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OnlineDeploymentInner.class, OnlineDeploymentInner.class, + this.client.getContext()); } /** * Create or update Inference Endpoint Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -1470,25 +1165,18 @@ private PollerFlux, OnlineDeploymentInner> beg */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, OnlineDeploymentInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - OnlineDeploymentInner body, - Context context) { + String resourceGroupName, String workspaceName, String endpointName, String deploymentName, + OnlineDeploymentInner body, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, workspaceName, endpointName, deploymentName, body, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), OnlineDeploymentInner.class, OnlineDeploymentInner.class, context); + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, + endpointName, deploymentName, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OnlineDeploymentInner.class, OnlineDeploymentInner.class, context); } /** * Create or update Inference Endpoint Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -1501,19 +1189,15 @@ private PollerFlux, OnlineDeploymentInner> beg */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, OnlineDeploymentInner> beginCreateOrUpdate( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, + String resourceGroupName, String workspaceName, String endpointName, String deploymentName, OnlineDeploymentInner body) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body) + return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body) .getSyncPoller(); } /** * Create or update Inference Endpoint Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -1527,12 +1211,8 @@ public SyncPoller, OnlineDeploymentInner> begi */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, OnlineDeploymentInner> beginCreateOrUpdate( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - OnlineDeploymentInner body, - Context context) { + String resourceGroupName, String workspaceName, String endpointName, String deploymentName, + OnlineDeploymentInner body, Context context) { return this .beginCreateOrUpdateAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body, context) .getSyncPoller(); @@ -1540,7 +1220,7 @@ public SyncPoller, OnlineDeploymentInner> begi /** * Create or update Inference Endpoint Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -1552,20 +1232,15 @@ public SyncPoller, OnlineDeploymentInner> begi * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - OnlineDeploymentInner body) { - return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body) - .last() + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String endpointName, String deploymentName, OnlineDeploymentInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Create or update Inference Endpoint Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -1578,13 +1253,8 @@ private Mono createOrUpdateAsync( * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - OnlineDeploymentInner body, - Context context) { + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String endpointName, String deploymentName, OnlineDeploymentInner body, Context context) { return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body, context) .last() .flatMap(this.client::getLroFinalResultOrError); @@ -1592,7 +1262,7 @@ private Mono createOrUpdateAsync( /** * Create or update Inference Endpoint Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -1604,18 +1274,14 @@ private Mono createOrUpdateAsync( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OnlineDeploymentInner createOrUpdate( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - OnlineDeploymentInner body) { + public OnlineDeploymentInner createOrUpdate(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName, OnlineDeploymentInner body) { return createOrUpdateAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body).block(); } /** * Create or update Inference Endpoint Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -1628,20 +1294,15 @@ public OnlineDeploymentInner createOrUpdate( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OnlineDeploymentInner createOrUpdate( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - OnlineDeploymentInner body, - Context context) { + public OnlineDeploymentInner createOrUpdate(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName, OnlineDeploymentInner body, Context context) { return createOrUpdateAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body, context) .block(); } /** * Polls an Endpoint operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -1653,23 +1314,15 @@ public OnlineDeploymentInner createOrUpdate( * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getLogsWithResponseAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - DeploymentLogsRequest body) { + private Mono> getLogsWithResponseAsync(String resourceGroupName, String workspaceName, + String endpointName, String deploymentName, DeploymentLogsRequest body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1691,26 +1344,15 @@ private Mono> getLogsWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .getLogs( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - deploymentName, - this.client.getApiVersion(), - body, - accept, - context)) + .withContext(context -> service.getLogs(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, endpointName, deploymentName, this.client.getApiVersion(), body, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Polls an Endpoint operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -1723,24 +1365,15 @@ private Mono> getLogsWithResponseAsync( * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getLogsWithResponseAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - DeploymentLogsRequest body, - Context context) { + private Mono> getLogsWithResponseAsync(String resourceGroupName, String workspaceName, + String endpointName, String deploymentName, DeploymentLogsRequest body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1762,23 +1395,13 @@ private Mono> getLogsWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .getLogs( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - deploymentName, - this.client.getApiVersion(), - body, - accept, - context); + return service.getLogs(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, endpointName, deploymentName, this.client.getApiVersion(), body, accept, context); } /** * Polls an Endpoint operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -1790,19 +1413,15 @@ private Mono> getLogsWithResponseAsync( * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getLogsAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - DeploymentLogsRequest body) { + private Mono getLogsAsync(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName, DeploymentLogsRequest body) { return getLogsWithResponseAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Polls an Endpoint operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -1815,20 +1434,15 @@ private Mono getLogsAsync( * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getLogsWithResponse( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - DeploymentLogsRequest body, - Context context) { + public Response getLogsWithResponse(String resourceGroupName, String workspaceName, + String endpointName, String deploymentName, DeploymentLogsRequest body, Context context) { return getLogsWithResponseAsync(resourceGroupName, workspaceName, endpointName, deploymentName, body, context) .block(); } /** * Polls an Endpoint operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -1840,19 +1454,15 @@ public Response getLogsWithResponse( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentLogsInner getLogs( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - DeploymentLogsRequest body) { + public DeploymentLogsInner getLogs(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName, DeploymentLogsRequest body) { return getLogsWithResponse(resourceGroupName, workspaceName, endpointName, deploymentName, body, Context.NONE) .getValue(); } /** * List Inference Endpoint Deployment Skus. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -1863,27 +1473,18 @@ public DeploymentLogsInner getLogs( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of SkuResource entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSkusSinglePageAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - Integer count, - String skip) { + private Mono> listSkusSinglePageAsync(String resourceGroupName, + String workspaceName, String endpointName, String deploymentName, Integer count, String skip) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1900,36 +1501,17 @@ private Mono> listSkusSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listSkus( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - deploymentName, - this.client.getApiVersion(), - count, - skip, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listSkus(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, endpointName, deploymentName, this.client.getApiVersion(), count, + skip, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List Inference Endpoint Deployment Skus. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -1941,28 +1523,18 @@ private Mono> listSkusSinglePageAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of SkuResource entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSkusSinglePageAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - Integer count, - String skip, - Context context) { + private Mono> listSkusSinglePageAsync(String resourceGroupName, + String workspaceName, String endpointName, String deploymentName, Integer count, String skip, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1980,32 +1552,15 @@ private Mono> listSkusSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listSkus( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - deploymentName, - this.client.getApiVersion(), - count, - skip, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listSkus(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + endpointName, deploymentName, this.client.getApiVersion(), count, skip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List Inference Endpoint Deployment Skus. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -2018,13 +1573,8 @@ private Mono> listSkusSinglePageAsync( * @return a paginated list of SkuResource entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listSkusAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - Integer count, - String skip) { + private PagedFlux listSkusAsync(String resourceGroupName, String workspaceName, + String endpointName, String deploymentName, Integer count, String skip) { return new PagedFlux<>( () -> listSkusSinglePageAsync(resourceGroupName, workspaceName, endpointName, deploymentName, count, skip), nextLink -> listSkusNextSinglePageAsync(nextLink)); @@ -2032,7 +1582,7 @@ private PagedFlux listSkusAsync( /** * List Inference Endpoint Deployment Skus. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -2043,8 +1593,8 @@ private PagedFlux listSkusAsync( * @return a paginated list of SkuResource entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listSkusAsync( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName) { + private PagedFlux listSkusAsync(String resourceGroupName, String workspaceName, + String endpointName, String deploymentName) { final Integer count = null; final String skip = null; return new PagedFlux<>( @@ -2054,7 +1604,7 @@ private PagedFlux listSkusAsync( /** * List Inference Endpoint Deployment Skus. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -2068,24 +1618,15 @@ private PagedFlux listSkusAsync( * @return a paginated list of SkuResource entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listSkusAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - Integer count, - String skip, - Context context) { - return new PagedFlux<>( - () -> - listSkusSinglePageAsync( - resourceGroupName, workspaceName, endpointName, deploymentName, count, skip, context), - nextLink -> listSkusNextSinglePageAsync(nextLink, context)); + private PagedFlux listSkusAsync(String resourceGroupName, String workspaceName, + String endpointName, String deploymentName, Integer count, String skip, Context context) { + return new PagedFlux<>(() -> listSkusSinglePageAsync(resourceGroupName, workspaceName, endpointName, + deploymentName, count, skip, context), nextLink -> listSkusNextSinglePageAsync(nextLink, context)); } /** * List Inference Endpoint Deployment Skus. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -2096,8 +1637,8 @@ private PagedFlux listSkusAsync( * @return a paginated list of SkuResource entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSkus( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName) { + public PagedIterable listSkus(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName) { final Integer count = null; final String skip = null; return new PagedIterable<>( @@ -2106,7 +1647,7 @@ public PagedIterable listSkus( /** * List Inference Endpoint Deployment Skus. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -2120,28 +1661,21 @@ public PagedIterable listSkus( * @return a paginated list of SkuResource entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSkus( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - Integer count, - String skip, - Context context) { + public PagedIterable listSkus(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName, Integer count, String skip, Context context) { return new PagedIterable<>( listSkusAsync(resourceGroupName, workspaceName, endpointName, deploymentName, count, skip, context)); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of OnlineDeployment entities along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -2149,37 +1683,26 @@ private Mono> listNextSinglePageAsync(Strin return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of OnlineDeployment entities along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -2187,36 +1710,25 @@ private Mono> listNextSinglePageAsync(Strin return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of SkuResource entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSkusNextSinglePageAsync(String nextLink) { @@ -2224,37 +1736,27 @@ private Mono> listSkusNextSinglePageAsync(String return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listSkusNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of SkuResource entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSkusNextSinglePageAsync(String nextLink, Context context) { @@ -2262,23 +1764,13 @@ private Mono> listSkusNextSinglePageAsync(String return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listSkusNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listSkusNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OnlineDeploymentsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OnlineDeploymentsImpl.java index 4c98b529a0d7e..9232468ea4cea 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OnlineDeploymentsImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OnlineDeploymentsImpl.java @@ -26,62 +26,50 @@ public final class OnlineDeploymentsImpl implements OnlineDeployments { private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - public OnlineDeploymentsImpl( - OnlineDeploymentsClient innerClient, + public OnlineDeploymentsImpl(OnlineDeploymentsClient innerClient, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list(String resourceGroupName, String workspaceName, String endpointName) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, workspaceName, endpointName); - return Utils.mapPage(inner, inner1 -> new OnlineDeploymentImpl(inner1, this.manager())); + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, endpointName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OnlineDeploymentImpl(inner1, this.manager())); } - public PagedIterable list( - String resourceGroupName, - String workspaceName, - String endpointName, - String orderBy, - Integer top, - String skip, - Context context) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, workspaceName, endpointName, orderBy, top, skip, context); - return Utils.mapPage(inner, inner1 -> new OnlineDeploymentImpl(inner1, this.manager())); + public PagedIterable list(String resourceGroupName, String workspaceName, String endpointName, + String orderBy, Integer top, String skip, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, endpointName, orderBy, top, skip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OnlineDeploymentImpl(inner1, this.manager())); } public void delete(String resourceGroupName, String workspaceName, String endpointName, String deploymentName) { this.serviceClient().delete(resourceGroupName, workspaceName, endpointName, deploymentName); } - public void delete( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName, Context context) { + public void delete(String resourceGroupName, String workspaceName, String endpointName, String deploymentName, + Context context) { this.serviceClient().delete(resourceGroupName, workspaceName, endpointName, deploymentName, context); } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName, Context context) { - Response inner = - this - .serviceClient() - .getWithResponse(resourceGroupName, workspaceName, endpointName, deploymentName, context); + public Response getWithResponse(String resourceGroupName, String workspaceName, + String endpointName, String deploymentName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, workspaceName, endpointName, deploymentName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new OnlineDeploymentImpl(inner.getValue(), this.manager())); } else { return null; } } - public OnlineDeployment get( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName) { - OnlineDeploymentInner inner = - this.serviceClient().get(resourceGroupName, workspaceName, endpointName, deploymentName); + public OnlineDeployment get(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName) { + OnlineDeploymentInner inner + = this.serviceClient().get(resourceGroupName, workspaceName, endpointName, deploymentName); if (inner != null) { return new OnlineDeploymentImpl(inner, this.manager()); } else { @@ -89,36 +77,22 @@ public OnlineDeployment get( } } - public Response getLogsWithResponse( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - DeploymentLogsRequest body, - Context context) { - Response inner = - this - .serviceClient() - .getLogsWithResponse(resourceGroupName, workspaceName, endpointName, deploymentName, body, context); + public Response getLogsWithResponse(String resourceGroupName, String workspaceName, + String endpointName, String deploymentName, DeploymentLogsRequest body, Context context) { + Response inner = this.serviceClient() + .getLogsWithResponse(resourceGroupName, workspaceName, endpointName, deploymentName, body, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new DeploymentLogsImpl(inner.getValue(), this.manager())); } else { return null; } } - public DeploymentLogs getLogs( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - DeploymentLogsRequest body) { - DeploymentLogsInner inner = - this.serviceClient().getLogs(resourceGroupName, workspaceName, endpointName, deploymentName, body); + public DeploymentLogs getLogs(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName, DeploymentLogsRequest body) { + DeploymentLogsInner inner + = this.serviceClient().getLogs(resourceGroupName, workspaceName, endpointName, deploymentName, body); if (inner != null) { return new DeploymentLogsImpl(inner, this.manager()); } else { @@ -126,162 +100,113 @@ public DeploymentLogs getLogs( } } - public PagedIterable listSkus( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName) { - PagedIterable inner = - this.serviceClient().listSkus(resourceGroupName, workspaceName, endpointName, deploymentName); - return Utils.mapPage(inner, inner1 -> new SkuResourceImpl(inner1, this.manager())); + public PagedIterable listSkus(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName) { + PagedIterable inner + = this.serviceClient().listSkus(resourceGroupName, workspaceName, endpointName, deploymentName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SkuResourceImpl(inner1, this.manager())); } - public PagedIterable listSkus( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - Integer count, - String skip, - Context context) { - PagedIterable inner = - this - .serviceClient() - .listSkus(resourceGroupName, workspaceName, endpointName, deploymentName, count, skip, context); - return Utils.mapPage(inner, inner1 -> new SkuResourceImpl(inner1, this.manager())); + public PagedIterable listSkus(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName, Integer count, String skip, Context context) { + PagedIterable inner = this.serviceClient() + .listSkus(resourceGroupName, workspaceName, endpointName, deploymentName, count, skip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SkuResourceImpl(inner1, this.manager())); } public OnlineDeployment getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String endpointName = Utils.getValueFromIdByName(id, "onlineEndpoints"); + String endpointName = ResourceManagerUtils.getValueFromIdByName(id, "onlineEndpoints"); if (endpointName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'onlineEndpoints'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'onlineEndpoints'.", id))); } - String deploymentName = Utils.getValueFromIdByName(id, "deployments"); + String deploymentName = ResourceManagerUtils.getValueFromIdByName(id, "deployments"); if (deploymentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); } - return this - .getWithResponse(resourceGroupName, workspaceName, endpointName, deploymentName, Context.NONE) + return this.getWithResponse(resourceGroupName, workspaceName, endpointName, deploymentName, Context.NONE) .getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String endpointName = Utils.getValueFromIdByName(id, "onlineEndpoints"); + String endpointName = ResourceManagerUtils.getValueFromIdByName(id, "onlineEndpoints"); if (endpointName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'onlineEndpoints'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'onlineEndpoints'.", id))); } - String deploymentName = Utils.getValueFromIdByName(id, "deployments"); + String deploymentName = ResourceManagerUtils.getValueFromIdByName(id, "deployments"); if (deploymentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); } return this.getWithResponse(resourceGroupName, workspaceName, endpointName, deploymentName, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String endpointName = Utils.getValueFromIdByName(id, "onlineEndpoints"); + String endpointName = ResourceManagerUtils.getValueFromIdByName(id, "onlineEndpoints"); if (endpointName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'onlineEndpoints'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'onlineEndpoints'.", id))); } - String deploymentName = Utils.getValueFromIdByName(id, "deployments"); + String deploymentName = ResourceManagerUtils.getValueFromIdByName(id, "deployments"); if (deploymentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); } this.delete(resourceGroupName, workspaceName, endpointName, deploymentName, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String endpointName = Utils.getValueFromIdByName(id, "onlineEndpoints"); + String endpointName = ResourceManagerUtils.getValueFromIdByName(id, "onlineEndpoints"); if (endpointName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'onlineEndpoints'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'onlineEndpoints'.", id))); } - String deploymentName = Utils.getValueFromIdByName(id, "deployments"); + String deploymentName = ResourceManagerUtils.getValueFromIdByName(id, "deployments"); if (deploymentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); } this.delete(resourceGroupName, workspaceName, endpointName, deploymentName, context); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OnlineEndpointImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OnlineEndpointImpl.java index f45e6848ce3ae..deca2eaaba4b2 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OnlineEndpointImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OnlineEndpointImpl.java @@ -106,20 +106,16 @@ public OnlineEndpointImpl withExistingWorkspace(String resourceGroupName, String } public OnlineEndpoint create() { - this.innerObject = - serviceManager - .serviceClient() - .getOnlineEndpoints() - .createOrUpdate(resourceGroupName, workspaceName, endpointName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getOnlineEndpoints() + .createOrUpdate(resourceGroupName, workspaceName, endpointName, this.innerModel(), Context.NONE); return this; } public OnlineEndpoint create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getOnlineEndpoints() - .createOrUpdate(resourceGroupName, workspaceName, endpointName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient() + .getOnlineEndpoints() + .createOrUpdate(resourceGroupName, workspaceName, endpointName, this.innerModel(), context); return this; } @@ -135,56 +131,46 @@ public OnlineEndpointImpl update() { } public OnlineEndpoint apply() { - this.innerObject = - serviceManager - .serviceClient() - .getOnlineEndpoints() - .update(resourceGroupName, workspaceName, endpointName, updateBody, Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getOnlineEndpoints() + .update(resourceGroupName, workspaceName, endpointName, updateBody, Context.NONE); return this; } public OnlineEndpoint apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getOnlineEndpoints() - .update(resourceGroupName, workspaceName, endpointName, updateBody, context); + this.innerObject = serviceManager.serviceClient() + .getOnlineEndpoints() + .update(resourceGroupName, workspaceName, endpointName, updateBody, context); return this; } - OnlineEndpointImpl( - OnlineEndpointInner innerObject, + OnlineEndpointImpl(OnlineEndpointInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); - this.endpointName = Utils.getValueFromIdByName(innerObject.id(), "onlineEndpoints"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.endpointName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "onlineEndpoints"); } public OnlineEndpoint refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getOnlineEndpoints() - .getWithResponse(resourceGroupName, workspaceName, endpointName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getOnlineEndpoints() + .getWithResponse(resourceGroupName, workspaceName, endpointName, Context.NONE) + .getValue(); return this; } public OnlineEndpoint refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getOnlineEndpoints() - .getWithResponse(resourceGroupName, workspaceName, endpointName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getOnlineEndpoints() + .getWithResponse(resourceGroupName, workspaceName, endpointName, context) + .getValue(); return this; } public Response listKeysWithResponse(Context context) { - return serviceManager - .onlineEndpoints() + return serviceManager.onlineEndpoints() .listKeysWithResponse(resourceGroupName, workspaceName, endpointName, context); } @@ -201,8 +187,7 @@ public void regenerateKeys(RegenerateEndpointKeysRequest body, Context context) } public Response getTokenWithResponse(Context context) { - return serviceManager - .onlineEndpoints() + return serviceManager.onlineEndpoints() .getTokenWithResponse(resourceGroupName, workspaceName, endpointName, context); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OnlineEndpointsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OnlineEndpointsClientImpl.java index 07f7cfd7be987..0eb3765d5e9e1 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OnlineEndpointsClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OnlineEndpointsClientImpl.java @@ -46,185 +46,136 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in OnlineEndpointsClient. */ +/** + * An instance of this class provides access to all the operations defined in OnlineEndpointsClient. + */ public final class OnlineEndpointsClientImpl implements OnlineEndpointsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final OnlineEndpointsService service; - /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of OnlineEndpointsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ - OnlineEndpointsClientImpl(AzureMachineLearningWorkspacesImpl client) { - this.service = - RestProxy.create(OnlineEndpointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + OnlineEndpointsClientImpl(AzureMachineLearningServicesImpl client) { + this.service + = RestProxy.create(OnlineEndpointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesOnlineEndpoints to be used by the proxy + * The interface defining all the services for AzureMachineLearningServicesOnlineEndpoints to be used by the proxy * service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AzureMachineLearning") public interface OnlineEndpointsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, + Mono> list(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @QueryParam("api-version") String apiVersion, - @QueryParam("name") String name, - @QueryParam("count") Integer count, - @QueryParam("computeType") EndpointComputeType computeType, - @QueryParam("$skip") String skip, - @QueryParam("tags") String tags, - @QueryParam("properties") String properties, - @QueryParam("orderBy") OrderString orderBy, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}") - @ExpectedResponses({200, 202, 204}) + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @QueryParam("name") String name, + @QueryParam("count") Integer count, @QueryParam("computeType") EndpointComputeType computeType, + @QueryParam("$skip") String skip, @QueryParam("tags") String tags, + @QueryParam("properties") String properties, @QueryParam("orderBy") OrderString orderBy, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}") + @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, + Mono>> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("endpointName") String endpointName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("endpointName") String endpointName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("endpointName") String endpointName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("endpointName") String endpointName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}") - @ExpectedResponses({200, 202}) + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, + Mono>> update(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("endpointName") String endpointName, - @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("endpointName") String endpointName, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") PartialMinimalTrackedResourceWithIdentity body, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, + Mono>> createOrUpdate(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("endpointName") String endpointName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") OnlineEndpointInner body, - @HeaderParam("Accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("endpointName") String endpointName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") OnlineEndpointInner body, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}" - + "/listKeys") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listKeys( - @HostParam("$host") String endpoint, + Mono> listKeys(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("endpointName") String endpointName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("endpointName") String endpointName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}" - + "/regenerateKeys") - @ExpectedResponses({200, 202}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> regenerateKeys( - @HostParam("$host") String endpoint, + Mono>> regenerateKeys(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("endpointName") String endpointName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") RegenerateEndpointKeysRequest body, - @HeaderParam("Accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("endpointName") String endpointName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RegenerateEndpointKeysRequest body, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getToken( - @HostParam("$host") String endpoint, + Mono> getToken(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("endpointName") String endpointName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("endpointName") String endpointName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * List Online Endpoints. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Name of the endpoint. @@ -232,38 +183,27 @@ Mono> listNext( * @param computeType EndpointComputeType to be filtered by. * @param skip Continuation token for pagination. * @param tags A set of tags with which to filter the returned models. It is a comma separated string of tags key or - * tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . + * tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . * @param properties A set of properties with which to filter the returned models. It is a comma separated string of - * properties key and/or properties key=value Example: propKey1,propKey2,propKey3=value3 . + * properties key and/or properties key=value Example: propKey1,propKey2,propKey3=value3 . * @param orderBy The option to order the response. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of OnlineEndpoint entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String workspaceName, - String name, - Integer count, - EndpointComputeType computeType, - String skip, - String tags, - String properties, + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String name, Integer count, EndpointComputeType computeType, String skip, String tags, String properties, OrderString orderBy) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -274,39 +214,17 @@ private Mono> listSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - this.client.getApiVersion(), - name, - count, - computeType, - skip, - tags, - properties, - orderBy, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), name, count, computeType, skip, tags, + properties, orderBy, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List Online Endpoints. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Name of the endpoint. @@ -314,40 +232,28 @@ private Mono> listSinglePageAsync( * @param computeType EndpointComputeType to be filtered by. * @param skip Continuation token for pagination. * @param tags A set of tags with which to filter the returned models. It is a comma separated string of tags key or - * tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . + * tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . * @param properties A set of properties with which to filter the returned models. It is a comma separated string of - * properties key and/or properties key=value Example: propKey1,propKey2,propKey3=value3 . + * properties key and/or properties key=value Example: propKey1,propKey2,propKey3=value3 . * @param orderBy The option to order the response. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of OnlineEndpoint entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String workspaceName, - String name, - Integer count, - EndpointComputeType computeType, - String skip, - String tags, - String properties, - OrderString orderBy, - Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String name, Integer count, EndpointComputeType computeType, String skip, String tags, String properties, + OrderString orderBy, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -359,35 +265,15 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - this.client.getApiVersion(), - name, - count, - computeType, - skip, - tags, - properties, - orderBy, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + this.client.getApiVersion(), name, count, computeType, skip, tags, properties, orderBy, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List Online Endpoints. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Name of the endpoint. @@ -395,9 +281,9 @@ private Mono> listSinglePageAsync( * @param computeType EndpointComputeType to be filtered by. * @param skip Continuation token for pagination. * @param tags A set of tags with which to filter the returned models. It is a comma separated string of tags key or - * tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . + * tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . * @param properties A set of properties with which to filter the returned models. It is a comma separated string of - * properties key and/or properties key=value Example: propKey1,propKey2,propKey3=value3 . + * properties key and/or properties key=value Example: propKey1,propKey2,propKey3=value3 . * @param orderBy The option to order the response. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -405,26 +291,16 @@ private Mono> listSinglePageAsync( * @return a paginated list of OnlineEndpoint entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String workspaceName, - String name, - Integer count, - EndpointComputeType computeType, - String skip, - String tags, - String properties, + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String name, + Integer count, EndpointComputeType computeType, String skip, String tags, String properties, OrderString orderBy) { - return new PagedFlux<>( - () -> - listSinglePageAsync( - resourceGroupName, workspaceName, name, count, computeType, skip, tags, properties, orderBy), - nextLink -> listNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, name, count, computeType, + skip, tags, properties, orderBy), nextLink -> listNextSinglePageAsync(nextLink)); } /** * List Online Endpoints. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -441,16 +317,13 @@ private PagedFlux listAsync(String resourceGroupName, Strin final String tags = null; final String properties = null; final OrderString orderBy = null; - return new PagedFlux<>( - () -> - listSinglePageAsync( - resourceGroupName, workspaceName, name, count, computeType, skip, tags, properties, orderBy), - nextLink -> listNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, name, count, computeType, + skip, tags, properties, orderBy), nextLink -> listNextSinglePageAsync(nextLink)); } /** * List Online Endpoints. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Name of the endpoint. @@ -458,9 +331,9 @@ private PagedFlux listAsync(String resourceGroupName, Strin * @param computeType EndpointComputeType to be filtered by. * @param skip Continuation token for pagination. * @param tags A set of tags with which to filter the returned models. It is a comma separated string of tags key or - * tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . + * tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . * @param properties A set of properties with which to filter the returned models. It is a comma separated string of - * properties key and/or properties key=value Example: propKey1,propKey2,propKey3=value3 . + * properties key and/or properties key=value Example: propKey1,propKey2,propKey3=value3 . * @param orderBy The option to order the response. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -469,36 +342,16 @@ private PagedFlux listAsync(String resourceGroupName, Strin * @return a paginated list of OnlineEndpoint entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String workspaceName, - String name, - Integer count, - EndpointComputeType computeType, - String skip, - String tags, - String properties, - OrderString orderBy, - Context context) { - return new PagedFlux<>( - () -> - listSinglePageAsync( - resourceGroupName, - workspaceName, - name, - count, - computeType, - skip, - tags, - properties, - orderBy, - context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String name, + Integer count, EndpointComputeType computeType, String skip, String tags, String properties, + OrderString orderBy, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, name, count, computeType, + skip, tags, properties, orderBy, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * List Online Endpoints. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -521,7 +374,7 @@ public PagedIterable list(String resourceGroupName, String /** * List Online Endpoints. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Name of the endpoint. @@ -529,9 +382,9 @@ public PagedIterable list(String resourceGroupName, String * @param computeType EndpointComputeType to be filtered by. * @param skip Continuation token for pagination. * @param tags A set of tags with which to filter the returned models. It is a comma separated string of tags key or - * tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . + * tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . * @param properties A set of properties with which to filter the returned models. It is a comma separated string of - * properties key and/or properties key=value Example: propKey1,propKey2,propKey3=value3 . + * properties key and/or properties key=value Example: propKey1,propKey2,propKey3=value3 . * @param orderBy The option to order the response. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -540,25 +393,16 @@ public PagedIterable list(String resourceGroupName, String * @return a paginated list of OnlineEndpoint entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, - String workspaceName, - String name, - Integer count, - EndpointComputeType computeType, - String skip, - String tags, - String properties, - OrderString orderBy, - Context context) { - return new PagedIterable<>( - listAsync( - resourceGroupName, workspaceName, name, count, computeType, skip, tags, properties, orderBy, context)); + public PagedIterable list(String resourceGroupName, String workspaceName, String name, + Integer count, EndpointComputeType computeType, String skip, String tags, String properties, + OrderString orderBy, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, name, count, computeType, skip, tags, + properties, orderBy, context)); } /** * Delete Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -568,19 +412,15 @@ public PagedIterable list( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String endpointName) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String endpointName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -594,24 +434,14 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, endpointName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -622,19 +452,15 @@ private Mono>> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String endpointName, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String endpointName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -648,21 +474,13 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - this.client.getApiVersion(), - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, endpointName, this.client.getApiVersion(), accept, context); } /** * Delete Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -672,18 +490,16 @@ private Mono>> deleteWithResponseAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String workspaceName, String endpointName) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, + String endpointName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName, endpointName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Delete Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -694,19 +510,18 @@ private PollerFlux, Void> beginDeleteAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String workspaceName, String endpointName, Context context) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, + String endpointName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, workspaceName, endpointName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, workspaceName, endpointName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** * Delete Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -716,14 +531,14 @@ private PollerFlux, Void> beginDeleteAsync( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String workspaceName, String endpointName) { + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, + String endpointName) { return this.beginDeleteAsync(resourceGroupName, workspaceName, endpointName).getSyncPoller(); } /** * Delete Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -734,14 +549,14 @@ public SyncPoller, Void> beginDelete( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String workspaceName, String endpointName, Context context) { + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, + String endpointName, Context context) { return this.beginDeleteAsync(resourceGroupName, workspaceName, endpointName, context).getSyncPoller(); } /** * Delete Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -752,14 +567,13 @@ public SyncPoller, Void> beginDelete( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String workspaceName, String endpointName) { - return beginDeleteAsync(resourceGroupName, workspaceName, endpointName) - .last() + return beginDeleteAsync(resourceGroupName, workspaceName, endpointName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -770,16 +584,15 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String workspaceName, String endpointName, Context context) { - return beginDeleteAsync(resourceGroupName, workspaceName, endpointName, context) - .last() + private Mono deleteAsync(String resourceGroupName, String workspaceName, String endpointName, + Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, endpointName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -794,7 +607,7 @@ public void delete(String resourceGroupName, String workspaceName, String endpoi /** * Delete Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -810,7 +623,7 @@ public void delete(String resourceGroupName, String workspaceName, String endpoi /** * Get Online Endpoint. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -820,19 +633,15 @@ public void delete(String resourceGroupName, String workspaceName, String endpoi * @return online Endpoint along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String endpointName) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String endpointName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -846,24 +655,14 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, endpointName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get Online Endpoint. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -874,19 +673,15 @@ private Mono> getWithResponseAsync( * @return online Endpoint along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String endpointName, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String endpointName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -900,21 +695,13 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - this.client.getApiVersion(), - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + endpointName, this.client.getApiVersion(), accept, context); } /** * Get Online Endpoint. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -931,7 +718,7 @@ private Mono getAsync(String resourceGroupName, String work /** * Get Online Endpoint. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -942,14 +729,14 @@ private Mono getAsync(String resourceGroupName, String work * @return online Endpoint along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String endpointName, Context context) { + public Response getWithResponse(String resourceGroupName, String workspaceName, + String endpointName, Context context) { return getWithResponseAsync(resourceGroupName, workspaceName, endpointName, context).block(); } /** * Get Online Endpoint. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -965,7 +752,7 @@ public OnlineEndpointInner get(String resourceGroupName, String workspaceName, S /** * Update Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -976,22 +763,15 @@ public OnlineEndpointInner get(String resourceGroupName, String workspaceName, S * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - PartialMinimalTrackedResourceWithIdentity body) { + private Mono>> updateWithResponseAsync(String resourceGroupName, String workspaceName, + String endpointName, PartialMinimalTrackedResourceWithIdentity body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1010,25 +790,14 @@ private Mono>> updateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - this.client.getApiVersion(), - body, - accept, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, endpointName, this.client.getApiVersion(), body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Update Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1040,23 +809,15 @@ private Mono>> updateWithResponseAsync( * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - PartialMinimalTrackedResourceWithIdentity body, - Context context) { + private Mono>> updateWithResponseAsync(String resourceGroupName, String workspaceName, + String endpointName, PartialMinimalTrackedResourceWithIdentity body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1075,22 +836,13 @@ private Mono>> updateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - this.client.getApiVersion(), - body, - accept, - context); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, endpointName, this.client.getApiVersion(), body, accept, context); } /** * Update Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1101,26 +853,17 @@ private Mono>> updateWithResponseAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, OnlineEndpointInner> beginUpdateAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - PartialMinimalTrackedResourceWithIdentity body) { - Mono>> mono = - updateWithResponseAsync(resourceGroupName, workspaceName, endpointName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OnlineEndpointInner.class, - OnlineEndpointInner.class, - this.client.getContext()); + private PollerFlux, OnlineEndpointInner> beginUpdateAsync(String resourceGroupName, + String workspaceName, String endpointName, PartialMinimalTrackedResourceWithIdentity body) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, workspaceName, endpointName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + OnlineEndpointInner.class, OnlineEndpointInner.class, this.client.getContext()); } /** * Update Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1132,24 +875,18 @@ private PollerFlux, OnlineEndpointInner> beginUp * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, OnlineEndpointInner> beginUpdateAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - PartialMinimalTrackedResourceWithIdentity body, - Context context) { + private PollerFlux, OnlineEndpointInner> beginUpdateAsync(String resourceGroupName, + String workspaceName, String endpointName, PartialMinimalTrackedResourceWithIdentity body, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, workspaceName, endpointName, body, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), OnlineEndpointInner.class, OnlineEndpointInner.class, context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, workspaceName, endpointName, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + OnlineEndpointInner.class, OnlineEndpointInner.class, context); } /** * Update Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1160,17 +897,14 @@ private PollerFlux, OnlineEndpointInner> beginUp * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, OnlineEndpointInner> beginUpdate( - String resourceGroupName, - String workspaceName, - String endpointName, - PartialMinimalTrackedResourceWithIdentity body) { + public SyncPoller, OnlineEndpointInner> beginUpdate(String resourceGroupName, + String workspaceName, String endpointName, PartialMinimalTrackedResourceWithIdentity body) { return this.beginUpdateAsync(resourceGroupName, workspaceName, endpointName, body).getSyncPoller(); } /** * Update Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1182,18 +916,14 @@ public SyncPoller, OnlineEndpointInner> beginUpd * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, OnlineEndpointInner> beginUpdate( - String resourceGroupName, - String workspaceName, - String endpointName, - PartialMinimalTrackedResourceWithIdentity body, - Context context) { + public SyncPoller, OnlineEndpointInner> beginUpdate(String resourceGroupName, + String workspaceName, String endpointName, PartialMinimalTrackedResourceWithIdentity body, Context context) { return this.beginUpdateAsync(resourceGroupName, workspaceName, endpointName, body, context).getSyncPoller(); } /** * Update Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1204,19 +934,15 @@ public SyncPoller, OnlineEndpointInner> beginUpd * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String workspaceName, - String endpointName, + private Mono updateAsync(String resourceGroupName, String workspaceName, String endpointName, PartialMinimalTrackedResourceWithIdentity body) { - return beginUpdateAsync(resourceGroupName, workspaceName, endpointName, body) - .last() + return beginUpdateAsync(resourceGroupName, workspaceName, endpointName, body).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Update Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1228,20 +954,15 @@ private Mono updateAsync( * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - PartialMinimalTrackedResourceWithIdentity body, - Context context) { - return beginUpdateAsync(resourceGroupName, workspaceName, endpointName, body, context) - .last() + private Mono updateAsync(String resourceGroupName, String workspaceName, String endpointName, + PartialMinimalTrackedResourceWithIdentity body, Context context) { + return beginUpdateAsync(resourceGroupName, workspaceName, endpointName, body, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Update Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1252,17 +973,14 @@ private Mono updateAsync( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OnlineEndpointInner update( - String resourceGroupName, - String workspaceName, - String endpointName, + public OnlineEndpointInner update(String resourceGroupName, String workspaceName, String endpointName, PartialMinimalTrackedResourceWithIdentity body) { return updateAsync(resourceGroupName, workspaceName, endpointName, body).block(); } /** * Update Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1274,18 +992,14 @@ public OnlineEndpointInner update( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OnlineEndpointInner update( - String resourceGroupName, - String workspaceName, - String endpointName, - PartialMinimalTrackedResourceWithIdentity body, - Context context) { + public OnlineEndpointInner update(String resourceGroupName, String workspaceName, String endpointName, + PartialMinimalTrackedResourceWithIdentity body, Context context) { return updateAsync(resourceGroupName, workspaceName, endpointName, body, context).block(); } /** * Create or update Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1296,19 +1010,15 @@ public OnlineEndpointInner update( * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String workspaceName, String endpointName, OnlineEndpointInner body) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String endpointName, OnlineEndpointInner body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1327,25 +1037,14 @@ private Mono>> createOrUpdateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - this.client.getApiVersion(), - body, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, endpointName, this.client.getApiVersion(), body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or update Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1357,23 +1056,15 @@ private Mono>> createOrUpdateWithResponseAsync( * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - OnlineEndpointInner body, - Context context) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String endpointName, OnlineEndpointInner body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1392,22 +1083,13 @@ private Mono>> createOrUpdateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - this.client.getApiVersion(), - body, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, endpointName, this.client.getApiVersion(), body, accept, context); } /** * Create or update Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1420,21 +1102,15 @@ private Mono>> createOrUpdateWithResponseAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, OnlineEndpointInner> beginCreateOrUpdateAsync( String resourceGroupName, String workspaceName, String endpointName, OnlineEndpointInner body) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, endpointName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OnlineEndpointInner.class, - OnlineEndpointInner.class, - this.client.getContext()); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, endpointName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + OnlineEndpointInner.class, OnlineEndpointInner.class, this.client.getContext()); } /** * Create or update Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1447,23 +1123,18 @@ private PollerFlux, OnlineEndpointInner> beginCr */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, OnlineEndpointInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - OnlineEndpointInner body, + String resourceGroupName, String workspaceName, String endpointName, OnlineEndpointInner body, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, endpointName, body, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), OnlineEndpointInner.class, OnlineEndpointInner.class, context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, endpointName, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + OnlineEndpointInner.class, OnlineEndpointInner.class, context); } /** * Create or update Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1481,7 +1152,7 @@ public SyncPoller, OnlineEndpointInner> beginCre /** * Create or update Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1494,19 +1165,15 @@ public SyncPoller, OnlineEndpointInner> beginCre */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, OnlineEndpointInner> beginCreateOrUpdate( - String resourceGroupName, - String workspaceName, - String endpointName, - OnlineEndpointInner body, + String resourceGroupName, String workspaceName, String endpointName, OnlineEndpointInner body, Context context) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, workspaceName, endpointName, body, context) + return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, endpointName, body, context) .getSyncPoller(); } /** * Create or update Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1517,16 +1184,15 @@ public SyncPoller, OnlineEndpointInner> beginCre * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String workspaceName, String endpointName, OnlineEndpointInner body) { - return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, endpointName, body) - .last() + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String endpointName, OnlineEndpointInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, endpointName, body).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Create or update Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1538,20 +1204,15 @@ private Mono createOrUpdateAsync( * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - OnlineEndpointInner body, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, endpointName, body, context) - .last() + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String endpointName, OnlineEndpointInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, endpointName, body, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Create or update Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1562,14 +1223,14 @@ private Mono createOrUpdateAsync( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OnlineEndpointInner createOrUpdate( - String resourceGroupName, String workspaceName, String endpointName, OnlineEndpointInner body) { + public OnlineEndpointInner createOrUpdate(String resourceGroupName, String workspaceName, String endpointName, + OnlineEndpointInner body) { return createOrUpdateAsync(resourceGroupName, workspaceName, endpointName, body).block(); } /** * Create or update Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1581,18 +1242,14 @@ public OnlineEndpointInner createOrUpdate( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OnlineEndpointInner createOrUpdate( - String resourceGroupName, - String workspaceName, - String endpointName, - OnlineEndpointInner body, - Context context) { + public OnlineEndpointInner createOrUpdate(String resourceGroupName, String workspaceName, String endpointName, + OnlineEndpointInner body, Context context) { return createOrUpdateAsync(resourceGroupName, workspaceName, endpointName, body, context).block(); } /** * List EndpointAuthKeys for an Endpoint using Key-based authentication. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1602,19 +1259,15 @@ public OnlineEndpointInner createOrUpdate( * @return keys for endpoint authentication along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeysWithResponseAsync( - String resourceGroupName, String workspaceName, String endpointName) { + private Mono> listKeysWithResponseAsync(String resourceGroupName, + String workspaceName, String endpointName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1628,24 +1281,14 @@ private Mono> listKeysWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listKeys( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.listKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, endpointName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List EndpointAuthKeys for an Endpoint using Key-based authentication. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1656,19 +1299,15 @@ private Mono> listKeysWithResponseAsync( * @return keys for endpoint authentication along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeysWithResponseAsync( - String resourceGroupName, String workspaceName, String endpointName, Context context) { + private Mono> listKeysWithResponseAsync(String resourceGroupName, + String workspaceName, String endpointName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1682,21 +1321,13 @@ private Mono> listKeysWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listKeys( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - this.client.getApiVersion(), - accept, - context); + return service.listKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, endpointName, this.client.getApiVersion(), accept, context); } /** * List EndpointAuthKeys for an Endpoint using Key-based authentication. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1706,15 +1337,15 @@ private Mono> listKeysWithResponseAsync( * @return keys for endpoint authentication on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listKeysAsync( - String resourceGroupName, String workspaceName, String endpointName) { + private Mono listKeysAsync(String resourceGroupName, String workspaceName, + String endpointName) { return listKeysWithResponseAsync(resourceGroupName, workspaceName, endpointName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * List EndpointAuthKeys for an Endpoint using Key-based authentication. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1725,14 +1356,14 @@ private Mono listKeysAsync( * @return keys for endpoint authentication along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listKeysWithResponse( - String resourceGroupName, String workspaceName, String endpointName, Context context) { + public Response listKeysWithResponse(String resourceGroupName, String workspaceName, + String endpointName, Context context) { return listKeysWithResponseAsync(resourceGroupName, workspaceName, endpointName, context).block(); } /** * List EndpointAuthKeys for an Endpoint using Key-based authentication. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1748,7 +1379,7 @@ public EndpointAuthKeysInner listKeys(String resourceGroupName, String workspace /** * Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1759,19 +1390,15 @@ public EndpointAuthKeysInner listKeys(String resourceGroupName, String workspace * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> regenerateKeysWithResponseAsync( - String resourceGroupName, String workspaceName, String endpointName, RegenerateEndpointKeysRequest body) { + private Mono>> regenerateKeysWithResponseAsync(String resourceGroupName, + String workspaceName, String endpointName, RegenerateEndpointKeysRequest body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1790,25 +1417,14 @@ private Mono>> regenerateKeysWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .regenerateKeys( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - this.client.getApiVersion(), - body, - accept, - context)) + .withContext(context -> service.regenerateKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, endpointName, this.client.getApiVersion(), body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1820,23 +1436,15 @@ private Mono>> regenerateKeysWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> regenerateKeysWithResponseAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - RegenerateEndpointKeysRequest body, - Context context) { + private Mono>> regenerateKeysWithResponseAsync(String resourceGroupName, + String workspaceName, String endpointName, RegenerateEndpointKeysRequest body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1855,22 +1463,13 @@ private Mono>> regenerateKeysWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .regenerateKeys( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - this.client.getApiVersion(), - body, - accept, - context); + return service.regenerateKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, endpointName, this.client.getApiVersion(), body, accept, context); } /** * Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1881,19 +1480,17 @@ private Mono>> regenerateKeysWithResponseAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginRegenerateKeysAsync( - String resourceGroupName, String workspaceName, String endpointName, RegenerateEndpointKeysRequest body) { - Mono>> mono = - regenerateKeysWithResponseAsync(resourceGroupName, workspaceName, endpointName, body); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + private PollerFlux, Void> beginRegenerateKeysAsync(String resourceGroupName, String workspaceName, + String endpointName, RegenerateEndpointKeysRequest body) { + Mono>> mono + = regenerateKeysWithResponseAsync(resourceGroupName, workspaceName, endpointName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1905,23 +1502,18 @@ private PollerFlux, Void> beginRegenerateKeysAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginRegenerateKeysAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - RegenerateEndpointKeysRequest body, - Context context) { + private PollerFlux, Void> beginRegenerateKeysAsync(String resourceGroupName, String workspaceName, + String endpointName, RegenerateEndpointKeysRequest body, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - regenerateKeysWithResponseAsync(resourceGroupName, workspaceName, endpointName, body, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + Mono>> mono + = regenerateKeysWithResponseAsync(resourceGroupName, workspaceName, endpointName, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** * Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1932,14 +1524,14 @@ private PollerFlux, Void> beginRegenerateKeysAsync( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginRegenerateKeys( - String resourceGroupName, String workspaceName, String endpointName, RegenerateEndpointKeysRequest body) { + public SyncPoller, Void> beginRegenerateKeys(String resourceGroupName, String workspaceName, + String endpointName, RegenerateEndpointKeysRequest body) { return this.beginRegenerateKeysAsync(resourceGroupName, workspaceName, endpointName, body).getSyncPoller(); } /** * Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1951,20 +1543,15 @@ public SyncPoller, Void> beginRegenerateKeys( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginRegenerateKeys( - String resourceGroupName, - String workspaceName, - String endpointName, - RegenerateEndpointKeysRequest body, - Context context) { - return this - .beginRegenerateKeysAsync(resourceGroupName, workspaceName, endpointName, body, context) + public SyncPoller, Void> beginRegenerateKeys(String resourceGroupName, String workspaceName, + String endpointName, RegenerateEndpointKeysRequest body, Context context) { + return this.beginRegenerateKeysAsync(resourceGroupName, workspaceName, endpointName, body, context) .getSyncPoller(); } /** * Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1975,16 +1562,15 @@ public SyncPoller, Void> beginRegenerateKeys( * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono regenerateKeysAsync( - String resourceGroupName, String workspaceName, String endpointName, RegenerateEndpointKeysRequest body) { - return beginRegenerateKeysAsync(resourceGroupName, workspaceName, endpointName, body) - .last() + private Mono regenerateKeysAsync(String resourceGroupName, String workspaceName, String endpointName, + RegenerateEndpointKeysRequest body) { + return beginRegenerateKeysAsync(resourceGroupName, workspaceName, endpointName, body).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -1996,20 +1582,15 @@ private Mono regenerateKeysAsync( * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono regenerateKeysAsync( - String resourceGroupName, - String workspaceName, - String endpointName, - RegenerateEndpointKeysRequest body, - Context context) { - return beginRegenerateKeysAsync(resourceGroupName, workspaceName, endpointName, body, context) - .last() + private Mono regenerateKeysAsync(String resourceGroupName, String workspaceName, String endpointName, + RegenerateEndpointKeysRequest body, Context context) { + return beginRegenerateKeysAsync(resourceGroupName, workspaceName, endpointName, body, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -2019,14 +1600,14 @@ private Mono regenerateKeysAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void regenerateKeys( - String resourceGroupName, String workspaceName, String endpointName, RegenerateEndpointKeysRequest body) { + public void regenerateKeys(String resourceGroupName, String workspaceName, String endpointName, + RegenerateEndpointKeysRequest body) { regenerateKeysAsync(resourceGroupName, workspaceName, endpointName, body).block(); } /** * Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -2037,18 +1618,14 @@ public void regenerateKeys( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void regenerateKeys( - String resourceGroupName, - String workspaceName, - String endpointName, - RegenerateEndpointKeysRequest body, - Context context) { + public void regenerateKeys(String resourceGroupName, String workspaceName, String endpointName, + RegenerateEndpointKeysRequest body, Context context) { regenerateKeysAsync(resourceGroupName, workspaceName, endpointName, body, context).block(); } /** - * Retrieve a valid AAD token for an Endpoint using AMLToken-based authentication. - * + * Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -2058,19 +1635,15 @@ public void regenerateKeys( * @return service Token along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getTokenWithResponseAsync( - String resourceGroupName, String workspaceName, String endpointName) { + private Mono> getTokenWithResponseAsync(String resourceGroupName, + String workspaceName, String endpointName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2084,24 +1657,14 @@ private Mono> getTokenWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .getToken( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.getToken(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, endpointName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieve a valid AAD token for an Endpoint using AMLToken-based authentication. - * + * Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -2112,19 +1675,15 @@ private Mono> getTokenWithResponseAsync( * @return service Token along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getTokenWithResponseAsync( - String resourceGroupName, String workspaceName, String endpointName, Context context) { + private Mono> getTokenWithResponseAsync(String resourceGroupName, + String workspaceName, String endpointName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2138,21 +1697,13 @@ private Mono> getTokenWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .getToken( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - endpointName, - this.client.getApiVersion(), - accept, - context); + return service.getToken(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, endpointName, this.client.getApiVersion(), accept, context); } /** - * Retrieve a valid AAD token for an Endpoint using AMLToken-based authentication. - * + * Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -2162,15 +1713,15 @@ private Mono> getTokenWithResponseAsync( * @return service Token on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getTokenAsync( - String resourceGroupName, String workspaceName, String endpointName) { + private Mono getTokenAsync(String resourceGroupName, String workspaceName, + String endpointName) { return getTokenWithResponseAsync(resourceGroupName, workspaceName, endpointName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Retrieve a valid AAD token for an Endpoint using AMLToken-based authentication. - * + * Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -2181,14 +1732,14 @@ private Mono getTokenAsync( * @return service Token along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getTokenWithResponse( - String resourceGroupName, String workspaceName, String endpointName, Context context) { + public Response getTokenWithResponse(String resourceGroupName, String workspaceName, + String endpointName, Context context) { return getTokenWithResponseAsync(resourceGroupName, workspaceName, endpointName, context).block(); } /** - * Retrieve a valid AAD token for an Endpoint using AMLToken-based authentication. - * + * Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -2204,14 +1755,13 @@ public EndpointAuthTokenInner getToken(String resourceGroupName, String workspac /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of OnlineEndpoint entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -2219,37 +1769,26 @@ private Mono> listNextSinglePageAsync(String return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of OnlineEndpoint entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -2257,23 +1796,13 @@ private Mono> listNextSinglePageAsync(String return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OnlineEndpointsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OnlineEndpointsImpl.java index 6bf5914ab736e..06c9718071702 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OnlineEndpointsImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OnlineEndpointsImpl.java @@ -28,8 +28,7 @@ public final class OnlineEndpointsImpl implements OnlineEndpoints { private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - public OnlineEndpointsImpl( - OnlineEndpointsClient innerClient, + public OnlineEndpointsImpl(OnlineEndpointsClient innerClient, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -37,35 +36,15 @@ public OnlineEndpointsImpl( public PagedIterable list(String resourceGroupName, String workspaceName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); - return Utils.mapPage(inner, inner1 -> new OnlineEndpointImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OnlineEndpointImpl(inner1, this.manager())); } - public PagedIterable list( - String resourceGroupName, - String workspaceName, - String name, - Integer count, - EndpointComputeType computeType, - String skip, - String tags, - String properties, - OrderString orderBy, - Context context) { - PagedIterable inner = - this - .serviceClient() - .list( - resourceGroupName, - workspaceName, - name, - count, - computeType, - skip, - tags, - properties, - orderBy, - context); - return Utils.mapPage(inner, inner1 -> new OnlineEndpointImpl(inner1, this.manager())); + public PagedIterable list(String resourceGroupName, String workspaceName, String name, + Integer count, EndpointComputeType computeType, String skip, String tags, String properties, + OrderString orderBy, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, workspaceName, name, count, computeType, skip, tags, properties, orderBy, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OnlineEndpointImpl(inner1, this.manager())); } public void delete(String resourceGroupName, String workspaceName, String endpointName) { @@ -76,15 +55,12 @@ public void delete(String resourceGroupName, String workspaceName, String endpoi this.serviceClient().delete(resourceGroupName, workspaceName, endpointName, context); } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String endpointName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, workspaceName, endpointName, context); + public Response getWithResponse(String resourceGroupName, String workspaceName, String endpointName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, endpointName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new OnlineEndpointImpl(inner.getValue(), this.manager())); } else { return null; @@ -100,15 +76,12 @@ public OnlineEndpoint get(String resourceGroupName, String workspaceName, String } } - public Response listKeysWithResponse( - String resourceGroupName, String workspaceName, String endpointName, Context context) { - Response inner = - this.serviceClient().listKeysWithResponse(resourceGroupName, workspaceName, endpointName, context); + public Response listKeysWithResponse(String resourceGroupName, String workspaceName, + String endpointName, Context context) { + Response inner + = this.serviceClient().listKeysWithResponse(resourceGroupName, workspaceName, endpointName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new EndpointAuthKeysImpl(inner.getValue(), this.manager())); } else { return null; @@ -124,29 +97,22 @@ public EndpointAuthKeys listKeys(String resourceGroupName, String workspaceName, } } - public void regenerateKeys( - String resourceGroupName, String workspaceName, String endpointName, RegenerateEndpointKeysRequest body) { + public void regenerateKeys(String resourceGroupName, String workspaceName, String endpointName, + RegenerateEndpointKeysRequest body) { this.serviceClient().regenerateKeys(resourceGroupName, workspaceName, endpointName, body); } - public void regenerateKeys( - String resourceGroupName, - String workspaceName, - String endpointName, - RegenerateEndpointKeysRequest body, - Context context) { + public void regenerateKeys(String resourceGroupName, String workspaceName, String endpointName, + RegenerateEndpointKeysRequest body, Context context) { this.serviceClient().regenerateKeys(resourceGroupName, workspaceName, endpointName, body, context); } - public Response getTokenWithResponse( - String resourceGroupName, String workspaceName, String endpointName, Context context) { - Response inner = - this.serviceClient().getTokenWithResponse(resourceGroupName, workspaceName, endpointName, context); + public Response getTokenWithResponse(String resourceGroupName, String workspaceName, + String endpointName, Context context) { + Response inner + = this.serviceClient().getTokenWithResponse(resourceGroupName, workspaceName, endpointName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new EndpointAuthTokenImpl(inner.getValue(), this.manager())); } else { return null; @@ -163,109 +129,77 @@ public EndpointAuthToken getToken(String resourceGroupName, String workspaceName } public OnlineEndpoint getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String endpointName = Utils.getValueFromIdByName(id, "onlineEndpoints"); + String endpointName = ResourceManagerUtils.getValueFromIdByName(id, "onlineEndpoints"); if (endpointName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'onlineEndpoints'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'onlineEndpoints'.", id))); } return this.getWithResponse(resourceGroupName, workspaceName, endpointName, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String endpointName = Utils.getValueFromIdByName(id, "onlineEndpoints"); + String endpointName = ResourceManagerUtils.getValueFromIdByName(id, "onlineEndpoints"); if (endpointName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'onlineEndpoints'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'onlineEndpoints'.", id))); } return this.getWithResponse(resourceGroupName, workspaceName, endpointName, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String endpointName = Utils.getValueFromIdByName(id, "onlineEndpoints"); + String endpointName = ResourceManagerUtils.getValueFromIdByName(id, "onlineEndpoints"); if (endpointName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'onlineEndpoints'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'onlineEndpoints'.", id))); } this.delete(resourceGroupName, workspaceName, endpointName, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String endpointName = Utils.getValueFromIdByName(id, "onlineEndpoints"); + String endpointName = ResourceManagerUtils.getValueFromIdByName(id, "onlineEndpoints"); if (endpointName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'onlineEndpoints'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'onlineEndpoints'.", id))); } this.delete(resourceGroupName, workspaceName, endpointName, context); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OperationImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OperationImpl.java new file mode 100644 index 0000000000000..99e81f54aa8ee --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OperationImpl.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.resourcemanager.machinelearning.fluent.models.OperationInner; +import com.azure.resourcemanager.machinelearning.models.ActionType; +import com.azure.resourcemanager.machinelearning.models.Operation; +import com.azure.resourcemanager.machinelearning.models.OperationDisplay; +import com.azure.resourcemanager.machinelearning.models.Origin; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + OperationImpl(OperationInner innerObject, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public Origin origin() { + return this.innerModel().origin(); + } + + public ActionType actionType() { + return this.innerModel().actionType(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OperationsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OperationsClientImpl.java index da8db6fc97aac..52d69a6933a90 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OperationsClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OperationsClientImpl.java @@ -25,153 +25,149 @@ import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.machinelearning.fluent.OperationsClient; -import com.azure.resourcemanager.machinelearning.fluent.models.AmlOperationInner; -import com.azure.resourcemanager.machinelearning.models.AmlOperationListResult; +import com.azure.resourcemanager.machinelearning.fluent.models.OperationInner; +import com.azure.resourcemanager.machinelearning.models.OperationListResult; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in OperationsClient. */ +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ public final class OperationsClientImpl implements OperationsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final OperationsService service; - /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of OperationsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ - OperationsClientImpl(AzureMachineLearningWorkspacesImpl client) { - this.service = - RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + OperationsClientImpl(AzureMachineLearningServicesImpl client) { + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesOperations to be used by the proxy + * The interface defining all the services for AzureMachineLearningServicesOperations to be used by the proxy * service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AzureMachineLearning") public interface OperationsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.MachineLearningServices/operations") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); } /** * Lists all of the available Azure Machine Learning Workspaces REST API operations. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an array of operations supported by the resource provider along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { + private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), null, null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Lists all of the available Azure Machine Learning Workspaces REST API operations. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an array of operations supported by the resource provider along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { + private Mono> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), null, null)); } /** * Lists all of the available Azure Machine Learning Workspaces REST API operations. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an array of operations supported by the resource provider as paginated response with {@link PagedFlux}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { + private PagedFlux listAsync() { return new PagedFlux<>(() -> listSinglePageAsync()); } /** * Lists all of the available Azure Machine Learning Workspaces REST API operations. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an array of operations supported by the resource provider as paginated response with {@link PagedFlux}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { + private PagedFlux listAsync(Context context) { return new PagedFlux<>(() -> listSinglePageAsync(context)); } /** * Lists all of the available Azure Machine Learning Workspaces REST API operations. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an array of operations supported by the resource provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { + public PagedIterable list() { return new PagedIterable<>(listAsync()); } /** * Lists all of the available Azure Machine Learning Workspaces REST API operations. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an array of operations supported by the resource provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { + public PagedIterable list(Context context) { return new PagedIterable<>(listAsync(context)); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OperationsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OperationsImpl.java index 9a500e365bd68..dda6d3e325819 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OperationsImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OperationsImpl.java @@ -8,8 +8,8 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.machinelearning.fluent.OperationsClient; -import com.azure.resourcemanager.machinelearning.fluent.models.AmlOperationInner; -import com.azure.resourcemanager.machinelearning.models.AmlOperation; +import com.azure.resourcemanager.machinelearning.fluent.models.OperationInner; +import com.azure.resourcemanager.machinelearning.models.Operation; import com.azure.resourcemanager.machinelearning.models.Operations; public final class OperationsImpl implements Operations { @@ -19,20 +19,20 @@ public final class OperationsImpl implements Operations { private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - public OperationsImpl( - OperationsClient innerClient, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + public OperationsImpl(OperationsClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new AmlOperationImpl(inner1, this.manager())); + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new AmlOperationImpl(inner1, this.manager())); + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } private OperationsClient serviceClient() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OutboundRuleBasicResourceImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OutboundRuleBasicResourceImpl.java new file mode 100644 index 0000000000000..535ca75832ee7 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/OutboundRuleBasicResourceImpl.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.OutboundRuleBasicResourceInner; +import com.azure.resourcemanager.machinelearning.models.OutboundRule; +import com.azure.resourcemanager.machinelearning.models.OutboundRuleBasicResource; + +public final class OutboundRuleBasicResourceImpl + implements OutboundRuleBasicResource, OutboundRuleBasicResource.Definition, OutboundRuleBasicResource.Update { + private OutboundRuleBasicResourceInner innerObject; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public OutboundRule properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public OutboundRuleBasicResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String ruleName; + + public OutboundRuleBasicResourceImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public OutboundRuleBasicResource create() { + this.innerObject = serviceManager.serviceClient() + .getManagedNetworkSettingsRules() + .createOrUpdate(resourceGroupName, workspaceName, ruleName, this.innerModel(), Context.NONE); + return this; + } + + public OutboundRuleBasicResource create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getManagedNetworkSettingsRules() + .createOrUpdate(resourceGroupName, workspaceName, ruleName, this.innerModel(), context); + return this; + } + + OutboundRuleBasicResourceImpl(String name, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = new OutboundRuleBasicResourceInner(); + this.serviceManager = serviceManager; + this.ruleName = name; + } + + public OutboundRuleBasicResourceImpl update() { + return this; + } + + public OutboundRuleBasicResource apply() { + this.innerObject = serviceManager.serviceClient() + .getManagedNetworkSettingsRules() + .createOrUpdate(resourceGroupName, workspaceName, ruleName, this.innerModel(), Context.NONE); + return this; + } + + public OutboundRuleBasicResource apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getManagedNetworkSettingsRules() + .createOrUpdate(resourceGroupName, workspaceName, ruleName, this.innerModel(), context); + return this; + } + + OutboundRuleBasicResourceImpl(OutboundRuleBasicResourceInner innerObject, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.ruleName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "outboundRules"); + } + + public OutboundRuleBasicResource refresh() { + this.innerObject = serviceManager.serviceClient() + .getManagedNetworkSettingsRules() + .getWithResponse(resourceGroupName, workspaceName, ruleName, Context.NONE) + .getValue(); + return this; + } + + public OutboundRuleBasicResource refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getManagedNetworkSettingsRules() + .getWithResponse(resourceGroupName, workspaceName, ruleName, context) + .getValue(); + return this; + } + + public OutboundRuleBasicResourceImpl withProperties(OutboundRule properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PendingUploadResponseDtoImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PendingUploadResponseDtoImpl.java new file mode 100644 index 0000000000000..dd3dc73314e88 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PendingUploadResponseDtoImpl.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.resourcemanager.machinelearning.fluent.models.PendingUploadResponseDtoInner; +import com.azure.resourcemanager.machinelearning.models.BlobReferenceForConsumptionDto; +import com.azure.resourcemanager.machinelearning.models.PendingUploadResponseDto; +import com.azure.resourcemanager.machinelearning.models.PendingUploadType; + +public final class PendingUploadResponseDtoImpl implements PendingUploadResponseDto { + private PendingUploadResponseDtoInner innerObject; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + PendingUploadResponseDtoImpl(PendingUploadResponseDtoInner innerObject, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public BlobReferenceForConsumptionDto blobReferenceForConsumption() { + return this.innerModel().blobReferenceForConsumption(); + } + + public String pendingUploadId() { + return this.innerModel().pendingUploadId(); + } + + public PendingUploadType pendingUploadType() { + return this.innerModel().pendingUploadType(); + } + + public PendingUploadResponseDtoInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateEndpointConnectionImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateEndpointConnectionImpl.java index edc0d80a01ead..c8219e514cfc5 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateEndpointConnectionImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateEndpointConnectionImpl.java @@ -105,29 +105,25 @@ public PrivateEndpointConnectionImpl withExistingWorkspace(String resourceGroupN } public PrivateEndpointConnection create() { - this.innerObject = - serviceManager - .serviceClient() - .getPrivateEndpointConnections() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, privateEndpointConnectionName, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, + this.innerModel(), Context.NONE) + .getValue(); return this; } public PrivateEndpointConnection create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getPrivateEndpointConnections() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, privateEndpointConnectionName, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, + this.innerModel(), context) + .getValue(); return this; } - PrivateEndpointConnectionImpl( - String name, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + PrivateEndpointConnectionImpl(String name, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = new PrivateEndpointConnectionInner(); this.serviceManager = serviceManager; this.privateEndpointConnectionName = name; @@ -138,54 +134,46 @@ public PrivateEndpointConnectionImpl update() { } public PrivateEndpointConnection apply() { - this.innerObject = - serviceManager - .serviceClient() - .getPrivateEndpointConnections() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, privateEndpointConnectionName, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, + this.innerModel(), Context.NONE) + .getValue(); return this; } public PrivateEndpointConnection apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getPrivateEndpointConnections() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, privateEndpointConnectionName, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, + this.innerModel(), context) + .getValue(); return this; } - PrivateEndpointConnectionImpl( - PrivateEndpointConnectionInner innerObject, + PrivateEndpointConnectionImpl(PrivateEndpointConnectionInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); - this.privateEndpointConnectionName = Utils.getValueFromIdByName(innerObject.id(), "privateEndpointConnections"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "privateEndpointConnections"); } public PrivateEndpointConnection refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getPrivateEndpointConnections() - .getWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, Context.NONE) + .getValue(); return this; } public PrivateEndpointConnection refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getPrivateEndpointConnections() - .getWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, context) + .getValue(); return this; } @@ -219,8 +207,8 @@ public PrivateEndpointConnectionImpl withPrivateEndpoint(PrivateEndpoint private return this; } - public PrivateEndpointConnectionImpl withPrivateLinkServiceConnectionState( - PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + public PrivateEndpointConnectionImpl + withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { this.innerModel().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); return this; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateEndpointConnectionsClientImpl.java index a2ee937022f0f..8795f1b3db3d5 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateEndpointConnectionsClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateEndpointConnectionsClientImpl.java @@ -33,121 +33,97 @@ import com.azure.resourcemanager.machinelearning.models.PrivateEndpointConnectionListResult; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +/** + * An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. + */ public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final PrivateEndpointConnectionsService service; - /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of PrivateEndpointConnectionsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ - PrivateEndpointConnectionsClientImpl(AzureMachineLearningWorkspacesImpl client) { - this.service = - RestProxy - .create( - PrivateEndpointConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + PrivateEndpointConnectionsClientImpl(AzureMachineLearningServicesImpl client) { + this.service = RestProxy.create(PrivateEndpointConnectionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesPrivateEndpointConnections to be used - * by the proxy service to perform REST calls. + * The interface defining all the services for AzureMachineLearningServicesPrivateEndpointConnections to be used by + * the proxy service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AzureMachineLearning") public interface PrivateEndpointConnectionsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections" - + "/{privateEndpointConnectionName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections" - + "/{privateEndpointConnectionName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, + Mono> createOrUpdate(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") PrivateEndpointConnectionInner properties, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections" - + "/{privateEndpointConnectionName}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, + Mono> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); } /** * List all the private endpoint connections associated with the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified workspace along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return list of private endpoint connection associated with the specified workspace along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String workspaceName) { + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -157,51 +133,36 @@ private Mono> listSinglePageAsync( return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - resourceGroupName, - workspaceName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .withContext(context -> service.list(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List all the private endpoint connections associated with the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified workspace along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return list of private endpoint connection associated with the specified workspace along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String workspaceName, Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -211,38 +172,28 @@ private Mono> listSinglePageAsync( return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - resourceGroupName, - workspaceName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + .list(this.client.getEndpoint(), resourceGroupName, workspaceName, this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), null, null)); } /** * List all the private endpoint connections associated with the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of private endpoint connection associated with the specified workspace as paginated response with - * {@link PagedFlux}. + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String workspaceName) { @@ -251,7 +202,7 @@ private PagedFlux listAsync(String resourceGroup /** * List all the private endpoint connections associated with the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -259,24 +210,24 @@ private PagedFlux listAsync(String resourceGroup * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of private endpoint connection associated with the specified workspace as paginated response with - * {@link PagedFlux}. + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String workspaceName, Context context) { + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + Context context) { return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, context)); } /** * List all the private endpoint connections associated with the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of private endpoint connection associated with the specified workspace as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String workspaceName) { @@ -285,7 +236,7 @@ public PagedIterable list(String resourceGroupNa /** * List all the private endpoint connections associated with the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -293,17 +244,17 @@ public PagedIterable list(String resourceGroupNa * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of private endpoint connection associated with the specified workspace as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String workspaceName, Context context) { + public PagedIterable list(String resourceGroupName, String workspaceName, + Context context) { return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, context)); } /** * Gets the specified private endpoint connection associated with the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. @@ -311,22 +262,18 @@ public PagedIterable list( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the specified private endpoint connection associated with the workspace along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + private Mono> getWithResponseAsync(String resourceGroupName, + String workspaceName, String privateEndpointConnectionName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -336,31 +283,20 @@ private Mono> getWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - privateEndpointConnectionName, - this.client.getApiVersion(), - accept, - context)) + context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, privateEndpointConnectionName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the specified private endpoint connection associated with the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. @@ -369,22 +305,18 @@ private Mono> getWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the specified private endpoint connection associated with the workspace along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, + String workspaceName, String privateEndpointConnectionName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -394,28 +326,18 @@ private Mono> getWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - privateEndpointConnectionName, - this.client.getApiVersion(), - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + privateEndpointConnectionName, this.client.getApiVersion(), accept, context); } /** * Gets the specified private endpoint connection associated with the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. @@ -423,18 +345,18 @@ private Mono> getWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the specified private endpoint connection associated with the workspace on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + private Mono getAsync(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName) { return getWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets the specified private endpoint connection associated with the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. @@ -445,14 +367,14 @@ private Mono getAsync( * @return the specified private endpoint connection associated with the workspace along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { + public Response getWithResponse(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName, Context context) { return getWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, context).block(); } /** * Gets the specified private endpoint connection associated with the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. @@ -462,15 +384,15 @@ public Response getWithResponse( * @return the specified private endpoint connection associated with the workspace. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner get( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + public PrivateEndpointConnectionInner get(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName) { return getWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, Context.NONE) .getValue(); } /** * Update the state of specified private endpoint connection associated with the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. @@ -478,26 +400,19 @@ public PrivateEndpointConnectionInner get( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of {@link - * Mono}. + * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String workspaceName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner properties) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -507,10 +422,8 @@ private Mono> createOrUpdateWithRespons return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } if (properties == null) { return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); @@ -519,25 +432,15 @@ private Mono> createOrUpdateWithRespons } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - privateEndpointConnectionName, - this.client.getApiVersion(), - properties, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, privateEndpointConnectionName, this.client.getApiVersion(), + properties, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Update the state of specified private endpoint connection associated with the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. @@ -546,27 +449,20 @@ private Mono> createOrUpdateWithRespons * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of {@link - * Mono}. + * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String workspaceName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties, + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner properties, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -576,10 +472,8 @@ private Mono> createOrUpdateWithRespons return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } if (properties == null) { return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); @@ -588,22 +482,13 @@ private Mono> createOrUpdateWithRespons } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - privateEndpointConnectionName, - this.client.getApiVersion(), - properties, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, privateEndpointConnectionName, this.client.getApiVersion(), properties, accept, context); } /** * Update the state of specified private endpoint connection associated with the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. @@ -614,19 +499,15 @@ private Mono> createOrUpdateWithRespons * @return the Private Endpoint Connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String workspaceName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties) { - return createOrUpdateWithResponseAsync( - resourceGroupName, workspaceName, privateEndpointConnectionName, properties) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner properties) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, + properties).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Update the state of specified private endpoint connection associated with the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. @@ -638,20 +519,16 @@ private Mono createOrUpdateAsync( * @return the Private Endpoint Connection resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties, + public Response createOrUpdateWithResponse(String resourceGroupName, + String workspaceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner properties, Context context) { - return createOrUpdateWithResponseAsync( - resourceGroupName, workspaceName, privateEndpointConnectionName, properties, context) - .block(); + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, + properties, context).block(); } /** * Update the state of specified private endpoint connection associated with the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. @@ -662,19 +539,15 @@ public Response createOrUpdateWithResponse( * @return the Private Endpoint Connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner createOrUpdate( - String resourceGroupName, - String workspaceName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties) { - return createOrUpdateWithResponse( - resourceGroupName, workspaceName, privateEndpointConnectionName, properties, Context.NONE) - .getValue(); + public PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner properties) { + return createOrUpdateWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, properties, + Context.NONE).getValue(); } /** * Deletes the specified private endpoint connection associated with the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. @@ -684,19 +557,15 @@ public PrivateEndpointConnectionInner createOrUpdate( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -706,31 +575,20 @@ private Mono> deleteWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - privateEndpointConnectionName, - this.client.getApiVersion(), - accept, - context)) + context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, privateEndpointConnectionName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Deletes the specified private endpoint connection associated with the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. @@ -741,19 +599,15 @@ private Mono> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -763,28 +617,18 @@ private Mono> deleteWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - privateEndpointConnectionName, - this.client.getApiVersion(), - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, privateEndpointConnectionName, this.client.getApiVersion(), accept, context); } /** * Deletes the specified private endpoint connection associated with the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. @@ -794,15 +638,15 @@ private Mono> deleteWithResponseAsync( * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + private Mono deleteAsync(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName) { return deleteWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName) .flatMap(ignored -> Mono.empty()); } /** * Deletes the specified private endpoint connection associated with the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. @@ -813,15 +657,15 @@ private Mono deleteAsync( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { + public Response deleteWithResponse(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName, Context context) { return deleteWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, context) .block(); } /** * Deletes the specified private endpoint connection associated with the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateEndpointConnectionsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateEndpointConnectionsImpl.java index 33910826bfaf3..03774c6fedf2a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateEndpointConnectionsImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateEndpointConnectionsImpl.java @@ -21,47 +21,41 @@ public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConn private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - public PrivateEndpointConnectionsImpl( - PrivateEndpointConnectionsClient innerClient, + public PrivateEndpointConnectionsImpl(PrivateEndpointConnectionsClient innerClient, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list(String resourceGroupName, String workspaceName) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, workspaceName); - return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); } - public PagedIterable list( - String resourceGroupName, String workspaceName, Context context) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, workspaceName, context); - return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + public PagedIterable list(String resourceGroupName, String workspaceName, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { - Response inner = - this - .serviceClient() - .getWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, context); + public Response getWithResponse(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); } else { return null; } } - public PrivateEndpointConnection get( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { - PrivateEndpointConnectionInner inner = - this.serviceClient().get(resourceGroupName, workspaceName, privateEndpointConnectionName); + public PrivateEndpointConnection get(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName) { + PrivateEndpointConnectionInner inner + = this.serviceClient().get(resourceGroupName, workspaceName, privateEndpointConnectionName); if (inner != null) { return new PrivateEndpointConnectionImpl(inner, this.manager()); } else { @@ -69,10 +63,9 @@ public PrivateEndpointConnection get( } } - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { - return this - .serviceClient() + public Response deleteWithResponse(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName, Context context) { + return this.serviceClient() .deleteWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, context); } @@ -81,119 +74,82 @@ public void delete(String resourceGroupName, String workspaceName, String privat } public PrivateEndpointConnection getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + String privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); if (privateEndpointConnectionName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", - id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); } - return this - .getWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, Context.NONE) + return this.getWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, Context.NONE) .getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + String privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); if (privateEndpointConnectionName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", - id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); } return this.getWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + String privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); if (privateEndpointConnectionName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", - id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); } this.deleteWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + String privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); if (privateEndpointConnectionName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", - id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); } return this.deleteWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, context); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateLinkResourceListResultImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateLinkResourceListResultImpl.java index 14109bebe8033..b245faebb0a88 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateLinkResourceListResultImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateLinkResourceListResultImpl.java @@ -15,8 +15,7 @@ public final class PrivateLinkResourceListResultImpl implements PrivateLinkResou private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - PrivateLinkResourceListResultImpl( - PrivateLinkResourceListResultInner innerObject, + PrivateLinkResourceListResultImpl(PrivateLinkResourceListResultInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateLinkResourcesClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateLinkResourcesClientImpl.java index e5f6ffba120f0..199d0432bb925 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateLinkResourcesClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateLinkResourcesClientImpl.java @@ -25,74 +25,69 @@ import com.azure.resourcemanager.machinelearning.fluent.models.PrivateLinkResourceListResultInner; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ +/** + * An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. + */ public final class PrivateLinkResourcesClientImpl implements PrivateLinkResourcesClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final PrivateLinkResourcesService service; - /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of PrivateLinkResourcesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ - PrivateLinkResourcesClientImpl(AzureMachineLearningWorkspacesImpl client) { - this.service = - RestProxy - .create(PrivateLinkResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + PrivateLinkResourcesClientImpl(AzureMachineLearningServicesImpl client) { + this.service = RestProxy.create(PrivateLinkResourcesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesPrivateLinkResources to be used by the + * The interface defining all the services for AzureMachineLearningServicesPrivateLinkResources to be used by the * proxy service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AzureMachineLearning") public interface PrivateLinkResourcesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, + Mono> list(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); } /** * Gets the private link resources that need to be created for a workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private link resources that need to be created for a workspace along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync( - String resourceGroupName, String workspaceName) { + private Mono> listWithResponseAsync(String resourceGroupName, + String workspaceName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -103,23 +98,14 @@ private Mono> listWithResponseAsync } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the private link resources that need to be created for a workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -127,22 +113,18 @@ private Mono> listWithResponseAsync * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private link resources that need to be created for a workspace along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync( - String resourceGroupName, String workspaceName, Context context) { + private Mono> listWithResponseAsync(String resourceGroupName, + String workspaceName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -153,27 +135,20 @@ private Mono> listWithResponseAsync } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - this.client.getApiVersion(), - accept, - context); + return service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), accept, context); } /** * Gets the private link resources that need to be created for a workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a workspace on successful completion of {@link - * Mono}. + * @return the private link resources that need to be created for a workspace on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono listAsync(String resourceGroupName, String workspaceName) { @@ -182,7 +157,7 @@ private Mono listAsync(String resourceGroupN /** * Gets the private link resources that need to be created for a workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -192,14 +167,14 @@ private Mono listAsync(String resourceGroupN * @return the private link resources that need to be created for a workspace along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse( - String resourceGroupName, String workspaceName, Context context) { + public Response listWithResponse(String resourceGroupName, String workspaceName, + Context context) { return listWithResponseAsync(resourceGroupName, workspaceName, context).block(); } /** * Gets the private link resources that need to be created for a workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateLinkResourcesImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateLinkResourcesImpl.java index d230fde3cbf93..f221aad8c31a2 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateLinkResourcesImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/PrivateLinkResourcesImpl.java @@ -20,22 +20,18 @@ public final class PrivateLinkResourcesImpl implements PrivateLinkResources { private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - public PrivateLinkResourcesImpl( - PrivateLinkResourcesClient innerClient, + public PrivateLinkResourcesImpl(PrivateLinkResourcesClient innerClient, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public Response listWithResponse( - String resourceGroupName, String workspaceName, Context context) { - Response inner = - this.serviceClient().listWithResponse(resourceGroupName, workspaceName, context); + public Response listWithResponse(String resourceGroupName, String workspaceName, + Context context) { + Response inner + = this.serviceClient().listWithResponse(resourceGroupName, workspaceName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new PrivateLinkResourceListResultImpl(inner.getValue(), this.manager())); } else { return null; diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/QuotasClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/QuotasClientImpl.java index d639dc8a9983e..e268fba325383 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/QuotasClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/QuotasClientImpl.java @@ -34,97 +34,87 @@ import com.azure.resourcemanager.machinelearning.models.QuotaUpdateParameters; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in QuotasClient. */ +/** + * An instance of this class provides access to all the operations defined in QuotasClient. + */ public final class QuotasClientImpl implements QuotasClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final QuotasService service; - /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of QuotasClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ - QuotasClientImpl(AzureMachineLearningWorkspacesImpl client) { + QuotasClientImpl(AzureMachineLearningServicesImpl client) { this.service = RestProxy.create(QuotasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesQuotas to be used by the proxy service - * to perform REST calls. + * The interface defining all the services for AzureMachineLearningServicesQuotas to be used by the proxy service to + * perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AzureMachineLearning") public interface QuotasService { - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}" - + "/updateQuotas") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @PathParam("location") String location, - @QueryParam("api-version") String apiVersion, + Mono> update(@HostParam("$host") String endpoint, + @PathParam("location") String location, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") QuotaUpdateParameters parameters, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") QuotaUpdateParameters parameters, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Update quota for each VM family in workspace. - * + * * @param location The location for update quota is queried. * @param parameters Quota update parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of update workspace quota along with {@link Response} on successful completion of {@link - * Mono}. + * @return the result of update workspace quota along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String location, QuotaUpdateParameters parameters) { + private Mono> updateWithResponseAsync(String location, + QuotaUpdateParameters parameters) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); @@ -133,49 +123,36 @@ private Mono> updateWithResponseAsync } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - location, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), location, this.client.getApiVersion(), + this.client.getSubscriptionId(), parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Update quota for each VM family in workspace. - * + * * @param location The location for update quota is queried. * @param parameters Quota update parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of update workspace quota along with {@link Response} on successful completion of {@link - * Mono}. + * @return the result of update workspace quota along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String location, QuotaUpdateParameters parameters, Context context) { + private Mono> updateWithResponseAsync(String location, + QuotaUpdateParameters parameters, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); @@ -184,20 +161,13 @@ private Mono> updateWithResponseAsync } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - location, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); + return service.update(this.client.getEndpoint(), location, this.client.getApiVersion(), + this.client.getSubscriptionId(), parameters, accept, context); } /** * Update quota for each VM family in workspace. - * + * * @param location The location for update quota is queried. * @param parameters Quota update parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -212,7 +182,7 @@ private Mono updateAsync(String location, Quot /** * Update quota for each VM family in workspace. - * + * * @param location The location for update quota is queried. * @param parameters Quota update parameters. * @param context The context to associate with this operation. @@ -222,14 +192,14 @@ private Mono updateAsync(String location, Quot * @return the result of update workspace quota along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String location, QuotaUpdateParameters parameters, Context context) { + public Response updateWithResponse(String location, + QuotaUpdateParameters parameters, Context context) { return updateWithResponseAsync(location, parameters, context).block(); } /** * Update quota for each VM family in workspace. - * + * * @param location The location for update quota is queried. * @param parameters Quota update parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -244,79 +214,56 @@ public UpdateWorkspaceQuotasResultInner update(String location, QuotaUpdateParam /** * Gets the currently assigned Workspace Quotas based on VMFamily. - * + * * @param location The location for which resource usage is queried. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the currently assigned Workspace Quotas based on VMFamily along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String location) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - location, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the currently assigned Workspace Quotas based on VMFamily. - * + * * @param location The location for which resource usage is queried. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the currently assigned Workspace Quotas based on VMFamily along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String location, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -324,27 +271,15 @@ private Mono> listSinglePageAsync(String locat final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - location, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), location, + accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Gets the currently assigned Workspace Quotas based on VMFamily. - * + * * @param location The location for which resource usage is queried. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -358,7 +293,7 @@ private PagedFlux listAsync(String location) { /** * Gets the currently assigned Workspace Quotas based on VMFamily. - * + * * @param location The location for which resource usage is queried. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -368,19 +303,19 @@ private PagedFlux listAsync(String location) { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String location, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(location, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listSinglePageAsync(location, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Gets the currently assigned Workspace Quotas based on VMFamily. - * + * * @param location The location for which resource usage is queried. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently assigned Workspace Quotas based on VMFamily as paginated response with {@link - * PagedIterable}. + * @return the currently assigned Workspace Quotas based on VMFamily as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String location) { @@ -389,14 +324,14 @@ public PagedIterable list(String location) { /** * Gets the currently assigned Workspace Quotas based on VMFamily. - * + * * @param location The location for which resource usage is queried. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently assigned Workspace Quotas based on VMFamily as paginated response with {@link - * PagedIterable}. + * @return the currently assigned Workspace Quotas based on VMFamily as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String location, Context context) { @@ -405,14 +340,13 @@ public PagedIterable list(String location, Context context) /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the List WorkspaceQuotasByVMFamily operation response along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -420,37 +354,26 @@ private Mono> listNextSinglePageAsync(String n return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the List WorkspaceQuotasByVMFamily operation response along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -458,23 +381,13 @@ private Mono> listNextSinglePageAsync(String n return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/QuotasImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/QuotasImpl.java index 14cdcd39648de..e3278e22e6ec0 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/QuotasImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/QuotasImpl.java @@ -12,8 +12,8 @@ import com.azure.resourcemanager.machinelearning.fluent.QuotasClient; import com.azure.resourcemanager.machinelearning.fluent.models.ResourceQuotaInner; import com.azure.resourcemanager.machinelearning.fluent.models.UpdateWorkspaceQuotasResultInner; -import com.azure.resourcemanager.machinelearning.models.QuotaUpdateParameters; import com.azure.resourcemanager.machinelearning.models.Quotas; +import com.azure.resourcemanager.machinelearning.models.QuotaUpdateParameters; import com.azure.resourcemanager.machinelearning.models.ResourceQuota; import com.azure.resourcemanager.machinelearning.models.UpdateWorkspaceQuotasResult; @@ -24,21 +24,18 @@ public final class QuotasImpl implements Quotas { private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - public QuotasImpl( - QuotasClient innerClient, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + public QuotasImpl(QuotasClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public Response updateWithResponse( - String location, QuotaUpdateParameters parameters, Context context) { - Response inner = - this.serviceClient().updateWithResponse(location, parameters, context); + public Response updateWithResponse(String location, QuotaUpdateParameters parameters, + Context context) { + Response inner + = this.serviceClient().updateWithResponse(location, parameters, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new UpdateWorkspaceQuotasResultImpl(inner.getValue(), this.manager())); } else { return null; @@ -56,12 +53,12 @@ public UpdateWorkspaceQuotasResult update(String location, QuotaUpdateParameters public PagedIterable list(String location) { PagedIterable inner = this.serviceClient().list(location); - return Utils.mapPage(inner, inner1 -> new ResourceQuotaImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ResourceQuotaImpl(inner1, this.manager())); } public PagedIterable list(String location, Context context) { PagedIterable inner = this.serviceClient().list(location, context); - return Utils.mapPage(inner, inner1 -> new ResourceQuotaImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ResourceQuotaImpl(inner1, this.manager())); } private QuotasClient serviceClient() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistriesClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistriesClientImpl.java new file mode 100644 index 0000000000000..774c277c54b86 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistriesClientImpl.java @@ -0,0 +1,1413 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.RegistriesClient; +import com.azure.resourcemanager.machinelearning.fluent.models.RegistryInner; +import com.azure.resourcemanager.machinelearning.models.PartialRegistryPartialTrackedResource; +import com.azure.resourcemanager.machinelearning.models.RegistryTrackedResourceArmPaginatedResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in RegistriesClient. + */ +public final class RegistriesClientImpl implements RegistriesClient { + /** + * The proxy service used to perform REST calls. + */ + private final RegistriesService service; + + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of RegistriesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RegistriesClientImpl(AzureMachineLearningServicesImpl client) { + this.service + = RestProxy.create(RegistriesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesRegistries to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface RegistriesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PartialRegistryPartialTrackedResource body, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") RegistryInner body, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> removeRegions(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") RegistryInner body, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List registries by subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List registries by subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List registries by subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List registries by subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List registries by subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List registries by subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List registries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List registries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List registries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List registries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List registries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List registries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Delete registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String registryName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String registryName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, this.client.getApiVersion(), accept, context); + } + + /** + * Delete registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, registryName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, registryName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String registryName) { + return this.beginDeleteAsync(resourceGroupName, registryName).getSyncPoller(); + } + + /** + * Delete registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, + Context context) { + return this.beginDeleteAsync(resourceGroupName, registryName, context).getSyncPoller(); + } + + /** + * Delete registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName) { + return beginDeleteAsync(resourceGroupName, registryName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName) { + deleteAsync(resourceGroupName, registryName).block(); + } + + /** + * Delete registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, Context context) { + deleteAsync(resourceGroupName, registryName, context).block(); + } + + /** + * Get registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registry along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String registryName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registry along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String registryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, this.client.getApiVersion(), accept, context); + } + + /** + * Get registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registry on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String registryName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, registryName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registry along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String registryName, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, registryName, context).block(); + } + + /** + * Get registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegistryInner getByResourceGroup(String resourceGroupName, String registryName) { + return getByResourceGroupWithResponse(resourceGroupName, registryName, Context.NONE).getValue(); + } + + /** + * Update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, String registryName, + PartialRegistryPartialTrackedResource body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, String registryName, + PartialRegistryPartialTrackedResource body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, this.client.getApiVersion(), body, accept, context); + } + + /** + * Update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String registryName, + PartialRegistryPartialTrackedResource body) { + return updateWithResponseAsync(resourceGroupName, registryName, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, String registryName, + PartialRegistryPartialTrackedResource body, Context context) { + return updateWithResponseAsync(resourceGroupName, registryName, body, context).block(); + } + + /** + * Update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegistryInner update(String resourceGroupName, String registryName, + PartialRegistryPartialTrackedResource body) { + return updateWithResponse(resourceGroupName, registryName, body, Context.NONE).getValue(); + } + + /** + * Create or update registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String registryName, RegistryInner body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String registryName, RegistryInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, this.client.getApiVersion(), body, accept, context); + } + + /** + * Create or update registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RegistryInner> beginCreateOrUpdateAsync(String resourceGroupName, + String registryName, RegistryInner body) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, registryName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + RegistryInner.class, RegistryInner.class, this.client.getContext()); + } + + /** + * Create or update registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RegistryInner> beginCreateOrUpdateAsync(String resourceGroupName, + String registryName, RegistryInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, registryName, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + RegistryInner.class, RegistryInner.class, context); + } + + /** + * Create or update registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RegistryInner> beginCreateOrUpdate(String resourceGroupName, + String registryName, RegistryInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, registryName, body).getSyncPoller(); + } + + /** + * Create or update registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RegistryInner> beginCreateOrUpdate(String resourceGroupName, + String registryName, RegistryInner body, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, registryName, body, context).getSyncPoller(); + } + + /** + * Create or update registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String registryName, RegistryInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String registryName, RegistryInner body, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegistryInner createOrUpdate(String resourceGroupName, String registryName, RegistryInner body) { + return createOrUpdateAsync(resourceGroupName, registryName, body).block(); + } + + /** + * Create or update registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegistryInner createOrUpdate(String resourceGroupName, String registryName, RegistryInner body, + Context context) { + return createOrUpdateAsync(resourceGroupName, registryName, body, context).block(); + } + + /** + * Remove regions from registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> removeRegionsWithResponseAsync(String resourceGroupName, + String registryName, RegistryInner body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.removeRegions(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Remove regions from registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> removeRegionsWithResponseAsync(String resourceGroupName, + String registryName, RegistryInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.removeRegions(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, this.client.getApiVersion(), body, accept, context); + } + + /** + * Remove regions from registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RegistryInner> beginRemoveRegionsAsync(String resourceGroupName, + String registryName, RegistryInner body) { + Mono>> mono = removeRegionsWithResponseAsync(resourceGroupName, registryName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + RegistryInner.class, RegistryInner.class, this.client.getContext()); + } + + /** + * Remove regions from registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RegistryInner> beginRemoveRegionsAsync(String resourceGroupName, + String registryName, RegistryInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = removeRegionsWithResponseAsync(resourceGroupName, registryName, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + RegistryInner.class, RegistryInner.class, context); + } + + /** + * Remove regions from registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RegistryInner> beginRemoveRegions(String resourceGroupName, + String registryName, RegistryInner body) { + return this.beginRemoveRegionsAsync(resourceGroupName, registryName, body).getSyncPoller(); + } + + /** + * Remove regions from registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RegistryInner> beginRemoveRegions(String resourceGroupName, + String registryName, RegistryInner body, Context context) { + return this.beginRemoveRegionsAsync(resourceGroupName, registryName, body, context).getSyncPoller(); + } + + /** + * Remove regions from registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono removeRegionsAsync(String resourceGroupName, String registryName, RegistryInner body) { + return beginRemoveRegionsAsync(resourceGroupName, registryName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Remove regions from registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono removeRegionsAsync(String resourceGroupName, String registryName, RegistryInner body, + Context context) { + return beginRemoveRegionsAsync(resourceGroupName, registryName, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Remove regions from registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegistryInner removeRegions(String resourceGroupName, String registryName, RegistryInner body) { + return removeRegionsAsync(resourceGroupName, registryName, body).block(); + } + + /** + * Remove regions from registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegistryInner removeRegions(String resourceGroupName, String registryName, RegistryInner body, + Context context) { + return removeRegionsAsync(resourceGroupName, registryName, body, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistriesImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistriesImpl.java new file mode 100644 index 0000000000000..f2ade7c855291 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistriesImpl.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.RegistriesClient; +import com.azure.resourcemanager.machinelearning.fluent.models.RegistryInner; +import com.azure.resourcemanager.machinelearning.models.Registries; +import com.azure.resourcemanager.machinelearning.models.Registry; + +public final class RegistriesImpl implements Registries { + private static final ClientLogger LOGGER = new ClientLogger(RegistriesImpl.class); + + private final RegistriesClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public RegistriesImpl(RegistriesClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RegistryImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RegistryImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RegistryImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RegistryImpl(inner1, this.manager())); + } + + public void deleteByResourceGroup(String resourceGroupName, String registryName) { + this.serviceClient().delete(resourceGroupName, registryName); + } + + public void delete(String resourceGroupName, String registryName, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, context); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String registryName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, registryName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RegistryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Registry getByResourceGroup(String resourceGroupName, String registryName) { + RegistryInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, registryName); + if (inner != null) { + return new RegistryImpl(inner, this.manager()); + } else { + return null; + } + } + + public Registry removeRegions(String resourceGroupName, String registryName, RegistryInner body) { + RegistryInner inner = this.serviceClient().removeRegions(resourceGroupName, registryName, body); + if (inner != null) { + return new RegistryImpl(inner, this.manager()); + } else { + return null; + } + } + + public Registry removeRegions(String resourceGroupName, String registryName, RegistryInner body, Context context) { + RegistryInner inner = this.serviceClient().removeRegions(resourceGroupName, registryName, body, context); + if (inner != null) { + return new RegistryImpl(inner, this.manager()); + } else { + return null; + } + } + + public Registry getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, registryName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, registryName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + this.delete(resourceGroupName, registryName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + this.delete(resourceGroupName, registryName, context); + } + + private RegistriesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + public RegistryImpl define(String name) { + return new RegistryImpl(name, this.manager()); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryCodeContainersClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryCodeContainersClientImpl.java new file mode 100644 index 0000000000000..ce32fdfa3b790 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryCodeContainersClientImpl.java @@ -0,0 +1,939 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.RegistryCodeContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.models.CodeContainerInner; +import com.azure.resourcemanager.machinelearning.models.CodeContainerResourceArmPaginatedResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in RegistryCodeContainersClient. + */ +public final class RegistryCodeContainersClientImpl implements RegistryCodeContainersClient { + /** + * The proxy service used to perform REST calls. + */ + private final RegistryCodeContainersService service; + + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of RegistryCodeContainersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RegistryCodeContainersClientImpl(AzureMachineLearningServicesImpl client) { + this.service = RestProxy.create(RegistryCodeContainersService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesRegistryCodeContainers to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface RegistryCodeContainersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, @QueryParam("$skip") String skip, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @PathParam("codeName") String codeName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @PathParam("codeName") String codeName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @PathParam("codeName") String codeName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CodeContainerInner body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeContainer entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String registryName, + String skip) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, this.client.getApiVersion(), skip, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeContainer entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String registryName, + String skip, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, + this.client.getApiVersion(), skip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, String skip) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, registryName, skip), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName) { + final String skip = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, registryName, skip), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, String skip, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, registryName, skip, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName) { + final String skip = null; + return new PagedIterable<>(listAsync(resourceGroupName, registryName, skip)); + } + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, String skip, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, skip, context)); + } + + /** + * Delete Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String registryName, + String codeName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (codeName == null) { + return Mono.error(new IllegalArgumentException("Parameter codeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, codeName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String registryName, + String codeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (codeName == null) { + return Mono.error(new IllegalArgumentException("Parameter codeName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, codeName, this.client.getApiVersion(), accept, context); + } + + /** + * Delete Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName, + String codeName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, registryName, codeName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName, + String codeName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, registryName, codeName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, + String codeName) { + return this.beginDeleteAsync(resourceGroupName, registryName, codeName).getSyncPoller(); + } + + /** + * Delete Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, + String codeName, Context context) { + return this.beginDeleteAsync(resourceGroupName, registryName, codeName, context).getSyncPoller(); + } + + /** + * Delete Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String codeName) { + return beginDeleteAsync(resourceGroupName, registryName, codeName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String codeName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, codeName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String codeName) { + deleteAsync(resourceGroupName, registryName, codeName).block(); + } + + /** + * Delete Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String codeName, Context context) { + deleteAsync(resourceGroupName, registryName, codeName, context).block(); + } + + /** + * Get Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return code container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String registryName, + String codeName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (codeName == null) { + return Mono.error(new IllegalArgumentException("Parameter codeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, codeName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return code container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String registryName, + String codeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (codeName == null) { + return Mono.error(new IllegalArgumentException("Parameter codeName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, + codeName, this.client.getApiVersion(), accept, context); + } + + /** + * Get Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return code container on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String registryName, String codeName) { + return getWithResponseAsync(resourceGroupName, registryName, codeName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return code container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String registryName, String codeName, + Context context) { + return getWithResponseAsync(resourceGroupName, registryName, codeName, context).block(); + } + + /** + * Get Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return code container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CodeContainerInner get(String resourceGroupName, String registryName, String codeName) { + return getWithResponse(resourceGroupName, registryName, codeName, Context.NONE).getValue(); + } + + /** + * Create or update Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String registryName, String codeName, CodeContainerInner body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (codeName == null) { + return Mono.error(new IllegalArgumentException("Parameter codeName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, codeName, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String registryName, String codeName, CodeContainerInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (codeName == null) { + return Mono.error(new IllegalArgumentException("Parameter codeName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, codeName, this.client.getApiVersion(), body, accept, context); + } + + /** + * Create or update Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CodeContainerInner> beginCreateOrUpdateAsync( + String resourceGroupName, String registryName, String codeName, CodeContainerInner body) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, registryName, codeName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + CodeContainerInner.class, CodeContainerInner.class, this.client.getContext()); + } + + /** + * Create or update Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CodeContainerInner> beginCreateOrUpdateAsync( + String resourceGroupName, String registryName, String codeName, CodeContainerInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, registryName, codeName, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + CodeContainerInner.class, CodeContainerInner.class, context); + } + + /** + * Create or update Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CodeContainerInner> beginCreateOrUpdate(String resourceGroupName, + String registryName, String codeName, CodeContainerInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, registryName, codeName, body).getSyncPoller(); + } + + /** + * Create or update Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CodeContainerInner> beginCreateOrUpdate(String resourceGroupName, + String registryName, String codeName, CodeContainerInner body, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, registryName, codeName, body, context).getSyncPoller(); + } + + /** + * Create or update Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String registryName, String codeName, + CodeContainerInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, codeName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String registryName, String codeName, + CodeContainerInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, codeName, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CodeContainerInner createOrUpdate(String resourceGroupName, String registryName, String codeName, + CodeContainerInner body) { + return createOrUpdateAsync(resourceGroupName, registryName, codeName, body).block(); + } + + /** + * Create or update Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CodeContainerInner createOrUpdate(String resourceGroupName, String registryName, String codeName, + CodeContainerInner body, Context context) { + return createOrUpdateAsync(resourceGroupName, registryName, codeName, body, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeContainer entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeContainer entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryCodeContainersImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryCodeContainersImpl.java new file mode 100644 index 0000000000000..a491e6685ad85 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryCodeContainersImpl.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.RegistryCodeContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.models.CodeContainerInner; +import com.azure.resourcemanager.machinelearning.models.CodeContainer; +import com.azure.resourcemanager.machinelearning.models.RegistryCodeContainers; + +public final class RegistryCodeContainersImpl implements RegistryCodeContainers { + private static final ClientLogger LOGGER = new ClientLogger(RegistryCodeContainersImpl.class); + + private final RegistryCodeContainersClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public RegistryCodeContainersImpl(RegistryCodeContainersClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String registryName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CodeContainerImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String registryName, String skip, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, registryName, skip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CodeContainerImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String registryName, String codeName) { + this.serviceClient().delete(resourceGroupName, registryName, codeName); + } + + public void delete(String resourceGroupName, String registryName, String codeName, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, codeName, context); + } + + public Response getWithResponse(String resourceGroupName, String registryName, String codeName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, registryName, codeName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CodeContainerImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CodeContainer get(String resourceGroupName, String registryName, String codeName) { + CodeContainerInner inner = this.serviceClient().get(resourceGroupName, registryName, codeName); + if (inner != null) { + return new CodeContainerImpl(inner, this.manager()); + } else { + return null; + } + } + + public CodeContainer getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String codeName = ResourceManagerUtils.getValueFromIdByName(id, "codes"); + if (codeName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'codes'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, codeName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String codeName = ResourceManagerUtils.getValueFromIdByName(id, "codes"); + if (codeName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'codes'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, codeName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String codeName = ResourceManagerUtils.getValueFromIdByName(id, "codes"); + if (codeName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'codes'.", id))); + } + this.delete(resourceGroupName, registryName, codeName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String codeName = ResourceManagerUtils.getValueFromIdByName(id, "codes"); + if (codeName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'codes'.", id))); + } + this.delete(resourceGroupName, registryName, codeName, context); + } + + private RegistryCodeContainersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + public CodeContainerImpl define(String name) { + return new CodeContainerImpl(name, this.manager()); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryCodeVersionsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryCodeVersionsClientImpl.java new file mode 100644 index 0000000000000..ff90e1c7c986c --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryCodeVersionsClientImpl.java @@ -0,0 +1,1194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.RegistryCodeVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.CodeVersionInner; +import com.azure.resourcemanager.machinelearning.fluent.models.PendingUploadResponseDtoInner; +import com.azure.resourcemanager.machinelearning.models.CodeVersionResourceArmPaginatedResult; +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in RegistryCodeVersionsClient. + */ +public final class RegistryCodeVersionsClientImpl implements RegistryCodeVersionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final RegistryCodeVersionsService service; + + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of RegistryCodeVersionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RegistryCodeVersionsClientImpl(AzureMachineLearningServicesImpl client) { + this.service = RestProxy.create(RegistryCodeVersionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesRegistryCodeVersions to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface RegistryCodeVersionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @PathParam("codeName") String codeName, @QueryParam("api-version") String apiVersion, + @QueryParam("$orderBy") String orderBy, @QueryParam("$top") Integer top, @QueryParam("$skip") String skip, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @PathParam("codeName") String codeName, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @PathParam("codeName") String codeName, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @PathParam("codeName") String codeName, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") CodeVersionInner body, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}/startPendingUpload") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrGetStartPendingUpload(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @PathParam("codeName") String codeName, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") PendingUploadRequestDto body, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeVersion entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String registryName, + String codeName, String orderBy, Integer top, String skip) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (codeName == null) { + return Mono.error(new IllegalArgumentException("Parameter codeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, codeName, this.client.getApiVersion(), orderBy, top, skip, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeVersion entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String registryName, + String codeName, String orderBy, Integer top, String skip, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (codeName == null) { + return Mono.error(new IllegalArgumentException("Parameter codeName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, codeName, + this.client.getApiVersion(), orderBy, top, skip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeVersion entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, String codeName, + String orderBy, Integer top, String skip) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, registryName, codeName, orderBy, top, skip), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeVersion entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, String codeName) { + final String orderBy = null; + final Integer top = null; + final String skip = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, registryName, codeName, orderBy, top, skip), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeVersion entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, String codeName, + String orderBy, Integer top, String skip, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, codeName, orderBy, top, skip, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, String codeName) { + final String orderBy = null; + final Integer top = null; + final String skip = null; + return new PagedIterable<>(listAsync(resourceGroupName, registryName, codeName, orderBy, top, skip)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, String codeName, + String orderBy, Integer top, String skip, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, codeName, orderBy, top, skip, context)); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String registryName, + String codeName, String version) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (codeName == null) { + return Mono.error(new IllegalArgumentException("Parameter codeName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, codeName, version, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String registryName, + String codeName, String version, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (codeName == null) { + return Mono.error(new IllegalArgumentException("Parameter codeName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, codeName, version, this.client.getApiVersion(), accept, context); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName, + String codeName, String version) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, registryName, codeName, version); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName, + String codeName, String version, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, registryName, codeName, version, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, + String codeName, String version) { + return this.beginDeleteAsync(resourceGroupName, registryName, codeName, version).getSyncPoller(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, + String codeName, String version, Context context) { + return this.beginDeleteAsync(resourceGroupName, registryName, codeName, version, context).getSyncPoller(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String codeName, String version) { + return beginDeleteAsync(resourceGroupName, registryName, codeName, version).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String codeName, String version, + Context context) { + return beginDeleteAsync(resourceGroupName, registryName, codeName, version, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String codeName, String version) { + deleteAsync(resourceGroupName, registryName, codeName, version).block(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String codeName, String version, + Context context) { + deleteAsync(resourceGroupName, registryName, codeName, version, context).block(); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String registryName, + String codeName, String version) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (codeName == null) { + return Mono.error(new IllegalArgumentException("Parameter codeName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, codeName, version, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String registryName, + String codeName, String version, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (codeName == null) { + return Mono.error(new IllegalArgumentException("Parameter codeName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, + codeName, version, this.client.getApiVersion(), accept, context); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String registryName, String codeName, + String version) { + return getWithResponseAsync(resourceGroupName, registryName, codeName, version) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String registryName, String codeName, + String version, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, codeName, version, context).block(); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CodeVersionInner get(String resourceGroupName, String registryName, String codeName, String version) { + return getWithResponse(resourceGroupName, registryName, codeName, version, Context.NONE).getValue(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String registryName, String codeName, String version, CodeVersionInner body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (codeName == null) { + return Mono.error(new IllegalArgumentException("Parameter codeName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, codeName, version, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String registryName, String codeName, String version, CodeVersionInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (codeName == null) { + return Mono.error(new IllegalArgumentException("Parameter codeName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, codeName, version, this.client.getApiVersion(), body, accept, context); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CodeVersionInner> beginCreateOrUpdateAsync( + String resourceGroupName, String registryName, String codeName, String version, CodeVersionInner body) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, registryName, codeName, version, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + CodeVersionInner.class, CodeVersionInner.class, this.client.getContext()); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CodeVersionInner> beginCreateOrUpdateAsync( + String resourceGroupName, String registryName, String codeName, String version, CodeVersionInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, registryName, codeName, version, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + CodeVersionInner.class, CodeVersionInner.class, context); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CodeVersionInner> beginCreateOrUpdate(String resourceGroupName, + String registryName, String codeName, String version, CodeVersionInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, registryName, codeName, version, body).getSyncPoller(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CodeVersionInner> beginCreateOrUpdate(String resourceGroupName, + String registryName, String codeName, String version, CodeVersionInner body, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, registryName, codeName, version, body, context) + .getSyncPoller(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String registryName, String codeName, + String version, CodeVersionInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, codeName, version, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String registryName, String codeName, + String version, CodeVersionInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, codeName, version, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CodeVersionInner createOrUpdate(String resourceGroupName, String registryName, String codeName, + String version, CodeVersionInner body) { + return createOrUpdateAsync(resourceGroupName, registryName, codeName, version, body).block(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CodeVersionInner createOrUpdate(String resourceGroupName, String registryName, String codeName, + String version, CodeVersionInner body, Context context) { + return createOrUpdateAsync(resourceGroupName, registryName, codeName, version, body, context).block(); + } + + /** + * Generate a storage location and credential for the client to upload a code asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Pending upload name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrGetStartPendingUploadWithResponseAsync( + String resourceGroupName, String registryName, String codeName, String version, PendingUploadRequestDto body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (codeName == null) { + return Mono.error(new IllegalArgumentException("Parameter codeName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrGetStartPendingUpload(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, registryName, codeName, version, + this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generate a storage location and credential for the client to upload a code asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Pending upload name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrGetStartPendingUploadWithResponseAsync( + String resourceGroupName, String registryName, String codeName, String version, PendingUploadRequestDto body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (codeName == null) { + return Mono.error(new IllegalArgumentException("Parameter codeName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrGetStartPendingUpload(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, codeName, version, this.client.getApiVersion(), body, accept, context); + } + + /** + * Generate a storage location and credential for the client to upload a code asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Pending upload name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrGetStartPendingUploadAsync(String resourceGroupName, + String registryName, String codeName, String version, PendingUploadRequestDto body) { + return createOrGetStartPendingUploadWithResponseAsync(resourceGroupName, registryName, codeName, version, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Generate a storage location and credential for the client to upload a code asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Pending upload name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrGetStartPendingUploadWithResponse(String resourceGroupName, + String registryName, String codeName, String version, PendingUploadRequestDto body, Context context) { + return createOrGetStartPendingUploadWithResponseAsync(resourceGroupName, registryName, codeName, version, body, + context).block(); + } + + /** + * Generate a storage location and credential for the client to upload a code asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Pending upload name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PendingUploadResponseDtoInner createOrGetStartPendingUpload(String resourceGroupName, String registryName, + String codeName, String version, PendingUploadRequestDto body) { + return createOrGetStartPendingUploadWithResponse(resourceGroupName, registryName, codeName, version, body, + Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeVersion entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeVersion entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryCodeVersionsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryCodeVersionsImpl.java new file mode 100644 index 0000000000000..87d9cff7eab0a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryCodeVersionsImpl.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.RegistryCodeVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.CodeVersionInner; +import com.azure.resourcemanager.machinelearning.fluent.models.PendingUploadResponseDtoInner; +import com.azure.resourcemanager.machinelearning.models.CodeVersion; +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; +import com.azure.resourcemanager.machinelearning.models.PendingUploadResponseDto; +import com.azure.resourcemanager.machinelearning.models.RegistryCodeVersions; + +public final class RegistryCodeVersionsImpl implements RegistryCodeVersions { + private static final ClientLogger LOGGER = new ClientLogger(RegistryCodeVersionsImpl.class); + + private final RegistryCodeVersionsClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public RegistryCodeVersionsImpl(RegistryCodeVersionsClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String registryName, String codeName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName, codeName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CodeVersionImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String registryName, String codeName, + String orderBy, Integer top, String skip, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, registryName, codeName, orderBy, top, skip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CodeVersionImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String registryName, String codeName, String version) { + this.serviceClient().delete(resourceGroupName, registryName, codeName, version); + } + + public void delete(String resourceGroupName, String registryName, String codeName, String version, + Context context) { + this.serviceClient().delete(resourceGroupName, registryName, codeName, version, context); + } + + public Response getWithResponse(String resourceGroupName, String registryName, String codeName, + String version, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, registryName, codeName, version, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CodeVersionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CodeVersion get(String resourceGroupName, String registryName, String codeName, String version) { + CodeVersionInner inner = this.serviceClient().get(resourceGroupName, registryName, codeName, version); + if (inner != null) { + return new CodeVersionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrGetStartPendingUploadWithResponse(String resourceGroupName, + String registryName, String codeName, String version, PendingUploadRequestDto body, Context context) { + Response inner = this.serviceClient() + .createOrGetStartPendingUploadWithResponse(resourceGroupName, registryName, codeName, version, body, + context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PendingUploadResponseDtoImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PendingUploadResponseDto createOrGetStartPendingUpload(String resourceGroupName, String registryName, + String codeName, String version, PendingUploadRequestDto body) { + PendingUploadResponseDtoInner inner = this.serviceClient() + .createOrGetStartPendingUpload(resourceGroupName, registryName, codeName, version, body); + if (inner != null) { + return new PendingUploadResponseDtoImpl(inner, this.manager()); + } else { + return null; + } + } + + public CodeVersion getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String codeName = ResourceManagerUtils.getValueFromIdByName(id, "codes"); + if (codeName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'codes'.", id))); + } + String version = ResourceManagerUtils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, codeName, version, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String codeName = ResourceManagerUtils.getValueFromIdByName(id, "codes"); + if (codeName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'codes'.", id))); + } + String version = ResourceManagerUtils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, codeName, version, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String codeName = ResourceManagerUtils.getValueFromIdByName(id, "codes"); + if (codeName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'codes'.", id))); + } + String version = ResourceManagerUtils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + this.delete(resourceGroupName, registryName, codeName, version, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String codeName = ResourceManagerUtils.getValueFromIdByName(id, "codes"); + if (codeName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'codes'.", id))); + } + String version = ResourceManagerUtils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + this.delete(resourceGroupName, registryName, codeName, version, context); + } + + private RegistryCodeVersionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + public CodeVersionImpl define(String name) { + return new CodeVersionImpl(name, this.manager()); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryComponentContainersClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryComponentContainersClientImpl.java new file mode 100644 index 0000000000000..314b113cd907e --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryComponentContainersClientImpl.java @@ -0,0 +1,945 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.RegistryComponentContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.models.ComponentContainerInner; +import com.azure.resourcemanager.machinelearning.models.ComponentContainerResourceArmPaginatedResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in RegistryComponentContainersClient. + */ +public final class RegistryComponentContainersClientImpl implements RegistryComponentContainersClient { + /** + * The proxy service used to perform REST calls. + */ + private final RegistryComponentContainersService service; + + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of RegistryComponentContainersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RegistryComponentContainersClientImpl(AzureMachineLearningServicesImpl client) { + this.service = RestProxy.create(RegistryComponentContainersService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesRegistryComponentContainers to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface RegistryComponentContainersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, @QueryParam("$skip") String skip, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @PathParam("componentName") String componentName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @PathParam("componentName") String componentName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @PathParam("componentName") String componentName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ComponentContainerInner body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentContainer entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String registryName, String skip) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, this.client.getApiVersion(), skip, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentContainer entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String registryName, String skip, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, + this.client.getApiVersion(), skip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, String skip) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, registryName, skip), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName) { + final String skip = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, registryName, skip), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, String skip, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, registryName, skip, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName) { + final String skip = null; + return new PagedIterable<>(listAsync(resourceGroupName, registryName, skip)); + } + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, String skip, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, skip, context)); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String registryName, + String componentName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (componentName == null) { + return Mono.error(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, componentName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String registryName, + String componentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (componentName == null) { + return Mono.error(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, componentName, this.client.getApiVersion(), accept, context); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName, + String componentName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, registryName, componentName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName, + String componentName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, registryName, componentName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, + String componentName) { + return this.beginDeleteAsync(resourceGroupName, registryName, componentName).getSyncPoller(); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, + String componentName, Context context) { + return this.beginDeleteAsync(resourceGroupName, registryName, componentName, context).getSyncPoller(); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String componentName) { + return beginDeleteAsync(resourceGroupName, registryName, componentName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String componentName, + Context context) { + return beginDeleteAsync(resourceGroupName, registryName, componentName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String componentName) { + deleteAsync(resourceGroupName, registryName, componentName).block(); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String componentName, Context context) { + deleteAsync(resourceGroupName, registryName, componentName, context).block(); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String registryName, + String componentName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (componentName == null) { + return Mono.error(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, componentName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String registryName, + String componentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (componentName == null) { + return Mono.error(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, + componentName, this.client.getApiVersion(), accept, context); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String registryName, + String componentName) { + return getWithResponseAsync(resourceGroupName, registryName, componentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String registryName, + String componentName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, componentName, context).block(); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ComponentContainerInner get(String resourceGroupName, String registryName, String componentName) { + return getWithResponse(resourceGroupName, registryName, componentName, Context.NONE).getValue(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String registryName, String componentName, ComponentContainerInner body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (componentName == null) { + return Mono.error(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, componentName, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String registryName, String componentName, ComponentContainerInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (componentName == null) { + return Mono.error(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, componentName, this.client.getApiVersion(), body, accept, context); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ComponentContainerInner> beginCreateOrUpdateAsync( + String resourceGroupName, String registryName, String componentName, ComponentContainerInner body) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, registryName, componentName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ComponentContainerInner.class, ComponentContainerInner.class, + this.client.getContext()); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ComponentContainerInner> beginCreateOrUpdateAsync( + String resourceGroupName, String registryName, String componentName, ComponentContainerInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, registryName, componentName, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ComponentContainerInner.class, ComponentContainerInner.class, context); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ComponentContainerInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, String componentName, ComponentContainerInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, registryName, componentName, body).getSyncPoller(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ComponentContainerInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, String componentName, ComponentContainerInner body, + Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, registryName, componentName, body, context) + .getSyncPoller(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String registryName, + String componentName, ComponentContainerInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, componentName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String registryName, + String componentName, ComponentContainerInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, componentName, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ComponentContainerInner createOrUpdate(String resourceGroupName, String registryName, String componentName, + ComponentContainerInner body) { + return createOrUpdateAsync(resourceGroupName, registryName, componentName, body).block(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ComponentContainerInner createOrUpdate(String resourceGroupName, String registryName, String componentName, + ComponentContainerInner body, Context context) { + return createOrUpdateAsync(resourceGroupName, registryName, componentName, body, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentContainer entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentContainer entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryComponentContainersImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryComponentContainersImpl.java new file mode 100644 index 0000000000000..5e2a79a306618 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryComponentContainersImpl.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.RegistryComponentContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.models.ComponentContainerInner; +import com.azure.resourcemanager.machinelearning.models.ComponentContainer; +import com.azure.resourcemanager.machinelearning.models.RegistryComponentContainers; + +public final class RegistryComponentContainersImpl implements RegistryComponentContainers { + private static final ClientLogger LOGGER = new ClientLogger(RegistryComponentContainersImpl.class); + + private final RegistryComponentContainersClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public RegistryComponentContainersImpl(RegistryComponentContainersClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String registryName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ComponentContainerImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String registryName, String skip, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, registryName, skip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ComponentContainerImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String registryName, String componentName) { + this.serviceClient().delete(resourceGroupName, registryName, componentName); + } + + public void delete(String resourceGroupName, String registryName, String componentName, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, componentName, context); + } + + public Response getWithResponse(String resourceGroupName, String registryName, + String componentName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, registryName, componentName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ComponentContainerImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ComponentContainer get(String resourceGroupName, String registryName, String componentName) { + ComponentContainerInner inner = this.serviceClient().get(resourceGroupName, registryName, componentName); + if (inner != null) { + return new ComponentContainerImpl(inner, this.manager()); + } else { + return null; + } + } + + public ComponentContainer getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String componentName = ResourceManagerUtils.getValueFromIdByName(id, "components"); + if (componentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, componentName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String componentName = ResourceManagerUtils.getValueFromIdByName(id, "components"); + if (componentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, componentName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String componentName = ResourceManagerUtils.getValueFromIdByName(id, "components"); + if (componentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id))); + } + this.delete(resourceGroupName, registryName, componentName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String componentName = ResourceManagerUtils.getValueFromIdByName(id, "components"); + if (componentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id))); + } + this.delete(resourceGroupName, registryName, componentName, context); + } + + private RegistryComponentContainersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + public ComponentContainerImpl define(String name) { + return new ComponentContainerImpl(name, this.manager()); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryComponentVersionsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryComponentVersionsClientImpl.java new file mode 100644 index 0000000000000..43da2cee78934 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryComponentVersionsClientImpl.java @@ -0,0 +1,1032 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.RegistryComponentVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.ComponentVersionInner; +import com.azure.resourcemanager.machinelearning.models.ComponentVersionResourceArmPaginatedResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in RegistryComponentVersionsClient. + */ +public final class RegistryComponentVersionsClientImpl implements RegistryComponentVersionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final RegistryComponentVersionsService service; + + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of RegistryComponentVersionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RegistryComponentVersionsClientImpl(AzureMachineLearningServicesImpl client) { + this.service = RestProxy.create(RegistryComponentVersionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesRegistryComponentVersions to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface RegistryComponentVersionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @PathParam("componentName") String componentName, @QueryParam("api-version") String apiVersion, + @QueryParam("$orderBy") String orderBy, @QueryParam("$top") Integer top, @QueryParam("$skip") String skip, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @PathParam("componentName") String componentName, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @PathParam("componentName") String componentName, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @PathParam("componentName") String componentName, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") ComponentVersionInner body, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentVersion entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String registryName, String componentName, String orderBy, Integer top, String skip) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (componentName == null) { + return Mono.error(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, componentName, this.client.getApiVersion(), orderBy, top, skip, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentVersion entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String registryName, String componentName, String orderBy, Integer top, String skip, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (componentName == null) { + return Mono.error(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, + componentName, this.client.getApiVersion(), orderBy, top, skip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentVersion entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, + String componentName, String orderBy, Integer top, String skip) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, componentName, orderBy, top, skip), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentVersion entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, + String componentName) { + final String orderBy = null; + final Integer top = null; + final String skip = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, componentName, orderBy, top, skip), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentVersion entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, + String componentName, String orderBy, Integer top, String skip, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, componentName, orderBy, top, skip, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, + String componentName) { + final String orderBy = null; + final Integer top = null; + final String skip = null; + return new PagedIterable<>(listAsync(resourceGroupName, registryName, componentName, orderBy, top, skip)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, + String componentName, String orderBy, Integer top, String skip, Context context) { + return new PagedIterable<>( + listAsync(resourceGroupName, registryName, componentName, orderBy, top, skip, context)); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String registryName, + String componentName, String version) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (componentName == null) { + return Mono.error(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, componentName, version, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String registryName, + String componentName, String version, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (componentName == null) { + return Mono.error(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, componentName, version, this.client.getApiVersion(), accept, context); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName, + String componentName, String version) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, registryName, componentName, version); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName, + String componentName, String version, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, registryName, componentName, version, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, + String componentName, String version) { + return this.beginDeleteAsync(resourceGroupName, registryName, componentName, version).getSyncPoller(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, + String componentName, String version, Context context) { + return this.beginDeleteAsync(resourceGroupName, registryName, componentName, version, context).getSyncPoller(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String componentName, + String version) { + return beginDeleteAsync(resourceGroupName, registryName, componentName, version).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String componentName, String version, + Context context) { + return beginDeleteAsync(resourceGroupName, registryName, componentName, version, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String componentName, String version) { + deleteAsync(resourceGroupName, registryName, componentName, version).block(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String componentName, String version, + Context context) { + deleteAsync(resourceGroupName, registryName, componentName, version, context).block(); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String registryName, + String componentName, String version) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (componentName == null) { + return Mono.error(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, componentName, version, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String registryName, + String componentName, String version, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (componentName == null) { + return Mono.error(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, + componentName, version, this.client.getApiVersion(), accept, context); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String registryName, String componentName, + String version) { + return getWithResponseAsync(resourceGroupName, registryName, componentName, version) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String registryName, + String componentName, String version, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, componentName, version, context).block(); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ComponentVersionInner get(String resourceGroupName, String registryName, String componentName, + String version) { + return getWithResponse(resourceGroupName, registryName, componentName, version, Context.NONE).getValue(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String registryName, String componentName, String version, ComponentVersionInner body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (componentName == null) { + return Mono.error(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, componentName, version, this.client.getApiVersion(), body, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String registryName, String componentName, String version, ComponentVersionInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (componentName == null) { + return Mono.error(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, componentName, version, this.client.getApiVersion(), body, accept, context); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ComponentVersionInner> beginCreateOrUpdateAsync( + String resourceGroupName, String registryName, String componentName, String version, + ComponentVersionInner body) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, registryName, componentName, version, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ComponentVersionInner.class, ComponentVersionInner.class, + this.client.getContext()); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ComponentVersionInner> beginCreateOrUpdateAsync( + String resourceGroupName, String registryName, String componentName, String version, ComponentVersionInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, registryName, componentName, version, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ComponentVersionInner.class, ComponentVersionInner.class, context); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ComponentVersionInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, String componentName, String version, + ComponentVersionInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, registryName, componentName, version, body) + .getSyncPoller(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ComponentVersionInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, String componentName, String version, ComponentVersionInner body, + Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, registryName, componentName, version, body, context) + .getSyncPoller(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String registryName, + String componentName, String version, ComponentVersionInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, componentName, version, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String registryName, + String componentName, String version, ComponentVersionInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, componentName, version, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ComponentVersionInner createOrUpdate(String resourceGroupName, String registryName, String componentName, + String version, ComponentVersionInner body) { + return createOrUpdateAsync(resourceGroupName, registryName, componentName, version, body).block(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ComponentVersionInner createOrUpdate(String resourceGroupName, String registryName, String componentName, + String version, ComponentVersionInner body, Context context) { + return createOrUpdateAsync(resourceGroupName, registryName, componentName, version, body, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentVersion entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentVersion entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryComponentVersionsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryComponentVersionsImpl.java new file mode 100644 index 0000000000000..9bebeec5e2824 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryComponentVersionsImpl.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.RegistryComponentVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.ComponentVersionInner; +import com.azure.resourcemanager.machinelearning.models.ComponentVersion; +import com.azure.resourcemanager.machinelearning.models.RegistryComponentVersions; + +public final class RegistryComponentVersionsImpl implements RegistryComponentVersions { + private static final ClientLogger LOGGER = new ClientLogger(RegistryComponentVersionsImpl.class); + + private final RegistryComponentVersionsClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public RegistryComponentVersionsImpl(RegistryComponentVersionsClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String registryName, String componentName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, registryName, componentName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ComponentVersionImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String registryName, String componentName, + String orderBy, Integer top, String skip, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, registryName, componentName, orderBy, top, skip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ComponentVersionImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String registryName, String componentName, String version) { + this.serviceClient().delete(resourceGroupName, registryName, componentName, version); + } + + public void delete(String resourceGroupName, String registryName, String componentName, String version, + Context context) { + this.serviceClient().delete(resourceGroupName, registryName, componentName, version, context); + } + + public Response getWithResponse(String resourceGroupName, String registryName, + String componentName, String version, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, registryName, componentName, version, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ComponentVersionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ComponentVersion get(String resourceGroupName, String registryName, String componentName, String version) { + ComponentVersionInner inner = this.serviceClient().get(resourceGroupName, registryName, componentName, version); + if (inner != null) { + return new ComponentVersionImpl(inner, this.manager()); + } else { + return null; + } + } + + public ComponentVersion getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String componentName = ResourceManagerUtils.getValueFromIdByName(id, "components"); + if (componentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id))); + } + String version = ResourceManagerUtils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, componentName, version, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String componentName = ResourceManagerUtils.getValueFromIdByName(id, "components"); + if (componentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id))); + } + String version = ResourceManagerUtils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, componentName, version, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String componentName = ResourceManagerUtils.getValueFromIdByName(id, "components"); + if (componentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id))); + } + String version = ResourceManagerUtils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + this.delete(resourceGroupName, registryName, componentName, version, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String componentName = ResourceManagerUtils.getValueFromIdByName(id, "components"); + if (componentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'components'.", id))); + } + String version = ResourceManagerUtils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + this.delete(resourceGroupName, registryName, componentName, version, context); + } + + private RegistryComponentVersionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + public ComponentVersionImpl define(String name) { + return new ComponentVersionImpl(name, this.manager()); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryDataContainersClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryDataContainersClientImpl.java new file mode 100644 index 0000000000000..b42e1fd42d6f3 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryDataContainersClientImpl.java @@ -0,0 +1,947 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.RegistryDataContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.models.DataContainerInner; +import com.azure.resourcemanager.machinelearning.models.DataContainerResourceArmPaginatedResult; +import com.azure.resourcemanager.machinelearning.models.ListViewType; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in RegistryDataContainersClient. + */ +public final class RegistryDataContainersClientImpl implements RegistryDataContainersClient { + /** + * The proxy service used to perform REST calls. + */ + private final RegistryDataContainersService service; + + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of RegistryDataContainersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RegistryDataContainersClientImpl(AzureMachineLearningServicesImpl client) { + this.service = RestProxy.create(RegistryDataContainersService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesRegistryDataContainers to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface RegistryDataContainersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, @QueryParam("$skip") String skip, + @QueryParam("listViewType") ListViewType listViewType, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DataContainerInner body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List Data containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataContainer entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String registryName, + String skip, ListViewType listViewType) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, this.client.getApiVersion(), skip, listViewType, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Data containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataContainer entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String registryName, + String skip, ListViewType listViewType, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, + this.client.getApiVersion(), skip, listViewType, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Data containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, String skip, + ListViewType listViewType) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, registryName, skip, listViewType), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List Data containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName) { + final String skip = null; + final ListViewType listViewType = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, registryName, skip, listViewType), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List Data containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, String skip, + ListViewType listViewType, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, registryName, skip, listViewType, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List Data containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName) { + final String skip = null; + final ListViewType listViewType = null; + return new PagedIterable<>(listAsync(resourceGroupName, registryName, skip, listViewType)); + } + + /** + * List Data containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, String skip, + ListViewType listViewType, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, skip, listViewType, context)); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String registryName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, name, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String registryName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, name, this.client.getApiVersion(), accept, context); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName, + String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, registryName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName, + String name, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, registryName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String name) { + return this.beginDeleteAsync(resourceGroupName, registryName, name).getSyncPoller(); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String name, + Context context) { + return this.beginDeleteAsync(resourceGroupName, registryName, name, context).getSyncPoller(); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String name) { + return beginDeleteAsync(resourceGroupName, registryName, name).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, name, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String name) { + deleteAsync(resourceGroupName, registryName, name).block(); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String name, Context context) { + deleteAsync(resourceGroupName, registryName, name, context).block(); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String registryName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, name, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String registryName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, + name, this.client.getApiVersion(), accept, context); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String registryName, String name) { + return getWithResponseAsync(resourceGroupName, registryName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String registryName, String name, + Context context) { + return getWithResponseAsync(resourceGroupName, registryName, name, context).block(); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataContainerInner get(String resourceGroupName, String registryName, String name) { + return getWithResponse(resourceGroupName, registryName, name, Context.NONE).getValue(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String registryName, String name, DataContainerInner body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, name, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String registryName, String name, DataContainerInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, name, this.client.getApiVersion(), body, accept, context); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DataContainerInner> + beginCreateOrUpdateAsync(String resourceGroupName, String registryName, String name, DataContainerInner body) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, registryName, name, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DataContainerInner.class, DataContainerInner.class, this.client.getContext()); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DataContainerInner> beginCreateOrUpdateAsync( + String resourceGroupName, String registryName, String name, DataContainerInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, registryName, name, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DataContainerInner.class, DataContainerInner.class, context); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DataContainerInner> beginCreateOrUpdate(String resourceGroupName, + String registryName, String name, DataContainerInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, registryName, name, body).getSyncPoller(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DataContainerInner> beginCreateOrUpdate(String resourceGroupName, + String registryName, String name, DataContainerInner body, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, registryName, name, body, context).getSyncPoller(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String registryName, String name, + DataContainerInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, name, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String registryName, String name, + DataContainerInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, name, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataContainerInner createOrUpdate(String resourceGroupName, String registryName, String name, + DataContainerInner body) { + return createOrUpdateAsync(resourceGroupName, registryName, name, body).block(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataContainerInner createOrUpdate(String resourceGroupName, String registryName, String name, + DataContainerInner body, Context context) { + return createOrUpdateAsync(resourceGroupName, registryName, name, body, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataContainer entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataContainer entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryDataContainersImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryDataContainersImpl.java new file mode 100644 index 0000000000000..df5bf929a8a45 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryDataContainersImpl.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.RegistryDataContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.models.DataContainerInner; +import com.azure.resourcemanager.machinelearning.models.DataContainer; +import com.azure.resourcemanager.machinelearning.models.ListViewType; +import com.azure.resourcemanager.machinelearning.models.RegistryDataContainers; + +public final class RegistryDataContainersImpl implements RegistryDataContainers { + private static final ClientLogger LOGGER = new ClientLogger(RegistryDataContainersImpl.class); + + private final RegistryDataContainersClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public RegistryDataContainersImpl(RegistryDataContainersClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String registryName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DataContainerImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String registryName, String skip, + ListViewType listViewType, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, registryName, skip, listViewType, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DataContainerImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String registryName, String name) { + this.serviceClient().delete(resourceGroupName, registryName, name); + } + + public void delete(String resourceGroupName, String registryName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, name, context); + } + + public Response getWithResponse(String resourceGroupName, String registryName, String name, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, registryName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DataContainerImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DataContainer get(String resourceGroupName, String registryName, String name) { + DataContainerInner inner = this.serviceClient().get(resourceGroupName, registryName, name); + if (inner != null) { + return new DataContainerImpl(inner, this.manager()); + } else { + return null; + } + } + + public DataContainer getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "data"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'data'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "data"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'data'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "data"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'data'.", id))); + } + this.delete(resourceGroupName, registryName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "data"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'data'.", id))); + } + this.delete(resourceGroupName, registryName, name, context); + } + + private RegistryDataContainersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + public DataContainerImpl define(String name) { + return new DataContainerImpl(name, this.manager()); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryDataReferencesClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryDataReferencesClientImpl.java new file mode 100644 index 0000000000000..7d6f6d3093afb --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryDataReferencesClientImpl.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.machinelearning.fluent.RegistryDataReferencesClient; +import com.azure.resourcemanager.machinelearning.fluent.models.GetBlobReferenceSasResponseDtoInner; +import com.azure.resourcemanager.machinelearning.models.GetBlobReferenceSasRequestDto; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in RegistryDataReferencesClient. + */ +public final class RegistryDataReferencesClientImpl implements RegistryDataReferencesClient { + /** + * The proxy service used to perform REST calls. + */ + private final RegistryDataReferencesService service; + + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of RegistryDataReferencesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RegistryDataReferencesClientImpl(AzureMachineLearningServicesImpl client) { + this.service = RestProxy.create(RegistryDataReferencesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesRegistryDataReferences to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface RegistryDataReferencesService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/datareferences/{name}/versions/{version}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getBlobReferenceSas(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @PathParam("name") String name, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") GetBlobReferenceSasRequestDto body, @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get blob reference SAS Uri. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data reference name. + * @param version Version identifier. + * @param body Asset id and blob uri. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return blob reference SAS Uri along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getBlobReferenceSasWithResponseAsync( + String resourceGroupName, String registryName, String name, String version, + GetBlobReferenceSasRequestDto body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getBlobReferenceSas(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, name, version, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get blob reference SAS Uri. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data reference name. + * @param version Version identifier. + * @param body Asset id and blob uri. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return blob reference SAS Uri along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getBlobReferenceSasWithResponseAsync( + String resourceGroupName, String registryName, String name, String version, GetBlobReferenceSasRequestDto body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getBlobReferenceSas(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, name, version, this.client.getApiVersion(), body, accept, context); + } + + /** + * Get blob reference SAS Uri. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data reference name. + * @param version Version identifier. + * @param body Asset id and blob uri. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return blob reference SAS Uri on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getBlobReferenceSasAsync(String resourceGroupName, + String registryName, String name, String version, GetBlobReferenceSasRequestDto body) { + return getBlobReferenceSasWithResponseAsync(resourceGroupName, registryName, name, version, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get blob reference SAS Uri. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data reference name. + * @param version Version identifier. + * @param body Asset id and blob uri. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return blob reference SAS Uri along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getBlobReferenceSasWithResponse(String resourceGroupName, + String registryName, String name, String version, GetBlobReferenceSasRequestDto body, Context context) { + return getBlobReferenceSasWithResponseAsync(resourceGroupName, registryName, name, version, body, context) + .block(); + } + + /** + * Get blob reference SAS Uri. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data reference name. + * @param version Version identifier. + * @param body Asset id and blob uri. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return blob reference SAS Uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GetBlobReferenceSasResponseDtoInner getBlobReferenceSas(String resourceGroupName, String registryName, + String name, String version, GetBlobReferenceSasRequestDto body) { + return getBlobReferenceSasWithResponse(resourceGroupName, registryName, name, version, body, Context.NONE) + .getValue(); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryDataReferencesImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryDataReferencesImpl.java new file mode 100644 index 0000000000000..15795769c719b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryDataReferencesImpl.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.RegistryDataReferencesClient; +import com.azure.resourcemanager.machinelearning.fluent.models.GetBlobReferenceSasResponseDtoInner; +import com.azure.resourcemanager.machinelearning.models.GetBlobReferenceSasRequestDto; +import com.azure.resourcemanager.machinelearning.models.GetBlobReferenceSasResponseDto; +import com.azure.resourcemanager.machinelearning.models.RegistryDataReferences; + +public final class RegistryDataReferencesImpl implements RegistryDataReferences { + private static final ClientLogger LOGGER = new ClientLogger(RegistryDataReferencesImpl.class); + + private final RegistryDataReferencesClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public RegistryDataReferencesImpl(RegistryDataReferencesClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getBlobReferenceSasWithResponse(String resourceGroupName, + String registryName, String name, String version, GetBlobReferenceSasRequestDto body, Context context) { + Response inner = this.serviceClient() + .getBlobReferenceSasWithResponse(resourceGroupName, registryName, name, version, body, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new GetBlobReferenceSasResponseDtoImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GetBlobReferenceSasResponseDto getBlobReferenceSas(String resourceGroupName, String registryName, + String name, String version, GetBlobReferenceSasRequestDto body) { + GetBlobReferenceSasResponseDtoInner inner + = this.serviceClient().getBlobReferenceSas(resourceGroupName, registryName, name, version, body); + if (inner != null) { + return new GetBlobReferenceSasResponseDtoImpl(inner, this.manager()); + } else { + return null; + } + } + + private RegistryDataReferencesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryDataVersionsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryDataVersionsClientImpl.java new file mode 100644 index 0000000000000..d7712266906eb --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryDataVersionsClientImpl.java @@ -0,0 +1,1223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.RegistryDataVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.DataVersionBaseInner; +import com.azure.resourcemanager.machinelearning.fluent.models.PendingUploadResponseDtoInner; +import com.azure.resourcemanager.machinelearning.models.DataVersionBaseResourceArmPaginatedResult; +import com.azure.resourcemanager.machinelearning.models.ListViewType; +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in RegistryDataVersionsClient. + */ +public final class RegistryDataVersionsClientImpl implements RegistryDataVersionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final RegistryDataVersionsService service; + + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of RegistryDataVersionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RegistryDataVersionsClientImpl(AzureMachineLearningServicesImpl client) { + this.service = RestProxy.create(RegistryDataVersionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesRegistryDataVersions to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface RegistryDataVersionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @QueryParam("$orderBy") String orderBy, @QueryParam("$top") Integer top, @QueryParam("$skip") String skip, + @QueryParam("$tags") String tags, @QueryParam("listViewType") ListViewType listViewType, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @PathParam("name") String name, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @PathParam("name") String name, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @PathParam("name") String name, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") DataVersionBaseInner body, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}/startPendingUpload") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrGetStartPendingUpload(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @PathParam("name") String name, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") PendingUploadRequestDto body, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List data versions in the data container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data container's name. + * @param orderBy Please choose OrderBy value from ['createdtime', 'modifiedtime']. + * @param top 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. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataVersionBase entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String registryName, + String name, String orderBy, Integer top, String skip, String tags, ListViewType listViewType) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, name, this.client.getApiVersion(), orderBy, top, skip, tags, + listViewType, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List data versions in the data container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data container's name. + * @param orderBy Please choose OrderBy value from ['createdtime', 'modifiedtime']. + * @param top 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. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataVersionBase entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String registryName, + String name, String orderBy, Integer top, String skip, String tags, ListViewType listViewType, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, name, + this.client.getApiVersion(), orderBy, top, skip, tags, listViewType, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List data versions in the data container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data container's name. + * @param orderBy Please choose OrderBy value from ['createdtime', 'modifiedtime']. + * @param top 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. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataVersionBase entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, String name, + String orderBy, Integer top, String skip, String tags, ListViewType listViewType) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, name, orderBy, top, skip, tags, listViewType), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List data versions in the data container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data container's name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataVersionBase entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, String name) { + final String orderBy = null; + final Integer top = null; + final String skip = null; + final String tags = null; + final ListViewType listViewType = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, name, orderBy, top, skip, tags, listViewType), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List data versions in the data container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data container's name. + * @param orderBy Please choose OrderBy value from ['createdtime', 'modifiedtime']. + * @param top 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. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataVersionBase entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, String name, + String orderBy, Integer top, String skip, String tags, ListViewType listViewType, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, registryName, name, orderBy, top, skip, + tags, listViewType, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List data versions in the data container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data container's name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataVersionBase entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, String name) { + final String orderBy = null; + final Integer top = null; + final String skip = null; + final String tags = null; + final ListViewType listViewType = null; + return new PagedIterable<>( + listAsync(resourceGroupName, registryName, name, orderBy, top, skip, tags, listViewType)); + } + + /** + * List data versions in the data container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data container's name. + * @param orderBy Please choose OrderBy value from ['createdtime', 'modifiedtime']. + * @param top 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. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataVersionBase entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, String name, + String orderBy, Integer top, String skip, String tags, ListViewType listViewType, Context context) { + return new PagedIterable<>( + listAsync(resourceGroupName, registryName, name, orderBy, top, skip, tags, listViewType, context)); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String registryName, + String name, String version) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, name, version, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String registryName, + String name, String version, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, name, version, this.client.getApiVersion(), accept, context); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName, + String name, String version) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, registryName, name, version); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName, + String name, String version, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, registryName, name, version, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String name, + String version) { + return this.beginDeleteAsync(resourceGroupName, registryName, name, version).getSyncPoller(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String name, + String version, Context context) { + return this.beginDeleteAsync(resourceGroupName, registryName, name, version, context).getSyncPoller(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String name, String version) { + return beginDeleteAsync(resourceGroupName, registryName, name, version).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String name, String version, + Context context) { + return beginDeleteAsync(resourceGroupName, registryName, name, version, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String name, String version) { + deleteAsync(resourceGroupName, registryName, name, version).block(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String name, String version, Context context) { + deleteAsync(resourceGroupName, registryName, name, version, context).block(); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String registryName, + String name, String version) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, name, version, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String registryName, + String name, String version, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, + name, version, this.client.getApiVersion(), accept, context); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String registryName, String name, + String version) { + return getWithResponseAsync(resourceGroupName, registryName, name, version) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String registryName, String name, + String version, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, name, version, context).block(); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataVersionBaseInner get(String resourceGroupName, String registryName, String name, String version) { + return getWithResponse(resourceGroupName, registryName, name, version, Context.NONE).getValue(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String registryName, String name, String version, DataVersionBaseInner body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, name, version, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String registryName, String name, String version, DataVersionBaseInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, name, version, this.client.getApiVersion(), body, accept, context); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DataVersionBaseInner> beginCreateOrUpdateAsync( + String resourceGroupName, String registryName, String name, String version, DataVersionBaseInner body) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, registryName, name, version, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DataVersionBaseInner.class, DataVersionBaseInner.class, this.client.getContext()); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DataVersionBaseInner> beginCreateOrUpdateAsync( + String resourceGroupName, String registryName, String name, String version, DataVersionBaseInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, registryName, name, version, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DataVersionBaseInner.class, DataVersionBaseInner.class, context); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DataVersionBaseInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, String name, String version, DataVersionBaseInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, registryName, name, version, body).getSyncPoller(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DataVersionBaseInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, String name, String version, DataVersionBaseInner body, + Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, registryName, name, version, body, context) + .getSyncPoller(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String registryName, String name, + String version, DataVersionBaseInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, name, version, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String registryName, String name, + String version, DataVersionBaseInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, name, version, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataVersionBaseInner createOrUpdate(String resourceGroupName, String registryName, String name, + String version, DataVersionBaseInner body) { + return createOrUpdateAsync(resourceGroupName, registryName, name, version, body).block(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataVersionBaseInner createOrUpdate(String resourceGroupName, String registryName, String name, + String version, DataVersionBaseInner body, Context context) { + return createOrUpdateAsync(resourceGroupName, registryName, name, version, body, context).block(); + } + + /** + * Generate a storage location and credential for the client to upload a data asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data asset name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrGetStartPendingUploadWithResponseAsync( + String resourceGroupName, String registryName, String name, String version, PendingUploadRequestDto body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrGetStartPendingUpload(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, registryName, name, version, + this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generate a storage location and credential for the client to upload a data asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data asset name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrGetStartPendingUploadWithResponseAsync( + String resourceGroupName, String registryName, String name, String version, PendingUploadRequestDto body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrGetStartPendingUpload(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, name, version, this.client.getApiVersion(), body, accept, context); + } + + /** + * Generate a storage location and credential for the client to upload a data asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data asset name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrGetStartPendingUploadAsync(String resourceGroupName, + String registryName, String name, String version, PendingUploadRequestDto body) { + return createOrGetStartPendingUploadWithResponseAsync(resourceGroupName, registryName, name, version, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Generate a storage location and credential for the client to upload a data asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data asset name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrGetStartPendingUploadWithResponse(String resourceGroupName, + String registryName, String name, String version, PendingUploadRequestDto body, Context context) { + return createOrGetStartPendingUploadWithResponseAsync(resourceGroupName, registryName, name, version, body, + context).block(); + } + + /** + * Generate a storage location and credential for the client to upload a data asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data asset name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PendingUploadResponseDtoInner createOrGetStartPendingUpload(String resourceGroupName, String registryName, + String name, String version, PendingUploadRequestDto body) { + return createOrGetStartPendingUploadWithResponse(resourceGroupName, registryName, name, version, body, + Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataVersionBase entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataVersionBase entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryDataVersionsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryDataVersionsImpl.java new file mode 100644 index 0000000000000..39f04326b41a2 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryDataVersionsImpl.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.RegistryDataVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.DataVersionBaseInner; +import com.azure.resourcemanager.machinelearning.fluent.models.PendingUploadResponseDtoInner; +import com.azure.resourcemanager.machinelearning.models.DataVersionBase; +import com.azure.resourcemanager.machinelearning.models.ListViewType; +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; +import com.azure.resourcemanager.machinelearning.models.PendingUploadResponseDto; +import com.azure.resourcemanager.machinelearning.models.RegistryDataVersions; + +public final class RegistryDataVersionsImpl implements RegistryDataVersions { + private static final ClientLogger LOGGER = new ClientLogger(RegistryDataVersionsImpl.class); + + private final RegistryDataVersionsClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public RegistryDataVersionsImpl(RegistryDataVersionsClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String registryName, String name) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName, name); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DataVersionBaseImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String registryName, String name, + String orderBy, Integer top, String skip, String tags, ListViewType listViewType, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, registryName, name, orderBy, top, skip, tags, listViewType, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DataVersionBaseImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String registryName, String name, String version) { + this.serviceClient().delete(resourceGroupName, registryName, name, version); + } + + public void delete(String resourceGroupName, String registryName, String name, String version, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, name, version, context); + } + + public Response getWithResponse(String resourceGroupName, String registryName, String name, + String version, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, registryName, name, version, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DataVersionBaseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DataVersionBase get(String resourceGroupName, String registryName, String name, String version) { + DataVersionBaseInner inner = this.serviceClient().get(resourceGroupName, registryName, name, version); + if (inner != null) { + return new DataVersionBaseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrGetStartPendingUploadWithResponse(String resourceGroupName, + String registryName, String name, String version, PendingUploadRequestDto body, Context context) { + Response inner = this.serviceClient() + .createOrGetStartPendingUploadWithResponse(resourceGroupName, registryName, name, version, body, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PendingUploadResponseDtoImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PendingUploadResponseDto createOrGetStartPendingUpload(String resourceGroupName, String registryName, + String name, String version, PendingUploadRequestDto body) { + PendingUploadResponseDtoInner inner + = this.serviceClient().createOrGetStartPendingUpload(resourceGroupName, registryName, name, version, body); + if (inner != null) { + return new PendingUploadResponseDtoImpl(inner, this.manager()); + } else { + return null; + } + } + + public DataVersionBase getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "data"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'data'.", id))); + } + String version = ResourceManagerUtils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, name, version, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "data"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'data'.", id))); + } + String version = ResourceManagerUtils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, name, version, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "data"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'data'.", id))); + } + String version = ResourceManagerUtils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + this.delete(resourceGroupName, registryName, name, version, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "data"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'data'.", id))); + } + String version = ResourceManagerUtils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + this.delete(resourceGroupName, registryName, name, version, context); + } + + private RegistryDataVersionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + public DataVersionBaseImpl define(String name) { + return new DataVersionBaseImpl(name, this.manager()); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryEnvironmentContainersClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryEnvironmentContainersClientImpl.java new file mode 100644 index 0000000000000..2da0ebf6cb236 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryEnvironmentContainersClientImpl.java @@ -0,0 +1,962 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.RegistryEnvironmentContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentContainerInner; +import com.azure.resourcemanager.machinelearning.models.EnvironmentContainerResourceArmPaginatedResult; +import com.azure.resourcemanager.machinelearning.models.ListViewType; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in RegistryEnvironmentContainersClient. + */ +public final class RegistryEnvironmentContainersClientImpl implements RegistryEnvironmentContainersClient { + /** + * The proxy service used to perform REST calls. + */ + private final RegistryEnvironmentContainersService service; + + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of RegistryEnvironmentContainersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RegistryEnvironmentContainersClientImpl(AzureMachineLearningServicesImpl client) { + this.service = RestProxy.create(RegistryEnvironmentContainersService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesRegistryEnvironmentContainers to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface RegistryEnvironmentContainersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, @QueryParam("$skip") String skip, + @QueryParam("listViewType") ListViewType listViewType, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @PathParam("environmentName") String environmentName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @PathParam("environmentName") String environmentName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @PathParam("environmentName") String environmentName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") EnvironmentContainerInner body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List environment containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentContainer entities along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String registryName, String skip, ListViewType listViewType) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, this.client.getApiVersion(), skip, listViewType, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List environment containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentContainer entities along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String registryName, String skip, ListViewType listViewType, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, + this.client.getApiVersion(), skip, listViewType, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List environment containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, String skip, + ListViewType listViewType) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, registryName, skip, listViewType), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List environment containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName) { + final String skip = null; + final ListViewType listViewType = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, registryName, skip, listViewType), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List environment containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, String skip, + ListViewType listViewType, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, registryName, skip, listViewType, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List environment containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName) { + final String skip = null; + final ListViewType listViewType = null; + return new PagedIterable<>(listAsync(resourceGroupName, registryName, skip, listViewType)); + } + + /** + * List environment containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, String skip, + ListViewType listViewType, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, skip, listViewType, context)); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String registryName, + String environmentName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, environmentName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String registryName, + String environmentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, environmentName, this.client.getApiVersion(), accept, context); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName, + String environmentName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, registryName, environmentName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName, + String environmentName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, registryName, environmentName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, + String environmentName) { + return this.beginDeleteAsync(resourceGroupName, registryName, environmentName).getSyncPoller(); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, + String environmentName, Context context) { + return this.beginDeleteAsync(resourceGroupName, registryName, environmentName, context).getSyncPoller(); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String environmentName) { + return beginDeleteAsync(resourceGroupName, registryName, environmentName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String environmentName, + Context context) { + return beginDeleteAsync(resourceGroupName, registryName, environmentName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String environmentName) { + deleteAsync(resourceGroupName, registryName, environmentName).block(); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String environmentName, Context context) { + deleteAsync(resourceGroupName, registryName, environmentName, context).block(); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String registryName, String environmentName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, environmentName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String registryName, String environmentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, + environmentName, this.client.getApiVersion(), accept, context); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String registryName, + String environmentName) { + return getWithResponseAsync(resourceGroupName, registryName, environmentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String registryName, + String environmentName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, environmentName, context).block(); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EnvironmentContainerInner get(String resourceGroupName, String registryName, String environmentName) { + return getWithResponse(resourceGroupName, registryName, environmentName, Context.NONE).getValue(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String registryName, String environmentName, EnvironmentContainerInner body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, environmentName, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String registryName, String environmentName, EnvironmentContainerInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, environmentName, this.client.getApiVersion(), body, accept, context); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EnvironmentContainerInner> beginCreateOrUpdateAsync( + String resourceGroupName, String registryName, String environmentName, EnvironmentContainerInner body) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, registryName, environmentName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), EnvironmentContainerInner.class, EnvironmentContainerInner.class, + this.client.getContext()); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EnvironmentContainerInner> beginCreateOrUpdateAsync( + String resourceGroupName, String registryName, String environmentName, EnvironmentContainerInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, registryName, environmentName, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), EnvironmentContainerInner.class, EnvironmentContainerInner.class, context); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EnvironmentContainerInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, String environmentName, EnvironmentContainerInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, registryName, environmentName, body).getSyncPoller(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EnvironmentContainerInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, String environmentName, EnvironmentContainerInner body, + Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, registryName, environmentName, body, context) + .getSyncPoller(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String registryName, + String environmentName, EnvironmentContainerInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, environmentName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String registryName, + String environmentName, EnvironmentContainerInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, environmentName, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EnvironmentContainerInner createOrUpdate(String resourceGroupName, String registryName, + String environmentName, EnvironmentContainerInner body) { + return createOrUpdateAsync(resourceGroupName, registryName, environmentName, body).block(); + } + + /** + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EnvironmentContainerInner createOrUpdate(String resourceGroupName, String registryName, + String environmentName, EnvironmentContainerInner body, Context context) { + return createOrUpdateAsync(resourceGroupName, registryName, environmentName, body, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentContainer entities along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentContainer entities along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryEnvironmentContainersImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryEnvironmentContainersImpl.java new file mode 100644 index 0000000000000..667556ba0a77a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryEnvironmentContainersImpl.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.RegistryEnvironmentContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentContainerInner; +import com.azure.resourcemanager.machinelearning.models.EnvironmentContainer; +import com.azure.resourcemanager.machinelearning.models.ListViewType; +import com.azure.resourcemanager.machinelearning.models.RegistryEnvironmentContainers; + +public final class RegistryEnvironmentContainersImpl implements RegistryEnvironmentContainers { + private static final ClientLogger LOGGER = new ClientLogger(RegistryEnvironmentContainersImpl.class); + + private final RegistryEnvironmentContainersClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public RegistryEnvironmentContainersImpl(RegistryEnvironmentContainersClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String registryName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EnvironmentContainerImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String registryName, String skip, + ListViewType listViewType, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, registryName, skip, listViewType, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EnvironmentContainerImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String registryName, String environmentName) { + this.serviceClient().delete(resourceGroupName, registryName, environmentName); + } + + public void delete(String resourceGroupName, String registryName, String environmentName, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, environmentName, context); + } + + public Response getWithResponse(String resourceGroupName, String registryName, + String environmentName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, registryName, environmentName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EnvironmentContainerImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public EnvironmentContainer get(String resourceGroupName, String registryName, String environmentName) { + EnvironmentContainerInner inner = this.serviceClient().get(resourceGroupName, registryName, environmentName); + if (inner != null) { + return new EnvironmentContainerImpl(inner, this.manager()); + } else { + return null; + } + } + + public EnvironmentContainer getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String environmentName = ResourceManagerUtils.getValueFromIdByName(id, "environments"); + if (environmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, environmentName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String environmentName = ResourceManagerUtils.getValueFromIdByName(id, "environments"); + if (environmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, environmentName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String environmentName = ResourceManagerUtils.getValueFromIdByName(id, "environments"); + if (environmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); + } + this.delete(resourceGroupName, registryName, environmentName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String environmentName = ResourceManagerUtils.getValueFromIdByName(id, "environments"); + if (environmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); + } + this.delete(resourceGroupName, registryName, environmentName, context); + } + + private RegistryEnvironmentContainersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + public EnvironmentContainerImpl define(String name) { + return new EnvironmentContainerImpl(name, this.manager()); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryEnvironmentVersionsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryEnvironmentVersionsClientImpl.java new file mode 100644 index 0000000000000..ddb4b424a084a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryEnvironmentVersionsClientImpl.java @@ -0,0 +1,1052 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.RegistryEnvironmentVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentVersionInner; +import com.azure.resourcemanager.machinelearning.models.EnvironmentVersionResourceArmPaginatedResult; +import com.azure.resourcemanager.machinelearning.models.ListViewType; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in RegistryEnvironmentVersionsClient. + */ +public final class RegistryEnvironmentVersionsClientImpl implements RegistryEnvironmentVersionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final RegistryEnvironmentVersionsService service; + + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of RegistryEnvironmentVersionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RegistryEnvironmentVersionsClientImpl(AzureMachineLearningServicesImpl client) { + this.service = RestProxy.create(RegistryEnvironmentVersionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesRegistryEnvironmentVersions to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface RegistryEnvironmentVersionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @PathParam("environmentName") String environmentName, @QueryParam("api-version") String apiVersion, + @QueryParam("$orderBy") String orderBy, @QueryParam("$top") Integer top, @QueryParam("$skip") String skip, + @QueryParam("listViewType") ListViewType listViewType, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @PathParam("environmentName") String environmentName, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @PathParam("environmentName") String environmentName, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @PathParam("environmentName") String environmentName, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") EnvironmentVersionInner body, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentVersion entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String registryName, String environmentName, String orderBy, Integer top, String skip, + ListViewType listViewType) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, environmentName, this.client.getApiVersion(), orderBy, top, skip, + listViewType, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentVersion entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String registryName, String environmentName, String orderBy, Integer top, String skip, + ListViewType listViewType, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, + environmentName, this.client.getApiVersion(), orderBy, top, skip, listViewType, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentVersion entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, + String environmentName, String orderBy, Integer top, String skip, ListViewType listViewType) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, registryName, environmentName, orderBy, top, + skip, listViewType), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentVersion entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, + String environmentName) { + final String orderBy = null; + final Integer top = null; + final String skip = null; + final ListViewType listViewType = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, registryName, environmentName, orderBy, top, + skip, listViewType), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentVersion entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, + String environmentName, String orderBy, Integer top, String skip, ListViewType listViewType, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, registryName, environmentName, orderBy, top, + skip, listViewType, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, + String environmentName) { + final String orderBy = null; + final Integer top = null; + final String skip = null; + final ListViewType listViewType = null; + return new PagedIterable<>( + listAsync(resourceGroupName, registryName, environmentName, orderBy, top, skip, listViewType)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, + String environmentName, String orderBy, Integer top, String skip, ListViewType listViewType, Context context) { + return new PagedIterable<>( + listAsync(resourceGroupName, registryName, environmentName, orderBy, top, skip, listViewType, context)); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String registryName, + String environmentName, String version) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, environmentName, version, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String registryName, + String environmentName, String version, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, environmentName, version, this.client.getApiVersion(), accept, context); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName, + String environmentName, String version) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, registryName, environmentName, version); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName, + String environmentName, String version, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, registryName, environmentName, version, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, + String environmentName, String version) { + return this.beginDeleteAsync(resourceGroupName, registryName, environmentName, version).getSyncPoller(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, + String environmentName, String version, Context context) { + return this.beginDeleteAsync(resourceGroupName, registryName, environmentName, version, context) + .getSyncPoller(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String environmentName, + String version) { + return beginDeleteAsync(resourceGroupName, registryName, environmentName, version).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String environmentName, + String version, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, environmentName, version, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String environmentName, String version) { + deleteAsync(resourceGroupName, registryName, environmentName, version).block(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String environmentName, String version, + Context context) { + deleteAsync(resourceGroupName, registryName, environmentName, version, context).block(); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String registryName, + String environmentName, String version) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, environmentName, version, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String registryName, + String environmentName, String version, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, + environmentName, version, this.client.getApiVersion(), accept, context); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String registryName, + String environmentName, String version) { + return getWithResponseAsync(resourceGroupName, registryName, environmentName, version) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String registryName, + String environmentName, String version, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, environmentName, version, context).block(); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EnvironmentVersionInner get(String resourceGroupName, String registryName, String environmentName, + String version) { + return getWithResponse(resourceGroupName, registryName, environmentName, version, Context.NONE).getValue(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String registryName, String environmentName, String version, EnvironmentVersionInner body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, environmentName, version, this.client.getApiVersion(), body, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String registryName, String environmentName, String version, EnvironmentVersionInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, environmentName, version, this.client.getApiVersion(), body, accept, context); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EnvironmentVersionInner> beginCreateOrUpdateAsync( + String resourceGroupName, String registryName, String environmentName, String version, + EnvironmentVersionInner body) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, registryName, environmentName, version, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), EnvironmentVersionInner.class, EnvironmentVersionInner.class, + this.client.getContext()); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EnvironmentVersionInner> beginCreateOrUpdateAsync( + String resourceGroupName, String registryName, String environmentName, String version, + EnvironmentVersionInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, registryName, environmentName, version, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), EnvironmentVersionInner.class, EnvironmentVersionInner.class, context); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EnvironmentVersionInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, String environmentName, String version, + EnvironmentVersionInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, registryName, environmentName, version, body) + .getSyncPoller(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EnvironmentVersionInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, String environmentName, String version, + EnvironmentVersionInner body, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, registryName, environmentName, version, body, context) + .getSyncPoller(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String registryName, + String environmentName, String version, EnvironmentVersionInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, environmentName, version, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String registryName, + String environmentName, String version, EnvironmentVersionInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, environmentName, version, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EnvironmentVersionInner createOrUpdate(String resourceGroupName, String registryName, String environmentName, + String version, EnvironmentVersionInner body) { + return createOrUpdateAsync(resourceGroupName, registryName, environmentName, version, body).block(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EnvironmentVersionInner createOrUpdate(String resourceGroupName, String registryName, String environmentName, + String version, EnvironmentVersionInner body, Context context) { + return createOrUpdateAsync(resourceGroupName, registryName, environmentName, version, body, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentVersion entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentVersion entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryEnvironmentVersionsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryEnvironmentVersionsImpl.java new file mode 100644 index 0000000000000..09cf49941ade6 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryEnvironmentVersionsImpl.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.RegistryEnvironmentVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentVersionInner; +import com.azure.resourcemanager.machinelearning.models.EnvironmentVersion; +import com.azure.resourcemanager.machinelearning.models.ListViewType; +import com.azure.resourcemanager.machinelearning.models.RegistryEnvironmentVersions; + +public final class RegistryEnvironmentVersionsImpl implements RegistryEnvironmentVersions { + private static final ClientLogger LOGGER = new ClientLogger(RegistryEnvironmentVersionsImpl.class); + + private final RegistryEnvironmentVersionsClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public RegistryEnvironmentVersionsImpl(RegistryEnvironmentVersionsClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String registryName, + String environmentName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, registryName, environmentName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EnvironmentVersionImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String registryName, String environmentName, + String orderBy, Integer top, String skip, ListViewType listViewType, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, registryName, environmentName, orderBy, top, skip, listViewType, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EnvironmentVersionImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String registryName, String environmentName, String version) { + this.serviceClient().delete(resourceGroupName, registryName, environmentName, version); + } + + public void delete(String resourceGroupName, String registryName, String environmentName, String version, + Context context) { + this.serviceClient().delete(resourceGroupName, registryName, environmentName, version, context); + } + + public Response getWithResponse(String resourceGroupName, String registryName, + String environmentName, String version, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, registryName, environmentName, version, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EnvironmentVersionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public EnvironmentVersion get(String resourceGroupName, String registryName, String environmentName, + String version) { + EnvironmentVersionInner inner + = this.serviceClient().get(resourceGroupName, registryName, environmentName, version); + if (inner != null) { + return new EnvironmentVersionImpl(inner, this.manager()); + } else { + return null; + } + } + + public EnvironmentVersion getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String environmentName = ResourceManagerUtils.getValueFromIdByName(id, "environments"); + if (environmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); + } + String version = ResourceManagerUtils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, environmentName, version, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String environmentName = ResourceManagerUtils.getValueFromIdByName(id, "environments"); + if (environmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); + } + String version = ResourceManagerUtils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, environmentName, version, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String environmentName = ResourceManagerUtils.getValueFromIdByName(id, "environments"); + if (environmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); + } + String version = ResourceManagerUtils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + this.delete(resourceGroupName, registryName, environmentName, version, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String environmentName = ResourceManagerUtils.getValueFromIdByName(id, "environments"); + if (environmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); + } + String version = ResourceManagerUtils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + this.delete(resourceGroupName, registryName, environmentName, version, context); + } + + private RegistryEnvironmentVersionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + public EnvironmentVersionImpl define(String name) { + return new EnvironmentVersionImpl(name, this.manager()); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryImpl.java new file mode 100644 index 0000000000000..37863e5db4586 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryImpl.java @@ -0,0 +1,296 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.RegistryInner; +import com.azure.resourcemanager.machinelearning.models.ArmResourceId; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.PartialRegistryPartialTrackedResource; +import com.azure.resourcemanager.machinelearning.models.PartialSku; +import com.azure.resourcemanager.machinelearning.models.Registry; +import com.azure.resourcemanager.machinelearning.models.RegistryPartialManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.RegistryPrivateEndpointConnection; +import com.azure.resourcemanager.machinelearning.models.RegistryRegionArmDetails; +import com.azure.resourcemanager.machinelearning.models.Sku; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class RegistryImpl implements Registry, Registry.Definition, Registry.Update { + private RegistryInner innerObject; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + + public String kind() { + return this.innerModel().kind(); + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String discoveryUrl() { + return this.innerModel().discoveryUrl(); + } + + public String intellectualPropertyPublisher() { + return this.innerModel().intellectualPropertyPublisher(); + } + + public ArmResourceId managedResourceGroup() { + return this.innerModel().managedResourceGroup(); + } + + public String mlFlowRegistryUri() { + return this.innerModel().mlFlowRegistryUri(); + } + + public List registryPrivateEndpointConnections() { + List inner = this.innerModel().registryPrivateEndpointConnections(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + + public List regionDetails() { + List inner = this.innerModel().regionDetails(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public RegistryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String registryName; + + private PartialRegistryPartialTrackedResource updateBody; + + public RegistryImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Registry create() { + this.innerObject = serviceManager.serviceClient() + .getRegistries() + .createOrUpdate(resourceGroupName, registryName, this.innerModel(), Context.NONE); + return this; + } + + public Registry create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRegistries() + .createOrUpdate(resourceGroupName, registryName, this.innerModel(), context); + return this; + } + + RegistryImpl(String name, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = new RegistryInner(); + this.serviceManager = serviceManager; + this.registryName = name; + } + + public RegistryImpl update() { + this.updateBody = new PartialRegistryPartialTrackedResource(); + return this; + } + + public Registry apply() { + this.innerObject = serviceManager.serviceClient() + .getRegistries() + .updateWithResponse(resourceGroupName, registryName, updateBody, Context.NONE) + .getValue(); + return this; + } + + public Registry apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRegistries() + .updateWithResponse(resourceGroupName, registryName, updateBody, context) + .getValue(); + return this; + } + + RegistryImpl(RegistryInner innerObject, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.registryName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "registries"); + } + + public Registry refresh() { + this.innerObject = serviceManager.serviceClient() + .getRegistries() + .getByResourceGroupWithResponse(resourceGroupName, registryName, Context.NONE) + .getValue(); + return this; + } + + public Registry refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRegistries() + .getByResourceGroupWithResponse(resourceGroupName, registryName, context) + .getValue(); + return this; + } + + public Registry removeRegions(RegistryInner body) { + return serviceManager.registries().removeRegions(resourceGroupName, registryName, body); + } + + public Registry removeRegions(RegistryInner body, Context context) { + return serviceManager.registries().removeRegions(resourceGroupName, registryName, body, context); + } + + public RegistryImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public RegistryImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public RegistryImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBody.withTags(tags); + return this; + } + } + + public RegistryImpl withIdentity(ManagedServiceIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public RegistryImpl withKind(String kind) { + this.innerModel().withKind(kind); + return this; + } + + public RegistryImpl withSku(Sku sku) { + this.innerModel().withSku(sku); + return this; + } + + public RegistryImpl withDiscoveryUrl(String discoveryUrl) { + this.innerModel().withDiscoveryUrl(discoveryUrl); + return this; + } + + public RegistryImpl withIntellectualPropertyPublisher(String intellectualPropertyPublisher) { + this.innerModel().withIntellectualPropertyPublisher(intellectualPropertyPublisher); + return this; + } + + public RegistryImpl withManagedResourceGroup(ArmResourceId managedResourceGroup) { + this.innerModel().withManagedResourceGroup(managedResourceGroup); + return this; + } + + public RegistryImpl withMlFlowRegistryUri(String mlFlowRegistryUri) { + this.innerModel().withMlFlowRegistryUri(mlFlowRegistryUri); + return this; + } + + public RegistryImpl withRegistryPrivateEndpointConnections( + List registryPrivateEndpointConnections) { + this.innerModel().withRegistryPrivateEndpointConnections(registryPrivateEndpointConnections); + return this; + } + + public RegistryImpl withPublicNetworkAccess(String publicNetworkAccess) { + this.innerModel().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + public RegistryImpl withRegionDetails(List regionDetails) { + this.innerModel().withRegionDetails(regionDetails); + return this; + } + + public RegistryImpl withIdentity(RegistryPartialManagedServiceIdentity identity) { + this.updateBody.withIdentity(identity); + return this; + } + + public RegistryImpl withSku(PartialSku sku) { + this.updateBody.withSku(sku); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryModelContainersClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryModelContainersClientImpl.java new file mode 100644 index 0000000000000..f60cdfba220ff --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryModelContainersClientImpl.java @@ -0,0 +1,949 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.RegistryModelContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.models.ModelContainerInner; +import com.azure.resourcemanager.machinelearning.models.ListViewType; +import com.azure.resourcemanager.machinelearning.models.ModelContainerResourceArmPaginatedResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in RegistryModelContainersClient. + */ +public final class RegistryModelContainersClientImpl implements RegistryModelContainersClient { + /** + * The proxy service used to perform REST calls. + */ + private final RegistryModelContainersService service; + + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of RegistryModelContainersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RegistryModelContainersClientImpl(AzureMachineLearningServicesImpl client) { + this.service = RestProxy.create(RegistryModelContainersService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesRegistryModelContainers to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface RegistryModelContainersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, @QueryParam("$skip") String skip, + @QueryParam("listViewType") ListViewType listViewType, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @PathParam("modelName") String modelName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @PathParam("modelName") String modelName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @PathParam("modelName") String modelName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ModelContainerInner body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List model containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelContainer entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String registryName, + String skip, ListViewType listViewType) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, this.client.getApiVersion(), skip, listViewType, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List model containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelContainer entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String registryName, + String skip, ListViewType listViewType, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, + this.client.getApiVersion(), skip, listViewType, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List model containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, String skip, + ListViewType listViewType) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, registryName, skip, listViewType), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List model containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName) { + final String skip = null; + final ListViewType listViewType = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, registryName, skip, listViewType), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List model containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelContainer entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, String skip, + ListViewType listViewType, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, registryName, skip, listViewType, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List model containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName) { + final String skip = null; + final ListViewType listViewType = null; + return new PagedIterable<>(listAsync(resourceGroupName, registryName, skip, listViewType)); + } + + /** + * List model containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelContainer entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, String skip, + ListViewType listViewType, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, skip, listViewType, context)); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String registryName, + String modelName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (modelName == null) { + return Mono.error(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, modelName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String registryName, + String modelName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (modelName == null) { + return Mono.error(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, modelName, this.client.getApiVersion(), accept, context); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName, + String modelName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, registryName, modelName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName, + String modelName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, registryName, modelName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, + String modelName) { + return this.beginDeleteAsync(resourceGroupName, registryName, modelName).getSyncPoller(); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, + String modelName, Context context) { + return this.beginDeleteAsync(resourceGroupName, registryName, modelName, context).getSyncPoller(); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String modelName) { + return beginDeleteAsync(resourceGroupName, registryName, modelName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String modelName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, modelName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String modelName) { + deleteAsync(resourceGroupName, registryName, modelName).block(); + } + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String modelName, Context context) { + deleteAsync(resourceGroupName, registryName, modelName, context).block(); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String registryName, + String modelName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (modelName == null) { + return Mono.error(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, modelName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String registryName, + String modelName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (modelName == null) { + return Mono.error(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, + modelName, this.client.getApiVersion(), accept, context); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String registryName, String modelName) { + return getWithResponseAsync(resourceGroupName, registryName, modelName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String registryName, + String modelName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, modelName, context).block(); + } + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelContainerInner get(String resourceGroupName, String registryName, String modelName) { + return getWithResponse(resourceGroupName, registryName, modelName, Context.NONE).getValue(); + } + + /** + * Create or update model container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String registryName, String modelName, ModelContainerInner body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (modelName == null) { + return Mono.error(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, modelName, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update model container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String registryName, String modelName, ModelContainerInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (modelName == null) { + return Mono.error(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, modelName, this.client.getApiVersion(), body, accept, context); + } + + /** + * Create or update model container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ModelContainerInner> beginCreateOrUpdateAsync( + String resourceGroupName, String registryName, String modelName, ModelContainerInner body) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, registryName, modelName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ModelContainerInner.class, ModelContainerInner.class, this.client.getContext()); + } + + /** + * Create or update model container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ModelContainerInner> beginCreateOrUpdateAsync( + String resourceGroupName, String registryName, String modelName, ModelContainerInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, registryName, modelName, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ModelContainerInner.class, ModelContainerInner.class, context); + } + + /** + * Create or update model container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ModelContainerInner> + beginCreateOrUpdate(String resourceGroupName, String registryName, String modelName, ModelContainerInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, registryName, modelName, body).getSyncPoller(); + } + + /** + * Create or update model container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ModelContainerInner> beginCreateOrUpdate( + String resourceGroupName, String registryName, String modelName, ModelContainerInner body, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, registryName, modelName, body, context).getSyncPoller(); + } + + /** + * Create or update model container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String registryName, + String modelName, ModelContainerInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, modelName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update model container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String registryName, + String modelName, ModelContainerInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, modelName, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update model container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param body Container entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelContainerInner createOrUpdate(String resourceGroupName, String registryName, String modelName, + ModelContainerInner body) { + return createOrUpdateAsync(resourceGroupName, registryName, modelName, body).block(); + } + + /** + * Create or update model container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param body Container entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelContainerInner createOrUpdate(String resourceGroupName, String registryName, String modelName, + ModelContainerInner body, Context context) { + return createOrUpdateAsync(resourceGroupName, registryName, modelName, body, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelContainer entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelContainer entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryModelContainersImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryModelContainersImpl.java new file mode 100644 index 0000000000000..075465e163fe8 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryModelContainersImpl.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.RegistryModelContainersClient; +import com.azure.resourcemanager.machinelearning.fluent.models.ModelContainerInner; +import com.azure.resourcemanager.machinelearning.models.ListViewType; +import com.azure.resourcemanager.machinelearning.models.ModelContainer; +import com.azure.resourcemanager.machinelearning.models.RegistryModelContainers; + +public final class RegistryModelContainersImpl implements RegistryModelContainers { + private static final ClientLogger LOGGER = new ClientLogger(RegistryModelContainersImpl.class); + + private final RegistryModelContainersClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public RegistryModelContainersImpl(RegistryModelContainersClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String registryName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ModelContainerImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String registryName, String skip, + ListViewType listViewType, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, registryName, skip, listViewType, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ModelContainerImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String registryName, String modelName) { + this.serviceClient().delete(resourceGroupName, registryName, modelName); + } + + public void delete(String resourceGroupName, String registryName, String modelName, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, modelName, context); + } + + public Response getWithResponse(String resourceGroupName, String registryName, String modelName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, registryName, modelName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ModelContainerImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ModelContainer get(String resourceGroupName, String registryName, String modelName) { + ModelContainerInner inner = this.serviceClient().get(resourceGroupName, registryName, modelName); + if (inner != null) { + return new ModelContainerImpl(inner, this.manager()); + } else { + return null; + } + } + + public ModelContainer getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String modelName = ResourceManagerUtils.getValueFromIdByName(id, "models"); + if (modelName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'models'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, modelName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String modelName = ResourceManagerUtils.getValueFromIdByName(id, "models"); + if (modelName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'models'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, modelName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String modelName = ResourceManagerUtils.getValueFromIdByName(id, "models"); + if (modelName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'models'.", id))); + } + this.delete(resourceGroupName, registryName, modelName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String modelName = ResourceManagerUtils.getValueFromIdByName(id, "models"); + if (modelName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'models'.", id))); + } + this.delete(resourceGroupName, registryName, modelName, context); + } + + private RegistryModelContainersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + public ModelContainerImpl define(String name) { + return new ModelContainerImpl(name, this.manager()); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryModelVersionsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryModelVersionsClientImpl.java new file mode 100644 index 0000000000000..a040e054cf7ee --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryModelVersionsClientImpl.java @@ -0,0 +1,1243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.RegistryModelVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.ModelVersionInner; +import com.azure.resourcemanager.machinelearning.fluent.models.PendingUploadResponseDtoInner; +import com.azure.resourcemanager.machinelearning.models.ListViewType; +import com.azure.resourcemanager.machinelearning.models.ModelVersionResourceArmPaginatedResult; +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in RegistryModelVersionsClient. + */ +public final class RegistryModelVersionsClientImpl implements RegistryModelVersionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final RegistryModelVersionsService service; + + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of RegistryModelVersionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RegistryModelVersionsClientImpl(AzureMachineLearningServicesImpl client) { + this.service = RestProxy.create(RegistryModelVersionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesRegistryModelVersions to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface RegistryModelVersionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @PathParam("modelName") String modelName, @QueryParam("api-version") String apiVersion, + @QueryParam("$skip") String skip, @QueryParam("$orderBy") String orderBy, @QueryParam("$top") Integer top, + @QueryParam("version") String version, @QueryParam("description") String description, + @QueryParam("tags") String tags, @QueryParam("properties") String properties, + @QueryParam("listViewType") ListViewType listViewType, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @PathParam("modelName") String modelName, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @PathParam("modelName") String modelName, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @PathParam("modelName") String modelName, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") ModelVersionInner body, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/startPendingUpload") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrGetStartPendingUpload(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @PathParam("modelName") String modelName, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") PendingUploadRequestDto body, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param version Version identifier. + * @param description Model description. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param properties Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2. + * @param listViewType View type for including/excluding (for example) archived entities. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelVersion entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String registryName, + String modelName, String skip, String orderBy, Integer top, String version, String description, String tags, + String properties, ListViewType listViewType) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (modelName == null) { + return Mono.error(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, modelName, this.client.getApiVersion(), skip, orderBy, top, version, + description, tags, properties, listViewType, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param version Version identifier. + * @param description Model description. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param properties Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelVersion entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String registryName, + String modelName, String skip, String orderBy, Integer top, String version, String description, String tags, + String properties, ListViewType listViewType, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (modelName == null) { + return Mono.error(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, + modelName, this.client.getApiVersion(), skip, orderBy, top, version, description, tags, properties, + listViewType, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param version Version identifier. + * @param description Model description. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param properties Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2. + * @param listViewType View type for including/excluding (for example) archived entities. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelVersion entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, String modelName, + String skip, String orderBy, Integer top, String version, String description, String tags, String properties, + ListViewType listViewType) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, registryName, modelName, skip, orderBy, top, + version, description, tags, properties, listViewType), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelVersion entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, String modelName) { + final String skip = null; + final String orderBy = null; + final Integer top = null; + final String version = null; + final String description = null; + final String tags = null; + final String properties = null; + final ListViewType listViewType = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, registryName, modelName, skip, orderBy, top, + version, description, tags, properties, listViewType), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param version Version identifier. + * @param description Model description. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param properties Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelVersion entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, String modelName, + String skip, String orderBy, Integer top, String version, String description, String tags, String properties, + ListViewType listViewType, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, modelName, skip, orderBy, top, version, + description, tags, properties, listViewType, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, String modelName) { + final String skip = null; + final String orderBy = null; + final Integer top = null; + final String version = null; + final String description = null; + final String tags = null; + final String properties = null; + final ListViewType listViewType = null; + return new PagedIterable<>(listAsync(resourceGroupName, registryName, modelName, skip, orderBy, top, version, + description, tags, properties, listViewType)); + } + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param version Version identifier. + * @param description Model description. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param properties Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelVersion entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, String modelName, + String skip, String orderBy, Integer top, String version, String description, String tags, String properties, + ListViewType listViewType, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, modelName, skip, orderBy, top, version, + description, tags, properties, listViewType, context)); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String registryName, + String modelName, String version) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (modelName == null) { + return Mono.error(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, modelName, version, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String registryName, + String modelName, String version, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (modelName == null) { + return Mono.error(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, modelName, version, this.client.getApiVersion(), accept, context); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName, + String modelName, String version) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, registryName, modelName, version); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName, + String modelName, String version, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, registryName, modelName, version, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, + String modelName, String version) { + return this.beginDeleteAsync(resourceGroupName, registryName, modelName, version).getSyncPoller(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, + String modelName, String version, Context context) { + return this.beginDeleteAsync(resourceGroupName, registryName, modelName, version, context).getSyncPoller(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String modelName, String version) { + return beginDeleteAsync(resourceGroupName, registryName, modelName, version).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String modelName, String version, + Context context) { + return beginDeleteAsync(resourceGroupName, registryName, modelName, version, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String modelName, String version) { + deleteAsync(resourceGroupName, registryName, modelName, version).block(); + } + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String modelName, String version, + Context context) { + deleteAsync(resourceGroupName, registryName, modelName, version, context).block(); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String registryName, + String modelName, String version) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (modelName == null) { + return Mono.error(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, modelName, version, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String registryName, + String modelName, String version, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (modelName == null) { + return Mono.error(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, + modelName, version, this.client.getApiVersion(), accept, context); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String registryName, String modelName, + String version) { + return getWithResponseAsync(resourceGroupName, registryName, modelName, version) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String registryName, String modelName, + String version, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, modelName, version, context).block(); + } + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelVersionInner get(String resourceGroupName, String registryName, String modelName, String version) { + return getWithResponse(resourceGroupName, registryName, modelName, version, Context.NONE).getValue(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String registryName, String modelName, String version, ModelVersionInner body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (modelName == null) { + return Mono.error(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, modelName, version, this.client.getApiVersion(), body, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String registryName, String modelName, String version, ModelVersionInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (modelName == null) { + return Mono.error(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, modelName, version, this.client.getApiVersion(), body, accept, context); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ModelVersionInner> beginCreateOrUpdateAsync( + String resourceGroupName, String registryName, String modelName, String version, ModelVersionInner body) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, registryName, modelName, version, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ModelVersionInner.class, ModelVersionInner.class, this.client.getContext()); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ModelVersionInner> beginCreateOrUpdateAsync( + String resourceGroupName, String registryName, String modelName, String version, ModelVersionInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, registryName, modelName, version, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ModelVersionInner.class, ModelVersionInner.class, context); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ModelVersionInner> beginCreateOrUpdate(String resourceGroupName, + String registryName, String modelName, String version, ModelVersionInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, registryName, modelName, version, body).getSyncPoller(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ModelVersionInner> beginCreateOrUpdate(String resourceGroupName, + String registryName, String modelName, String version, ModelVersionInner body, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, registryName, modelName, version, body, context) + .getSyncPoller(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String registryName, String modelName, + String version, ModelVersionInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, modelName, version, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String registryName, String modelName, + String version, ModelVersionInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, registryName, modelName, version, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelVersionInner createOrUpdate(String resourceGroupName, String registryName, String modelName, + String version, ModelVersionInner body) { + return createOrUpdateAsync(resourceGroupName, registryName, modelName, version, body).block(); + } + + /** + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelVersionInner createOrUpdate(String resourceGroupName, String registryName, String modelName, + String version, ModelVersionInner body, Context context) { + return createOrUpdateAsync(resourceGroupName, registryName, modelName, version, body, context).block(); + } + + /** + * Generate a storage location and credential for the client to upload a model asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Model name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrGetStartPendingUploadWithResponseAsync( + String resourceGroupName, String registryName, String modelName, String version, PendingUploadRequestDto body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (modelName == null) { + return Mono.error(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrGetStartPendingUpload(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, registryName, modelName, version, + this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generate a storage location and credential for the client to upload a model asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Model name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrGetStartPendingUploadWithResponseAsync( + String resourceGroupName, String registryName, String modelName, String version, PendingUploadRequestDto body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (modelName == null) { + return Mono.error(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrGetStartPendingUpload(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, modelName, version, this.client.getApiVersion(), body, accept, context); + } + + /** + * Generate a storage location and credential for the client to upload a model asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Model name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrGetStartPendingUploadAsync(String resourceGroupName, + String registryName, String modelName, String version, PendingUploadRequestDto body) { + return createOrGetStartPendingUploadWithResponseAsync(resourceGroupName, registryName, modelName, version, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Generate a storage location and credential for the client to upload a model asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Model name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrGetStartPendingUploadWithResponse(String resourceGroupName, + String registryName, String modelName, String version, PendingUploadRequestDto body, Context context) { + return createOrGetStartPendingUploadWithResponseAsync(resourceGroupName, registryName, modelName, version, body, + context).block(); + } + + /** + * Generate a storage location and credential for the client to upload a model asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Model name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PendingUploadResponseDtoInner createOrGetStartPendingUpload(String resourceGroupName, String registryName, + String modelName, String version, PendingUploadRequestDto body) { + return createOrGetStartPendingUploadWithResponse(resourceGroupName, registryName, modelName, version, body, + Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelVersion entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelVersion entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryModelVersionsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryModelVersionsImpl.java new file mode 100644 index 0000000000000..799af6df7aa6d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/RegistryModelVersionsImpl.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.RegistryModelVersionsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.ModelVersionInner; +import com.azure.resourcemanager.machinelearning.fluent.models.PendingUploadResponseDtoInner; +import com.azure.resourcemanager.machinelearning.models.ListViewType; +import com.azure.resourcemanager.machinelearning.models.ModelVersion; +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; +import com.azure.resourcemanager.machinelearning.models.PendingUploadResponseDto; +import com.azure.resourcemanager.machinelearning.models.RegistryModelVersions; + +public final class RegistryModelVersionsImpl implements RegistryModelVersions { + private static final ClientLogger LOGGER = new ClientLogger(RegistryModelVersionsImpl.class); + + private final RegistryModelVersionsClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public RegistryModelVersionsImpl(RegistryModelVersionsClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String registryName, String modelName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName, modelName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ModelVersionImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String registryName, String modelName, + String skip, String orderBy, Integer top, String version, String description, String tags, String properties, + ListViewType listViewType, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, registryName, modelName, skip, orderBy, top, version, description, tags, + properties, listViewType, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ModelVersionImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String registryName, String modelName, String version) { + this.serviceClient().delete(resourceGroupName, registryName, modelName, version); + } + + public void delete(String resourceGroupName, String registryName, String modelName, String version, + Context context) { + this.serviceClient().delete(resourceGroupName, registryName, modelName, version, context); + } + + public Response getWithResponse(String resourceGroupName, String registryName, String modelName, + String version, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, registryName, modelName, version, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ModelVersionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ModelVersion get(String resourceGroupName, String registryName, String modelName, String version) { + ModelVersionInner inner = this.serviceClient().get(resourceGroupName, registryName, modelName, version); + if (inner != null) { + return new ModelVersionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrGetStartPendingUploadWithResponse(String resourceGroupName, + String registryName, String modelName, String version, PendingUploadRequestDto body, Context context) { + Response inner = this.serviceClient() + .createOrGetStartPendingUploadWithResponse(resourceGroupName, registryName, modelName, version, body, + context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PendingUploadResponseDtoImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PendingUploadResponseDto createOrGetStartPendingUpload(String resourceGroupName, String registryName, + String modelName, String version, PendingUploadRequestDto body) { + PendingUploadResponseDtoInner inner = this.serviceClient() + .createOrGetStartPendingUpload(resourceGroupName, registryName, modelName, version, body); + if (inner != null) { + return new PendingUploadResponseDtoImpl(inner, this.manager()); + } else { + return null; + } + } + + public ModelVersion getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String modelName = ResourceManagerUtils.getValueFromIdByName(id, "models"); + if (modelName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'models'.", id))); + } + String version = ResourceManagerUtils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, modelName, version, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String modelName = ResourceManagerUtils.getValueFromIdByName(id, "models"); + if (modelName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'models'.", id))); + } + String version = ResourceManagerUtils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, modelName, version, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String modelName = ResourceManagerUtils.getValueFromIdByName(id, "models"); + if (modelName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'models'.", id))); + } + String version = ResourceManagerUtils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + this.delete(resourceGroupName, registryName, modelName, version, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = ResourceManagerUtils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String modelName = ResourceManagerUtils.getValueFromIdByName(id, "models"); + if (modelName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'models'.", id))); + } + String version = ResourceManagerUtils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + this.delete(resourceGroupName, registryName, modelName, version, context); + } + + private RegistryModelVersionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + public ModelVersionImpl define(String name) { + return new ModelVersionImpl(name, this.manager()); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ResourceManagerUtils.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ResourceManagerUtils.java new file mode 100644 index 0000000000000..cd2a6cecc972e --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ResourceManagerUtils.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class ResourceManagerUtils { + private ResourceManagerUtils() { + } + + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (!segments.isEmpty() && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl<>(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux + .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ResourceQuotaImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ResourceQuotaImpl.java index a16025c4b7b7f..587759ff4f328 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ResourceQuotaImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ResourceQuotaImpl.java @@ -14,8 +14,7 @@ public final class ResourceQuotaImpl implements ResourceQuota { private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - ResourceQuotaImpl( - ResourceQuotaInner innerObject, + ResourceQuotaImpl(ResourceQuotaInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ScheduleImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ScheduleImpl.java index a4b080c85af25..99af457f6cbd1 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ScheduleImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ScheduleImpl.java @@ -60,20 +60,16 @@ public ScheduleImpl withExistingWorkspace(String resourceGroupName, String works } public Schedule create() { - this.innerObject = - serviceManager - .serviceClient() - .getSchedules() - .createOrUpdate(resourceGroupName, workspaceName, name, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getSchedules() + .createOrUpdate(resourceGroupName, workspaceName, name, this.innerModel(), Context.NONE); return this; } public Schedule create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getSchedules() - .createOrUpdate(resourceGroupName, workspaceName, name, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient() + .getSchedules() + .createOrUpdate(resourceGroupName, workspaceName, name, this.innerModel(), context); return this; } @@ -88,49 +84,41 @@ public ScheduleImpl update() { } public Schedule apply() { - this.innerObject = - serviceManager - .serviceClient() - .getSchedules() - .createOrUpdate(resourceGroupName, workspaceName, name, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getSchedules() + .createOrUpdate(resourceGroupName, workspaceName, name, this.innerModel(), Context.NONE); return this; } public Schedule apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getSchedules() - .createOrUpdate(resourceGroupName, workspaceName, name, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient() + .getSchedules() + .createOrUpdate(resourceGroupName, workspaceName, name, this.innerModel(), context); return this; } - ScheduleImpl( - ScheduleInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + ScheduleImpl(ScheduleInner innerObject, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); - this.name = Utils.getValueFromIdByName(innerObject.id(), "schedules"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "schedules"); } public Schedule refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getSchedules() - .getWithResponse(resourceGroupName, workspaceName, name, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getSchedules() + .getWithResponse(resourceGroupName, workspaceName, name, Context.NONE) + .getValue(); return this; } public Schedule refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getSchedules() - .getWithResponse(resourceGroupName, workspaceName, name, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getSchedules() + .getWithResponse(resourceGroupName, workspaceName, name, context) + .getValue(); return this; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/SchedulesClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/SchedulesClientImpl.java index 5b592b442ec78..5a3225c145ab3 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/SchedulesClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/SchedulesClientImpl.java @@ -39,112 +39,91 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in SchedulesClient. */ +/** + * An instance of this class provides access to all the operations defined in SchedulesClient. + */ public final class SchedulesClientImpl implements SchedulesClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final SchedulesService service; - /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of SchedulesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ - SchedulesClientImpl(AzureMachineLearningWorkspacesImpl client) { - this.service = - RestProxy.create(SchedulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + SchedulesClientImpl(AzureMachineLearningServicesImpl client) { + this.service + = RestProxy.create(SchedulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesSchedules to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for AzureMachineLearningServicesSchedules to be used by the proxy service + * to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AzureMachineLearning") public interface SchedulesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, + Mono> list(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @QueryParam("api-version") String apiVersion, - @QueryParam("$skip") String skip, - @QueryParam("listViewType") ScheduleListViewType listViewType, - @HeaderParam("Accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @QueryParam("$skip") String skip, + @QueryParam("listViewType") ScheduleListViewType listViewType, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}") - @ExpectedResponses({200, 202, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}") + @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, + Mono>> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, + Mono>> createOrUpdate(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ScheduleInner body, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ScheduleInner body, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * List schedules in specified workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -152,23 +131,19 @@ Mono> listNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a paginated list of Schedule entities along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return a paginated list of Schedule entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String workspaceName, String skip, ScheduleListViewType listViewType) { + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String skip, ScheduleListViewType listViewType) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -179,34 +154,16 @@ private Mono> listSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - this.client.getApiVersion(), - skip, - listViewType, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), skip, listViewType, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List schedules in specified workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -215,27 +172,19 @@ private Mono> listSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a paginated list of Schedule entities along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return a paginated list of Schedule entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String workspaceName, - String skip, - ScheduleListViewType listViewType, - Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String skip, ScheduleListViewType listViewType, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -247,30 +196,15 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - this.client.getApiVersion(), - skip, - listViewType, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + this.client.getApiVersion(), skip, listViewType, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List schedules in specified workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -281,16 +215,15 @@ private Mono> listSinglePageAsync( * @return a paginated list of Schedule entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String workspaceName, String skip, ScheduleListViewType listViewType) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, skip, listViewType), + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String skip, + ScheduleListViewType listViewType) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skip, listViewType), nextLink -> listNextSinglePageAsync(nextLink)); } /** * List schedules in specified workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -302,14 +235,13 @@ private PagedFlux listAsync( private PagedFlux listAsync(String resourceGroupName, String workspaceName) { final String skip = null; final ScheduleListViewType listViewType = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, skip, listViewType), + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skip, listViewType), nextLink -> listNextSinglePageAsync(nextLink)); } /** * List schedules in specified workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -321,20 +253,15 @@ private PagedFlux listAsync(String resourceGroupName, String work * @return a paginated list of Schedule entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String workspaceName, - String skip, - ScheduleListViewType listViewType, - Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, skip, listViewType, context), + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String skip, + ScheduleListViewType listViewType, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skip, listViewType, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * List schedules in specified workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -351,7 +278,7 @@ public PagedIterable list(String resourceGroupName, String worksp /** * List schedules in specified workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -363,18 +290,14 @@ public PagedIterable list(String resourceGroupName, String worksp * @return a paginated list of Schedule entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, - String workspaceName, - String skip, - ScheduleListViewType listViewType, - Context context) { + public PagedIterable list(String resourceGroupName, String workspaceName, String skip, + ScheduleListViewType listViewType, Context context) { return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, skip, listViewType, context)); } /** * Delete schedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Schedule name. @@ -384,19 +307,15 @@ public PagedIterable list( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String name) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String name) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -410,24 +329,14 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete schedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Schedule name. @@ -438,19 +347,15 @@ private Mono>> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String name, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String name, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -464,21 +369,13 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, this.client.getApiVersion(), accept, context); } /** * Delete schedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Schedule name. @@ -488,18 +385,16 @@ private Mono>> deleteWithResponseAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String workspaceName, String name) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, + String name) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName, name); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Delete schedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Schedule name. @@ -510,19 +405,18 @@ private PollerFlux, Void> beginDeleteAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String workspaceName, String name, Context context) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, + String name, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, workspaceName, name, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, workspaceName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** * Delete schedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Schedule name. @@ -538,7 +432,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, /** * Delete schedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Schedule name. @@ -549,14 +443,14 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String workspaceName, String name, Context context) { + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String name, + Context context) { return this.beginDeleteAsync(resourceGroupName, workspaceName, name, context).getSyncPoller(); } /** * Delete schedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Schedule name. @@ -567,14 +461,13 @@ public SyncPoller, Void> beginDelete( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String workspaceName, String name) { - return beginDeleteAsync(resourceGroupName, workspaceName, name) - .last() + return beginDeleteAsync(resourceGroupName, workspaceName, name).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete schedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Schedule name. @@ -586,14 +479,13 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String workspaceName, String name, Context context) { - return beginDeleteAsync(resourceGroupName, workspaceName, name, context) - .last() + return beginDeleteAsync(resourceGroupName, workspaceName, name, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete schedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Schedule name. @@ -608,7 +500,7 @@ public void delete(String resourceGroupName, String workspaceName, String name) /** * Delete schedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Schedule name. @@ -624,7 +516,7 @@ public void delete(String resourceGroupName, String workspaceName, String name, /** * Get schedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Schedule name. @@ -634,19 +526,15 @@ public void delete(String resourceGroupName, String workspaceName, String name, * @return schedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String name) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String name) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -660,24 +548,14 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get schedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Schedule name. @@ -688,19 +566,15 @@ private Mono> getWithResponseAsync( * @return schedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String name, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String name, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -714,21 +588,13 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + name, this.client.getApiVersion(), accept, context); } /** * Get schedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Schedule name. @@ -745,7 +611,7 @@ private Mono getAsync(String resourceGroupName, String workspaceN /** * Get schedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Schedule name. @@ -756,14 +622,14 @@ private Mono getAsync(String resourceGroupName, String workspaceN * @return schedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String name, Context context) { + public Response getWithResponse(String resourceGroupName, String workspaceName, String name, + Context context) { return getWithResponseAsync(resourceGroupName, workspaceName, name, context).block(); } /** * Get schedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Schedule name. @@ -779,7 +645,7 @@ public ScheduleInner get(String resourceGroupName, String workspaceName, String /** * Create or update schedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Schedule name. @@ -787,23 +653,19 @@ public ScheduleInner get(String resourceGroupName, String workspaceName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link - * Mono}. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String workspaceName, String name, ScheduleInner body) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String name, ScheduleInner body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -822,25 +684,14 @@ private Mono>> createOrUpdateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - body, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or update schedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Schedule name. @@ -849,23 +700,19 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of {@link - * Mono}. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String workspaceName, String name, ScheduleInner body, Context context) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String name, ScheduleInner body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -884,22 +731,13 @@ private Mono>> createOrUpdateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - this.client.getApiVersion(), - body, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, this.client.getApiVersion(), body, accept, context); } /** * Create or update schedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Schedule name. @@ -910,23 +748,17 @@ private Mono>> createOrUpdateWithResponseAsync( * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ScheduleInner> beginCreateOrUpdateAsync( - String resourceGroupName, String workspaceName, String name, ScheduleInner body) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ScheduleInner.class, - ScheduleInner.class, - this.client.getContext()); + private PollerFlux, ScheduleInner> beginCreateOrUpdateAsync(String resourceGroupName, + String workspaceName, String name, ScheduleInner body) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ScheduleInner.class, ScheduleInner.class, this.client.getContext()); } /** * Create or update schedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Schedule name. @@ -938,20 +770,18 @@ private PollerFlux, ScheduleInner> beginCreateOrUpdate * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ScheduleInner> beginCreateOrUpdateAsync( - String resourceGroupName, String workspaceName, String name, ScheduleInner body, Context context) { + private PollerFlux, ScheduleInner> beginCreateOrUpdateAsync(String resourceGroupName, + String workspaceName, String name, ScheduleInner body, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, body, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ScheduleInner.class, ScheduleInner.class, context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ScheduleInner.class, ScheduleInner.class, context); } /** * Create or update schedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Schedule name. @@ -962,14 +792,14 @@ private PollerFlux, ScheduleInner> beginCreateOrUpdate * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ScheduleInner> beginCreateOrUpdate( - String resourceGroupName, String workspaceName, String name, ScheduleInner body) { + public SyncPoller, ScheduleInner> beginCreateOrUpdate(String resourceGroupName, + String workspaceName, String name, ScheduleInner body) { return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, body).getSyncPoller(); } /** * Create or update schedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Schedule name. @@ -981,14 +811,14 @@ public SyncPoller, ScheduleInner> beginCreateOrUpdate( * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ScheduleInner> beginCreateOrUpdate( - String resourceGroupName, String workspaceName, String name, ScheduleInner body, Context context) { + public SyncPoller, ScheduleInner> beginCreateOrUpdate(String resourceGroupName, + String workspaceName, String name, ScheduleInner body, Context context) { return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, body, context).getSyncPoller(); } /** * Create or update schedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Schedule name. @@ -999,16 +829,15 @@ public SyncPoller, ScheduleInner> beginCreateOrUpdate( * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String workspaceName, String name, ScheduleInner body) { - return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, body) - .last() + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, String name, + ScheduleInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, body).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Create or update schedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Schedule name. @@ -1020,16 +849,15 @@ private Mono createOrUpdateAsync( * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String workspaceName, String name, ScheduleInner body, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, body, context) - .last() + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, String name, + ScheduleInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, body, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Create or update schedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Schedule name. @@ -1040,14 +868,14 @@ private Mono createOrUpdateAsync( * @return azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ScheduleInner createOrUpdate( - String resourceGroupName, String workspaceName, String name, ScheduleInner body) { + public ScheduleInner createOrUpdate(String resourceGroupName, String workspaceName, String name, + ScheduleInner body) { return createOrUpdateAsync(resourceGroupName, workspaceName, name, body).block(); } /** * Create or update schedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Schedule name. @@ -1059,21 +887,20 @@ public ScheduleInner createOrUpdate( * @return azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ScheduleInner createOrUpdate( - String resourceGroupName, String workspaceName, String name, ScheduleInner body, Context context) { + public ScheduleInner createOrUpdate(String resourceGroupName, String workspaceName, String name, ScheduleInner body, + Context context) { return createOrUpdateAsync(resourceGroupName, workspaceName, name, body, context).block(); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a paginated list of Schedule entities along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return a paginated list of Schedule entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1081,37 +908,26 @@ private Mono> listNextSinglePageAsync(String nextLi return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a paginated list of Schedule entities along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return a paginated list of Schedule entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -1119,23 +935,13 @@ private Mono> listNextSinglePageAsync(String nextLi return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/SchedulesImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/SchedulesImpl.java index af20e658dc52c..ac5df25345fdd 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/SchedulesImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/SchedulesImpl.java @@ -22,26 +22,22 @@ public final class SchedulesImpl implements Schedules { private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - public SchedulesImpl( - SchedulesClient innerClient, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + public SchedulesImpl(SchedulesClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list(String resourceGroupName, String workspaceName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); - return Utils.mapPage(inner, inner1 -> new ScheduleImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ScheduleImpl(inner1, this.manager())); } - public PagedIterable list( - String resourceGroupName, - String workspaceName, - String skip, - ScheduleListViewType listViewType, - Context context) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, workspaceName, skip, listViewType, context); - return Utils.mapPage(inner, inner1 -> new ScheduleImpl(inner1, this.manager())); + public PagedIterable list(String resourceGroupName, String workspaceName, String skip, + ScheduleListViewType listViewType, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, skip, listViewType, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ScheduleImpl(inner1, this.manager())); } public void delete(String resourceGroupName, String workspaceName, String name) { @@ -52,15 +48,12 @@ public void delete(String resourceGroupName, String workspaceName, String name, this.serviceClient().delete(resourceGroupName, workspaceName, name, context); } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String name, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, workspaceName, name, context); + public Response getWithResponse(String resourceGroupName, String workspaceName, String name, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, name, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ScheduleImpl(inner.getValue(), this.manager())); } else { return null; @@ -77,105 +70,77 @@ public Schedule get(String resourceGroupName, String workspaceName, String name) } public Schedule getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String name = Utils.getValueFromIdByName(id, "schedules"); + String name = ResourceManagerUtils.getValueFromIdByName(id, "schedules"); if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'schedules'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'schedules'.", id))); } return this.getWithResponse(resourceGroupName, workspaceName, name, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String name = Utils.getValueFromIdByName(id, "schedules"); + String name = ResourceManagerUtils.getValueFromIdByName(id, "schedules"); if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'schedules'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'schedules'.", id))); } return this.getWithResponse(resourceGroupName, workspaceName, name, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String name = Utils.getValueFromIdByName(id, "schedules"); + String name = ResourceManagerUtils.getValueFromIdByName(id, "schedules"); if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'schedules'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'schedules'.", id))); } this.delete(resourceGroupName, workspaceName, name, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String name = Utils.getValueFromIdByName(id, "schedules"); + String name = ResourceManagerUtils.getValueFromIdByName(id, "schedules"); if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'schedules'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'schedules'.", id))); } this.delete(resourceGroupName, workspaceName, name, context); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ServerlessEndpointImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ServerlessEndpointImpl.java new file mode 100644 index 0000000000000..04d5d4e91b6ff --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ServerlessEndpointImpl.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.ServerlessEndpointInner; +import com.azure.resourcemanager.machinelearning.models.EndpointAuthKeys; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.PartialManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.PartialMinimalTrackedResourceWithSkuAndIdentity; +import com.azure.resourcemanager.machinelearning.models.PartialSku; +import com.azure.resourcemanager.machinelearning.models.RegenerateEndpointKeysRequest; +import com.azure.resourcemanager.machinelearning.models.ServerlessEndpoint; +import com.azure.resourcemanager.machinelearning.models.ServerlessEndpointProperties; +import com.azure.resourcemanager.machinelearning.models.Sku; +import java.util.Collections; +import java.util.Map; + +public final class ServerlessEndpointImpl + implements ServerlessEndpoint, ServerlessEndpoint.Definition, ServerlessEndpoint.Update { + private ServerlessEndpointInner innerObject; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + + public String kind() { + return this.innerModel().kind(); + } + + public ServerlessEndpointProperties properties() { + return this.innerModel().properties(); + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ServerlessEndpointInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String name; + + private PartialMinimalTrackedResourceWithSkuAndIdentity updateBody; + + public ServerlessEndpointImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public ServerlessEndpoint create() { + this.innerObject = serviceManager.serviceClient() + .getServerlessEndpoints() + .createOrUpdate(resourceGroupName, workspaceName, name, this.innerModel(), Context.NONE); + return this; + } + + public ServerlessEndpoint create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getServerlessEndpoints() + .createOrUpdate(resourceGroupName, workspaceName, name, this.innerModel(), context); + return this; + } + + ServerlessEndpointImpl(String name, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = new ServerlessEndpointInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public ServerlessEndpointImpl update() { + this.updateBody = new PartialMinimalTrackedResourceWithSkuAndIdentity(); + return this; + } + + public ServerlessEndpoint apply() { + this.innerObject = serviceManager.serviceClient() + .getServerlessEndpoints() + .update(resourceGroupName, workspaceName, name, updateBody, Context.NONE); + return this; + } + + public ServerlessEndpoint apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getServerlessEndpoints() + .update(resourceGroupName, workspaceName, name, updateBody, context); + return this; + } + + ServerlessEndpointImpl(ServerlessEndpointInner innerObject, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "serverlessEndpoints"); + } + + public ServerlessEndpoint refresh() { + this.innerObject = serviceManager.serviceClient() + .getServerlessEndpoints() + .getWithResponse(resourceGroupName, workspaceName, name, Context.NONE) + .getValue(); + return this; + } + + public ServerlessEndpoint refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getServerlessEndpoints() + .getWithResponse(resourceGroupName, workspaceName, name, context) + .getValue(); + return this; + } + + public Response listKeysWithResponse(Context context) { + return serviceManager.serverlessEndpoints() + .listKeysWithResponse(resourceGroupName, workspaceName, name, context); + } + + public EndpointAuthKeys listKeys() { + return serviceManager.serverlessEndpoints().listKeys(resourceGroupName, workspaceName, name); + } + + public EndpointAuthKeys regenerateKeys(RegenerateEndpointKeysRequest body) { + return serviceManager.serverlessEndpoints().regenerateKeys(resourceGroupName, workspaceName, name, body); + } + + public EndpointAuthKeys regenerateKeys(RegenerateEndpointKeysRequest body, Context context) { + return serviceManager.serverlessEndpoints() + .regenerateKeys(resourceGroupName, workspaceName, name, body, context); + } + + public ServerlessEndpointImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ServerlessEndpointImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ServerlessEndpointImpl withProperties(ServerlessEndpointProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public ServerlessEndpointImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBody.withTags(tags); + return this; + } + } + + public ServerlessEndpointImpl withIdentity(ManagedServiceIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public ServerlessEndpointImpl withKind(String kind) { + this.innerModel().withKind(kind); + return this; + } + + public ServerlessEndpointImpl withSku(Sku sku) { + this.innerModel().withSku(sku); + return this; + } + + public ServerlessEndpointImpl withIdentity(PartialManagedServiceIdentity identity) { + this.updateBody.withIdentity(identity); + return this; + } + + public ServerlessEndpointImpl withSku(PartialSku sku) { + this.updateBody.withSku(sku); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ServerlessEndpointsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ServerlessEndpointsClientImpl.java new file mode 100644 index 0000000000000..6a29cf4007dd8 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ServerlessEndpointsClientImpl.java @@ -0,0 +1,1604 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.machinelearning.fluent.ServerlessEndpointsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.EndpointAuthKeysInner; +import com.azure.resourcemanager.machinelearning.fluent.models.ServerlessEndpointInner; +import com.azure.resourcemanager.machinelearning.models.PartialMinimalTrackedResourceWithSkuAndIdentity; +import com.azure.resourcemanager.machinelearning.models.RegenerateEndpointKeysRequest; +import com.azure.resourcemanager.machinelearning.models.ServerlessEndpointTrackedResourceArmPaginatedResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ServerlessEndpointsClient. + */ +public final class ServerlessEndpointsClientImpl implements ServerlessEndpointsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ServerlessEndpointsService service; + + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; + + /** + * Initializes an instance of ServerlessEndpointsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ServerlessEndpointsClientImpl(AzureMachineLearningServicesImpl client) { + this.service = RestProxy.create(ServerlessEndpointsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMachineLearningServicesServerlessEndpoints to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMachineLearning") + public interface ServerlessEndpointsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @QueryParam("$skip") String skip, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PartialMinimalTrackedResourceWithSkuAndIdentity body, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ServerlessEndpointInner body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/listKeys") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listKeys(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/regenerateKeys") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> regenerateKeys(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RegenerateEndpointKeysRequest body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List Serverless Endpoints. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ServerlessEndpoint entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, String skip) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), skip, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Serverless Endpoints. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ServerlessEndpoint entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, String skip, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + this.client.getApiVersion(), skip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Serverless Endpoints. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ServerlessEndpoint entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String skip) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skip), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List Serverless Endpoints. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ServerlessEndpoint entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + final String skip = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skip), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List Serverless Endpoints. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ServerlessEndpoint entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String skip, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skip, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List Serverless Endpoints. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ServerlessEndpoint entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + final String skip = null; + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, skip)); + } + + /** + * List Serverless Endpoints. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ServerlessEndpoint entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, String skip, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, skip, context)); + } + + /** + * Delete Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, this.client.getApiVersion(), accept, context); + } + + /** + * Delete Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, + String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, + String name, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, workspaceName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String name) { + return this.beginDeleteAsync(resourceGroupName, workspaceName, name).getSyncPoller(); + } + + /** + * Delete Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String name, + Context context) { + return this.beginDeleteAsync(resourceGroupName, workspaceName, name, context).getSyncPoller(); + } + + /** + * Delete Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String name) { + return beginDeleteAsync(resourceGroupName, workspaceName, name).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, name, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String name) { + deleteAsync(resourceGroupName, workspaceName, name).block(); + } + + /** + * Delete Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String name, Context context) { + deleteAsync(resourceGroupName, workspaceName, name, context).block(); + } + + /** + * Get Serverless Endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return serverless Endpoint along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get Serverless Endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return serverless Endpoint along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + name, this.client.getApiVersion(), accept, context); + } + + /** + * Get Serverless Endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return serverless Endpoint on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String name) { + return getWithResponseAsync(resourceGroupName, workspaceName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get Serverless Endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return serverless Endpoint along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String workspaceName, + String name, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, name, context).block(); + } + + /** + * Get Serverless Endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return serverless Endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServerlessEndpointInner get(String resourceGroupName, String workspaceName, String name) { + return getWithResponse(resourceGroupName, workspaceName, name, Context.NONE).getValue(); + } + + /** + * Update Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body Serverless Endpoint entity to apply during operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String workspaceName, + String name, PartialMinimalTrackedResourceWithSkuAndIdentity body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body Serverless Endpoint entity to apply during operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String workspaceName, + String name, PartialMinimalTrackedResourceWithSkuAndIdentity body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, this.client.getApiVersion(), body, accept, context); + } + + /** + * Update Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body Serverless Endpoint entity to apply during operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ServerlessEndpointInner> beginUpdateAsync( + String resourceGroupName, String workspaceName, String name, + PartialMinimalTrackedResourceWithSkuAndIdentity body) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, workspaceName, name, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ServerlessEndpointInner.class, ServerlessEndpointInner.class, + this.client.getContext()); + } + + /** + * Update Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body Serverless Endpoint entity to apply during operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ServerlessEndpointInner> beginUpdateAsync( + String resourceGroupName, String workspaceName, String name, + PartialMinimalTrackedResourceWithSkuAndIdentity body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, workspaceName, name, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ServerlessEndpointInner.class, ServerlessEndpointInner.class, context); + } + + /** + * Update Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body Serverless Endpoint entity to apply during operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ServerlessEndpointInner> beginUpdate( + String resourceGroupName, String workspaceName, String name, + PartialMinimalTrackedResourceWithSkuAndIdentity body) { + return this.beginUpdateAsync(resourceGroupName, workspaceName, name, body).getSyncPoller(); + } + + /** + * Update Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body Serverless Endpoint entity to apply during operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ServerlessEndpointInner> beginUpdate( + String resourceGroupName, String workspaceName, String name, + PartialMinimalTrackedResourceWithSkuAndIdentity body, Context context) { + return this.beginUpdateAsync(resourceGroupName, workspaceName, name, body, context).getSyncPoller(); + } + + /** + * Update Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body Serverless Endpoint entity to apply during operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String workspaceName, String name, + PartialMinimalTrackedResourceWithSkuAndIdentity body) { + return beginUpdateAsync(resourceGroupName, workspaceName, name, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body Serverless Endpoint entity to apply during operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String workspaceName, String name, + PartialMinimalTrackedResourceWithSkuAndIdentity body, Context context) { + return beginUpdateAsync(resourceGroupName, workspaceName, name, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body Serverless Endpoint entity to apply during operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServerlessEndpointInner update(String resourceGroupName, String workspaceName, String name, + PartialMinimalTrackedResourceWithSkuAndIdentity body) { + return updateAsync(resourceGroupName, workspaceName, name, body).block(); + } + + /** + * Update Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body Serverless Endpoint entity to apply during operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServerlessEndpointInner update(String resourceGroupName, String workspaceName, String name, + PartialMinimalTrackedResourceWithSkuAndIdentity body, Context context) { + return updateAsync(resourceGroupName, workspaceName, name, body, context).block(); + } + + /** + * Create or update Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body Serverless Endpoint entity to apply during operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String name, ServerlessEndpointInner body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body Serverless Endpoint entity to apply during operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String name, ServerlessEndpointInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, this.client.getApiVersion(), body, accept, context); + } + + /** + * Create or update Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body Serverless Endpoint entity to apply during operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ServerlessEndpointInner> beginCreateOrUpdateAsync( + String resourceGroupName, String workspaceName, String name, ServerlessEndpointInner body) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ServerlessEndpointInner.class, ServerlessEndpointInner.class, + this.client.getContext()); + } + + /** + * Create or update Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body Serverless Endpoint entity to apply during operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ServerlessEndpointInner> beginCreateOrUpdateAsync( + String resourceGroupName, String workspaceName, String name, ServerlessEndpointInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, name, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ServerlessEndpointInner.class, ServerlessEndpointInner.class, context); + } + + /** + * Create or update Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body Serverless Endpoint entity to apply during operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ServerlessEndpointInner> + beginCreateOrUpdate(String resourceGroupName, String workspaceName, String name, ServerlessEndpointInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, body).getSyncPoller(); + } + + /** + * Create or update Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body Serverless Endpoint entity to apply during operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ServerlessEndpointInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String name, ServerlessEndpointInner body, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, body, context).getSyncPoller(); + } + + /** + * Create or update Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body Serverless Endpoint entity to apply during operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String name, ServerlessEndpointInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body Serverless Endpoint entity to apply during operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String name, ServerlessEndpointInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, name, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body Serverless Endpoint entity to apply during operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServerlessEndpointInner createOrUpdate(String resourceGroupName, String workspaceName, String name, + ServerlessEndpointInner body) { + return createOrUpdateAsync(resourceGroupName, workspaceName, name, body).block(); + } + + /** + * Create or update Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body Serverless Endpoint entity to apply during operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServerlessEndpointInner createOrUpdate(String resourceGroupName, String workspaceName, String name, + ServerlessEndpointInner body, Context context) { + return createOrUpdateAsync(resourceGroupName, workspaceName, name, body, context).block(); + } + + /** + * List EndpointAuthKeys for an Endpoint using Key-based authentication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return keys for endpoint authentication along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listKeysWithResponseAsync(String resourceGroupName, + String workspaceName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List EndpointAuthKeys for an Endpoint using Key-based authentication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return keys for endpoint authentication along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listKeysWithResponseAsync(String resourceGroupName, + String workspaceName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, this.client.getApiVersion(), accept, context); + } + + /** + * List EndpointAuthKeys for an Endpoint using Key-based authentication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return keys for endpoint authentication on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listKeysAsync(String resourceGroupName, String workspaceName, String name) { + return listKeysWithResponseAsync(resourceGroupName, workspaceName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * List EndpointAuthKeys for an Endpoint using Key-based authentication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return keys for endpoint authentication along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listKeysWithResponse(String resourceGroupName, String workspaceName, + String name, Context context) { + return listKeysWithResponseAsync(resourceGroupName, workspaceName, name, context).block(); + } + + /** + * List EndpointAuthKeys for an Endpoint using Key-based authentication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return keys for endpoint authentication. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EndpointAuthKeysInner listKeys(String resourceGroupName, String workspaceName, String name) { + return listKeysWithResponse(resourceGroupName, workspaceName, name, Context.NONE).getValue(); + } + + /** + * Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body RegenerateKeys request . + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return keys for endpoint authentication along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> regenerateKeysWithResponseAsync(String resourceGroupName, + String workspaceName, String name, RegenerateEndpointKeysRequest body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.regenerateKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body RegenerateKeys request . + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return keys for endpoint authentication along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> regenerateKeysWithResponseAsync(String resourceGroupName, + String workspaceName, String name, RegenerateEndpointKeysRequest body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.regenerateKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, name, this.client.getApiVersion(), body, accept, context); + } + + /** + * Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body RegenerateKeys request . + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of keys for endpoint authentication. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EndpointAuthKeysInner> beginRegenerateKeysAsync( + String resourceGroupName, String workspaceName, String name, RegenerateEndpointKeysRequest body) { + Mono>> mono + = regenerateKeysWithResponseAsync(resourceGroupName, workspaceName, name, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), EndpointAuthKeysInner.class, EndpointAuthKeysInner.class, + this.client.getContext()); + } + + /** + * Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body RegenerateKeys request . + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of keys for endpoint authentication. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EndpointAuthKeysInner> beginRegenerateKeysAsync( + String resourceGroupName, String workspaceName, String name, RegenerateEndpointKeysRequest body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = regenerateKeysWithResponseAsync(resourceGroupName, workspaceName, name, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), EndpointAuthKeysInner.class, EndpointAuthKeysInner.class, context); + } + + /** + * Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body RegenerateKeys request . + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of keys for endpoint authentication. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EndpointAuthKeysInner> beginRegenerateKeys( + String resourceGroupName, String workspaceName, String name, RegenerateEndpointKeysRequest body) { + return this.beginRegenerateKeysAsync(resourceGroupName, workspaceName, name, body).getSyncPoller(); + } + + /** + * Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body RegenerateKeys request . + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of keys for endpoint authentication. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EndpointAuthKeysInner> beginRegenerateKeys( + String resourceGroupName, String workspaceName, String name, RegenerateEndpointKeysRequest body, + Context context) { + return this.beginRegenerateKeysAsync(resourceGroupName, workspaceName, name, body, context).getSyncPoller(); + } + + /** + * Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body RegenerateKeys request . + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return keys for endpoint authentication on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono regenerateKeysAsync(String resourceGroupName, String workspaceName, String name, + RegenerateEndpointKeysRequest body) { + return beginRegenerateKeysAsync(resourceGroupName, workspaceName, name, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body RegenerateKeys request . + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return keys for endpoint authentication on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono regenerateKeysAsync(String resourceGroupName, String workspaceName, String name, + RegenerateEndpointKeysRequest body, Context context) { + return beginRegenerateKeysAsync(resourceGroupName, workspaceName, name, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body RegenerateKeys request . + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return keys for endpoint authentication. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EndpointAuthKeysInner regenerateKeys(String resourceGroupName, String workspaceName, String name, + RegenerateEndpointKeysRequest body) { + return regenerateKeysAsync(resourceGroupName, workspaceName, name, body).block(); + } + + /** + * Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body RegenerateKeys request . + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return keys for endpoint authentication. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EndpointAuthKeysInner regenerateKeys(String resourceGroupName, String workspaceName, String name, + RegenerateEndpointKeysRequest body, Context context) { + return regenerateKeysAsync(resourceGroupName, workspaceName, name, body, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ServerlessEndpoint entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ServerlessEndpoint entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ServerlessEndpointsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ServerlessEndpointsImpl.java new file mode 100644 index 0000000000000..b063241990c0c --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/ServerlessEndpointsImpl.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.machinelearning.fluent.ServerlessEndpointsClient; +import com.azure.resourcemanager.machinelearning.fluent.models.EndpointAuthKeysInner; +import com.azure.resourcemanager.machinelearning.fluent.models.ServerlessEndpointInner; +import com.azure.resourcemanager.machinelearning.models.EndpointAuthKeys; +import com.azure.resourcemanager.machinelearning.models.RegenerateEndpointKeysRequest; +import com.azure.resourcemanager.machinelearning.models.ServerlessEndpoint; +import com.azure.resourcemanager.machinelearning.models.ServerlessEndpoints; + +public final class ServerlessEndpointsImpl implements ServerlessEndpoints { + private static final ClientLogger LOGGER = new ClientLogger(ServerlessEndpointsImpl.class); + + private final ServerlessEndpointsClient innerClient; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + public ServerlessEndpointsImpl(ServerlessEndpointsClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ServerlessEndpointImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String skip, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, skip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ServerlessEndpointImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String workspaceName, String name) { + this.serviceClient().delete(resourceGroupName, workspaceName, name); + } + + public void delete(String resourceGroupName, String workspaceName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, workspaceName, name, context); + } + + public Response getWithResponse(String resourceGroupName, String workspaceName, String name, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ServerlessEndpointImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ServerlessEndpoint get(String resourceGroupName, String workspaceName, String name) { + ServerlessEndpointInner inner = this.serviceClient().get(resourceGroupName, workspaceName, name); + if (inner != null) { + return new ServerlessEndpointImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listKeysWithResponse(String resourceGroupName, String workspaceName, String name, + Context context) { + Response inner + = this.serviceClient().listKeysWithResponse(resourceGroupName, workspaceName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EndpointAuthKeysImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public EndpointAuthKeys listKeys(String resourceGroupName, String workspaceName, String name) { + EndpointAuthKeysInner inner = this.serviceClient().listKeys(resourceGroupName, workspaceName, name); + if (inner != null) { + return new EndpointAuthKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public EndpointAuthKeys regenerateKeys(String resourceGroupName, String workspaceName, String name, + RegenerateEndpointKeysRequest body) { + EndpointAuthKeysInner inner = this.serviceClient().regenerateKeys(resourceGroupName, workspaceName, name, body); + if (inner != null) { + return new EndpointAuthKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public EndpointAuthKeys regenerateKeys(String resourceGroupName, String workspaceName, String name, + RegenerateEndpointKeysRequest body, Context context) { + EndpointAuthKeysInner inner + = this.serviceClient().regenerateKeys(resourceGroupName, workspaceName, name, body, context); + if (inner != null) { + return new EndpointAuthKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public ServerlessEndpoint getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "serverlessEndpoints"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'serverlessEndpoints'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "serverlessEndpoints"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'serverlessEndpoints'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "serverlessEndpoints"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'serverlessEndpoints'.", id))); + } + this.delete(resourceGroupName, workspaceName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "serverlessEndpoints"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'serverlessEndpoints'.", id))); + } + this.delete(resourceGroupName, workspaceName, name, context); + } + + private ServerlessEndpointsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } + + public ServerlessEndpointImpl define(String name) { + return new ServerlessEndpointImpl(name, this.manager()); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/SkuResourceImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/SkuResourceImpl.java index 122efdee34aef..87e01997be481 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/SkuResourceImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/SkuResourceImpl.java @@ -14,8 +14,8 @@ public final class SkuResourceImpl implements SkuResource { private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - SkuResourceImpl( - SkuResourceInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + SkuResourceImpl(SkuResourceInner innerObject, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/UpdateWorkspaceQuotasResultImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/UpdateWorkspaceQuotasResultImpl.java index 908490a7694de..84cfd25ec4b6c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/UpdateWorkspaceQuotasResultImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/UpdateWorkspaceQuotasResultImpl.java @@ -15,8 +15,7 @@ public final class UpdateWorkspaceQuotasResultImpl implements UpdateWorkspaceQuo private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - UpdateWorkspaceQuotasResultImpl( - UpdateWorkspaceQuotasResultInner innerObject, + UpdateWorkspaceQuotasResultImpl(UpdateWorkspaceQuotasResultInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/UsagesClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/UsagesClientImpl.java index ec1dff04b47bb..df51b8bb51d70 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/UsagesClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/UsagesClientImpl.java @@ -30,129 +30,105 @@ import com.azure.resourcemanager.machinelearning.models.ListUsagesResult; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in UsagesClient. */ +/** + * An instance of this class provides access to all the operations defined in UsagesClient. + */ public final class UsagesClientImpl implements UsagesClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final UsagesService service; - /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of UsagesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ - UsagesClientImpl(AzureMachineLearningWorkspacesImpl client) { + UsagesClientImpl(AzureMachineLearningServicesImpl client) { this.service = RestProxy.create(UsagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesUsages to be used by the proxy service - * to perform REST calls. + * The interface defining all the services for AzureMachineLearningServicesUsages to be used by the proxy service to + * perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AzureMachineLearning") public interface UsagesService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Gets the current usage information as well as limits for AML resources for given subscription and location. - * + * * @param location The location for which resource usage is queried. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current usage information as well as limits for AML resources for given subscription and location - * along with {@link PagedResponse} on successful completion of {@link Mono}. + * along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String location) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - location, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the current usage information as well as limits for AML resources for given subscription and location. - * + * * @param location The location for which resource usage is queried. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current usage information as well as limits for AML resources for given subscription and location - * along with {@link PagedResponse} on successful completion of {@link Mono}. + * along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String location, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -160,33 +136,21 @@ private Mono> listSinglePageAsync(String location, Con final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - location, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), location, + accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Gets the current usage information as well as limits for AML resources for given subscription and location. - * + * * @param location The location for which resource usage is queried. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current usage information as well as limits for AML resources for given subscription and location as - * paginated response with {@link PagedFlux}. + * paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String location) { @@ -195,30 +159,30 @@ private PagedFlux listAsync(String location) { /** * Gets the current usage information as well as limits for AML resources for given subscription and location. - * + * * @param location The location for which resource usage is queried. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current usage information as well as limits for AML resources for given subscription and location as - * paginated response with {@link PagedFlux}. + * paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String location, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(location, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listSinglePageAsync(location, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Gets the current usage information as well as limits for AML resources for given subscription and location. - * + * * @param location The location for which resource usage is queried. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current usage information as well as limits for AML resources for given subscription and location as - * paginated response with {@link PagedIterable}. + * paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String location) { @@ -227,14 +191,14 @@ public PagedIterable list(String location) { /** * Gets the current usage information as well as limits for AML resources for given subscription and location. - * + * * @param location The location for which resource usage is queried. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current usage information as well as limits for AML resources for given subscription and location as - * paginated response with {@link PagedIterable}. + * paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String location, Context context) { @@ -243,14 +207,13 @@ public PagedIterable list(String location, Context context) { /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Usages operation response along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return the List Usages operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -258,37 +221,26 @@ private Mono> listNextSinglePageAsync(String nextLink) return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Usages operation response along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return the List Usages operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -296,23 +248,13 @@ private Mono> listNextSinglePageAsync(String nextLink, return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/UsagesImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/UsagesImpl.java index b70b59b57e69a..fb42a38499969 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/UsagesImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/UsagesImpl.java @@ -19,20 +19,20 @@ public final class UsagesImpl implements Usages { private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - public UsagesImpl( - UsagesClient innerClient, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + public UsagesImpl(UsagesClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list(String location) { PagedIterable inner = this.serviceClient().list(location); - return Utils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); } public PagedIterable list(String location, Context context) { PagedIterable inner = this.serviceClient().list(location, context); - return Utils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); } private UsagesClient serviceClient() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/Utils.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/Utils.java deleted file mode 100644 index 7ca689e769aec..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/Utils.java +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.util.CoreUtils; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.util.function.Function; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import reactor.core.publisher.Flux; - -final class Utils { - static String getValueFromIdByName(String id, String name) { - if (id == null) { - return null; - } - Iterator itr = Arrays.stream(id.split("/")).iterator(); - while (itr.hasNext()) { - String part = itr.next(); - if (part != null && !part.trim().isEmpty()) { - if (part.equalsIgnoreCase(name)) { - if (itr.hasNext()) { - return itr.next(); - } else { - return null; - } - } - } - } - return null; - } - - static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { - if (id == null || pathTemplate == null) { - return null; - } - String parameterNameParentheses = "{" + parameterName + "}"; - List idSegmentsReverted = Arrays.asList(id.split("/")); - List pathSegments = Arrays.asList(pathTemplate.split("/")); - Collections.reverse(idSegmentsReverted); - Iterator idItrReverted = idSegmentsReverted.iterator(); - int pathIndex = pathSegments.size(); - while (idItrReverted.hasNext() && pathIndex > 0) { - String idSegment = idItrReverted.next(); - String pathSegment = pathSegments.get(--pathIndex); - if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { - if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { - if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { - List segments = new ArrayList<>(); - segments.add(idSegment); - idItrReverted.forEachRemaining(segments::add); - Collections.reverse(segments); - if (segments.size() > 0 && segments.get(0).isEmpty()) { - segments.remove(0); - } - return String.join("/", segments); - } else { - return idSegment; - } - } - } - } - return null; - } - - static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { - return new PagedIterableImpl(pageIterable, mapper); - } - - private static final class PagedIterableImpl extends PagedIterable { - - private final PagedIterable pagedIterable; - private final Function mapper; - private final Function, PagedResponse> pageMapper; - - private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { - super( - PagedFlux - .create( - () -> - (continuationToken, pageSize) -> - Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); - this.pagedIterable = pagedIterable; - this.mapper = mapper; - this.pageMapper = getPageMapper(mapper); - } - - private static Function, PagedResponse> getPageMapper(Function mapper) { - return page -> - new PagedResponseBase( - page.getRequest(), - page.getStatusCode(), - page.getHeaders(), - page.getElements().stream().map(mapper).collect(Collectors.toList()), - page.getContinuationToken(), - null); - } - - @Override - public Stream stream() { - return pagedIterable.stream().map(mapper); - } - - @Override - public Stream> streamByPage() { - return pagedIterable.streamByPage().map(pageMapper); - } - - @Override - public Stream> streamByPage(String continuationToken) { - return pagedIterable.streamByPage(continuationToken).map(pageMapper); - } - - @Override - public Stream> streamByPage(int preferredPageSize) { - return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); - } - - @Override - public Stream> streamByPage(String continuationToken, int preferredPageSize) { - return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); - } - - @Override - public Iterator iterator() { - return new IteratorImpl(pagedIterable.iterator(), mapper); - } - - @Override - public Iterable> iterableByPage() { - return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); - } - - @Override - public Iterable> iterableByPage(String continuationToken) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken), pageMapper); - } - - @Override - public Iterable> iterableByPage(int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(preferredPageSize), pageMapper); - } - - @Override - public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); - } - } - - private static final class IteratorImpl implements Iterator { - - private final Iterator iterator; - private final Function mapper; - - private IteratorImpl(Iterator iterator, Function mapper) { - this.iterator = iterator; - this.mapper = mapper; - } - - @Override - public boolean hasNext() { - return iterator.hasNext(); - } - - @Override - public S next() { - return mapper.apply(iterator.next()); - } - - @Override - public void remove() { - iterator.remove(); - } - } - - private static final class IterableImpl implements Iterable { - - private final Iterable iterable; - private final Function mapper; - - private IterableImpl(Iterable iterable, Function mapper) { - this.iterable = iterable; - this.mapper = mapper; - } - - @Override - public Iterator iterator() { - return new IteratorImpl(iterable.iterator(), mapper); - } - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/VirtualMachineSizeListResultImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/VirtualMachineSizeListResultImpl.java index 92771d638a0b9..21844b218b84e 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/VirtualMachineSizeListResultImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/VirtualMachineSizeListResultImpl.java @@ -15,8 +15,7 @@ public final class VirtualMachineSizeListResultImpl implements VirtualMachineSiz private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - VirtualMachineSizeListResultImpl( - VirtualMachineSizeListResultInner innerObject, + VirtualMachineSizeListResultImpl(VirtualMachineSizeListResultInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/VirtualMachineSizesClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/VirtualMachineSizesClientImpl.java index 862150234bac0..68968ce905937 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/VirtualMachineSizesClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/VirtualMachineSizesClientImpl.java @@ -25,130 +25,110 @@ import com.azure.resourcemanager.machinelearning.fluent.models.VirtualMachineSizeListResultInner; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in VirtualMachineSizesClient. */ +/** + * An instance of this class provides access to all the operations defined in VirtualMachineSizesClient. + */ public final class VirtualMachineSizesClientImpl implements VirtualMachineSizesClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final VirtualMachineSizesService service; - /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of VirtualMachineSizesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ - VirtualMachineSizesClientImpl(AzureMachineLearningWorkspacesImpl client) { - this.service = - RestProxy.create(VirtualMachineSizesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + VirtualMachineSizesClientImpl(AzureMachineLearningServicesImpl client) { + this.service = RestProxy.create(VirtualMachineSizesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesVirtualMachineSizes to be used by the + * The interface defining all the services for AzureMachineLearningServicesVirtualMachineSizes to be used by the * proxy service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AzureMachineLearning") public interface VirtualMachineSizesService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("location") String location, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @PathParam("location") String location, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); } /** * Returns supported VM Sizes in a location. - * + * * @param location The location upon which virtual-machine-sizes is queried. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the List Virtual Machine size operation response along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listWithResponseAsync(String location) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - location, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) + .withContext(context -> service.list(this.client.getEndpoint(), location, this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Returns supported VM Sizes in a location. - * + * * @param location The location upon which virtual-machine-sizes is queried. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the List Virtual Machine size operation response along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listWithResponseAsync(String location, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - location, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); + return service.list(this.client.getEndpoint(), location, this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); } /** * Returns supported VM Sizes in a location. - * + * * @param location The location upon which virtual-machine-sizes is queried. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -162,7 +142,7 @@ private Mono listAsync(String location) { /** * Returns supported VM Sizes in a location. - * + * * @param location The location upon which virtual-machine-sizes is queried. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -177,7 +157,7 @@ public Response listWithResponse(String locat /** * Returns supported VM Sizes in a location. - * + * * @param location The location upon which virtual-machine-sizes is queried. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/VirtualMachineSizesImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/VirtualMachineSizesImpl.java index eeec5b0fbd763..78ee3bbf2913b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/VirtualMachineSizesImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/VirtualMachineSizesImpl.java @@ -20,8 +20,7 @@ public final class VirtualMachineSizesImpl implements VirtualMachineSizes { private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - public VirtualMachineSizesImpl( - VirtualMachineSizesClient innerClient, + public VirtualMachineSizesImpl(VirtualMachineSizesClient innerClient, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -30,10 +29,7 @@ public VirtualMachineSizesImpl( public Response listWithResponse(String location, Context context) { Response inner = this.serviceClient().listWithResponse(location, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new VirtualMachineSizeListResultImpl(inner.getValue(), this.manager())); } else { return null; diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceConnectionPropertiesV2BasicResourceImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceConnectionPropertiesV2BasicResourceImpl.java index 9ff113b0e7ac1..8dbbeb5c54524 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceConnectionPropertiesV2BasicResourceImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceConnectionPropertiesV2BasicResourceImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.machinelearning.implementation; +import com.azure.core.http.rest.Response; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.machinelearning.fluent.models.WorkspaceConnectionPropertiesV2BasicResourceInner; @@ -16,8 +17,7 @@ public final class WorkspaceConnectionPropertiesV2BasicResourceImpl private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - WorkspaceConnectionPropertiesV2BasicResourceImpl( - WorkspaceConnectionPropertiesV2BasicResourceInner innerObject, + WorkspaceConnectionPropertiesV2BasicResourceImpl(WorkspaceConnectionPropertiesV2BasicResourceInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -57,60 +57,61 @@ private com.azure.resourcemanager.machinelearning.MachineLearningManager manager private String connectionName; - public WorkspaceConnectionPropertiesV2BasicResourceImpl withExistingWorkspace( - String resourceGroupName, String workspaceName) { + public WorkspaceConnectionPropertiesV2BasicResourceImpl withExistingWorkspace(String resourceGroupName, + String workspaceName) { this.resourceGroupName = resourceGroupName; this.workspaceName = workspaceName; return this; } public WorkspaceConnectionPropertiesV2BasicResource create() { - this.innerObject = - serviceManager - .serviceClient() - .getWorkspaceConnections() - .createWithResponse(resourceGroupName, workspaceName, connectionName, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getWorkspaceConnections() + .createWithResponse(resourceGroupName, workspaceName, connectionName, this.innerModel(), Context.NONE) + .getValue(); return this; } public WorkspaceConnectionPropertiesV2BasicResource create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getWorkspaceConnections() - .createWithResponse(resourceGroupName, workspaceName, connectionName, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getWorkspaceConnections() + .createWithResponse(resourceGroupName, workspaceName, connectionName, this.innerModel(), context) + .getValue(); return this; } - WorkspaceConnectionPropertiesV2BasicResourceImpl( - String name, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + WorkspaceConnectionPropertiesV2BasicResourceImpl(String name, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = new WorkspaceConnectionPropertiesV2BasicResourceInner(); this.serviceManager = serviceManager; this.connectionName = name; } public WorkspaceConnectionPropertiesV2BasicResource refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getWorkspaceConnections() - .getWithResponse(resourceGroupName, workspaceName, connectionName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getWorkspaceConnections() + .getWithResponse(resourceGroupName, workspaceName, connectionName, Context.NONE) + .getValue(); return this; } public WorkspaceConnectionPropertiesV2BasicResource refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getWorkspaceConnections() - .getWithResponse(resourceGroupName, workspaceName, connectionName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getWorkspaceConnections() + .getWithResponse(resourceGroupName, workspaceName, connectionName, context) + .getValue(); return this; } + public Response listSecretsWithResponse(Context context) { + return serviceManager.workspaceConnections() + .listSecretsWithResponse(resourceGroupName, workspaceName, connectionName, context); + } + + public WorkspaceConnectionPropertiesV2BasicResource listSecrets() { + return serviceManager.workspaceConnections().listSecrets(resourceGroupName, workspaceName, connectionName); + } + public WorkspaceConnectionPropertiesV2BasicResourceImpl withProperties(WorkspaceConnectionPropertiesV2 properties) { this.innerModel().withProperties(properties); return this; diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceConnectionsClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceConnectionsClientImpl.java index 2b07717ee35e0..f9dc4ceaaf710 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceConnectionsClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceConnectionsClientImpl.java @@ -13,6 +13,7 @@ import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -33,113 +34,101 @@ import com.azure.resourcemanager.machinelearning.models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in WorkspaceConnectionsClient. */ +/** + * An instance of this class provides access to all the operations defined in WorkspaceConnectionsClient. + */ public final class WorkspaceConnectionsClientImpl implements WorkspaceConnectionsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final WorkspaceConnectionsService service; - /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of WorkspaceConnectionsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ - WorkspaceConnectionsClientImpl(AzureMachineLearningWorkspacesImpl client) { - this.service = - RestProxy - .create(WorkspaceConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + WorkspaceConnectionsClientImpl(AzureMachineLearningServicesImpl client) { + this.service = RestProxy.create(WorkspaceConnectionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesWorkspaceConnections to be used by the + * The interface defining all the services for AzureMachineLearningServicesWorkspaceConnections to be used by the * proxy service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AzureMachineLearning") public interface WorkspaceConnectionsService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, + Mono> create(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("connectionName") String connectionName, - @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("connectionName") String connectionName, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") WorkspaceConnectionPropertiesV2BasicResourceInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}") - @ExpectedResponses({200}) + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("connectionName") String connectionName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}") - @ExpectedResponses({200, 204}) + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("connectionName") String connectionName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, + Mono> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("connectionName") String connectionName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections") - @ExpectedResponses({200}) + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("connectionName") String connectionName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @QueryParam("target") String target, - @QueryParam("category") String category, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("target") String target, @QueryParam("category") String category, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/listsecrets") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSecrets( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("connectionName") String connectionName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * The create operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param connectionName Friendly name of the workspace connection. @@ -151,21 +140,15 @@ Mono> l */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createWithResponseAsync( - String resourceGroupName, - String workspaceName, - String connectionName, + String resourceGroupName, String workspaceName, String connectionName, WorkspaceConnectionPropertiesV2BasicResourceInner parameters) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -185,24 +168,14 @@ private Mono> create final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .create( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - connectionName, - this.client.getApiVersion(), - parameters, - accept, - context)) + context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, connectionName, this.client.getApiVersion(), parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * The create operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param connectionName Friendly name of the workspace connection. @@ -215,22 +188,15 @@ private Mono> create */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createWithResponseAsync( - String resourceGroupName, - String workspaceName, - String connectionName, - WorkspaceConnectionPropertiesV2BasicResourceInner parameters, - Context context) { + String resourceGroupName, String workspaceName, String connectionName, + WorkspaceConnectionPropertiesV2BasicResourceInner parameters, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -249,22 +215,13 @@ private Mono> create } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - connectionName, - this.client.getApiVersion(), - parameters, - accept, - context); + return service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, connectionName, this.client.getApiVersion(), parameters, accept, context); } /** * The create operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param connectionName Friendly name of the workspace connection. @@ -275,18 +232,15 @@ private Mono> create * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, - String workspaceName, - String connectionName, - WorkspaceConnectionPropertiesV2BasicResourceInner parameters) { + private Mono createAsync(String resourceGroupName, + String workspaceName, String connectionName, WorkspaceConnectionPropertiesV2BasicResourceInner parameters) { return createWithResponseAsync(resourceGroupName, workspaceName, connectionName, parameters) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * The create operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param connectionName Friendly name of the workspace connection. @@ -298,18 +252,15 @@ private Mono createAsync( * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceGroupName, - String workspaceName, - String connectionName, - WorkspaceConnectionPropertiesV2BasicResourceInner parameters, + public Response createWithResponse(String resourceGroupName, + String workspaceName, String connectionName, WorkspaceConnectionPropertiesV2BasicResourceInner parameters, Context context) { return createWithResponseAsync(resourceGroupName, workspaceName, connectionName, parameters, context).block(); } /** * The create operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param connectionName Friendly name of the workspace connection. @@ -320,18 +271,15 @@ public Response createWithRes * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WorkspaceConnectionPropertiesV2BasicResourceInner create( - String resourceGroupName, - String workspaceName, - String connectionName, - WorkspaceConnectionPropertiesV2BasicResourceInner parameters) { + public WorkspaceConnectionPropertiesV2BasicResourceInner create(String resourceGroupName, String workspaceName, + String connectionName, WorkspaceConnectionPropertiesV2BasicResourceInner parameters) { return createWithResponse(resourceGroupName, workspaceName, connectionName, parameters, Context.NONE) .getValue(); } /** * The get operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param connectionName Friendly name of the workspace connection. @@ -341,19 +289,15 @@ public WorkspaceConnectionPropertiesV2BasicResourceInner create( * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String connectionName) { + private Mono> + getWithResponseAsync(String resourceGroupName, String workspaceName, String connectionName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -367,24 +311,14 @@ private Mono> getWit } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - connectionName, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, connectionName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * The get operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param connectionName Friendly name of the workspace connection. @@ -395,19 +329,15 @@ private Mono> getWit * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String connectionName, Context context) { + private Mono> + getWithResponseAsync(String resourceGroupName, String workspaceName, String connectionName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -421,21 +351,13 @@ private Mono> getWit } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - connectionName, - this.client.getApiVersion(), - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + connectionName, this.client.getApiVersion(), accept, context); } /** * The get operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param connectionName Friendly name of the workspace connection. @@ -445,15 +367,15 @@ private Mono> getWit * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String workspaceName, String connectionName) { + private Mono getAsync(String resourceGroupName, + String workspaceName, String connectionName) { return getWithResponseAsync(resourceGroupName, workspaceName, connectionName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * The get operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param connectionName Friendly name of the workspace connection. @@ -464,14 +386,14 @@ private Mono getAsync( * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String connectionName, Context context) { + public Response getWithResponse(String resourceGroupName, + String workspaceName, String connectionName, Context context) { return getWithResponseAsync(resourceGroupName, workspaceName, connectionName, context).block(); } /** * The get operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param connectionName Friendly name of the workspace connection. @@ -481,14 +403,14 @@ public Response getWithRespon * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WorkspaceConnectionPropertiesV2BasicResourceInner get( - String resourceGroupName, String workspaceName, String connectionName) { + public WorkspaceConnectionPropertiesV2BasicResourceInner get(String resourceGroupName, String workspaceName, + String connectionName) { return getWithResponse(resourceGroupName, workspaceName, connectionName, Context.NONE).getValue(); } /** * The delete operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param connectionName Friendly name of the workspace connection. @@ -498,19 +420,15 @@ public WorkspaceConnectionPropertiesV2BasicResourceInner get( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String connectionName) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String connectionName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -524,24 +442,14 @@ private Mono> deleteWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - connectionName, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, connectionName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * The delete operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param connectionName Friendly name of the workspace connection. @@ -552,19 +460,15 @@ private Mono> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String connectionName, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String connectionName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -578,21 +482,13 @@ private Mono> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - connectionName, - this.client.getApiVersion(), - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, connectionName, this.client.getApiVersion(), accept, context); } /** * The delete operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param connectionName Friendly name of the workspace connection. @@ -609,7 +505,7 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S /** * The delete operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param connectionName Friendly name of the workspace connection. @@ -620,14 +516,14 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String connectionName, Context context) { + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String connectionName, + Context context) { return deleteWithResponseAsync(resourceGroupName, workspaceName, connectionName, context).block(); } /** * The delete operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param connectionName Friendly name of the workspace connection. @@ -642,7 +538,7 @@ public void delete(String resourceGroupName, String workspaceName, String connec /** * The list operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param target Target of the workspace connection. @@ -653,19 +549,15 @@ public void delete(String resourceGroupName, String workspaceName, String connec * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String workspaceName, String target, String category) { + private Mono> + listSinglePageAsync(String resourceGroupName, String workspaceName, String target, String category) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -676,34 +568,17 @@ private Mono> l } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - target, - category, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, target, category, this.client.getApiVersion(), accept, context)) .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * The list operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param target Target of the workspace connection. @@ -718,16 +593,12 @@ private Mono> l private Mono> listSinglePageAsync( String resourceGroupName, String workspaceName, String target, String category, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -739,30 +610,15 @@ private Mono> l final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - target, - category, - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, target, + category, this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * The list operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param target Target of the workspace connection. @@ -773,16 +629,15 @@ private Mono> l * @return the paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String workspaceName, String target, String category) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, target, category), + private PagedFlux listAsync(String resourceGroupName, + String workspaceName, String target, String category) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, target, category), nextLink -> listNextSinglePageAsync(nextLink)); } /** * The list operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -791,18 +646,17 @@ private PagedFlux listAsync( * @return the paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String workspaceName) { + private PagedFlux listAsync(String resourceGroupName, + String workspaceName) { final String target = null; final String category = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, target, category), + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, target, category), nextLink -> listNextSinglePageAsync(nextLink)); } /** * The list operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param target Target of the workspace connection. @@ -814,16 +668,15 @@ private PagedFlux listAsync( * @return the paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String workspaceName, String target, String category, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, target, category, context), + private PagedFlux listAsync(String resourceGroupName, + String workspaceName, String target, String category, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, target, category, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * The list operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -832,8 +685,8 @@ private PagedFlux listAsync( * @return the paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String workspaceName) { + public PagedIterable list(String resourceGroupName, + String workspaceName) { final String target = null; final String category = null; return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, target, category)); @@ -841,7 +694,7 @@ public PagedIterable list( /** * The list operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param target Target of the workspace connection. @@ -853,53 +706,173 @@ public PagedIterable list( * @return the paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String workspaceName, String target, String category, Context context) { + public PagedIterable list(String resourceGroupName, + String workspaceName, String target, String category, Context context) { return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, target, category, context)); } + /** + * List all the secrets of a machine learning workspaces connections. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param connectionName Friendly name of the workspace connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listSecretsWithResponseAsync(String resourceGroupName, String workspaceName, String connectionName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listSecrets(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, connectionName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all the secrets of a machine learning workspaces connections. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param connectionName Friendly name of the workspace connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSecretsWithResponseAsync( + String resourceGroupName, String workspaceName, String connectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listSecrets(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, connectionName, this.client.getApiVersion(), accept, context); + } + + /** + * List all the secrets of a machine learning workspaces connections. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param connectionName Friendly name of the workspace connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listSecretsAsync(String resourceGroupName, + String workspaceName, String connectionName) { + return listSecretsWithResponseAsync(resourceGroupName, workspaceName, connectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * List all the secrets of a machine learning workspaces connections. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param connectionName Friendly name of the workspace connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listSecretsWithResponse(String resourceGroupName, + String workspaceName, String connectionName, Context context) { + return listSecretsWithResponseAsync(resourceGroupName, workspaceName, connectionName, context).block(); + } + + /** + * List all the secrets of a machine learning workspaces connections. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param connectionName Friendly name of the workspace connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkspaceConnectionPropertiesV2BasicResourceInner listSecrets(String resourceGroupName, String workspaceName, + String connectionName) { + return listSecretsWithResponse(resourceGroupName, workspaceName, connectionName, Context.NONE).getValue(); + } + /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink) { + private Mono> + listNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -907,29 +880,19 @@ private Mono> l * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { + private Mono> + listNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceConnectionsImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceConnectionsImpl.java index ba28d102dd9c4..58050994047b8 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceConnectionsImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceConnectionsImpl.java @@ -21,32 +21,28 @@ public final class WorkspaceConnectionsImpl implements WorkspaceConnections { private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - public WorkspaceConnectionsImpl( - WorkspaceConnectionsClient innerClient, + public WorkspaceConnectionsImpl(WorkspaceConnectionsClient innerClient, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String connectionName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, workspaceName, connectionName, context); + public Response getWithResponse(String resourceGroupName, + String workspaceName, String connectionName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, connectionName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new WorkspaceConnectionPropertiesV2BasicResourceImpl(inner.getValue(), this.manager())); } else { return null; } } - public WorkspaceConnectionPropertiesV2BasicResource get( - String resourceGroupName, String workspaceName, String connectionName) { - WorkspaceConnectionPropertiesV2BasicResourceInner inner = - this.serviceClient().get(resourceGroupName, workspaceName, connectionName); + public WorkspaceConnectionPropertiesV2BasicResource get(String resourceGroupName, String workspaceName, + String connectionName) { + WorkspaceConnectionPropertiesV2BasicResourceInner inner + = this.serviceClient().get(resourceGroupName, workspaceName, connectionName); if (inner != null) { return new WorkspaceConnectionPropertiesV2BasicResourceImpl(inner, this.manager()); } else { @@ -54,8 +50,8 @@ public WorkspaceConnectionPropertiesV2BasicResource get( } } - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String connectionName, Context context) { + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String connectionName, + Context context) { return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, connectionName, context); } @@ -63,122 +59,117 @@ public void delete(String resourceGroupName, String workspaceName, String connec this.serviceClient().delete(resourceGroupName, workspaceName, connectionName); } - public PagedIterable list( - String resourceGroupName, String workspaceName) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, workspaceName); - return Utils - .mapPage(inner, inner1 -> new WorkspaceConnectionPropertiesV2BasicResourceImpl(inner1, this.manager())); + public PagedIterable list(String resourceGroupName, + String workspaceName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new WorkspaceConnectionPropertiesV2BasicResourceImpl(inner1, this.manager())); } - public PagedIterable list( - String resourceGroupName, String workspaceName, String target, String category, Context context) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, workspaceName, target, category, context); - return Utils - .mapPage(inner, inner1 -> new WorkspaceConnectionPropertiesV2BasicResourceImpl(inner1, this.manager())); + public PagedIterable list(String resourceGroupName, + String workspaceName, String target, String category, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, target, category, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new WorkspaceConnectionPropertiesV2BasicResourceImpl(inner1, this.manager())); + } + + public Response listSecretsWithResponse(String resourceGroupName, + String workspaceName, String connectionName, Context context) { + Response inner + = this.serviceClient().listSecretsWithResponse(resourceGroupName, workspaceName, connectionName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new WorkspaceConnectionPropertiesV2BasicResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public WorkspaceConnectionPropertiesV2BasicResource listSecrets(String resourceGroupName, String workspaceName, + String connectionName) { + WorkspaceConnectionPropertiesV2BasicResourceInner inner + = this.serviceClient().listSecrets(resourceGroupName, workspaceName, connectionName); + if (inner != null) { + return new WorkspaceConnectionPropertiesV2BasicResourceImpl(inner, this.manager()); + } else { + return null; + } } public WorkspaceConnectionPropertiesV2BasicResource getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String connectionName = Utils.getValueFromIdByName(id, "connections"); + String connectionName = ResourceManagerUtils.getValueFromIdByName(id, "connections"); if (connectionName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); } return this.getWithResponse(resourceGroupName, workspaceName, connectionName, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String connectionName = Utils.getValueFromIdByName(id, "connections"); + String connectionName = ResourceManagerUtils.getValueFromIdByName(id, "connections"); if (connectionName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); } return this.getWithResponse(resourceGroupName, workspaceName, connectionName, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String connectionName = Utils.getValueFromIdByName(id, "connections"); + String connectionName = ResourceManagerUtils.getValueFromIdByName(id, "connections"); if (connectionName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); } this.deleteWithResponse(resourceGroupName, workspaceName, connectionName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String connectionName = Utils.getValueFromIdByName(id, "connections"); + String connectionName = ResourceManagerUtils.getValueFromIdByName(id, "connections"); if (connectionName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); } return this.deleteWithResponse(resourceGroupName, workspaceName, connectionName, context); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceFeaturesClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceFeaturesClientImpl.java index 46e72e570fe95..e6c0f065208f7 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceFeaturesClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceFeaturesClientImpl.java @@ -30,83 +30,77 @@ import com.azure.resourcemanager.machinelearning.models.ListAmlUserFeatureResult; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in WorkspaceFeaturesClient. */ +/** + * An instance of this class provides access to all the operations defined in WorkspaceFeaturesClient. + */ public final class WorkspaceFeaturesClientImpl implements WorkspaceFeaturesClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final WorkspaceFeaturesService service; - /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of WorkspaceFeaturesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ - WorkspaceFeaturesClientImpl(AzureMachineLearningWorkspacesImpl client) { - this.service = - RestProxy.create(WorkspaceFeaturesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + WorkspaceFeaturesClientImpl(AzureMachineLearningServicesImpl client) { + this.service + = RestProxy.create(WorkspaceFeaturesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesWorkspaceFeatures to be used by the - * proxy service to perform REST calls. + * The interface defining all the services for AzureMachineLearningServicesWorkspaceFeatures to be used by the proxy + * service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AzureMachineLearning") public interface WorkspaceFeaturesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Lists all enabled features for a workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the List Aml user feature operation response along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String workspaceName) { + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -117,32 +111,16 @@ private Mono> listSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Lists all enabled features for a workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -150,22 +128,18 @@ private Mono> listSinglePageAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the List Aml user feature operation response along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String workspaceName, Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -177,28 +151,15 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Lists all enabled features for a workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -208,13 +169,13 @@ private Mono> listSinglePageAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String workspaceName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName), nextLink -> listNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** * Lists all enabled features for a workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -225,14 +186,13 @@ private PagedFlux listAsync(String resourceGroupName, Strin */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String workspaceName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, context), + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Lists all enabled features for a workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -247,7 +207,7 @@ public PagedIterable list(String resourceGroupName, String /** * Lists all enabled features for a workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -263,14 +223,13 @@ public PagedIterable list(String resourceGroupName, String /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the List Aml user feature operation response along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -278,37 +237,26 @@ private Mono> listNextSinglePageAsync(String return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the List Aml user feature operation response along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -316,23 +264,13 @@ private Mono> listNextSinglePageAsync(String return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceFeaturesImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceFeaturesImpl.java index 875e67abbaffb..fb9af118f3f32 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceFeaturesImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceFeaturesImpl.java @@ -19,8 +19,7 @@ public final class WorkspaceFeaturesImpl implements WorkspaceFeatures { private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - public WorkspaceFeaturesImpl( - WorkspaceFeaturesClient innerClient, + public WorkspaceFeaturesImpl(WorkspaceFeaturesClient innerClient, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -28,12 +27,12 @@ public WorkspaceFeaturesImpl( public PagedIterable list(String resourceGroupName, String workspaceName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); - return Utils.mapPage(inner, inner1 -> new AmlUserFeatureImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AmlUserFeatureImpl(inner1, this.manager())); } public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName, context); - return Utils.mapPage(inner, inner1 -> new AmlUserFeatureImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AmlUserFeatureImpl(inner1, this.manager())); } private WorkspaceFeaturesClient serviceClient() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceImpl.java index 5a2da698968a9..45c4a9d20c9c9 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceImpl.java @@ -8,26 +8,32 @@ import com.azure.core.management.Region; import com.azure.core.management.SystemData; import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.ManagedNetworkSettingsInner; import com.azure.resourcemanager.machinelearning.fluent.models.NotebookResourceInfoInner; import com.azure.resourcemanager.machinelearning.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.machinelearning.fluent.models.WorkspaceInner; +import com.azure.resourcemanager.machinelearning.fluent.models.WorkspaceUpdateParametersInner; import com.azure.resourcemanager.machinelearning.models.DiagnoseResponseResult; import com.azure.resourcemanager.machinelearning.models.DiagnoseWorkspaceParameters; import com.azure.resourcemanager.machinelearning.models.EncryptionProperty; +import com.azure.resourcemanager.machinelearning.models.EncryptionUpdateProperties; +import com.azure.resourcemanager.machinelearning.models.FeatureStoreSettings; import com.azure.resourcemanager.machinelearning.models.ListNotebookKeysResult; import com.azure.resourcemanager.machinelearning.models.ListStorageAccountKeysResult; import com.azure.resourcemanager.machinelearning.models.ListWorkspaceKeysResult; +import com.azure.resourcemanager.machinelearning.models.ManagedNetworkSettings; import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; import com.azure.resourcemanager.machinelearning.models.NotebookAccessTokenResult; import com.azure.resourcemanager.machinelearning.models.NotebookResourceInfo; import com.azure.resourcemanager.machinelearning.models.PrivateEndpointConnection; import com.azure.resourcemanager.machinelearning.models.ProvisioningState; import com.azure.resourcemanager.machinelearning.models.PublicNetworkAccess; +import com.azure.resourcemanager.machinelearning.models.ServerlessComputeSettings; import com.azure.resourcemanager.machinelearning.models.ServiceManagedResourcesSettings; import com.azure.resourcemanager.machinelearning.models.SharedPrivateLinkResource; import com.azure.resourcemanager.machinelearning.models.Sku; import com.azure.resourcemanager.machinelearning.models.Workspace; -import com.azure.resourcemanager.machinelearning.models.WorkspaceUpdateParameters; +import com.azure.resourcemanager.machinelearning.models.WorkspaceHubConfig; import java.util.Collections; import java.util.List; import java.util.Map; @@ -54,6 +60,10 @@ public ManagedServiceIdentity identity() { return this.innerModel().identity(); } + public String kind() { + return this.innerModel().kind(); + } + public String location() { return this.innerModel().location(); } @@ -142,17 +152,18 @@ public PublicNetworkAccess publicNetworkAccess() { public List privateEndpointConnections() { List inner = this.innerModel().privateEndpointConnections(); if (inner != null) { - return Collections - .unmodifiableList( - inner - .stream() - .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) - .collect(Collectors.toList())); + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); } else { return Collections.emptyList(); } } + public ServerlessComputeSettings serverlessComputeSettings() { + return this.innerModel().serverlessComputeSettings(); + } + public List sharedPrivateLinkResources() { List inner = this.innerModel().sharedPrivateLinkResources(); if (inner != null) { @@ -195,6 +206,40 @@ public Boolean v1LegacyMode() { return this.innerModel().v1LegacyMode(); } + public ManagedNetworkSettings managedNetwork() { + ManagedNetworkSettingsInner inner = this.innerModel().managedNetwork(); + if (inner != null) { + return new ManagedNetworkSettingsImpl(inner, this.manager()); + } else { + return null; + } + } + + public FeatureStoreSettings featureStoreSettings() { + return this.innerModel().featureStoreSettings(); + } + + public List associatedWorkspaces() { + List inner = this.innerModel().associatedWorkspaces(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Boolean enableDataIsolation() { + return this.innerModel().enableDataIsolation(); + } + + public String hubResourceId() { + return this.innerModel().hubResourceId(); + } + + public WorkspaceHubConfig workspaceHubConfig() { + return this.innerModel().workspaceHubConfig(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -219,7 +264,7 @@ private com.azure.resourcemanager.machinelearning.MachineLearningManager manager private String workspaceName; - private WorkspaceUpdateParameters updateParameters; + private WorkspaceUpdateParametersInner updateParameters; public WorkspaceImpl withExistingResourceGroup(String resourceGroupName) { this.resourceGroupName = resourceGroupName; @@ -227,20 +272,16 @@ public WorkspaceImpl withExistingResourceGroup(String resourceGroupName) { } public Workspace create() { - this.innerObject = - serviceManager - .serviceClient() - .getWorkspaces() - .createOrUpdate(resourceGroupName, workspaceName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getWorkspaces() + .createOrUpdate(resourceGroupName, workspaceName, this.innerModel(), Context.NONE); return this; } public Workspace create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getWorkspaces() - .createOrUpdate(resourceGroupName, workspaceName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient() + .getWorkspaces() + .createOrUpdate(resourceGroupName, workspaceName, this.innerModel(), context); return this; } @@ -251,53 +292,45 @@ public Workspace create(Context context) { } public WorkspaceImpl update() { - this.updateParameters = new WorkspaceUpdateParameters(); + this.updateParameters = new WorkspaceUpdateParametersInner(); return this; } public Workspace apply() { - this.innerObject = - serviceManager - .serviceClient() - .getWorkspaces() - .update(resourceGroupName, workspaceName, updateParameters, Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getWorkspaces() + .update(resourceGroupName, workspaceName, updateParameters, Context.NONE); return this; } public Workspace apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getWorkspaces() - .update(resourceGroupName, workspaceName, updateParameters, context); + this.innerObject = serviceManager.serviceClient() + .getWorkspaces() + .update(resourceGroupName, workspaceName, updateParameters, context); return this; } - WorkspaceImpl( - WorkspaceInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + WorkspaceImpl(WorkspaceInner innerObject, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); } public Workspace refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getWorkspaces() - .getByResourceGroupWithResponse(resourceGroupName, workspaceName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getWorkspaces() + .getByResourceGroupWithResponse(resourceGroupName, workspaceName, Context.NONE) + .getValue(); return this; } public Workspace refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getWorkspaces() - .getByResourceGroupWithResponse(resourceGroupName, workspaceName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getWorkspaces() + .getByResourceGroupWithResponse(resourceGroupName, workspaceName, context) + .getValue(); return this; } @@ -326,8 +359,7 @@ public void resyncKeys(Context context) { } public Response listNotebookAccessTokenWithResponse(Context context) { - return serviceManager - .workspaces() + return serviceManager.workspaces() .listNotebookAccessTokenWithResponse(resourceGroupName, workspaceName, context); } @@ -344,8 +376,7 @@ public NotebookResourceInfo prepareNotebook(Context context) { } public Response listStorageAccountKeysWithResponse(Context context) { - return serviceManager - .workspaces() + return serviceManager.workspaces() .listStorageAccountKeysWithResponse(resourceGroupName, workspaceName, context); } @@ -391,6 +422,11 @@ public WorkspaceImpl withIdentity(ManagedServiceIdentity identity) { } } + public WorkspaceImpl withKind(String kind) { + this.innerModel().withKind(kind); + return this; + } + public WorkspaceImpl withSku(Sku sku) { if (isInCreateMode()) { this.innerModel().withSku(sku); @@ -491,13 +527,23 @@ public WorkspaceImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAc } } + public WorkspaceImpl withServerlessComputeSettings(ServerlessComputeSettings serverlessComputeSettings) { + if (isInCreateMode()) { + this.innerModel().withServerlessComputeSettings(serverlessComputeSettings); + return this; + } else { + this.updateParameters.withServerlessComputeSettings(serverlessComputeSettings); + return this; + } + } + public WorkspaceImpl withSharedPrivateLinkResources(List sharedPrivateLinkResources) { this.innerModel().withSharedPrivateLinkResources(sharedPrivateLinkResources); return this; } - public WorkspaceImpl withServiceManagedResourcesSettings( - ServiceManagedResourcesSettings serviceManagedResourcesSettings) { + public WorkspaceImpl + withServiceManagedResourcesSettings(ServiceManagedResourcesSettings serviceManagedResourcesSettings) { if (isInCreateMode()) { this.innerModel().withServiceManagedResourcesSettings(serviceManagedResourcesSettings); return this; @@ -518,7 +564,62 @@ public WorkspaceImpl withPrimaryUserAssignedIdentity(String primaryUserAssignedI } public WorkspaceImpl withV1LegacyMode(Boolean v1LegacyMode) { - this.innerModel().withV1LegacyMode(v1LegacyMode); + if (isInCreateMode()) { + this.innerModel().withV1LegacyMode(v1LegacyMode); + return this; + } else { + this.updateParameters.withV1LegacyMode(v1LegacyMode); + return this; + } + } + + public WorkspaceImpl withManagedNetwork(ManagedNetworkSettingsInner managedNetwork) { + if (isInCreateMode()) { + this.innerModel().withManagedNetwork(managedNetwork); + return this; + } else { + this.updateParameters.withManagedNetwork(managedNetwork); + return this; + } + } + + public WorkspaceImpl withFeatureStoreSettings(FeatureStoreSettings featureStoreSettings) { + if (isInCreateMode()) { + this.innerModel().withFeatureStoreSettings(featureStoreSettings); + return this; + } else { + this.updateParameters.withFeatureStoreSettings(featureStoreSettings); + return this; + } + } + + public WorkspaceImpl withAssociatedWorkspaces(List associatedWorkspaces) { + this.innerModel().withAssociatedWorkspaces(associatedWorkspaces); + return this; + } + + public WorkspaceImpl withEnableDataIsolation(Boolean enableDataIsolation) { + if (isInCreateMode()) { + this.innerModel().withEnableDataIsolation(enableDataIsolation); + return this; + } else { + this.updateParameters.withEnableDataIsolation(enableDataIsolation); + return this; + } + } + + public WorkspaceImpl withHubResourceId(String hubResourceId) { + this.innerModel().withHubResourceId(hubResourceId); + return this; + } + + public WorkspaceImpl withWorkspaceHubConfig(WorkspaceHubConfig workspaceHubConfig) { + this.innerModel().withWorkspaceHubConfig(workspaceHubConfig); + return this; + } + + public WorkspaceImpl withEncryption(EncryptionUpdateProperties encryption) { + this.updateParameters.withEncryption(encryption); return this; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspacePropertiesImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspacePropertiesImpl.java index e097ac2af75b8..7b8461716398c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspacePropertiesImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspacePropertiesImpl.java @@ -4,16 +4,21 @@ package com.azure.resourcemanager.machinelearning.implementation; +import com.azure.resourcemanager.machinelearning.fluent.models.ManagedNetworkSettingsInner; import com.azure.resourcemanager.machinelearning.fluent.models.NotebookResourceInfoInner; import com.azure.resourcemanager.machinelearning.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.machinelearning.fluent.models.WorkspacePropertiesInner; import com.azure.resourcemanager.machinelearning.models.EncryptionProperty; +import com.azure.resourcemanager.machinelearning.models.FeatureStoreSettings; +import com.azure.resourcemanager.machinelearning.models.ManagedNetworkSettings; import com.azure.resourcemanager.machinelearning.models.NotebookResourceInfo; import com.azure.resourcemanager.machinelearning.models.PrivateEndpointConnection; import com.azure.resourcemanager.machinelearning.models.ProvisioningState; import com.azure.resourcemanager.machinelearning.models.PublicNetworkAccess; +import com.azure.resourcemanager.machinelearning.models.ServerlessComputeSettings; import com.azure.resourcemanager.machinelearning.models.ServiceManagedResourcesSettings; import com.azure.resourcemanager.machinelearning.models.SharedPrivateLinkResource; +import com.azure.resourcemanager.machinelearning.models.WorkspaceHubConfig; import com.azure.resourcemanager.machinelearning.models.WorkspaceProperties; import java.util.Collections; import java.util.List; @@ -24,8 +29,7 @@ public final class WorkspacePropertiesImpl implements WorkspaceProperties { private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - WorkspacePropertiesImpl( - WorkspacePropertiesInner innerObject, + WorkspacePropertiesImpl(WorkspacePropertiesInner innerObject, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -98,17 +102,18 @@ public PublicNetworkAccess publicNetworkAccess() { public List privateEndpointConnections() { List inner = this.innerModel().privateEndpointConnections(); if (inner != null) { - return Collections - .unmodifiableList( - inner - .stream() - .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) - .collect(Collectors.toList())); + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); } else { return Collections.emptyList(); } } + public ServerlessComputeSettings serverlessComputeSettings() { + return this.innerModel().serverlessComputeSettings(); + } + public List sharedPrivateLinkResources() { List inner = this.innerModel().sharedPrivateLinkResources(); if (inner != null) { @@ -151,6 +156,40 @@ public Boolean v1LegacyMode() { return this.innerModel().v1LegacyMode(); } + public ManagedNetworkSettings managedNetwork() { + ManagedNetworkSettingsInner inner = this.innerModel().managedNetwork(); + if (inner != null) { + return new ManagedNetworkSettingsImpl(inner, this.manager()); + } else { + return null; + } + } + + public FeatureStoreSettings featureStoreSettings() { + return this.innerModel().featureStoreSettings(); + } + + public List associatedWorkspaces() { + List inner = this.innerModel().associatedWorkspaces(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Boolean enableDataIsolation() { + return this.innerModel().enableDataIsolation(); + } + + public String hubResourceId() { + return this.innerModel().hubResourceId(); + } + + public WorkspaceHubConfig workspaceHubConfig() { + return this.innerModel().workspaceHubConfig(); + } + public WorkspacePropertiesInner innerModel() { return this.innerObject; } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspacePropertiesUpdateParametersImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspacePropertiesUpdateParametersImpl.java new file mode 100644 index 0000000000000..33bff913658cb --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspacePropertiesUpdateParametersImpl.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.resourcemanager.machinelearning.fluent.models.ManagedNetworkSettingsInner; +import com.azure.resourcemanager.machinelearning.fluent.models.WorkspacePropertiesUpdateParametersInner; +import com.azure.resourcemanager.machinelearning.models.EncryptionUpdateProperties; +import com.azure.resourcemanager.machinelearning.models.FeatureStoreSettings; +import com.azure.resourcemanager.machinelearning.models.ManagedNetworkSettings; +import com.azure.resourcemanager.machinelearning.models.PublicNetworkAccess; +import com.azure.resourcemanager.machinelearning.models.ServerlessComputeSettings; +import com.azure.resourcemanager.machinelearning.models.ServiceManagedResourcesSettings; +import com.azure.resourcemanager.machinelearning.models.WorkspacePropertiesUpdateParameters; + +public final class WorkspacePropertiesUpdateParametersImpl implements WorkspacePropertiesUpdateParameters { + private WorkspacePropertiesUpdateParametersInner innerObject; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + WorkspacePropertiesUpdateParametersImpl(WorkspacePropertiesUpdateParametersInner innerObject, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String description() { + return this.innerModel().description(); + } + + public String friendlyName() { + return this.innerModel().friendlyName(); + } + + public String imageBuildCompute() { + return this.innerModel().imageBuildCompute(); + } + + public ServiceManagedResourcesSettings serviceManagedResourcesSettings() { + return this.innerModel().serviceManagedResourcesSettings(); + } + + public String primaryUserAssignedIdentity() { + return this.innerModel().primaryUserAssignedIdentity(); + } + + public ServerlessComputeSettings serverlessComputeSettings() { + return this.innerModel().serverlessComputeSettings(); + } + + public PublicNetworkAccess publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + + public String applicationInsights() { + return this.innerModel().applicationInsights(); + } + + public String containerRegistry() { + return this.innerModel().containerRegistry(); + } + + public FeatureStoreSettings featureStoreSettings() { + return this.innerModel().featureStoreSettings(); + } + + public ManagedNetworkSettings managedNetwork() { + ManagedNetworkSettingsInner inner = this.innerModel().managedNetwork(); + if (inner != null) { + return new ManagedNetworkSettingsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Boolean enableDataIsolation() { + return this.innerModel().enableDataIsolation(); + } + + public Boolean v1LegacyMode() { + return this.innerModel().v1LegacyMode(); + } + + public EncryptionUpdateProperties encryption() { + return this.innerModel().encryption(); + } + + public WorkspacePropertiesUpdateParametersInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceUpdateParametersImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceUpdateParametersImpl.java new file mode 100644 index 0000000000000..32081f8e7d6af --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspaceUpdateParametersImpl.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.implementation; + +import com.azure.resourcemanager.machinelearning.fluent.models.ManagedNetworkSettingsInner; +import com.azure.resourcemanager.machinelearning.fluent.models.WorkspaceUpdateParametersInner; +import com.azure.resourcemanager.machinelearning.models.EncryptionUpdateProperties; +import com.azure.resourcemanager.machinelearning.models.FeatureStoreSettings; +import com.azure.resourcemanager.machinelearning.models.ManagedNetworkSettings; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.PublicNetworkAccess; +import com.azure.resourcemanager.machinelearning.models.ServerlessComputeSettings; +import com.azure.resourcemanager.machinelearning.models.ServiceManagedResourcesSettings; +import com.azure.resourcemanager.machinelearning.models.Sku; +import com.azure.resourcemanager.machinelearning.models.WorkspaceUpdateParameters; +import java.util.Collections; +import java.util.Map; + +public final class WorkspaceUpdateParametersImpl implements WorkspaceUpdateParameters { + private WorkspaceUpdateParametersInner innerObject; + + private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; + + WorkspaceUpdateParametersImpl(WorkspaceUpdateParametersInner innerObject, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + + public String description() { + return this.innerModel().description(); + } + + public String friendlyName() { + return this.innerModel().friendlyName(); + } + + public String imageBuildCompute() { + return this.innerModel().imageBuildCompute(); + } + + public ServiceManagedResourcesSettings serviceManagedResourcesSettings() { + return this.innerModel().serviceManagedResourcesSettings(); + } + + public String primaryUserAssignedIdentity() { + return this.innerModel().primaryUserAssignedIdentity(); + } + + public ServerlessComputeSettings serverlessComputeSettings() { + return this.innerModel().serverlessComputeSettings(); + } + + public PublicNetworkAccess publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + + public String applicationInsights() { + return this.innerModel().applicationInsights(); + } + + public String containerRegistry() { + return this.innerModel().containerRegistry(); + } + + public FeatureStoreSettings featureStoreSettings() { + return this.innerModel().featureStoreSettings(); + } + + public ManagedNetworkSettings managedNetwork() { + ManagedNetworkSettingsInner inner = this.innerModel().managedNetwork(); + if (inner != null) { + return new ManagedNetworkSettingsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Boolean enableDataIsolation() { + return this.innerModel().enableDataIsolation(); + } + + public Boolean v1LegacyMode() { + return this.innerModel().v1LegacyMode(); + } + + public EncryptionUpdateProperties encryption() { + return this.innerModel().encryption(); + } + + public WorkspaceUpdateParametersInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.machinelearning.MachineLearningManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspacesClientImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspacesClientImpl.java index 31d06417842a9..feee77d86fa16 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspacesClientImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspacesClientImpl.java @@ -42,295 +42,212 @@ import com.azure.resourcemanager.machinelearning.fluent.models.NotebookAccessTokenResultInner; import com.azure.resourcemanager.machinelearning.fluent.models.NotebookResourceInfoInner; import com.azure.resourcemanager.machinelearning.fluent.models.WorkspaceInner; +import com.azure.resourcemanager.machinelearning.fluent.models.WorkspaceUpdateParametersInner; import com.azure.resourcemanager.machinelearning.models.DiagnoseWorkspaceParameters; import com.azure.resourcemanager.machinelearning.models.WorkspaceListResult; -import com.azure.resourcemanager.machinelearning.models.WorkspaceUpdateParameters; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in WorkspacesClient. */ +/** + * An instance of this class provides access to all the operations defined in WorkspacesClient. + */ public final class WorkspacesClientImpl implements WorkspacesClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final WorkspacesService service; - /** The service client containing this operation class. */ - private final AzureMachineLearningWorkspacesImpl client; + /** + * The service client containing this operation class. + */ + private final AzureMachineLearningServicesImpl client; /** * Initializes an instance of WorkspacesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ - WorkspacesClientImpl(AzureMachineLearningWorkspacesImpl client) { - this.service = - RestProxy.create(WorkspacesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + WorkspacesClientImpl(AzureMachineLearningServicesImpl client) { + this.service + = RestProxy.create(WorkspacesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureMachineLearningWorkspacesWorkspaces to be used by the proxy + * The interface defining all the services for AzureMachineLearningServicesWorkspaces to be used by the proxy * service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "AzureMachineLearning") public interface WorkspacesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}") - @ExpectedResponses({200, 202}) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @BodyParam("application/json") WorkspaceInner parameters, - @HeaderParam("Accept") String accept, + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @BodyParam("application/json") WorkspaceInner parameters, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}") - @ExpectedResponses({200, 202, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}") + @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}") - @ExpectedResponses({200, 202}) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("forceToPurge") Boolean forceToPurge, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @BodyParam("application/json") WorkspaceUpdateParameters parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces") - @ExpectedResponses({200}) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @BodyParam("application/json") WorkspaceUpdateParametersInner parameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("$skip") String skip, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose") - @ExpectedResponses({200, 202}) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$skip") String skip, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> diagnose( - @HostParam("$host") String endpoint, + Mono>> diagnose(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DiagnoseWorkspaceParameters parameters, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") DiagnoseWorkspaceParameters parameters, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listKeys( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys") - @ExpectedResponses({200, 202}) + Mono> listKeys(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> resyncKeys( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @HeaderParam("Accept") String accept, - Context context); + Mono>> resyncKeys(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$skip") String skip, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$skip") String skip, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNotebookAccessToken( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook") - @ExpectedResponses({200, 202}) + Mono> listNotebookAccessToken(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> prepareNotebook( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys") - @ExpectedResponses({200}) + Mono>> prepareNotebook(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listStorageAccountKeys( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys") - @ExpectedResponses({200}) + Mono> listStorageAccountKeys(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNotebookKeys( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints") - @ExpectedResponses({200}) + Mono> listNotebookKeys(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listOutboundNetworkDependenciesEndpoints( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Gets the properties of the specified machine learning workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the properties of the specified machine learning workspace along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String workspaceName) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String workspaceName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -341,23 +258,14 @@ private Mono> getByResourceGroupWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - accept, - context)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the properties of the specified machine learning workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -365,22 +273,18 @@ private Mono> getByResourceGroupWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the properties of the specified machine learning workspace along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String workspaceName, Context context) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String workspaceName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -391,20 +295,13 @@ private Mono> getByResourceGroupWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - accept, - context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context); } /** * Gets the properties of the specified machine learning workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -420,7 +317,7 @@ private Mono getByResourceGroupAsync(String resourceGroupName, S /** * Gets the properties of the specified machine learning workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -430,14 +327,14 @@ private Mono getByResourceGroupAsync(String resourceGroupName, S * @return the properties of the specified machine learning workspace along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String workspaceName, Context context) { + public Response getByResourceGroupWithResponse(String resourceGroupName, String workspaceName, + Context context) { return getByResourceGroupWithResponseAsync(resourceGroupName, workspaceName, context).block(); } /** * Gets the properties of the specified machine learning workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -452,7 +349,7 @@ public WorkspaceInner getByResourceGroup(String resourceGroupName, String worksp /** * Creates or updates a workspace with the specified parameters. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param parameters The parameters for creating or updating a machine learning workspace. @@ -460,22 +357,18 @@ public WorkspaceInner getByResourceGroup(String resourceGroupName, String worksp * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an object that represents a machine learning workspace along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String workspaceName, WorkspaceInner parameters) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, WorkspaceInner parameters) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -491,24 +384,14 @@ private Mono>> createOrUpdateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - parameters, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates or updates a workspace with the specified parameters. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param parameters The parameters for creating or updating a machine learning workspace. @@ -517,22 +400,18 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an object that represents a machine learning workspace along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String workspaceName, WorkspaceInner parameters, Context context) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, WorkspaceInner parameters, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -548,21 +427,13 @@ private Mono>> createOrUpdateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - parameters, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, parameters, accept, context); } /** * Creates or updates a workspace with the specified parameters. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param parameters The parameters for creating or updating a machine learning workspace. @@ -572,23 +443,17 @@ private Mono>> createOrUpdateWithResponseAsync( * @return the {@link PollerFlux} for polling of an object that represents a machine learning workspace. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, WorkspaceInner> beginCreateOrUpdateAsync( - String resourceGroupName, String workspaceName, WorkspaceInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - WorkspaceInner.class, - WorkspaceInner.class, - this.client.getContext()); + private PollerFlux, WorkspaceInner> beginCreateOrUpdateAsync(String resourceGroupName, + String workspaceName, WorkspaceInner parameters) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + WorkspaceInner.class, WorkspaceInner.class, this.client.getContext()); } /** * Creates or updates a workspace with the specified parameters. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param parameters The parameters for creating or updating a machine learning workspace. @@ -599,20 +464,18 @@ private PollerFlux, WorkspaceInner> beginCreateOrUpda * @return the {@link PollerFlux} for polling of an object that represents a machine learning workspace. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, WorkspaceInner> beginCreateOrUpdateAsync( - String resourceGroupName, String workspaceName, WorkspaceInner parameters, Context context) { + private PollerFlux, WorkspaceInner> beginCreateOrUpdateAsync(String resourceGroupName, + String workspaceName, WorkspaceInner parameters, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), WorkspaceInner.class, WorkspaceInner.class, context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, parameters, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + WorkspaceInner.class, WorkspaceInner.class, context); } /** * Creates or updates a workspace with the specified parameters. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param parameters The parameters for creating or updating a machine learning workspace. @@ -622,14 +485,14 @@ private PollerFlux, WorkspaceInner> beginCreateOrUpda * @return the {@link SyncPoller} for polling of an object that represents a machine learning workspace. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, WorkspaceInner> beginCreateOrUpdate( - String resourceGroupName, String workspaceName, WorkspaceInner parameters) { + public SyncPoller, WorkspaceInner> beginCreateOrUpdate(String resourceGroupName, + String workspaceName, WorkspaceInner parameters) { return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, parameters).getSyncPoller(); } /** * Creates or updates a workspace with the specified parameters. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param parameters The parameters for creating or updating a machine learning workspace. @@ -640,14 +503,14 @@ public SyncPoller, WorkspaceInner> beginCreateOrUpdat * @return the {@link SyncPoller} for polling of an object that represents a machine learning workspace. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, WorkspaceInner> beginCreateOrUpdate( - String resourceGroupName, String workspaceName, WorkspaceInner parameters, Context context) { + public SyncPoller, WorkspaceInner> beginCreateOrUpdate(String resourceGroupName, + String workspaceName, WorkspaceInner parameters, Context context) { return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, parameters, context).getSyncPoller(); } /** * Creates or updates a workspace with the specified parameters. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param parameters The parameters for creating or updating a machine learning workspace. @@ -657,16 +520,15 @@ public SyncPoller, WorkspaceInner> beginCreateOrUpdat * @return an object that represents a machine learning workspace on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String workspaceName, WorkspaceInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, parameters) - .last() + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + WorkspaceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, parameters).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Creates or updates a workspace with the specified parameters. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param parameters The parameters for creating or updating a machine learning workspace. @@ -677,16 +539,15 @@ private Mono createOrUpdateAsync( * @return an object that represents a machine learning workspace on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String workspaceName, WorkspaceInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, parameters, context) - .last() + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + WorkspaceInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, parameters, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Creates or updates a workspace with the specified parameters. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param parameters The parameters for creating or updating a machine learning workspace. @@ -702,7 +563,7 @@ public WorkspaceInner createOrUpdate(String resourceGroupName, String workspaceN /** * Creates or updates a workspace with the specified parameters. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param parameters The parameters for creating or updating a machine learning workspace. @@ -713,34 +574,32 @@ public WorkspaceInner createOrUpdate(String resourceGroupName, String workspaceN * @return an object that represents a machine learning workspace. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WorkspaceInner createOrUpdate( - String resourceGroupName, String workspaceName, WorkspaceInner parameters, Context context) { + public WorkspaceInner createOrUpdate(String resourceGroupName, String workspaceName, WorkspaceInner parameters, + Context context) { return createOrUpdateAsync(resourceGroupName, workspaceName, parameters, context).block(); } /** * Deletes a machine learning workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. + * @param forceToPurge Flag to indicate delete is a purge request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + Boolean forceToPurge) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -751,25 +610,17 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, forceToPurge, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Deletes a machine learning workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. + * @param forceToPurge Flag to indicate delete is a purge request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -777,19 +628,15 @@ private Mono>> deleteWithResponseAsync(String resource * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + Boolean forceToPurge, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -800,20 +647,32 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, forceToPurge, accept, context); + } + + /** + * Deletes a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param forceToPurge Flag to indicate delete is a purge request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, + Boolean forceToPurge) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName, forceToPurge); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Deletes a machine learning workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -823,18 +682,18 @@ private Mono>> deleteWithResponseAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + final Boolean forceToPurge = null; + Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName, forceToPurge); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Deletes a machine learning workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. + * @param forceToPurge Flag to indicate delete is a purge request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -842,18 +701,18 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String workspaceName, Context context) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, + Boolean forceToPurge, Context context) { context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, workspaceName, forceToPurge, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** * Deletes a machine learning workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -863,14 +722,16 @@ private PollerFlux, Void> beginDeleteAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName) { - return this.beginDeleteAsync(resourceGroupName, workspaceName).getSyncPoller(); + final Boolean forceToPurge = null; + return this.beginDeleteAsync(resourceGroupName, workspaceName, forceToPurge).getSyncPoller(); } /** * Deletes a machine learning workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. + * @param forceToPurge Flag to indicate delete is a purge request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -878,14 +739,31 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String workspaceName, Context context) { - return this.beginDeleteAsync(resourceGroupName, workspaceName, context).getSyncPoller(); + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, + Boolean forceToPurge, Context context) { + return this.beginDeleteAsync(resourceGroupName, workspaceName, forceToPurge, context).getSyncPoller(); } /** * Deletes a machine learning workspace. - * + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param forceToPurge Flag to indicate delete is a purge request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, Boolean forceToPurge) { + return beginDeleteAsync(resourceGroupName, workspaceName, forceToPurge).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a machine learning workspace. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -895,14 +773,17 @@ public SyncPoller, Void> beginDelete( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String workspaceName) { - return beginDeleteAsync(resourceGroupName, workspaceName).last().flatMap(this.client::getLroFinalResultOrError); + final Boolean forceToPurge = null; + return beginDeleteAsync(resourceGroupName, workspaceName, forceToPurge).last() + .flatMap(this.client::getLroFinalResultOrError); } /** * Deletes a machine learning workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. + * @param forceToPurge Flag to indicate delete is a purge request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -910,15 +791,15 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName) { * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String workspaceName, Context context) { - return beginDeleteAsync(resourceGroupName, workspaceName, context) - .last() + private Mono deleteAsync(String resourceGroupName, String workspaceName, Boolean forceToPurge, + Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, forceToPurge, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Deletes a machine learning workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -927,27 +808,29 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, C */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String workspaceName) { - deleteAsync(resourceGroupName, workspaceName).block(); + final Boolean forceToPurge = null; + deleteAsync(resourceGroupName, workspaceName, forceToPurge).block(); } /** * Deletes a machine learning workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. + * @param forceToPurge Flag to indicate delete is a purge request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String workspaceName, Context context) { - deleteAsync(resourceGroupName, workspaceName, context).block(); + public void delete(String resourceGroupName, String workspaceName, Boolean forceToPurge, Context context) { + deleteAsync(resourceGroupName, workspaceName, forceToPurge, context).block(); } /** * Updates a machine learning workspace with the specified parameters. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param parameters The parameters for updating a machine learning workspace. @@ -955,22 +838,18 @@ public void delete(String resourceGroupName, String workspaceName, Context conte * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an object that represents a machine learning workspace along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String workspaceName, WorkspaceUpdateParameters parameters) { + private Mono>> updateWithResponseAsync(String resourceGroupName, String workspaceName, + WorkspaceUpdateParametersInner parameters) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -986,24 +865,14 @@ private Mono>> updateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - parameters, - accept, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Updates a machine learning workspace with the specified parameters. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param parameters The parameters for updating a machine learning workspace. @@ -1012,22 +881,18 @@ private Mono>> updateWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an object that represents a machine learning workspace along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String workspaceName, WorkspaceUpdateParameters parameters, Context context) { + private Mono>> updateWithResponseAsync(String resourceGroupName, String workspaceName, + WorkspaceUpdateParametersInner parameters, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1043,21 +908,13 @@ private Mono>> updateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - parameters, - accept, - context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, parameters, accept, context); } /** * Updates a machine learning workspace with the specified parameters. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param parameters The parameters for updating a machine learning workspace. @@ -1067,22 +924,16 @@ private Mono>> updateWithResponseAsync( * @return the {@link PollerFlux} for polling of an object that represents a machine learning workspace. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, WorkspaceInner> beginUpdateAsync( - String resourceGroupName, String workspaceName, WorkspaceUpdateParameters parameters) { + private PollerFlux, WorkspaceInner> beginUpdateAsync(String resourceGroupName, + String workspaceName, WorkspaceUpdateParametersInner parameters) { Mono>> mono = updateWithResponseAsync(resourceGroupName, workspaceName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - WorkspaceInner.class, - WorkspaceInner.class, - this.client.getContext()); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + WorkspaceInner.class, WorkspaceInner.class, this.client.getContext()); } /** * Updates a machine learning workspace with the specified parameters. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param parameters The parameters for updating a machine learning workspace. @@ -1093,20 +944,18 @@ private PollerFlux, WorkspaceInner> beginUpdateAsync( * @return the {@link PollerFlux} for polling of an object that represents a machine learning workspace. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, WorkspaceInner> beginUpdateAsync( - String resourceGroupName, String workspaceName, WorkspaceUpdateParameters parameters, Context context) { + private PollerFlux, WorkspaceInner> beginUpdateAsync(String resourceGroupName, + String workspaceName, WorkspaceUpdateParametersInner parameters, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, workspaceName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), WorkspaceInner.class, WorkspaceInner.class, context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, workspaceName, parameters, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + WorkspaceInner.class, WorkspaceInner.class, context); } /** * Updates a machine learning workspace with the specified parameters. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param parameters The parameters for updating a machine learning workspace. @@ -1116,14 +965,14 @@ private PollerFlux, WorkspaceInner> beginUpdateAsync( * @return the {@link SyncPoller} for polling of an object that represents a machine learning workspace. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, WorkspaceInner> beginUpdate( - String resourceGroupName, String workspaceName, WorkspaceUpdateParameters parameters) { + public SyncPoller, WorkspaceInner> beginUpdate(String resourceGroupName, + String workspaceName, WorkspaceUpdateParametersInner parameters) { return this.beginUpdateAsync(resourceGroupName, workspaceName, parameters).getSyncPoller(); } /** * Updates a machine learning workspace with the specified parameters. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param parameters The parameters for updating a machine learning workspace. @@ -1134,14 +983,14 @@ public SyncPoller, WorkspaceInner> beginUpdate( * @return the {@link SyncPoller} for polling of an object that represents a machine learning workspace. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, WorkspaceInner> beginUpdate( - String resourceGroupName, String workspaceName, WorkspaceUpdateParameters parameters, Context context) { + public SyncPoller, WorkspaceInner> beginUpdate(String resourceGroupName, + String workspaceName, WorkspaceUpdateParametersInner parameters, Context context) { return this.beginUpdateAsync(resourceGroupName, workspaceName, parameters, context).getSyncPoller(); } /** * Updates a machine learning workspace with the specified parameters. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param parameters The parameters for updating a machine learning workspace. @@ -1151,16 +1000,15 @@ public SyncPoller, WorkspaceInner> beginUpdate( * @return an object that represents a machine learning workspace on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String workspaceName, WorkspaceUpdateParameters parameters) { - return beginUpdateAsync(resourceGroupName, workspaceName, parameters) - .last() + private Mono updateAsync(String resourceGroupName, String workspaceName, + WorkspaceUpdateParametersInner parameters) { + return beginUpdateAsync(resourceGroupName, workspaceName, parameters).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Updates a machine learning workspace with the specified parameters. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param parameters The parameters for updating a machine learning workspace. @@ -1171,16 +1019,15 @@ private Mono updateAsync( * @return an object that represents a machine learning workspace on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String workspaceName, WorkspaceUpdateParameters parameters, Context context) { - return beginUpdateAsync(resourceGroupName, workspaceName, parameters, context) - .last() + private Mono updateAsync(String resourceGroupName, String workspaceName, + WorkspaceUpdateParametersInner parameters, Context context) { + return beginUpdateAsync(resourceGroupName, workspaceName, parameters, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Updates a machine learning workspace with the specified parameters. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param parameters The parameters for updating a machine learning workspace. @@ -1190,13 +1037,14 @@ private Mono updateAsync( * @return an object that represents a machine learning workspace. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WorkspaceInner update(String resourceGroupName, String workspaceName, WorkspaceUpdateParameters parameters) { + public WorkspaceInner update(String resourceGroupName, String workspaceName, + WorkspaceUpdateParametersInner parameters) { return updateAsync(resourceGroupName, workspaceName, parameters).block(); } /** * Updates a machine learning workspace with the specified parameters. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param parameters The parameters for updating a machine learning workspace. @@ -1207,36 +1055,32 @@ public WorkspaceInner update(String resourceGroupName, String workspaceName, Wor * @return an object that represents a machine learning workspace. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WorkspaceInner update( - String resourceGroupName, String workspaceName, WorkspaceUpdateParameters parameters, Context context) { + public WorkspaceInner update(String resourceGroupName, String workspaceName, + WorkspaceUpdateParametersInner parameters, Context context) { return updateAsync(resourceGroupName, workspaceName, parameters, context).block(); } /** * Lists all the available machine learning workspaces under the specified resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param skip Continuation token for pagination. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the result of a request to list machine learning workspaces along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, String skip) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + String skip) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1244,32 +1088,16 @@ private Mono> listByResourceGroupSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - skip, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, skip, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Lists all the available machine learning workspaces under the specified resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param skip Continuation token for pagination. * @param context The context to associate with this operation. @@ -1277,22 +1105,18 @@ private Mono> listByResourceGroupSinglePageAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the result of a request to list machine learning workspaces along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, String skip, Context context) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + String skip, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1301,28 +1125,15 @@ private Mono> listByResourceGroupSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - skip, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, skip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Lists all the available machine learning workspaces under the specified resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param skip Continuation token for pagination. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1332,14 +1143,13 @@ private Mono> listByResourceGroupSinglePageAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, String skip) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, skip), + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, skip), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** * Lists all the available machine learning workspaces under the specified resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1349,14 +1159,13 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupN @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { final String skip = null; - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, skip), + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, skip), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** * Lists all the available machine learning workspaces under the specified resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param skip Continuation token for pagination. * @param context The context to associate with this operation. @@ -1367,20 +1176,19 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupN */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, String skip, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, skip, context), + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, skip, context), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } /** * Lists all the available machine learning workspaces under the specified resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list machine learning workspaces as paginated response with {@link - * PagedIterable}. + * @return the result of a request to list machine learning workspaces as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -1390,15 +1198,15 @@ public PagedIterable listByResourceGroup(String resourceGroupNam /** * Lists all the available machine learning workspaces under the specified resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param skip Continuation token for pagination. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list machine learning workspaces as paginated response with {@link - * PagedIterable}. + * @return the result of a request to list machine learning workspaces as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, String skip, Context context) { @@ -1407,7 +1215,7 @@ public PagedIterable listByResourceGroup(String resourceGroupNam /** * Diagnose workspace setup issue. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param parameters The parameter of diagnosing workspace health. @@ -1417,19 +1225,15 @@ public PagedIterable listByResourceGroup(String resourceGroupNam * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> diagnoseWithResponseAsync( - String resourceGroupName, String workspaceName, DiagnoseWorkspaceParameters parameters) { + private Mono>> diagnoseWithResponseAsync(String resourceGroupName, String workspaceName, + DiagnoseWorkspaceParameters parameters) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1443,24 +1247,14 @@ private Mono>> diagnoseWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .diagnose( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - this.client.getApiVersion(), - parameters, - accept, - context)) + .withContext(context -> service.diagnose(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Diagnose workspace setup issue. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param parameters The parameter of diagnosing workspace health. @@ -1471,19 +1265,15 @@ private Mono>> diagnoseWithResponseAsync( * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> diagnoseWithResponseAsync( - String resourceGroupName, String workspaceName, DiagnoseWorkspaceParameters parameters, Context context) { + private Mono>> diagnoseWithResponseAsync(String resourceGroupName, String workspaceName, + DiagnoseWorkspaceParameters parameters, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1497,21 +1287,13 @@ private Mono>> diagnoseWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .diagnose( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - this.client.getApiVersion(), - parameters, - accept, - context); + return service.diagnose(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), parameters, accept, context); } /** * Diagnose workspace setup issue. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param parameters The parameter of diagnosing workspace health. @@ -1521,22 +1303,17 @@ private Mono>> diagnoseWithResponseAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DiagnoseResponseResultInner> beginDiagnoseAsync( - String resourceGroupName, String workspaceName, DiagnoseWorkspaceParameters parameters) { + private PollerFlux, DiagnoseResponseResultInner> + beginDiagnoseAsync(String resourceGroupName, String workspaceName, DiagnoseWorkspaceParameters parameters) { Mono>> mono = diagnoseWithResponseAsync(resourceGroupName, workspaceName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DiagnoseResponseResultInner.class, - DiagnoseResponseResultInner.class, - this.client.getContext()); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), DiagnoseResponseResultInner.class, DiagnoseResponseResultInner.class, + this.client.getContext()); } /** * Diagnose workspace setup issue. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1545,23 +1322,18 @@ private PollerFlux, DiagnoseResponseResu * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DiagnoseResponseResultInner> beginDiagnoseAsync( - String resourceGroupName, String workspaceName) { + private PollerFlux, DiagnoseResponseResultInner> + beginDiagnoseAsync(String resourceGroupName, String workspaceName) { final DiagnoseWorkspaceParameters parameters = null; Mono>> mono = diagnoseWithResponseAsync(resourceGroupName, workspaceName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DiagnoseResponseResultInner.class, - DiagnoseResponseResultInner.class, - this.client.getContext()); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), DiagnoseResponseResultInner.class, DiagnoseResponseResultInner.class, + this.client.getContext()); } /** * Diagnose workspace setup issue. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param parameters The parameter of diagnosing workspace health. @@ -1575,21 +1347,16 @@ private PollerFlux, DiagnoseResponseResu private PollerFlux, DiagnoseResponseResultInner> beginDiagnoseAsync( String resourceGroupName, String workspaceName, DiagnoseWorkspaceParameters parameters, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - diagnoseWithResponseAsync(resourceGroupName, workspaceName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DiagnoseResponseResultInner.class, - DiagnoseResponseResultInner.class, - context); + Mono>> mono + = diagnoseWithResponseAsync(resourceGroupName, workspaceName, parameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), DiagnoseResponseResultInner.class, DiagnoseResponseResultInner.class, + context); } /** * Diagnose workspace setup issue. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1598,15 +1365,15 @@ private PollerFlux, DiagnoseResponseResu * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DiagnoseResponseResultInner> beginDiagnose( - String resourceGroupName, String workspaceName) { + public SyncPoller, DiagnoseResponseResultInner> + beginDiagnose(String resourceGroupName, String workspaceName) { final DiagnoseWorkspaceParameters parameters = null; return this.beginDiagnoseAsync(resourceGroupName, workspaceName, parameters).getSyncPoller(); } /** * Diagnose workspace setup issue. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param parameters The parameter of diagnosing workspace health. @@ -1624,7 +1391,7 @@ public SyncPoller, DiagnoseResponseResul /** * Diagnose workspace setup issue. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param parameters The parameter of diagnosing workspace health. @@ -1634,16 +1401,15 @@ public SyncPoller, DiagnoseResponseResul * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono diagnoseAsync( - String resourceGroupName, String workspaceName, DiagnoseWorkspaceParameters parameters) { - return beginDiagnoseAsync(resourceGroupName, workspaceName, parameters) - .last() + private Mono diagnoseAsync(String resourceGroupName, String workspaceName, + DiagnoseWorkspaceParameters parameters) { + return beginDiagnoseAsync(resourceGroupName, workspaceName, parameters).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Diagnose workspace setup issue. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1654,14 +1420,13 @@ private Mono diagnoseAsync( @ServiceMethod(returns = ReturnType.SINGLE) private Mono diagnoseAsync(String resourceGroupName, String workspaceName) { final DiagnoseWorkspaceParameters parameters = null; - return beginDiagnoseAsync(resourceGroupName, workspaceName, parameters) - .last() + return beginDiagnoseAsync(resourceGroupName, workspaceName, parameters).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Diagnose workspace setup issue. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param parameters The parameter of diagnosing workspace health. @@ -1672,16 +1437,15 @@ private Mono diagnoseAsync(String resourceGroupName * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono diagnoseAsync( - String resourceGroupName, String workspaceName, DiagnoseWorkspaceParameters parameters, Context context) { - return beginDiagnoseAsync(resourceGroupName, workspaceName, parameters, context) - .last() + private Mono diagnoseAsync(String resourceGroupName, String workspaceName, + DiagnoseWorkspaceParameters parameters, Context context) { + return beginDiagnoseAsync(resourceGroupName, workspaceName, parameters, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Diagnose workspace setup issue. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1697,7 +1461,7 @@ public DiagnoseResponseResultInner diagnose(String resourceGroupName, String wor /** * Diagnose workspace setup issue. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param parameters The parameter of diagnosing workspace health. @@ -1708,15 +1472,15 @@ public DiagnoseResponseResultInner diagnose(String resourceGroupName, String wor * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DiagnoseResponseResultInner diagnose( - String resourceGroupName, String workspaceName, DiagnoseWorkspaceParameters parameters, Context context) { + public DiagnoseResponseResultInner diagnose(String resourceGroupName, String workspaceName, + DiagnoseWorkspaceParameters parameters, Context context) { return diagnoseAsync(resourceGroupName, workspaceName, parameters, context).block(); } /** * Lists all the keys associated with this workspace. This includes keys for the storage account, app insights and * password for container registry. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1725,19 +1489,15 @@ public DiagnoseResponseResultInner diagnose( * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeysWithResponseAsync( - String resourceGroupName, String workspaceName) { + private Mono> listKeysWithResponseAsync(String resourceGroupName, + String workspaceName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1748,24 +1508,15 @@ private Mono> listKeysWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listKeys( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - accept, - context)) + .withContext(context -> service.listKeys(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Lists all the keys associated with this workspace. This includes keys for the storage account, app insights and * password for container registry. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -1775,19 +1526,15 @@ private Mono> listKeysWithResponseAsync( * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeysWithResponseAsync( - String resourceGroupName, String workspaceName, Context context) { + private Mono> listKeysWithResponseAsync(String resourceGroupName, + String workspaceName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1798,21 +1545,14 @@ private Mono> listKeysWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listKeys( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - accept, - context); + return service.listKeys(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, accept, context); } /** * Lists all the keys associated with this workspace. This includes keys for the storage account, app insights and * password for container registry. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1829,7 +1569,7 @@ private Mono listKeysAsync(String resourceGroupNam /** * Lists all the keys associated with this workspace. This includes keys for the storage account, app insights and * password for container registry. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -1839,15 +1579,15 @@ private Mono listKeysAsync(String resourceGroupNam * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listKeysWithResponse( - String resourceGroupName, String workspaceName, Context context) { + public Response listKeysWithResponse(String resourceGroupName, String workspaceName, + Context context) { return listKeysWithResponseAsync(resourceGroupName, workspaceName, context).block(); } /** * Lists all the keys associated with this workspace. This includes keys for the storage account, app insights and * password for container registry. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1863,7 +1603,7 @@ public ListWorkspaceKeysResultInner listKeys(String resourceGroupName, String wo /** * Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and * password for container registry. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1872,19 +1612,15 @@ public ListWorkspaceKeysResultInner listKeys(String resourceGroupName, String wo * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> resyncKeysWithResponseAsync( - String resourceGroupName, String workspaceName) { + private Mono>> resyncKeysWithResponseAsync(String resourceGroupName, + String workspaceName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1895,24 +1631,15 @@ private Mono>> resyncKeysWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .resyncKeys( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - accept, - context)) + .withContext(context -> service.resyncKeys(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and * password for container registry. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -1922,19 +1649,15 @@ private Mono>> resyncKeysWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> resyncKeysWithResponseAsync( - String resourceGroupName, String workspaceName, Context context) { + private Mono>> resyncKeysWithResponseAsync(String resourceGroupName, String workspaceName, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1945,21 +1668,14 @@ private Mono>> resyncKeysWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .resyncKeys( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - accept, - context); + return service.resyncKeys(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context); } /** * Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and * password for container registry. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1970,16 +1686,14 @@ private Mono>> resyncKeysWithResponseAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginResyncKeysAsync(String resourceGroupName, String workspaceName) { Mono>> mono = resyncKeysWithResponseAsync(resourceGroupName, workspaceName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and * password for container registry. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -1989,19 +1703,18 @@ private PollerFlux, Void> beginResyncKeysAsync(String resourceG * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginResyncKeysAsync( - String resourceGroupName, String workspaceName, Context context) { + private PollerFlux, Void> beginResyncKeysAsync(String resourceGroupName, String workspaceName, + Context context) { context = this.client.mergeContext(context); Mono>> mono = resyncKeysWithResponseAsync(resourceGroupName, workspaceName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** * Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and * password for container registry. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2017,7 +1730,7 @@ public SyncPoller, Void> beginResyncKeys(String resourceGroupNa /** * Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and * password for container registry. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -2027,15 +1740,15 @@ public SyncPoller, Void> beginResyncKeys(String resourceGroupNa * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginResyncKeys( - String resourceGroupName, String workspaceName, Context context) { + public SyncPoller, Void> beginResyncKeys(String resourceGroupName, String workspaceName, + Context context) { return this.beginResyncKeysAsync(resourceGroupName, workspaceName, context).getSyncPoller(); } /** * Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and * password for container registry. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2045,15 +1758,14 @@ public SyncPoller, Void> beginResyncKeys( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono resyncKeysAsync(String resourceGroupName, String workspaceName) { - return beginResyncKeysAsync(resourceGroupName, workspaceName) - .last() + return beginResyncKeysAsync(resourceGroupName, workspaceName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and * password for container registry. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -2064,15 +1776,14 @@ private Mono resyncKeysAsync(String resourceGroupName, String workspaceNam */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono resyncKeysAsync(String resourceGroupName, String workspaceName, Context context) { - return beginResyncKeysAsync(resourceGroupName, workspaceName, context) - .last() + return beginResyncKeysAsync(resourceGroupName, workspaceName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and * password for container registry. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2087,7 +1798,7 @@ public void resyncKeys(String resourceGroupName, String workspaceName) { /** * Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and * password for container registry. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -2102,101 +1813,66 @@ public void resyncKeys(String resourceGroupName, String workspaceName, Context c /** * Lists all the available machine learning workspaces under the specified subscription. - * + * * @param skip Continuation token for pagination. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the result of a request to list machine learning workspaces along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String skip) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - skip, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), skip, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Lists all the available machine learning workspaces under the specified subscription. - * + * * @param skip Continuation token for pagination. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the result of a request to list machine learning workspaces along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String skip, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - skip, - accept, + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), skip, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Lists all the available machine learning workspaces under the specified subscription. - * + * * @param skip Continuation token for pagination. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2205,13 +1881,13 @@ private Mono> listSinglePageAsync(String skip, Con */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String skip) { - return new PagedFlux<>( - () -> listSinglePageAsync(skip), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(skip), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** * Lists all the available machine learning workspaces under the specified subscription. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the result of a request to list machine learning workspaces as paginated response with {@link PagedFlux}. @@ -2219,13 +1895,13 @@ private PagedFlux listAsync(String skip) { @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { final String skip = null; - return new PagedFlux<>( - () -> listSinglePageAsync(skip), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(skip), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** * Lists all the available machine learning workspaces under the specified subscription. - * + * * @param skip Continuation token for pagination. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2235,18 +1911,17 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String skip, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(skip, context), + return new PagedFlux<>(() -> listSinglePageAsync(skip, context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); } /** * Lists all the available machine learning workspaces under the specified subscription. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list machine learning workspaces as paginated response with {@link - * PagedIterable}. + * @return the result of a request to list machine learning workspaces as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -2256,14 +1931,14 @@ public PagedIterable list() { /** * Lists all the available machine learning workspaces under the specified subscription. - * + * * @param skip Continuation token for pagination. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list machine learning workspaces as paginated response with {@link - * PagedIterable}. + * @return the result of a request to list machine learning workspaces as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String skip, Context context) { @@ -2272,7 +1947,7 @@ public PagedIterable list(String skip, Context context) { /** * return notebook access token and refresh token. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2281,19 +1956,15 @@ public PagedIterable list(String skip, Context context) { * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNotebookAccessTokenWithResponseAsync( - String resourceGroupName, String workspaceName) { + private Mono> + listNotebookAccessTokenWithResponseAsync(String resourceGroupName, String workspaceName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2305,22 +1976,14 @@ private Mono> listNotebookAccessTokenWi final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .listNotebookAccessToken( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - accept, - context)) + context -> service.listNotebookAccessToken(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * return notebook access token and refresh token. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -2330,19 +1993,15 @@ private Mono> listNotebookAccessTokenWi * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNotebookAccessTokenWithResponseAsync( - String resourceGroupName, String workspaceName, Context context) { + private Mono> + listNotebookAccessTokenWithResponseAsync(String resourceGroupName, String workspaceName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2353,20 +2012,13 @@ private Mono> listNotebookAccessTokenWi } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNotebookAccessToken( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - accept, - context); + return service.listNotebookAccessToken(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context); } /** * return notebook access token and refresh token. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2375,15 +2027,15 @@ private Mono> listNotebookAccessTokenWi * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listNotebookAccessTokenAsync( - String resourceGroupName, String workspaceName) { + private Mono listNotebookAccessTokenAsync(String resourceGroupName, + String workspaceName) { return listNotebookAccessTokenWithResponseAsync(resourceGroupName, workspaceName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * return notebook access token and refresh token. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -2393,14 +2045,14 @@ private Mono listNotebookAccessTokenAsync( * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listNotebookAccessTokenWithResponse( - String resourceGroupName, String workspaceName, Context context) { + public Response listNotebookAccessTokenWithResponse(String resourceGroupName, + String workspaceName, Context context) { return listNotebookAccessTokenWithResponseAsync(resourceGroupName, workspaceName, context).block(); } /** * return notebook access token and refresh token. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2415,7 +2067,7 @@ public NotebookAccessTokenResultInner listNotebookAccessToken(String resourceGro /** * Prepare a notebook. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2424,19 +2076,15 @@ public NotebookAccessTokenResultInner listNotebookAccessToken(String resourceGro * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> prepareNotebookWithResponseAsync( - String resourceGroupName, String workspaceName) { + private Mono>> prepareNotebookWithResponseAsync(String resourceGroupName, + String workspaceName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2447,23 +2095,14 @@ private Mono>> prepareNotebookWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .prepareNotebook( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - accept, - context)) + .withContext(context -> service.prepareNotebook(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Prepare a notebook. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -2473,19 +2112,15 @@ private Mono>> prepareNotebookWithResponseAsync( * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> prepareNotebookWithResponseAsync( - String resourceGroupName, String workspaceName, Context context) { + private Mono>> prepareNotebookWithResponseAsync(String resourceGroupName, + String workspaceName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2496,20 +2131,13 @@ private Mono>> prepareNotebookWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .prepareNotebook( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - accept, - context); + return service.prepareNotebook(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context); } /** * Prepare a notebook. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2518,22 +2146,17 @@ private Mono>> prepareNotebookWithResponseAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, NotebookResourceInfoInner> beginPrepareNotebookAsync( - String resourceGroupName, String workspaceName) { + private PollerFlux, NotebookResourceInfoInner> + beginPrepareNotebookAsync(String resourceGroupName, String workspaceName) { Mono>> mono = prepareNotebookWithResponseAsync(resourceGroupName, workspaceName); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - NotebookResourceInfoInner.class, - NotebookResourceInfoInner.class, - this.client.getContext()); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), NotebookResourceInfoInner.class, NotebookResourceInfoInner.class, + this.client.getContext()); } /** * Prepare a notebook. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -2543,24 +2166,18 @@ private PollerFlux, NotebookResourceInfoIn * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, NotebookResourceInfoInner> beginPrepareNotebookAsync( - String resourceGroupName, String workspaceName, Context context) { + private PollerFlux, NotebookResourceInfoInner> + beginPrepareNotebookAsync(String resourceGroupName, String workspaceName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - prepareNotebookWithResponseAsync(resourceGroupName, workspaceName, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - NotebookResourceInfoInner.class, - NotebookResourceInfoInner.class, - context); + Mono>> mono + = prepareNotebookWithResponseAsync(resourceGroupName, workspaceName, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), NotebookResourceInfoInner.class, NotebookResourceInfoInner.class, context); } /** * Prepare a notebook. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2569,14 +2186,14 @@ private PollerFlux, NotebookResourceInfoIn * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, NotebookResourceInfoInner> beginPrepareNotebook( - String resourceGroupName, String workspaceName) { + public SyncPoller, NotebookResourceInfoInner> + beginPrepareNotebook(String resourceGroupName, String workspaceName) { return this.beginPrepareNotebookAsync(resourceGroupName, workspaceName).getSyncPoller(); } /** * Prepare a notebook. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -2586,14 +2203,14 @@ public SyncPoller, NotebookResourceInfoInn * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, NotebookResourceInfoInner> beginPrepareNotebook( - String resourceGroupName, String workspaceName, Context context) { + public SyncPoller, NotebookResourceInfoInner> + beginPrepareNotebook(String resourceGroupName, String workspaceName, Context context) { return this.beginPrepareNotebookAsync(resourceGroupName, workspaceName, context).getSyncPoller(); } /** * Prepare a notebook. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2603,14 +2220,13 @@ public SyncPoller, NotebookResourceInfoInn */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono prepareNotebookAsync(String resourceGroupName, String workspaceName) { - return beginPrepareNotebookAsync(resourceGroupName, workspaceName) - .last() + return beginPrepareNotebookAsync(resourceGroupName, workspaceName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Prepare a notebook. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -2620,16 +2236,15 @@ private Mono prepareNotebookAsync(String resourceGrou * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono prepareNotebookAsync( - String resourceGroupName, String workspaceName, Context context) { - return beginPrepareNotebookAsync(resourceGroupName, workspaceName, context) - .last() + private Mono prepareNotebookAsync(String resourceGroupName, String workspaceName, + Context context) { + return beginPrepareNotebookAsync(resourceGroupName, workspaceName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Prepare a notebook. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2644,7 +2259,7 @@ public NotebookResourceInfoInner prepareNotebook(String resourceGroupName, Strin /** * Prepare a notebook. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -2660,7 +2275,7 @@ public NotebookResourceInfoInner prepareNotebook(String resourceGroupName, Strin /** * List storage account keys of a workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2669,19 +2284,15 @@ public NotebookResourceInfoInner prepareNotebook(String resourceGroupName, Strin * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listStorageAccountKeysWithResponseAsync( - String resourceGroupName, String workspaceName) { + private Mono> + listStorageAccountKeysWithResponseAsync(String resourceGroupName, String workspaceName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2693,22 +2304,14 @@ private Mono> listStorageAccountKeys final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .listStorageAccountKeys( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - accept, - context)) + context -> service.listStorageAccountKeys(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List storage account keys of a workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -2718,19 +2321,15 @@ private Mono> listStorageAccountKeys * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listStorageAccountKeysWithResponseAsync( - String resourceGroupName, String workspaceName, Context context) { + private Mono> + listStorageAccountKeysWithResponseAsync(String resourceGroupName, String workspaceName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2741,20 +2340,13 @@ private Mono> listStorageAccountKeys } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listStorageAccountKeys( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - accept, - context); + return service.listStorageAccountKeys(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context); } /** * List storage account keys of a workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2763,15 +2355,15 @@ private Mono> listStorageAccountKeys * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listStorageAccountKeysAsync( - String resourceGroupName, String workspaceName) { + private Mono listStorageAccountKeysAsync(String resourceGroupName, + String workspaceName) { return listStorageAccountKeysWithResponseAsync(resourceGroupName, workspaceName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * List storage account keys of a workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -2781,14 +2373,14 @@ private Mono listStorageAccountKeysAsync( * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listStorageAccountKeysWithResponse( - String resourceGroupName, String workspaceName, Context context) { + public Response listStorageAccountKeysWithResponse(String resourceGroupName, + String workspaceName, Context context) { return listStorageAccountKeysWithResponseAsync(resourceGroupName, workspaceName, context).block(); } /** * List storage account keys of a workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2803,7 +2395,7 @@ public ListStorageAccountKeysResultInner listStorageAccountKeys(String resourceG /** * List keys of a notebook. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2812,19 +2404,15 @@ public ListStorageAccountKeysResultInner listStorageAccountKeys(String resourceG * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNotebookKeysWithResponseAsync( - String resourceGroupName, String workspaceName) { + private Mono> listNotebookKeysWithResponseAsync(String resourceGroupName, + String workspaceName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2835,23 +2423,14 @@ private Mono> listNotebookKeysWithResponse } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listNotebookKeys( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - accept, - context)) + .withContext(context -> service.listNotebookKeys(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List keys of a notebook. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -2861,19 +2440,15 @@ private Mono> listNotebookKeysWithResponse * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNotebookKeysWithResponseAsync( - String resourceGroupName, String workspaceName, Context context) { + private Mono> listNotebookKeysWithResponseAsync(String resourceGroupName, + String workspaceName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2884,20 +2459,13 @@ private Mono> listNotebookKeysWithResponse } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNotebookKeys( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - accept, - context); + return service.listNotebookKeys(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context); } /** * List keys of a notebook. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2913,7 +2481,7 @@ private Mono listNotebookKeysAsync(String resourceG /** * List keys of a notebook. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -2923,14 +2491,14 @@ private Mono listNotebookKeysAsync(String resourceG * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listNotebookKeysWithResponse( - String resourceGroupName, String workspaceName, Context context) { + public Response listNotebookKeysWithResponse(String resourceGroupName, + String workspaceName, Context context) { return listNotebookKeysWithResponseAsync(resourceGroupName, workspaceName, context).block(); } /** * List keys of a notebook. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2945,7 +2513,7 @@ public ListNotebookKeysResultInner listNotebookKeys(String resourceGroupName, St /** * Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2954,19 +2522,15 @@ public ListNotebookKeysResultInner listNotebookKeys(String resourceGroupName, St * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOutboundNetworkDependenciesEndpointsWithResponseAsync( - String resourceGroupName, String workspaceName) { + private Mono> + listOutboundNetworkDependenciesEndpointsWithResponseAsync(String resourceGroupName, String workspaceName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2977,23 +2541,15 @@ private Mono> listOutboundNetworkDependencie } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listOutboundNetworkDependenciesEndpoints( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.listOutboundNetworkDependenciesEndpoints(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, this.client.getApiVersion(), accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -3006,16 +2562,12 @@ private Mono> listOutboundNetworkDependencie private Mono> listOutboundNetworkDependenciesEndpointsWithResponseAsync( String resourceGroupName, String workspaceName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3026,20 +2578,14 @@ private Mono> listOutboundNetworkDependencie } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listOutboundNetworkDependenciesEndpoints( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - this.client.getApiVersion(), - accept, - context); + return service.listOutboundNetworkDependenciesEndpoints(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, this.client.getApiVersion(), accept, + context); } /** * Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3048,15 +2594,15 @@ private Mono> listOutboundNetworkDependencie * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listOutboundNetworkDependenciesEndpointsAsync( - String resourceGroupName, String workspaceName) { + private Mono listOutboundNetworkDependenciesEndpointsAsync(String resourceGroupName, + String workspaceName) { return listOutboundNetworkDependenciesEndpointsWithResponseAsync(resourceGroupName, workspaceName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -3074,7 +2620,7 @@ public Response listOutboundNetworkDependenciesEndpoi /** * Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3083,22 +2629,21 @@ public Response listOutboundNetworkDependenciesEndpoi * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ExternalFqdnResponseInner listOutboundNetworkDependenciesEndpoints( - String resourceGroupName, String workspaceName) { + public ExternalFqdnResponseInner listOutboundNetworkDependenciesEndpoints(String resourceGroupName, + String workspaceName) { return listOutboundNetworkDependenciesEndpointsWithResponse(resourceGroupName, workspaceName, Context.NONE) .getValue(); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the result of a request to list machine learning workspaces along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -3106,76 +2651,55 @@ private Mono> listByResourceGroupNextSinglePageAsy return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the result of a request to list machine learning workspaces along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the result of a request to list machine learning workspaces along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { @@ -3183,63 +2707,43 @@ private Mono> listBySubscriptionNextSinglePageAsyn return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the result of a request to list machine learning workspaces along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspacesImpl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspacesImpl.java index 75bd16e0e6576..380278379945f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspacesImpl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/WorkspacesImpl.java @@ -36,21 +36,18 @@ public final class WorkspacesImpl implements Workspaces { private final com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager; - public WorkspacesImpl( - WorkspacesClient innerClient, com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { + public WorkspacesImpl(WorkspacesClient innerClient, + com.azure.resourcemanager.machinelearning.MachineLearningManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public Response getByResourceGroupWithResponse( - String resourceGroupName, String workspaceName, Context context) { - Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, workspaceName, context); + public Response getByResourceGroupWithResponse(String resourceGroupName, String workspaceName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, workspaceName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new WorkspaceImpl(inner.getValue(), this.manager())); } else { return null; @@ -66,23 +63,23 @@ public Workspace getByResourceGroup(String resourceGroupName, String workspaceNa } } - public void deleteByResourceGroup(String resourceGroupName, String workspaceName) { + public void delete(String resourceGroupName, String workspaceName) { this.serviceClient().delete(resourceGroupName, workspaceName); } - public void delete(String resourceGroupName, String workspaceName, Context context) { - this.serviceClient().delete(resourceGroupName, workspaceName, context); + public void delete(String resourceGroupName, String workspaceName, Boolean forceToPurge, Context context) { + this.serviceClient().delete(resourceGroupName, workspaceName, forceToPurge, context); } public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName, String skip, Context context) { - PagedIterable inner = - this.serviceClient().listByResourceGroup(resourceGroupName, skip, context); - return Utils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, skip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); } public DiagnoseResponseResult diagnose(String resourceGroupName, String workspaceName) { @@ -94,10 +91,10 @@ public DiagnoseResponseResult diagnose(String resourceGroupName, String workspac } } - public DiagnoseResponseResult diagnose( - String resourceGroupName, String workspaceName, DiagnoseWorkspaceParameters parameters, Context context) { - DiagnoseResponseResultInner inner = - this.serviceClient().diagnose(resourceGroupName, workspaceName, parameters, context); + public DiagnoseResponseResult diagnose(String resourceGroupName, String workspaceName, + DiagnoseWorkspaceParameters parameters, Context context) { + DiagnoseResponseResultInner inner + = this.serviceClient().diagnose(resourceGroupName, workspaceName, parameters, context); if (inner != null) { return new DiagnoseResponseResultImpl(inner, this.manager()); } else { @@ -105,15 +102,12 @@ public DiagnoseResponseResult diagnose( } } - public Response listKeysWithResponse( - String resourceGroupName, String workspaceName, Context context) { - Response inner = - this.serviceClient().listKeysWithResponse(resourceGroupName, workspaceName, context); + public Response listKeysWithResponse(String resourceGroupName, String workspaceName, + Context context) { + Response inner + = this.serviceClient().listKeysWithResponse(resourceGroupName, workspaceName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ListWorkspaceKeysResultImpl(inner.getValue(), this.manager())); } else { return null; @@ -139,23 +133,20 @@ public void resyncKeys(String resourceGroupName, String workspaceName, Context c public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); } public PagedIterable list(String skip, Context context) { PagedIterable inner = this.serviceClient().list(skip, context); - return Utils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); } - public Response listNotebookAccessTokenWithResponse( - String resourceGroupName, String workspaceName, Context context) { - Response inner = - this.serviceClient().listNotebookAccessTokenWithResponse(resourceGroupName, workspaceName, context); + public Response listNotebookAccessTokenWithResponse(String resourceGroupName, + String workspaceName, Context context) { + Response inner + = this.serviceClient().listNotebookAccessTokenWithResponse(resourceGroupName, workspaceName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new NotebookAccessTokenResultImpl(inner.getValue(), this.manager())); } else { return null; @@ -163,8 +154,8 @@ public Response listNotebookAccessTokenWithResponse( } public NotebookAccessTokenResult listNotebookAccessToken(String resourceGroupName, String workspaceName) { - NotebookAccessTokenResultInner inner = - this.serviceClient().listNotebookAccessToken(resourceGroupName, workspaceName); + NotebookAccessTokenResultInner inner + = this.serviceClient().listNotebookAccessToken(resourceGroupName, workspaceName); if (inner != null) { return new NotebookAccessTokenResultImpl(inner, this.manager()); } else { @@ -182,8 +173,8 @@ public NotebookResourceInfo prepareNotebook(String resourceGroupName, String wor } public NotebookResourceInfo prepareNotebook(String resourceGroupName, String workspaceName, Context context) { - NotebookResourceInfoInner inner = - this.serviceClient().prepareNotebook(resourceGroupName, workspaceName, context); + NotebookResourceInfoInner inner + = this.serviceClient().prepareNotebook(resourceGroupName, workspaceName, context); if (inner != null) { return new NotebookResourceInfoImpl(inner, this.manager()); } else { @@ -191,15 +182,12 @@ public NotebookResourceInfo prepareNotebook(String resourceGroupName, String wor } } - public Response listStorageAccountKeysWithResponse( - String resourceGroupName, String workspaceName, Context context) { - Response inner = - this.serviceClient().listStorageAccountKeysWithResponse(resourceGroupName, workspaceName, context); + public Response listStorageAccountKeysWithResponse(String resourceGroupName, + String workspaceName, Context context) { + Response inner + = this.serviceClient().listStorageAccountKeysWithResponse(resourceGroupName, workspaceName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ListStorageAccountKeysResultImpl(inner.getValue(), this.manager())); } else { return null; @@ -207,8 +195,8 @@ public Response listStorageAccountKeysWithResponse } public ListStorageAccountKeysResult listStorageAccountKeys(String resourceGroupName, String workspaceName) { - ListStorageAccountKeysResultInner inner = - this.serviceClient().listStorageAccountKeys(resourceGroupName, workspaceName); + ListStorageAccountKeysResultInner inner + = this.serviceClient().listStorageAccountKeys(resourceGroupName, workspaceName); if (inner != null) { return new ListStorageAccountKeysResultImpl(inner, this.manager()); } else { @@ -216,15 +204,12 @@ public ListStorageAccountKeysResult listStorageAccountKeys(String resourceGroupN } } - public Response listNotebookKeysWithResponse( - String resourceGroupName, String workspaceName, Context context) { - Response inner = - this.serviceClient().listNotebookKeysWithResponse(resourceGroupName, workspaceName, context); + public Response listNotebookKeysWithResponse(String resourceGroupName, String workspaceName, + Context context) { + Response inner + = this.serviceClient().listNotebookKeysWithResponse(resourceGroupName, workspaceName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ListNotebookKeysResultImpl(inner.getValue(), this.manager())); } else { return null; @@ -240,27 +225,22 @@ public ListNotebookKeysResult listNotebookKeys(String resourceGroupName, String } } - public Response listOutboundNetworkDependenciesEndpointsWithResponse( - String resourceGroupName, String workspaceName, Context context) { - Response inner = - this - .serviceClient() - .listOutboundNetworkDependenciesEndpointsWithResponse(resourceGroupName, workspaceName, context); + public Response listOutboundNetworkDependenciesEndpointsWithResponse(String resourceGroupName, + String workspaceName, Context context) { + Response inner = this.serviceClient() + .listOutboundNetworkDependenciesEndpointsWithResponse(resourceGroupName, workspaceName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ExternalFqdnResponseImpl(inner.getValue(), this.manager())); } else { return null; } } - public ExternalFqdnResponse listOutboundNetworkDependenciesEndpoints( - String resourceGroupName, String workspaceName) { - ExternalFqdnResponseInner inner = - this.serviceClient().listOutboundNetworkDependenciesEndpoints(resourceGroupName, workspaceName); + public ExternalFqdnResponse listOutboundNetworkDependenciesEndpoints(String resourceGroupName, + String workspaceName) { + ExternalFqdnResponseInner inner + = this.serviceClient().listOutboundNetworkDependenciesEndpoints(resourceGroupName, workspaceName); if (inner != null) { return new ExternalFqdnResponseImpl(inner, this.manager()); } else { @@ -269,79 +249,60 @@ public ExternalFqdnResponse listOutboundNetworkDependenciesEndpoints( } public Workspace getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, workspaceName, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, workspaceName, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - this.delete(resourceGroupName, workspaceName, Context.NONE); + Boolean localForceToPurge = null; + this.delete(resourceGroupName, workspaceName, localForceToPurge, Context.NONE); } - public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + public void deleteByIdWithResponse(String id, Boolean forceToPurge, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - this.delete(resourceGroupName, workspaceName, context); + this.delete(resourceGroupName, workspaceName, forceToPurge, context); } private WorkspacesClient serviceClient() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/package-info.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/package-info.java index d69c58716f983..493a1fefe775c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/package-info.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/implementation/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the implementations for AzureMachineLearningWorkspaces. These APIs allow end users to operate on - * Azure Machine Learning Workspace resources. + * Package containing the implementations for AzureMachineLearningServices. + * These APIs allow end users to operate on Azure Machine Learning Workspace resources. */ package com.azure.resourcemanager.machinelearning.implementation; diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AadAuthTypeWorkspaceConnectionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AadAuthTypeWorkspaceConnectionProperties.java new file mode 100644 index 0000000000000..b9a569dc66e59 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AadAuthTypeWorkspaceConnectionProperties.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; + +/** + * This connection type covers the AAD auth for any applicable Azure service. + */ +@Fluent +public final class AadAuthTypeWorkspaceConnectionProperties extends WorkspaceConnectionPropertiesV2 { + /* + * Authentication type of the connection target + */ + private ConnectionAuthType authType = ConnectionAuthType.AAD; + + /* + * The createdByWorkspaceArmId property. + */ + private String createdByWorkspaceArmId; + + /* + * Group based on connection category + */ + private ConnectionGroup group; + + /** + * Creates an instance of AadAuthTypeWorkspaceConnectionProperties class. + */ + public AadAuthTypeWorkspaceConnectionProperties() { + } + + /** + * Get the authType property: Authentication type of the connection target. + * + * @return the authType value. + */ + @Override + public ConnectionAuthType authType() { + return this.authType; + } + + /** + * Get the createdByWorkspaceArmId property: The createdByWorkspaceArmId property. + * + * @return the createdByWorkspaceArmId value. + */ + @Override + public String createdByWorkspaceArmId() { + return this.createdByWorkspaceArmId; + } + + /** + * Get the group property: Group based on connection category. + * + * @return the group value. + */ + @Override + public ConnectionGroup group() { + return this.group; + } + + /** + * {@inheritDoc} + */ + @Override + public AadAuthTypeWorkspaceConnectionProperties withCategory(ConnectionCategory category) { + super.withCategory(category); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AadAuthTypeWorkspaceConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { + super.withExpiryTime(expiryTime); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AadAuthTypeWorkspaceConnectionProperties withIsSharedToAll(Boolean isSharedToAll) { + super.withIsSharedToAll(isSharedToAll); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AadAuthTypeWorkspaceConnectionProperties withTarget(String target) { + super.withTarget(target); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AadAuthTypeWorkspaceConnectionProperties withMetadata(Map metadata) { + super.withMetadata(metadata); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AadAuthTypeWorkspaceConnectionProperties withSharedUserList(List sharedUserList) { + super.withSharedUserList(sharedUserList); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AadAuthTypeWorkspaceConnectionProperties withValue(String value) { + super.withValue(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AadAuthTypeWorkspaceConnectionProperties withValueFormat(ValueFormat valueFormat) { + super.withValueFormat(valueFormat); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", category() == null ? null : category().toString()); + jsonWriter.writeStringField("expiryTime", + expiryTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expiryTime())); + jsonWriter.writeBooleanField("isSharedToAll", isSharedToAll()); + jsonWriter.writeStringField("target", target()); + jsonWriter.writeMapField("metadata", metadata(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("sharedUserList", sharedUserList(), + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("value", value()); + jsonWriter.writeStringField("valueFormat", valueFormat() == null ? null : valueFormat().toString()); + jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AadAuthTypeWorkspaceConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AadAuthTypeWorkspaceConnectionProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AadAuthTypeWorkspaceConnectionProperties. + */ + public static AadAuthTypeWorkspaceConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AadAuthTypeWorkspaceConnectionProperties deserializedAadAuthTypeWorkspaceConnectionProperties + = new AadAuthTypeWorkspaceConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedAadAuthTypeWorkspaceConnectionProperties + .withCategory(ConnectionCategory.fromString(reader.getString())); + } else if ("createdByWorkspaceArmId".equals(fieldName)) { + deserializedAadAuthTypeWorkspaceConnectionProperties.createdByWorkspaceArmId = reader.getString(); + } else if ("expiryTime".equals(fieldName)) { + deserializedAadAuthTypeWorkspaceConnectionProperties.withExpiryTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("group".equals(fieldName)) { + deserializedAadAuthTypeWorkspaceConnectionProperties.group + = ConnectionGroup.fromString(reader.getString()); + } else if ("isSharedToAll".equals(fieldName)) { + deserializedAadAuthTypeWorkspaceConnectionProperties + .withIsSharedToAll(reader.getNullable(JsonReader::getBoolean)); + } else if ("target".equals(fieldName)) { + deserializedAadAuthTypeWorkspaceConnectionProperties.withTarget(reader.getString()); + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedAadAuthTypeWorkspaceConnectionProperties.withMetadata(metadata); + } else if ("sharedUserList".equals(fieldName)) { + List sharedUserList = reader.readArray(reader1 -> reader1.getString()); + deserializedAadAuthTypeWorkspaceConnectionProperties.withSharedUserList(sharedUserList); + } else if ("value".equals(fieldName)) { + deserializedAadAuthTypeWorkspaceConnectionProperties.withValue(reader.getString()); + } else if ("valueFormat".equals(fieldName)) { + deserializedAadAuthTypeWorkspaceConnectionProperties + .withValueFormat(ValueFormat.fromString(reader.getString())); + } else if ("authType".equals(fieldName)) { + deserializedAadAuthTypeWorkspaceConnectionProperties.authType + = ConnectionAuthType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAadAuthTypeWorkspaceConnectionProperties; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AccessKeyAuthTypeWorkspaceConnectionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AccessKeyAuthTypeWorkspaceConnectionProperties.java new file mode 100644 index 0000000000000..7e2fcbcf6ffb3 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AccessKeyAuthTypeWorkspaceConnectionProperties.java @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; + +/** + * The AccessKeyAuthTypeWorkspaceConnectionProperties model. + */ +@Fluent +public final class AccessKeyAuthTypeWorkspaceConnectionProperties extends WorkspaceConnectionPropertiesV2 { + /* + * Authentication type of the connection target + */ + private ConnectionAuthType authType = ConnectionAuthType.ACCESS_KEY; + + /* + * The credentials property. + */ + private WorkspaceConnectionAccessKey credentials; + + /* + * The createdByWorkspaceArmId property. + */ + private String createdByWorkspaceArmId; + + /* + * Group based on connection category + */ + private ConnectionGroup group; + + /** + * Creates an instance of AccessKeyAuthTypeWorkspaceConnectionProperties class. + */ + public AccessKeyAuthTypeWorkspaceConnectionProperties() { + } + + /** + * Get the authType property: Authentication type of the connection target. + * + * @return the authType value. + */ + @Override + public ConnectionAuthType authType() { + return this.authType; + } + + /** + * Get the credentials property: The credentials property. + * + * @return the credentials value. + */ + public WorkspaceConnectionAccessKey credentials() { + return this.credentials; + } + + /** + * Set the credentials property: The credentials property. + * + * @param credentials the credentials value to set. + * @return the AccessKeyAuthTypeWorkspaceConnectionProperties object itself. + */ + public AccessKeyAuthTypeWorkspaceConnectionProperties withCredentials(WorkspaceConnectionAccessKey credentials) { + this.credentials = credentials; + return this; + } + + /** + * Get the createdByWorkspaceArmId property: The createdByWorkspaceArmId property. + * + * @return the createdByWorkspaceArmId value. + */ + @Override + public String createdByWorkspaceArmId() { + return this.createdByWorkspaceArmId; + } + + /** + * Get the group property: Group based on connection category. + * + * @return the group value. + */ + @Override + public ConnectionGroup group() { + return this.group; + } + + /** + * {@inheritDoc} + */ + @Override + public AccessKeyAuthTypeWorkspaceConnectionProperties withCategory(ConnectionCategory category) { + super.withCategory(category); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccessKeyAuthTypeWorkspaceConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { + super.withExpiryTime(expiryTime); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccessKeyAuthTypeWorkspaceConnectionProperties withIsSharedToAll(Boolean isSharedToAll) { + super.withIsSharedToAll(isSharedToAll); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccessKeyAuthTypeWorkspaceConnectionProperties withTarget(String target) { + super.withTarget(target); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccessKeyAuthTypeWorkspaceConnectionProperties withMetadata(Map metadata) { + super.withMetadata(metadata); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccessKeyAuthTypeWorkspaceConnectionProperties withSharedUserList(List sharedUserList) { + super.withSharedUserList(sharedUserList); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccessKeyAuthTypeWorkspaceConnectionProperties withValue(String value) { + super.withValue(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccessKeyAuthTypeWorkspaceConnectionProperties withValueFormat(ValueFormat valueFormat) { + super.withValueFormat(valueFormat); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (credentials() != null) { + credentials().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", category() == null ? null : category().toString()); + jsonWriter.writeStringField("expiryTime", + expiryTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expiryTime())); + jsonWriter.writeBooleanField("isSharedToAll", isSharedToAll()); + jsonWriter.writeStringField("target", target()); + jsonWriter.writeMapField("metadata", metadata(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("sharedUserList", sharedUserList(), + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("value", value()); + jsonWriter.writeStringField("valueFormat", valueFormat() == null ? null : valueFormat().toString()); + jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); + jsonWriter.writeJsonField("credentials", this.credentials); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccessKeyAuthTypeWorkspaceConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccessKeyAuthTypeWorkspaceConnectionProperties if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AccessKeyAuthTypeWorkspaceConnectionProperties. + */ + public static AccessKeyAuthTypeWorkspaceConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccessKeyAuthTypeWorkspaceConnectionProperties deserializedAccessKeyAuthTypeWorkspaceConnectionProperties + = new AccessKeyAuthTypeWorkspaceConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedAccessKeyAuthTypeWorkspaceConnectionProperties + .withCategory(ConnectionCategory.fromString(reader.getString())); + } else if ("createdByWorkspaceArmId".equals(fieldName)) { + deserializedAccessKeyAuthTypeWorkspaceConnectionProperties.createdByWorkspaceArmId + = reader.getString(); + } else if ("expiryTime".equals(fieldName)) { + deserializedAccessKeyAuthTypeWorkspaceConnectionProperties.withExpiryTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("group".equals(fieldName)) { + deserializedAccessKeyAuthTypeWorkspaceConnectionProperties.group + = ConnectionGroup.fromString(reader.getString()); + } else if ("isSharedToAll".equals(fieldName)) { + deserializedAccessKeyAuthTypeWorkspaceConnectionProperties + .withIsSharedToAll(reader.getNullable(JsonReader::getBoolean)); + } else if ("target".equals(fieldName)) { + deserializedAccessKeyAuthTypeWorkspaceConnectionProperties.withTarget(reader.getString()); + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedAccessKeyAuthTypeWorkspaceConnectionProperties.withMetadata(metadata); + } else if ("sharedUserList".equals(fieldName)) { + List sharedUserList = reader.readArray(reader1 -> reader1.getString()); + deserializedAccessKeyAuthTypeWorkspaceConnectionProperties.withSharedUserList(sharedUserList); + } else if ("value".equals(fieldName)) { + deserializedAccessKeyAuthTypeWorkspaceConnectionProperties.withValue(reader.getString()); + } else if ("valueFormat".equals(fieldName)) { + deserializedAccessKeyAuthTypeWorkspaceConnectionProperties + .withValueFormat(ValueFormat.fromString(reader.getString())); + } else if ("authType".equals(fieldName)) { + deserializedAccessKeyAuthTypeWorkspaceConnectionProperties.authType + = ConnectionAuthType.fromString(reader.getString()); + } else if ("credentials".equals(fieldName)) { + deserializedAccessKeyAuthTypeWorkspaceConnectionProperties.credentials + = WorkspaceConnectionAccessKey.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAccessKeyAuthTypeWorkspaceConnectionProperties; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AccountKeyAuthTypeWorkspaceConnectionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AccountKeyAuthTypeWorkspaceConnectionProperties.java new file mode 100644 index 0000000000000..47bc7db396dd6 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AccountKeyAuthTypeWorkspaceConnectionProperties.java @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; + +/** + * This connection type covers the account key connection for Azure storage. + */ +@Fluent +public final class AccountKeyAuthTypeWorkspaceConnectionProperties extends WorkspaceConnectionPropertiesV2 { + /* + * Authentication type of the connection target + */ + private ConnectionAuthType authType = ConnectionAuthType.ACCOUNT_KEY; + + /* + * The credentials property. + */ + private WorkspaceConnectionAccountKey credentials; + + /* + * The createdByWorkspaceArmId property. + */ + private String createdByWorkspaceArmId; + + /* + * Group based on connection category + */ + private ConnectionGroup group; + + /** + * Creates an instance of AccountKeyAuthTypeWorkspaceConnectionProperties class. + */ + public AccountKeyAuthTypeWorkspaceConnectionProperties() { + } + + /** + * Get the authType property: Authentication type of the connection target. + * + * @return the authType value. + */ + @Override + public ConnectionAuthType authType() { + return this.authType; + } + + /** + * Get the credentials property: The credentials property. + * + * @return the credentials value. + */ + public WorkspaceConnectionAccountKey credentials() { + return this.credentials; + } + + /** + * Set the credentials property: The credentials property. + * + * @param credentials the credentials value to set. + * @return the AccountKeyAuthTypeWorkspaceConnectionProperties object itself. + */ + public AccountKeyAuthTypeWorkspaceConnectionProperties withCredentials(WorkspaceConnectionAccountKey credentials) { + this.credentials = credentials; + return this; + } + + /** + * Get the createdByWorkspaceArmId property: The createdByWorkspaceArmId property. + * + * @return the createdByWorkspaceArmId value. + */ + @Override + public String createdByWorkspaceArmId() { + return this.createdByWorkspaceArmId; + } + + /** + * Get the group property: Group based on connection category. + * + * @return the group value. + */ + @Override + public ConnectionGroup group() { + return this.group; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountKeyAuthTypeWorkspaceConnectionProperties withCategory(ConnectionCategory category) { + super.withCategory(category); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountKeyAuthTypeWorkspaceConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { + super.withExpiryTime(expiryTime); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountKeyAuthTypeWorkspaceConnectionProperties withIsSharedToAll(Boolean isSharedToAll) { + super.withIsSharedToAll(isSharedToAll); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountKeyAuthTypeWorkspaceConnectionProperties withTarget(String target) { + super.withTarget(target); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountKeyAuthTypeWorkspaceConnectionProperties withMetadata(Map metadata) { + super.withMetadata(metadata); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountKeyAuthTypeWorkspaceConnectionProperties withSharedUserList(List sharedUserList) { + super.withSharedUserList(sharedUserList); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountKeyAuthTypeWorkspaceConnectionProperties withValue(String value) { + super.withValue(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountKeyAuthTypeWorkspaceConnectionProperties withValueFormat(ValueFormat valueFormat) { + super.withValueFormat(valueFormat); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (credentials() != null) { + credentials().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", category() == null ? null : category().toString()); + jsonWriter.writeStringField("expiryTime", + expiryTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expiryTime())); + jsonWriter.writeBooleanField("isSharedToAll", isSharedToAll()); + jsonWriter.writeStringField("target", target()); + jsonWriter.writeMapField("metadata", metadata(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("sharedUserList", sharedUserList(), + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("value", value()); + jsonWriter.writeStringField("valueFormat", valueFormat() == null ? null : valueFormat().toString()); + jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); + jsonWriter.writeJsonField("credentials", this.credentials); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccountKeyAuthTypeWorkspaceConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccountKeyAuthTypeWorkspaceConnectionProperties if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AccountKeyAuthTypeWorkspaceConnectionProperties. + */ + public static AccountKeyAuthTypeWorkspaceConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccountKeyAuthTypeWorkspaceConnectionProperties deserializedAccountKeyAuthTypeWorkspaceConnectionProperties + = new AccountKeyAuthTypeWorkspaceConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedAccountKeyAuthTypeWorkspaceConnectionProperties + .withCategory(ConnectionCategory.fromString(reader.getString())); + } else if ("createdByWorkspaceArmId".equals(fieldName)) { + deserializedAccountKeyAuthTypeWorkspaceConnectionProperties.createdByWorkspaceArmId + = reader.getString(); + } else if ("expiryTime".equals(fieldName)) { + deserializedAccountKeyAuthTypeWorkspaceConnectionProperties.withExpiryTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("group".equals(fieldName)) { + deserializedAccountKeyAuthTypeWorkspaceConnectionProperties.group + = ConnectionGroup.fromString(reader.getString()); + } else if ("isSharedToAll".equals(fieldName)) { + deserializedAccountKeyAuthTypeWorkspaceConnectionProperties + .withIsSharedToAll(reader.getNullable(JsonReader::getBoolean)); + } else if ("target".equals(fieldName)) { + deserializedAccountKeyAuthTypeWorkspaceConnectionProperties.withTarget(reader.getString()); + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedAccountKeyAuthTypeWorkspaceConnectionProperties.withMetadata(metadata); + } else if ("sharedUserList".equals(fieldName)) { + List sharedUserList = reader.readArray(reader1 -> reader1.getString()); + deserializedAccountKeyAuthTypeWorkspaceConnectionProperties.withSharedUserList(sharedUserList); + } else if ("value".equals(fieldName)) { + deserializedAccountKeyAuthTypeWorkspaceConnectionProperties.withValue(reader.getString()); + } else if ("valueFormat".equals(fieldName)) { + deserializedAccountKeyAuthTypeWorkspaceConnectionProperties + .withValueFormat(ValueFormat.fromString(reader.getString())); + } else if ("authType".equals(fieldName)) { + deserializedAccountKeyAuthTypeWorkspaceConnectionProperties.authType + = ConnectionAuthType.fromString(reader.getString()); + } else if ("credentials".equals(fieldName)) { + deserializedAccountKeyAuthTypeWorkspaceConnectionProperties.credentials + = WorkspaceConnectionAccountKey.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAccountKeyAuthTypeWorkspaceConnectionProperties; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AccountKeyDatastoreCredentials.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AccountKeyDatastoreCredentials.java index 3a914e9d93088..765b496c3b61c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AccountKeyDatastoreCredentials.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AccountKeyDatastoreCredentials.java @@ -6,28 +6,45 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Account key datastore credentials configuration. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "credentialsType") -@JsonTypeName("AccountKey") +/** + * Account key datastore credentials configuration. + */ @Fluent public final class AccountKeyDatastoreCredentials extends DatastoreCredentials { + /* + * [Required] Credential type used to authentication with storage. + */ + private CredentialsType credentialsType = CredentialsType.ACCOUNT_KEY; + /* * [Required] Storage account secrets. */ - @JsonProperty(value = "secrets", required = true) private AccountKeyDatastoreSecrets secrets; - /** Creates an instance of AccountKeyDatastoreCredentials class. */ + /** + * Creates an instance of AccountKeyDatastoreCredentials class. + */ public AccountKeyDatastoreCredentials() { } + /** + * Get the credentialsType property: [Required] Credential type used to authentication with storage. + * + * @return the credentialsType value. + */ + @Override + public CredentialsType credentialsType() { + return this.credentialsType; + } + /** * Get the secrets property: [Required] Storage account secrets. - * + * * @return the secrets value. */ public AccountKeyDatastoreSecrets secrets() { @@ -36,7 +53,7 @@ public AccountKeyDatastoreSecrets secrets() { /** * Set the secrets property: [Required] Storage account secrets. - * + * * @param secrets the secrets value to set. * @return the AccountKeyDatastoreCredentials object itself. */ @@ -47,21 +64,63 @@ public AccountKeyDatastoreCredentials withSecrets(AccountKeyDatastoreSecrets sec /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (secrets() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property secrets in model AccountKeyDatastoreCredentials")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property secrets in model AccountKeyDatastoreCredentials")); } else { secrets().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(AccountKeyDatastoreCredentials.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("secrets", this.secrets); + jsonWriter.writeStringField("credentialsType", + this.credentialsType == null ? null : this.credentialsType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccountKeyDatastoreCredentials from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccountKeyDatastoreCredentials if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AccountKeyDatastoreCredentials. + */ + public static AccountKeyDatastoreCredentials fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccountKeyDatastoreCredentials deserializedAccountKeyDatastoreCredentials + = new AccountKeyDatastoreCredentials(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("secrets".equals(fieldName)) { + deserializedAccountKeyDatastoreCredentials.secrets = AccountKeyDatastoreSecrets.fromJson(reader); + } else if ("credentialsType".equals(fieldName)) { + deserializedAccountKeyDatastoreCredentials.credentialsType + = CredentialsType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAccountKeyDatastoreCredentials; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AccountKeyDatastoreSecrets.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AccountKeyDatastoreSecrets.java index 8f18b266e3a95..f1920d6966646 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AccountKeyDatastoreSecrets.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AccountKeyDatastoreSecrets.java @@ -5,29 +5,46 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.fluent.models.DatastoreSecretsInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.IOException; -/** Datastore account key secrets. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "secretsType") -@JsonTypeName("AccountKey") +/** + * Datastore account key secrets. + */ @Fluent public final class AccountKeyDatastoreSecrets extends DatastoreSecretsInner { + /* + * [Required] Credential type used to authentication with storage. + */ + private SecretsType secretsType = SecretsType.ACCOUNT_KEY; + /* * Storage account key. */ - @JsonProperty(value = "key") private String key; - /** Creates an instance of AccountKeyDatastoreSecrets class. */ + /** + * Creates an instance of AccountKeyDatastoreSecrets class. + */ public AccountKeyDatastoreSecrets() { } + /** + * Get the secretsType property: [Required] Credential type used to authentication with storage. + * + * @return the secretsType value. + */ + @Override + public SecretsType secretsType() { + return this.secretsType; + } + /** * Get the key property: Storage account key. - * + * * @return the key value. */ public String key() { @@ -36,7 +53,7 @@ public String key() { /** * Set the key property: Storage account key. - * + * * @param key the key value to set. * @return the AccountKeyDatastoreSecrets object itself. */ @@ -47,11 +64,50 @@ public AccountKeyDatastoreSecrets withKey(String key) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("secretsType", this.secretsType == null ? null : this.secretsType.toString()); + jsonWriter.writeStringField("key", this.key); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccountKeyDatastoreSecrets from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccountKeyDatastoreSecrets if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AccountKeyDatastoreSecrets. + */ + public static AccountKeyDatastoreSecrets fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccountKeyDatastoreSecrets deserializedAccountKeyDatastoreSecrets = new AccountKeyDatastoreSecrets(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("secretsType".equals(fieldName)) { + deserializedAccountKeyDatastoreSecrets.secretsType = SecretsType.fromString(reader.getString()); + } else if ("key".equals(fieldName)) { + deserializedAccountKeyDatastoreSecrets.key = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAccountKeyDatastoreSecrets; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AcrDetails.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AcrDetails.java new file mode 100644 index 0000000000000..548ec82202f69 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AcrDetails.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Details of ACR account to be used for the Registry. + */ +@Fluent +public final class AcrDetails implements JsonSerializable { + /* + * Details of system created ACR account to be used for the Registry + */ + private SystemCreatedAcrAccount systemCreatedAcrAccount; + + /* + * Details of user created ACR account to be used for the Registry + */ + private UserCreatedAcrAccount userCreatedAcrAccount; + + /** + * Creates an instance of AcrDetails class. + */ + public AcrDetails() { + } + + /** + * Get the systemCreatedAcrAccount property: Details of system created ACR account to be used for the Registry. + * + * @return the systemCreatedAcrAccount value. + */ + public SystemCreatedAcrAccount systemCreatedAcrAccount() { + return this.systemCreatedAcrAccount; + } + + /** + * Set the systemCreatedAcrAccount property: Details of system created ACR account to be used for the Registry. + * + * @param systemCreatedAcrAccount the systemCreatedAcrAccount value to set. + * @return the AcrDetails object itself. + */ + public AcrDetails withSystemCreatedAcrAccount(SystemCreatedAcrAccount systemCreatedAcrAccount) { + this.systemCreatedAcrAccount = systemCreatedAcrAccount; + return this; + } + + /** + * Get the userCreatedAcrAccount property: Details of user created ACR account to be used for the Registry. + * + * @return the userCreatedAcrAccount value. + */ + public UserCreatedAcrAccount userCreatedAcrAccount() { + return this.userCreatedAcrAccount; + } + + /** + * Set the userCreatedAcrAccount property: Details of user created ACR account to be used for the Registry. + * + * @param userCreatedAcrAccount the userCreatedAcrAccount value to set. + * @return the AcrDetails object itself. + */ + public AcrDetails withUserCreatedAcrAccount(UserCreatedAcrAccount userCreatedAcrAccount) { + this.userCreatedAcrAccount = userCreatedAcrAccount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (systemCreatedAcrAccount() != null) { + systemCreatedAcrAccount().validate(); + } + if (userCreatedAcrAccount() != null) { + userCreatedAcrAccount().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("systemCreatedAcrAccount", this.systemCreatedAcrAccount); + jsonWriter.writeJsonField("userCreatedAcrAccount", this.userCreatedAcrAccount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AcrDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AcrDetails if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the AcrDetails. + */ + public static AcrDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AcrDetails deserializedAcrDetails = new AcrDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("systemCreatedAcrAccount".equals(fieldName)) { + deserializedAcrDetails.systemCreatedAcrAccount = SystemCreatedAcrAccount.fromJson(reader); + } else if ("userCreatedAcrAccount".equals(fieldName)) { + deserializedAcrDetails.userCreatedAcrAccount = UserCreatedAcrAccount.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAcrDetails; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ActionType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ActionType.java new file mode 100644 index 0000000000000..6b932b0f71ef4 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ActionType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ +public final class ActionType extends ExpandableStringEnum { + /** + * Static value Internal for ActionType. + */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** + * Gets known ActionType values. + * + * @return known ActionType values. + */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Aks.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Aks.java index e1f8238bd92c1..76d48c600bfe4 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Aks.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Aks.java @@ -5,28 +5,75 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; -/** A Machine Learning compute based on AKS. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "computeType") -@JsonTypeName("AKS") +/** + * A Machine Learning compute based on AKS. + */ @Fluent public final class Aks extends Compute { + /* + * The type of compute + */ + private ComputeType computeType = ComputeType.AKS; + /* * AKS properties */ - @JsonProperty(value = "properties") private AksSchemaProperties properties; - /** Creates an instance of Aks class. */ + /* + * The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. + */ + private ProvisioningState provisioningState; + + /* + * The time at which the compute was created. + */ + private OffsetDateTime createdOn; + + /* + * The time at which the compute was last modified. + */ + private OffsetDateTime modifiedOn; + + /* + * Errors during provisioning + */ + private List provisioningErrors; + + /* + * Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning + * service provisioned it if false. + */ + private Boolean isAttachedCompute; + + /** + * Creates an instance of Aks class. + */ public Aks() { } + /** + * Get the computeType property: The type of compute. + * + * @return the computeType value. + */ + @Override + public ComputeType computeType() { + return this.computeType; + } + /** * Get the properties property: AKS properties. - * + * * @return the properties value. */ public AksSchemaProperties properties() { @@ -35,7 +82,7 @@ public AksSchemaProperties properties() { /** * Set the properties property: AKS properties. - * + * * @param properties the properties value to set. * @return the Aks object itself. */ @@ -44,28 +91,88 @@ public Aks withProperties(AksSchemaProperties properties) { return this; } - /** {@inheritDoc} */ + /** + * Get the provisioningState property: The provision state of the cluster. Valid values are Unknown, Updating, + * Provisioning, Succeeded, and Failed. + * + * @return the provisioningState value. + */ + @Override + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the createdOn property: The time at which the compute was created. + * + * @return the createdOn value. + */ + @Override + public OffsetDateTime createdOn() { + return this.createdOn; + } + + /** + * Get the modifiedOn property: The time at which the compute was last modified. + * + * @return the modifiedOn value. + */ + @Override + public OffsetDateTime modifiedOn() { + return this.modifiedOn; + } + + /** + * Get the provisioningErrors property: Errors during provisioning. + * + * @return the provisioningErrors value. + */ + @Override + public List provisioningErrors() { + return this.provisioningErrors; + } + + /** + * Get the isAttachedCompute property: Indicating whether the compute was provisioned by user and brought from + * outside if true, or machine learning service provisioned it if false. + * + * @return the isAttachedCompute value. + */ + @Override + public Boolean isAttachedCompute() { + return this.isAttachedCompute; + } + + /** + * {@inheritDoc} + */ @Override public Aks withComputeLocation(String computeLocation) { super.withComputeLocation(computeLocation); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public Aks withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public Aks withResourceId(String resourceId) { super.withResourceId(resourceId); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public Aks withDisableLocalAuth(Boolean disableLocalAuth) { super.withDisableLocalAuth(disableLocalAuth); @@ -74,7 +181,7 @@ public Aks withDisableLocalAuth(Boolean disableLocalAuth) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -84,4 +191,69 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("computeLocation", computeLocation()); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("resourceId", resourceId()); + jsonWriter.writeBooleanField("disableLocalAuth", disableLocalAuth()); + jsonWriter.writeStringField("computeType", this.computeType == null ? null : this.computeType.toString()); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Aks from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Aks if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Aks. + */ + public static Aks fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Aks deserializedAks = new Aks(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("computeLocation".equals(fieldName)) { + deserializedAks.withComputeLocation(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedAks.provisioningState = ProvisioningState.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedAks.withDescription(reader.getString()); + } else if ("createdOn".equals(fieldName)) { + deserializedAks.createdOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("modifiedOn".equals(fieldName)) { + deserializedAks.modifiedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("resourceId".equals(fieldName)) { + deserializedAks.withResourceId(reader.getString()); + } else if ("provisioningErrors".equals(fieldName)) { + List provisioningErrors + = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); + deserializedAks.provisioningErrors = provisioningErrors; + } else if ("isAttachedCompute".equals(fieldName)) { + deserializedAks.isAttachedCompute = reader.getNullable(JsonReader::getBoolean); + } else if ("disableLocalAuth".equals(fieldName)) { + deserializedAks.withDisableLocalAuth(reader.getNullable(JsonReader::getBoolean)); + } else if ("computeType".equals(fieldName)) { + deserializedAks.computeType = ComputeType.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedAks.properties = AksSchemaProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAks; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AksComputeSecrets.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AksComputeSecrets.java index 048c5141075ba..8a4bda318ec92 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AksComputeSecrets.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AksComputeSecrets.java @@ -5,42 +5,57 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.fluent.models.ComputeSecretsInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.IOException; -/** Secrets related to a Machine Learning compute based on AKS. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "computeType") -@JsonTypeName("AKS") +/** + * Secrets related to a Machine Learning compute based on AKS. + */ @Fluent public final class AksComputeSecrets extends ComputeSecretsInner { + /* + * The type of compute + */ + private ComputeType computeType = ComputeType.AKS; + /* * Content of kubeconfig file that can be used to connect to the Kubernetes cluster. */ - @JsonProperty(value = "userKubeConfig") private String userKubeConfig; /* * Content of kubeconfig file that can be used to connect to the Kubernetes cluster. */ - @JsonProperty(value = "adminKubeConfig") private String adminKubeConfig; /* * Image registry pull secret. */ - @JsonProperty(value = "imagePullSecretName") private String imagePullSecretName; - /** Creates an instance of AksComputeSecrets class. */ + /** + * Creates an instance of AksComputeSecrets class. + */ public AksComputeSecrets() { } + /** + * Get the computeType property: The type of compute. + * + * @return the computeType value. + */ + @Override + public ComputeType computeType() { + return this.computeType; + } + /** * Get the userKubeConfig property: Content of kubeconfig file that can be used to connect to the Kubernetes * cluster. - * + * * @return the userKubeConfig value. */ public String userKubeConfig() { @@ -50,7 +65,7 @@ public String userKubeConfig() { /** * Set the userKubeConfig property: Content of kubeconfig file that can be used to connect to the Kubernetes * cluster. - * + * * @param userKubeConfig the userKubeConfig value to set. * @return the AksComputeSecrets object itself. */ @@ -62,7 +77,7 @@ public AksComputeSecrets withUserKubeConfig(String userKubeConfig) { /** * Get the adminKubeConfig property: Content of kubeconfig file that can be used to connect to the Kubernetes * cluster. - * + * * @return the adminKubeConfig value. */ public String adminKubeConfig() { @@ -72,7 +87,7 @@ public String adminKubeConfig() { /** * Set the adminKubeConfig property: Content of kubeconfig file that can be used to connect to the Kubernetes * cluster. - * + * * @param adminKubeConfig the adminKubeConfig value to set. * @return the AksComputeSecrets object itself. */ @@ -83,7 +98,7 @@ public AksComputeSecrets withAdminKubeConfig(String adminKubeConfig) { /** * Get the imagePullSecretName property: Image registry pull secret. - * + * * @return the imagePullSecretName value. */ public String imagePullSecretName() { @@ -92,7 +107,7 @@ public String imagePullSecretName() { /** * Set the imagePullSecretName property: Image registry pull secret. - * + * * @param imagePullSecretName the imagePullSecretName value to set. * @return the AksComputeSecrets object itself. */ @@ -103,11 +118,56 @@ public AksComputeSecrets withImagePullSecretName(String imagePullSecretName) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("computeType", this.computeType == null ? null : this.computeType.toString()); + jsonWriter.writeStringField("userKubeConfig", this.userKubeConfig); + jsonWriter.writeStringField("adminKubeConfig", this.adminKubeConfig); + jsonWriter.writeStringField("imagePullSecretName", this.imagePullSecretName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AksComputeSecrets from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AksComputeSecrets if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AksComputeSecrets. + */ + public static AksComputeSecrets fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AksComputeSecrets deserializedAksComputeSecrets = new AksComputeSecrets(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("computeType".equals(fieldName)) { + deserializedAksComputeSecrets.computeType = ComputeType.fromString(reader.getString()); + } else if ("userKubeConfig".equals(fieldName)) { + deserializedAksComputeSecrets.userKubeConfig = reader.getString(); + } else if ("adminKubeConfig".equals(fieldName)) { + deserializedAksComputeSecrets.adminKubeConfig = reader.getString(); + } else if ("imagePullSecretName".equals(fieldName)) { + deserializedAksComputeSecrets.imagePullSecretName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAksComputeSecrets; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AksComputeSecretsProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AksComputeSecretsProperties.java index caf711390f87d..457bf72bcf36c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AksComputeSecretsProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AksComputeSecretsProperties.java @@ -5,37 +5,42 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Properties of AksComputeSecrets. */ +/** + * Properties of AksComputeSecrets. + */ @Fluent -public class AksComputeSecretsProperties { +public class AksComputeSecretsProperties implements JsonSerializable { /* * Content of kubeconfig file that can be used to connect to the Kubernetes cluster. */ - @JsonProperty(value = "userKubeConfig") private String userKubeConfig; /* * Content of kubeconfig file that can be used to connect to the Kubernetes cluster. */ - @JsonProperty(value = "adminKubeConfig") private String adminKubeConfig; /* * Image registry pull secret. */ - @JsonProperty(value = "imagePullSecretName") private String imagePullSecretName; - /** Creates an instance of AksComputeSecretsProperties class. */ + /** + * Creates an instance of AksComputeSecretsProperties class. + */ public AksComputeSecretsProperties() { } /** * Get the userKubeConfig property: Content of kubeconfig file that can be used to connect to the Kubernetes * cluster. - * + * * @return the userKubeConfig value. */ public String userKubeConfig() { @@ -45,7 +50,7 @@ public String userKubeConfig() { /** * Set the userKubeConfig property: Content of kubeconfig file that can be used to connect to the Kubernetes * cluster. - * + * * @param userKubeConfig the userKubeConfig value to set. * @return the AksComputeSecretsProperties object itself. */ @@ -57,7 +62,7 @@ public AksComputeSecretsProperties withUserKubeConfig(String userKubeConfig) { /** * Get the adminKubeConfig property: Content of kubeconfig file that can be used to connect to the Kubernetes * cluster. - * + * * @return the adminKubeConfig value. */ public String adminKubeConfig() { @@ -67,7 +72,7 @@ public String adminKubeConfig() { /** * Set the adminKubeConfig property: Content of kubeconfig file that can be used to connect to the Kubernetes * cluster. - * + * * @param adminKubeConfig the adminKubeConfig value to set. * @return the AksComputeSecretsProperties object itself. */ @@ -78,7 +83,7 @@ public AksComputeSecretsProperties withAdminKubeConfig(String adminKubeConfig) { /** * Get the imagePullSecretName property: Image registry pull secret. - * + * * @return the imagePullSecretName value. */ public String imagePullSecretName() { @@ -87,7 +92,7 @@ public String imagePullSecretName() { /** * Set the imagePullSecretName property: Image registry pull secret. - * + * * @param imagePullSecretName the imagePullSecretName value to set. * @return the AksComputeSecretsProperties object itself. */ @@ -98,9 +103,51 @@ public AksComputeSecretsProperties withImagePullSecretName(String imagePullSecre /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("userKubeConfig", this.userKubeConfig); + jsonWriter.writeStringField("adminKubeConfig", this.adminKubeConfig); + jsonWriter.writeStringField("imagePullSecretName", this.imagePullSecretName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AksComputeSecretsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AksComputeSecretsProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AksComputeSecretsProperties. + */ + public static AksComputeSecretsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AksComputeSecretsProperties deserializedAksComputeSecretsProperties = new AksComputeSecretsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("userKubeConfig".equals(fieldName)) { + deserializedAksComputeSecretsProperties.userKubeConfig = reader.getString(); + } else if ("adminKubeConfig".equals(fieldName)) { + deserializedAksComputeSecretsProperties.adminKubeConfig = reader.getString(); + } else if ("imagePullSecretName".equals(fieldName)) { + deserializedAksComputeSecretsProperties.imagePullSecretName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAksComputeSecretsProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AksNetworkingConfiguration.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AksNetworkingConfiguration.java index a66653a00d7d9..77a0e89f149f6 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AksNetworkingConfiguration.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AksNetworkingConfiguration.java @@ -5,45 +5,48 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Advance configuration for AKS networking. */ +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Advance configuration for AKS networking. + */ @Fluent -public final class AksNetworkingConfiguration { +public final class AksNetworkingConfiguration implements JsonSerializable { /* * Virtual network subnet resource ID the compute nodes belong to */ - @JsonProperty(value = "subnetId") private String subnetId; /* - * A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP - * ranges. + * A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. */ - @JsonProperty(value = "serviceCidr") private String serviceCidr; /* * An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range * specified in serviceCidr. */ - @JsonProperty(value = "dnsServiceIP") private String dnsServiceIp; /* * A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or * the Kubernetes service address range. */ - @JsonProperty(value = "dockerBridgeCidr") private String dockerBridgeCidr; - /** Creates an instance of AksNetworkingConfiguration class. */ + /** + * Creates an instance of AksNetworkingConfiguration class. + */ public AksNetworkingConfiguration() { } /** * Get the subnetId property: Virtual network subnet resource ID the compute nodes belong to. - * + * * @return the subnetId value. */ public String subnetId() { @@ -52,7 +55,7 @@ public String subnetId() { /** * Set the subnetId property: Virtual network subnet resource ID the compute nodes belong to. - * + * * @param subnetId the subnetId value to set. * @return the AksNetworkingConfiguration object itself. */ @@ -64,7 +67,7 @@ public AksNetworkingConfiguration withSubnetId(String subnetId) { /** * Get the serviceCidr property: A CIDR notation IP range from which to assign service cluster IPs. It must not * overlap with any Subnet IP ranges. - * + * * @return the serviceCidr value. */ public String serviceCidr() { @@ -74,7 +77,7 @@ public String serviceCidr() { /** * Set the serviceCidr property: A CIDR notation IP range from which to assign service cluster IPs. It must not * overlap with any Subnet IP ranges. - * + * * @param serviceCidr the serviceCidr value to set. * @return the AksNetworkingConfiguration object itself. */ @@ -86,7 +89,7 @@ public AksNetworkingConfiguration withServiceCidr(String serviceCidr) { /** * Get the dnsServiceIp property: An IP address assigned to the Kubernetes DNS service. It must be within the * Kubernetes service address range specified in serviceCidr. - * + * * @return the dnsServiceIp value. */ public String dnsServiceIp() { @@ -96,7 +99,7 @@ public String dnsServiceIp() { /** * Set the dnsServiceIp property: An IP address assigned to the Kubernetes DNS service. It must be within the * Kubernetes service address range specified in serviceCidr. - * + * * @param dnsServiceIp the dnsServiceIp value to set. * @return the AksNetworkingConfiguration object itself. */ @@ -108,7 +111,7 @@ public AksNetworkingConfiguration withDnsServiceIp(String dnsServiceIp) { /** * Get the dockerBridgeCidr property: A CIDR notation IP range assigned to the Docker bridge network. It must not * overlap with any Subnet IP ranges or the Kubernetes service address range. - * + * * @return the dockerBridgeCidr value. */ public String dockerBridgeCidr() { @@ -118,7 +121,7 @@ public String dockerBridgeCidr() { /** * Set the dockerBridgeCidr property: A CIDR notation IP range assigned to the Docker bridge network. It must not * overlap with any Subnet IP ranges or the Kubernetes service address range. - * + * * @param dockerBridgeCidr the dockerBridgeCidr value to set. * @return the AksNetworkingConfiguration object itself. */ @@ -129,9 +132,54 @@ public AksNetworkingConfiguration withDockerBridgeCidr(String dockerBridgeCidr) /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("subnetId", this.subnetId); + jsonWriter.writeStringField("serviceCidr", this.serviceCidr); + jsonWriter.writeStringField("dnsServiceIP", this.dnsServiceIp); + jsonWriter.writeStringField("dockerBridgeCidr", this.dockerBridgeCidr); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AksNetworkingConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AksNetworkingConfiguration if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AksNetworkingConfiguration. + */ + public static AksNetworkingConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AksNetworkingConfiguration deserializedAksNetworkingConfiguration = new AksNetworkingConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("subnetId".equals(fieldName)) { + deserializedAksNetworkingConfiguration.subnetId = reader.getString(); + } else if ("serviceCidr".equals(fieldName)) { + deserializedAksNetworkingConfiguration.serviceCidr = reader.getString(); + } else if ("dnsServiceIP".equals(fieldName)) { + deserializedAksNetworkingConfiguration.dnsServiceIp = reader.getString(); + } else if ("dockerBridgeCidr".equals(fieldName)) { + deserializedAksNetworkingConfiguration.dockerBridgeCidr = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAksNetworkingConfiguration; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AksSchema.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AksSchema.java index 892c30daeece9..35ccb3e325744 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AksSchema.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AksSchema.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The AksSchema model. */ +/** + * The AksSchema model. + */ @Fluent -public class AksSchema { +public class AksSchema implements JsonSerializable { /* * AKS properties */ - @JsonProperty(value = "properties") private AksSchemaProperties properties; - /** Creates an instance of AksSchema class. */ + /** + * Creates an instance of AksSchema class. + */ public AksSchema() { } /** * Get the properties property: AKS properties. - * + * * @return the properties value. */ public AksSchemaProperties properties() { @@ -31,7 +38,7 @@ public AksSchemaProperties properties() { /** * Set the properties property: AKS properties. - * + * * @param properties the properties value to set. * @return the AksSchema object itself. */ @@ -42,7 +49,7 @@ public AksSchema withProperties(AksSchemaProperties properties) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -50,4 +57,40 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AksSchema from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AksSchema if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the AksSchema. + */ + public static AksSchema fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AksSchema deserializedAksSchema = new AksSchema(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedAksSchema.properties = AksSchemaProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAksSchema; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AksSchemaProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AksSchemaProperties.java index abef14024d16d..27256d2d9fc8a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AksSchemaProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AksSchemaProperties.java @@ -5,73 +5,72 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** AKS properties. */ +/** + * AKS properties. + */ @Fluent -public final class AksSchemaProperties { +public final class AksSchemaProperties implements JsonSerializable { /* * Cluster full qualified domain name */ - @JsonProperty(value = "clusterFqdn") private String clusterFqdn; /* * System services */ - @JsonProperty(value = "systemServices", access = JsonProperty.Access.WRITE_ONLY) private List systemServices; /* * Number of agents */ - @JsonProperty(value = "agentCount") private Integer agentCount; /* * Agent virtual machine size */ - @JsonProperty(value = "agentVmSize") private String agentVmSize; /* * Intended usage of the cluster */ - @JsonProperty(value = "clusterPurpose") private ClusterPurpose clusterPurpose; /* * SSL configuration */ - @JsonProperty(value = "sslConfiguration") private SslConfiguration sslConfiguration; /* * AKS networking configuration for vnet */ - @JsonProperty(value = "aksNetworkingConfiguration") private AksNetworkingConfiguration aksNetworkingConfiguration; /* * Load Balancer Type */ - @JsonProperty(value = "loadBalancerType") private LoadBalancerType loadBalancerType; /* * Load Balancer Subnet */ - @JsonProperty(value = "loadBalancerSubnet") private String loadBalancerSubnet; - /** Creates an instance of AksSchemaProperties class. */ + /** + * Creates an instance of AksSchemaProperties class. + */ public AksSchemaProperties() { } /** * Get the clusterFqdn property: Cluster full qualified domain name. - * + * * @return the clusterFqdn value. */ public String clusterFqdn() { @@ -80,7 +79,7 @@ public String clusterFqdn() { /** * Set the clusterFqdn property: Cluster full qualified domain name. - * + * * @param clusterFqdn the clusterFqdn value to set. * @return the AksSchemaProperties object itself. */ @@ -91,7 +90,7 @@ public AksSchemaProperties withClusterFqdn(String clusterFqdn) { /** * Get the systemServices property: System services. - * + * * @return the systemServices value. */ public List systemServices() { @@ -100,7 +99,7 @@ public List systemServices() { /** * Get the agentCount property: Number of agents. - * + * * @return the agentCount value. */ public Integer agentCount() { @@ -109,7 +108,7 @@ public Integer agentCount() { /** * Set the agentCount property: Number of agents. - * + * * @param agentCount the agentCount value to set. * @return the AksSchemaProperties object itself. */ @@ -120,7 +119,7 @@ public AksSchemaProperties withAgentCount(Integer agentCount) { /** * Get the agentVmSize property: Agent virtual machine size. - * + * * @return the agentVmSize value. */ public String agentVmSize() { @@ -129,7 +128,7 @@ public String agentVmSize() { /** * Set the agentVmSize property: Agent virtual machine size. - * + * * @param agentVmSize the agentVmSize value to set. * @return the AksSchemaProperties object itself. */ @@ -140,7 +139,7 @@ public AksSchemaProperties withAgentVmSize(String agentVmSize) { /** * Get the clusterPurpose property: Intended usage of the cluster. - * + * * @return the clusterPurpose value. */ public ClusterPurpose clusterPurpose() { @@ -149,7 +148,7 @@ public ClusterPurpose clusterPurpose() { /** * Set the clusterPurpose property: Intended usage of the cluster. - * + * * @param clusterPurpose the clusterPurpose value to set. * @return the AksSchemaProperties object itself. */ @@ -160,7 +159,7 @@ public AksSchemaProperties withClusterPurpose(ClusterPurpose clusterPurpose) { /** * Get the sslConfiguration property: SSL configuration. - * + * * @return the sslConfiguration value. */ public SslConfiguration sslConfiguration() { @@ -169,7 +168,7 @@ public SslConfiguration sslConfiguration() { /** * Set the sslConfiguration property: SSL configuration. - * + * * @param sslConfiguration the sslConfiguration value to set. * @return the AksSchemaProperties object itself. */ @@ -180,7 +179,7 @@ public AksSchemaProperties withSslConfiguration(SslConfiguration sslConfiguratio /** * Get the aksNetworkingConfiguration property: AKS networking configuration for vnet. - * + * * @return the aksNetworkingConfiguration value. */ public AksNetworkingConfiguration aksNetworkingConfiguration() { @@ -189,7 +188,7 @@ public AksNetworkingConfiguration aksNetworkingConfiguration() { /** * Set the aksNetworkingConfiguration property: AKS networking configuration for vnet. - * + * * @param aksNetworkingConfiguration the aksNetworkingConfiguration value to set. * @return the AksSchemaProperties object itself. */ @@ -200,7 +199,7 @@ public AksSchemaProperties withAksNetworkingConfiguration(AksNetworkingConfigura /** * Get the loadBalancerType property: Load Balancer Type. - * + * * @return the loadBalancerType value. */ public LoadBalancerType loadBalancerType() { @@ -209,7 +208,7 @@ public LoadBalancerType loadBalancerType() { /** * Set the loadBalancerType property: Load Balancer Type. - * + * * @param loadBalancerType the loadBalancerType value to set. * @return the AksSchemaProperties object itself. */ @@ -220,7 +219,7 @@ public AksSchemaProperties withLoadBalancerType(LoadBalancerType loadBalancerTyp /** * Get the loadBalancerSubnet property: Load Balancer Subnet. - * + * * @return the loadBalancerSubnet value. */ public String loadBalancerSubnet() { @@ -229,7 +228,7 @@ public String loadBalancerSubnet() { /** * Set the loadBalancerSubnet property: Load Balancer Subnet. - * + * * @param loadBalancerSubnet the loadBalancerSubnet value to set. * @return the AksSchemaProperties object itself. */ @@ -240,7 +239,7 @@ public AksSchemaProperties withLoadBalancerSubnet(String loadBalancerSubnet) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -254,4 +253,67 @@ public void validate() { aksNetworkingConfiguration().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("clusterFqdn", this.clusterFqdn); + jsonWriter.writeNumberField("agentCount", this.agentCount); + jsonWriter.writeStringField("agentVmSize", this.agentVmSize); + jsonWriter.writeStringField("clusterPurpose", + this.clusterPurpose == null ? null : this.clusterPurpose.toString()); + jsonWriter.writeJsonField("sslConfiguration", this.sslConfiguration); + jsonWriter.writeJsonField("aksNetworkingConfiguration", this.aksNetworkingConfiguration); + jsonWriter.writeStringField("loadBalancerType", + this.loadBalancerType == null ? null : this.loadBalancerType.toString()); + jsonWriter.writeStringField("loadBalancerSubnet", this.loadBalancerSubnet); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AksSchemaProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AksSchemaProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AksSchemaProperties. + */ + public static AksSchemaProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AksSchemaProperties deserializedAksSchemaProperties = new AksSchemaProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clusterFqdn".equals(fieldName)) { + deserializedAksSchemaProperties.clusterFqdn = reader.getString(); + } else if ("systemServices".equals(fieldName)) { + List systemServices = reader.readArray(reader1 -> SystemService.fromJson(reader1)); + deserializedAksSchemaProperties.systemServices = systemServices; + } else if ("agentCount".equals(fieldName)) { + deserializedAksSchemaProperties.agentCount = reader.getNullable(JsonReader::getInt); + } else if ("agentVmSize".equals(fieldName)) { + deserializedAksSchemaProperties.agentVmSize = reader.getString(); + } else if ("clusterPurpose".equals(fieldName)) { + deserializedAksSchemaProperties.clusterPurpose = ClusterPurpose.fromString(reader.getString()); + } else if ("sslConfiguration".equals(fieldName)) { + deserializedAksSchemaProperties.sslConfiguration = SslConfiguration.fromJson(reader); + } else if ("aksNetworkingConfiguration".equals(fieldName)) { + deserializedAksSchemaProperties.aksNetworkingConfiguration + = AksNetworkingConfiguration.fromJson(reader); + } else if ("loadBalancerType".equals(fieldName)) { + deserializedAksSchemaProperties.loadBalancerType = LoadBalancerType.fromString(reader.getString()); + } else if ("loadBalancerSubnet".equals(fieldName)) { + deserializedAksSchemaProperties.loadBalancerSubnet = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAksSchemaProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AllFeatures.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AllFeatures.java new file mode 100644 index 0000000000000..89e05a4ea432f --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AllFeatures.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The AllFeatures model. + */ +@Immutable +public final class AllFeatures extends MonitoringFeatureFilterBase { + /* + * [Required] Specifies the feature filter to leverage when selecting features to calculate metrics over. + */ + private MonitoringFeatureFilterType filterType = MonitoringFeatureFilterType.ALL_FEATURES; + + /** + * Creates an instance of AllFeatures class. + */ + public AllFeatures() { + } + + /** + * Get the filterType property: [Required] Specifies the feature filter to leverage when selecting features to + * calculate metrics over. + * + * @return the filterType value. + */ + @Override + public MonitoringFeatureFilterType filterType() { + return this.filterType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("filterType", this.filterType == null ? null : this.filterType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AllFeatures from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AllFeatures if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AllFeatures. + */ + public static AllFeatures fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AllFeatures deserializedAllFeatures = new AllFeatures(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("filterType".equals(fieldName)) { + deserializedAllFeatures.filterType = MonitoringFeatureFilterType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAllFeatures; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AllNodes.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AllNodes.java new file mode 100644 index 0000000000000..2b729b4a09b0e --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AllNodes.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * All nodes means the service will be running on all of the nodes of the job. + */ +@Immutable +public final class AllNodes extends Nodes { + /* + * [Required] Type of the Nodes value + */ + private NodesValueType nodesValueType = NodesValueType.ALL; + + /** + * Creates an instance of AllNodes class. + */ + public AllNodes() { + } + + /** + * Get the nodesValueType property: [Required] Type of the Nodes value. + * + * @return the nodesValueType value. + */ + @Override + public NodesValueType nodesValueType() { + return this.nodesValueType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nodesValueType", + this.nodesValueType == null ? null : this.nodesValueType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AllNodes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AllNodes if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the AllNodes. + */ + public static AllNodes fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AllNodes deserializedAllNodes = new AllNodes(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nodesValueType".equals(fieldName)) { + deserializedAllNodes.nodesValueType = NodesValueType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAllNodes; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AllocationState.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AllocationState.java index d3450dd2ccfb9..0639b5203e756 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AllocationState.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AllocationState.java @@ -5,27 +5,30 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** * Allocation state. - * - *

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 compute nodes. resizing - - * Indicates that the compute is resizing; that is, compute nodes are being added to or removed from the compute. + * + * 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 compute nodes. resizing - Indicates + * that the compute is resizing; that is, compute nodes are being added to or removed from the compute. */ public final class AllocationState extends ExpandableStringEnum { - /** Static value Steady for AllocationState. */ + /** + * Static value Steady for AllocationState. + */ public static final AllocationState STEADY = fromString("Steady"); - /** Static value Resizing for AllocationState. */ + /** + * Static value Resizing for AllocationState. + */ public static final AllocationState RESIZING = fromString("Resizing"); /** * Creates a new instance of AllocationState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -34,18 +37,17 @@ public AllocationState() { /** * Creates or finds a AllocationState from its string representation. - * + * * @param name a name to look for. * @return the corresponding AllocationState. */ - @JsonCreator public static AllocationState fromString(String name) { return fromString(name, AllocationState.class); } /** * Gets known AllocationState values. - * + * * @return known AllocationState values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlCompute.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlCompute.java index e066172a41ae2..25b3ad2c53f7a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlCompute.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlCompute.java @@ -5,28 +5,75 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; -/** An Azure Machine Learning compute. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "computeType") -@JsonTypeName("AmlCompute") +/** + * An Azure Machine Learning compute. + */ @Fluent public final class AmlCompute extends Compute { + /* + * The type of compute + */ + private ComputeType computeType = ComputeType.AML_COMPUTE; + /* * Properties of AmlCompute */ - @JsonProperty(value = "properties") private AmlComputeProperties properties; - /** Creates an instance of AmlCompute class. */ + /* + * The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. + */ + private ProvisioningState provisioningState; + + /* + * The time at which the compute was created. + */ + private OffsetDateTime createdOn; + + /* + * The time at which the compute was last modified. + */ + private OffsetDateTime modifiedOn; + + /* + * Errors during provisioning + */ + private List provisioningErrors; + + /* + * Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning + * service provisioned it if false. + */ + private Boolean isAttachedCompute; + + /** + * Creates an instance of AmlCompute class. + */ public AmlCompute() { } + /** + * Get the computeType property: The type of compute. + * + * @return the computeType value. + */ + @Override + public ComputeType computeType() { + return this.computeType; + } + /** * Get the properties property: Properties of AmlCompute. - * + * * @return the properties value. */ public AmlComputeProperties properties() { @@ -35,7 +82,7 @@ public AmlComputeProperties properties() { /** * Set the properties property: Properties of AmlCompute. - * + * * @param properties the properties value to set. * @return the AmlCompute object itself. */ @@ -44,28 +91,88 @@ public AmlCompute withProperties(AmlComputeProperties properties) { return this; } - /** {@inheritDoc} */ + /** + * Get the provisioningState property: The provision state of the cluster. Valid values are Unknown, Updating, + * Provisioning, Succeeded, and Failed. + * + * @return the provisioningState value. + */ + @Override + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the createdOn property: The time at which the compute was created. + * + * @return the createdOn value. + */ + @Override + public OffsetDateTime createdOn() { + return this.createdOn; + } + + /** + * Get the modifiedOn property: The time at which the compute was last modified. + * + * @return the modifiedOn value. + */ + @Override + public OffsetDateTime modifiedOn() { + return this.modifiedOn; + } + + /** + * Get the provisioningErrors property: Errors during provisioning. + * + * @return the provisioningErrors value. + */ + @Override + public List provisioningErrors() { + return this.provisioningErrors; + } + + /** + * Get the isAttachedCompute property: Indicating whether the compute was provisioned by user and brought from + * outside if true, or machine learning service provisioned it if false. + * + * @return the isAttachedCompute value. + */ + @Override + public Boolean isAttachedCompute() { + return this.isAttachedCompute; + } + + /** + * {@inheritDoc} + */ @Override public AmlCompute withComputeLocation(String computeLocation) { super.withComputeLocation(computeLocation); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AmlCompute withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AmlCompute withResourceId(String resourceId) { super.withResourceId(resourceId); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AmlCompute withDisableLocalAuth(Boolean disableLocalAuth) { super.withDisableLocalAuth(disableLocalAuth); @@ -74,7 +181,7 @@ public AmlCompute withDisableLocalAuth(Boolean disableLocalAuth) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -84,4 +191,69 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("computeLocation", computeLocation()); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("resourceId", resourceId()); + jsonWriter.writeBooleanField("disableLocalAuth", disableLocalAuth()); + jsonWriter.writeStringField("computeType", this.computeType == null ? null : this.computeType.toString()); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AmlCompute from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AmlCompute if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the AmlCompute. + */ + public static AmlCompute fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AmlCompute deserializedAmlCompute = new AmlCompute(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("computeLocation".equals(fieldName)) { + deserializedAmlCompute.withComputeLocation(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedAmlCompute.provisioningState = ProvisioningState.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedAmlCompute.withDescription(reader.getString()); + } else if ("createdOn".equals(fieldName)) { + deserializedAmlCompute.createdOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("modifiedOn".equals(fieldName)) { + deserializedAmlCompute.modifiedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("resourceId".equals(fieldName)) { + deserializedAmlCompute.withResourceId(reader.getString()); + } else if ("provisioningErrors".equals(fieldName)) { + List provisioningErrors + = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); + deserializedAmlCompute.provisioningErrors = provisioningErrors; + } else if ("isAttachedCompute".equals(fieldName)) { + deserializedAmlCompute.isAttachedCompute = reader.getNullable(JsonReader::getBoolean); + } else if ("disableLocalAuth".equals(fieldName)) { + deserializedAmlCompute.withDisableLocalAuth(reader.getNullable(JsonReader::getBoolean)); + } else if ("computeType".equals(fieldName)) { + deserializedAmlCompute.computeType = ComputeType.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedAmlCompute.properties = AmlComputeProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAmlCompute; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlComputeNodeInformation.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlComputeNodeInformation.java index fb5d1b5c24bb8..6923604357b96 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlComputeNodeInformation.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlComputeNodeInformation.java @@ -5,66 +5,56 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Compute node information related to a AmlCompute. */ +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Compute node information related to a AmlCompute. + */ @Immutable -public final class AmlComputeNodeInformation { +public final class AmlComputeNodeInformation implements JsonSerializable { /* - * Node ID. - * * ID of the compute node. */ - @JsonProperty(value = "nodeId", access = JsonProperty.Access.WRITE_ONLY) private String nodeId; /* - * Private IP address. - * * Private IP address of the compute node. */ - @JsonProperty(value = "privateIpAddress", access = JsonProperty.Access.WRITE_ONLY) private String privateIpAddress; /* - * Public IP address. - * * Public IP address of the compute node. */ - @JsonProperty(value = "publicIpAddress", access = JsonProperty.Access.WRITE_ONLY) private String publicIpAddress; /* - * Port. - * * SSH port number of the node. */ - @JsonProperty(value = "port", access = JsonProperty.Access.WRITE_ONLY) private Integer port; /* * State of the compute node. Values are idle, running, preparing, unusable, leaving and preempted. */ - @JsonProperty(value = "nodeState", access = JsonProperty.Access.WRITE_ONLY) private NodeState nodeState; /* - * Run ID. - * * ID of the Experiment running on the node, if any else null. */ - @JsonProperty(value = "runId", access = JsonProperty.Access.WRITE_ONLY) private String runId; - /** Creates an instance of AmlComputeNodeInformation class. */ + /** + * Creates an instance of AmlComputeNodeInformation class. + */ public AmlComputeNodeInformation() { } /** - * Get the nodeId property: Node ID. - * - *

ID of the compute node. - * + * Get the nodeId property: ID of the compute node. + * * @return the nodeId value. */ public String nodeId() { @@ -72,10 +62,8 @@ public String nodeId() { } /** - * Get the privateIpAddress property: Private IP address. - * - *

Private IP address of the compute node. - * + * Get the privateIpAddress property: Private IP address of the compute node. + * * @return the privateIpAddress value. */ public String privateIpAddress() { @@ -83,10 +71,8 @@ public String privateIpAddress() { } /** - * Get the publicIpAddress property: Public IP address. - * - *

Public IP address of the compute node. - * + * Get the publicIpAddress property: Public IP address of the compute node. + * * @return the publicIpAddress value. */ public String publicIpAddress() { @@ -94,10 +80,8 @@ public String publicIpAddress() { } /** - * Get the port property: Port. - * - *

SSH port number of the node. - * + * Get the port property: SSH port number of the node. + * * @return the port value. */ public Integer port() { @@ -107,7 +91,7 @@ public Integer port() { /** * Get the nodeState property: State of the compute node. Values are idle, running, preparing, unusable, leaving and * preempted. - * + * * @return the nodeState value. */ public NodeState nodeState() { @@ -115,10 +99,8 @@ public NodeState nodeState() { } /** - * Get the runId property: Run ID. - * - *

ID of the Experiment running on the node, if any else null. - * + * Get the runId property: ID of the Experiment running on the node, if any else null. + * * @return the runId value. */ public String runId() { @@ -127,9 +109,54 @@ public String runId() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AmlComputeNodeInformation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AmlComputeNodeInformation if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AmlComputeNodeInformation. + */ + public static AmlComputeNodeInformation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AmlComputeNodeInformation deserializedAmlComputeNodeInformation = new AmlComputeNodeInformation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nodeId".equals(fieldName)) { + deserializedAmlComputeNodeInformation.nodeId = reader.getString(); + } else if ("privateIpAddress".equals(fieldName)) { + deserializedAmlComputeNodeInformation.privateIpAddress = reader.getString(); + } else if ("publicIpAddress".equals(fieldName)) { + deserializedAmlComputeNodeInformation.publicIpAddress = reader.getString(); + } else if ("port".equals(fieldName)) { + deserializedAmlComputeNodeInformation.port = reader.getNullable(JsonReader::getInt); + } else if ("nodeState".equals(fieldName)) { + deserializedAmlComputeNodeInformation.nodeState = NodeState.fromString(reader.getString()); + } else if ("runId".equals(fieldName)) { + deserializedAmlComputeNodeInformation.runId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAmlComputeNodeInformation; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlComputeNodesInformation.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlComputeNodesInformation.java index 66e875ffc3cbe..d3062e6f3b569 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlComputeNodesInformation.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlComputeNodesInformation.java @@ -5,31 +5,37 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** Result of AmlCompute Nodes. */ +/** + * Result of AmlCompute Nodes. + */ @Immutable -public final class AmlComputeNodesInformation { +public final class AmlComputeNodesInformation implements JsonSerializable { /* * The collection of returned AmlCompute nodes details. */ - @JsonProperty(value = "nodes", access = JsonProperty.Access.WRITE_ONLY) private List nodes; /* * The continuation token. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of AmlComputeNodesInformation class. */ + /** + * Creates an instance of AmlComputeNodesInformation class. + */ public AmlComputeNodesInformation() { } /** * Get the nodes property: The collection of returned AmlCompute nodes details. - * + * * @return the nodes value. */ public List nodes() { @@ -38,7 +44,7 @@ public List nodes() { /** * Get the nextLink property: The continuation token. - * + * * @return the nextLink value. */ public String nextLink() { @@ -47,7 +53,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -55,4 +61,43 @@ public void validate() { nodes().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AmlComputeNodesInformation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AmlComputeNodesInformation if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AmlComputeNodesInformation. + */ + public static AmlComputeNodesInformation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AmlComputeNodesInformation deserializedAmlComputeNodesInformation = new AmlComputeNodesInformation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nodes".equals(fieldName)) { + List nodes + = reader.readArray(reader1 -> AmlComputeNodeInformation.fromJson(reader1)); + deserializedAmlComputeNodesInformation.nodes = nodes; + } else if ("nextLink".equals(fieldName)) { + deserializedAmlComputeNodesInformation.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAmlComputeNodesInformation; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlComputeProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlComputeProperties.java index 7168c72acc8d3..a34d71abb56ed 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlComputeProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlComputeProperties.java @@ -6,148 +6,125 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.exception.ManagementError; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.List; -/** AML Compute properties. */ +/** + * AML Compute properties. + */ @Fluent -public final class AmlComputeProperties { +public final class AmlComputeProperties implements JsonSerializable { /* * Compute OS Type */ - @JsonProperty(value = "osType") private OsType osType; /* * Virtual Machine Size */ - @JsonProperty(value = "vmSize") private String vmSize; /* * Virtual Machine priority */ - @JsonProperty(value = "vmPriority") private VmPriority vmPriority; /* * Virtual Machine image for AML Compute - windows only */ - @JsonProperty(value = "virtualMachineImage") private VirtualMachineImage virtualMachineImage; /* * Network is isolated or not */ - @JsonProperty(value = "isolatedNetwork") private Boolean isolatedNetwork; /* * Scale settings for AML Compute */ - @JsonProperty(value = "scaleSettings") private ScaleSettings scaleSettings; /* * Credentials for an administrator user account that will be created on each compute node. */ - @JsonProperty(value = "userAccountCredentials") private UserAccountCredentials userAccountCredentials; /* * Virtual network subnet resource ID the compute nodes belong to. */ - @JsonProperty(value = "subnet") private ResourceId subnet; /* - * Close remote Login Access Port - * - * State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on - * all nodes of the cluster. Enabled - Indicates that the public ssh port is open on all nodes of the cluster. + * State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on all + * nodes of the cluster. Enabled - Indicates that the public ssh port is open on all nodes of the cluster. * NotSpecified - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, else * is open all public nodes. It can be default only during cluster creation time, after creation it will be either * enabled or disabled. */ - @JsonProperty(value = "remoteLoginPortPublicAccess") private RemoteLoginPortPublicAccess remoteLoginPortPublicAccess; /* - * Allocation state. - * * 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 compute nodes. - * resizing - Indicates that the compute is resizing; that is, compute nodes are being added to or removed from the - * compute. + * created and when no operations are being performed on the compute to change the number of compute nodes. resizing + * - Indicates that the compute is resizing; that is, compute nodes are being added to or removed from the compute. */ - @JsonProperty(value = "allocationState", access = JsonProperty.Access.WRITE_ONLY) private AllocationState allocationState; /* - * Allocation state transition time. - * * The time at which the compute entered its current allocation state. */ - @JsonProperty(value = "allocationStateTransitionTime", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime allocationStateTransitionTime; /* - * Errors. - * * Collection of errors encountered by various compute nodes during node setup. */ - @JsonProperty(value = "errors", access = JsonProperty.Access.WRITE_ONLY) private List errors; /* - * Current node count. - * * The number of compute nodes currently assigned to the compute. */ - @JsonProperty(value = "currentNodeCount", access = JsonProperty.Access.WRITE_ONLY) private Integer currentNodeCount; /* - * Target node count. - * - * The target number of compute nodes for the compute. If the allocationState is resizing, this property denotes - * the target node count for the ongoing resize operation. If the allocationState is steady, this property denotes - * the target node count for the previous resize operation. + * The target number of compute nodes for the compute. If the allocationState is resizing, this property denotes the + * target node count for the ongoing resize operation. If the allocationState is steady, this property denotes the + * target node count for the previous resize operation. */ - @JsonProperty(value = "targetNodeCount", access = JsonProperty.Access.WRITE_ONLY) private Integer targetNodeCount; /* * Counts of various node states on the compute. */ - @JsonProperty(value = "nodeStateCounts", access = JsonProperty.Access.WRITE_ONLY) private NodeStateCounts nodeStateCounts; /* - * Enable node public IP. - * - * 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. + * 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. */ - @JsonProperty(value = "enableNodePublicIp") private Boolean enableNodePublicIp; /* * A property bag containing additional properties. */ - @JsonProperty(value = "propertyBag") private Object propertyBag; - /** Creates an instance of AmlComputeProperties class. */ + /** + * Creates an instance of AmlComputeProperties class. + */ public AmlComputeProperties() { } /** * Get the osType property: Compute OS Type. - * + * * @return the osType value. */ public OsType osType() { @@ -156,7 +133,7 @@ public OsType osType() { /** * Set the osType property: Compute OS Type. - * + * * @param osType the osType value to set. * @return the AmlComputeProperties object itself. */ @@ -167,7 +144,7 @@ public AmlComputeProperties withOsType(OsType osType) { /** * Get the vmSize property: Virtual Machine Size. - * + * * @return the vmSize value. */ public String vmSize() { @@ -176,7 +153,7 @@ public String vmSize() { /** * Set the vmSize property: Virtual Machine Size. - * + * * @param vmSize the vmSize value to set. * @return the AmlComputeProperties object itself. */ @@ -187,7 +164,7 @@ public AmlComputeProperties withVmSize(String vmSize) { /** * Get the vmPriority property: Virtual Machine priority. - * + * * @return the vmPriority value. */ public VmPriority vmPriority() { @@ -196,7 +173,7 @@ public VmPriority vmPriority() { /** * Set the vmPriority property: Virtual Machine priority. - * + * * @param vmPriority the vmPriority value to set. * @return the AmlComputeProperties object itself. */ @@ -207,7 +184,7 @@ public AmlComputeProperties withVmPriority(VmPriority vmPriority) { /** * Get the virtualMachineImage property: Virtual Machine image for AML Compute - windows only. - * + * * @return the virtualMachineImage value. */ public VirtualMachineImage virtualMachineImage() { @@ -216,7 +193,7 @@ public VirtualMachineImage virtualMachineImage() { /** * Set the virtualMachineImage property: Virtual Machine image for AML Compute - windows only. - * + * * @param virtualMachineImage the virtualMachineImage value to set. * @return the AmlComputeProperties object itself. */ @@ -227,7 +204,7 @@ public AmlComputeProperties withVirtualMachineImage(VirtualMachineImage virtualM /** * Get the isolatedNetwork property: Network is isolated or not. - * + * * @return the isolatedNetwork value. */ public Boolean isolatedNetwork() { @@ -236,7 +213,7 @@ public Boolean isolatedNetwork() { /** * Set the isolatedNetwork property: Network is isolated or not. - * + * * @param isolatedNetwork the isolatedNetwork value to set. * @return the AmlComputeProperties object itself. */ @@ -247,7 +224,7 @@ public AmlComputeProperties withIsolatedNetwork(Boolean isolatedNetwork) { /** * Get the scaleSettings property: Scale settings for AML Compute. - * + * * @return the scaleSettings value. */ public ScaleSettings scaleSettings() { @@ -256,7 +233,7 @@ public ScaleSettings scaleSettings() { /** * Set the scaleSettings property: Scale settings for AML Compute. - * + * * @param scaleSettings the scaleSettings value to set. * @return the AmlComputeProperties object itself. */ @@ -268,7 +245,7 @@ public AmlComputeProperties withScaleSettings(ScaleSettings scaleSettings) { /** * Get the userAccountCredentials property: Credentials for an administrator user account that will be created on * each compute node. - * + * * @return the userAccountCredentials value. */ public UserAccountCredentials userAccountCredentials() { @@ -278,7 +255,7 @@ public UserAccountCredentials userAccountCredentials() { /** * Set the userAccountCredentials property: Credentials for an administrator user account that will be created on * each compute node. - * + * * @param userAccountCredentials the userAccountCredentials value to set. * @return the AmlComputeProperties object itself. */ @@ -289,7 +266,7 @@ public AmlComputeProperties withUserAccountCredentials(UserAccountCredentials us /** * Get the subnet property: Virtual network subnet resource ID the compute nodes belong to. - * + * * @return the subnet value. */ public ResourceId subnet() { @@ -298,7 +275,7 @@ public ResourceId subnet() { /** * Set the subnet property: Virtual network subnet resource ID the compute nodes belong to. - * + * * @param subnet the subnet value to set. * @return the AmlComputeProperties object itself. */ @@ -308,14 +285,12 @@ public AmlComputeProperties withSubnet(ResourceId subnet) { } /** - * Get the remoteLoginPortPublicAccess property: Close remote Login Access Port - * - *

State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on - * all nodes of the cluster. Enabled - Indicates that the public ssh port is open on all nodes of the cluster. - * NotSpecified - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, else - * is open all public nodes. It can be default only during cluster creation time, after creation it will be either - * enabled or disabled. - * + * Get the remoteLoginPortPublicAccess property: State of the public SSH port. Possible values are: Disabled - + * Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - Indicates that the public ssh + * port is open on all nodes of the cluster. NotSpecified - Indicates that the public ssh port is closed on all + * nodes of the cluster if VNet is defined, else is open all public nodes. It can be default only during cluster + * creation time, after creation it will be either enabled or disabled. + * * @return the remoteLoginPortPublicAccess value. */ public RemoteLoginPortPublicAccess remoteLoginPortPublicAccess() { @@ -323,32 +298,28 @@ public RemoteLoginPortPublicAccess remoteLoginPortPublicAccess() { } /** - * Set the remoteLoginPortPublicAccess property: Close remote Login Access Port - * - *

State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on - * all nodes of the cluster. Enabled - Indicates that the public ssh port is open on all nodes of the cluster. - * NotSpecified - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, else - * is open all public nodes. It can be default only during cluster creation time, after creation it will be either - * enabled or disabled. - * + * Set the remoteLoginPortPublicAccess property: State of the public SSH port. Possible values are: Disabled - + * Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - Indicates that the public ssh + * port is open on all nodes of the cluster. NotSpecified - Indicates that the public ssh port is closed on all + * nodes of the cluster if VNet is defined, else is open all public nodes. It can be default only during cluster + * creation time, after creation it will be either enabled or disabled. + * * @param remoteLoginPortPublicAccess the remoteLoginPortPublicAccess value to set. * @return the AmlComputeProperties object itself. */ - public AmlComputeProperties withRemoteLoginPortPublicAccess( - RemoteLoginPortPublicAccess remoteLoginPortPublicAccess) { + public AmlComputeProperties + withRemoteLoginPortPublicAccess(RemoteLoginPortPublicAccess remoteLoginPortPublicAccess) { this.remoteLoginPortPublicAccess = remoteLoginPortPublicAccess; return this; } /** - * Get the allocationState property: Allocation state. - * - *

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 compute nodes. - * resizing - Indicates that the compute is resizing; that is, compute nodes are being added to or removed from the - * compute. - * + * Get the allocationState property: 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 compute nodes. resizing - Indicates that the compute is resizing; that is, compute nodes are being + * added to or removed from the compute. + * * @return the allocationState value. */ public AllocationState allocationState() { @@ -356,10 +327,9 @@ public AllocationState allocationState() { } /** - * Get the allocationStateTransitionTime property: Allocation state transition time. - * - *

The time at which the compute entered its current allocation state. - * + * Get the allocationStateTransitionTime property: The time at which the compute entered its current allocation + * state. + * * @return the allocationStateTransitionTime value. */ public OffsetDateTime allocationStateTransitionTime() { @@ -367,10 +337,8 @@ public OffsetDateTime allocationStateTransitionTime() { } /** - * Get the errors property: Errors. - * - *

Collection of errors encountered by various compute nodes during node setup. - * + * Get the errors property: Collection of errors encountered by various compute nodes during node setup. + * * @return the errors value. */ public List errors() { @@ -378,10 +346,8 @@ public List errors() { } /** - * Get the currentNodeCount property: Current node count. - * - *

The number of compute nodes currently assigned to the compute. - * + * Get the currentNodeCount property: The number of compute nodes currently assigned to the compute. + * * @return the currentNodeCount value. */ public Integer currentNodeCount() { @@ -389,12 +355,10 @@ public Integer currentNodeCount() { } /** - * Get the targetNodeCount property: Target node count. - * - *

The target number of compute nodes for the compute. If the allocationState is resizing, this property denotes - * the target node count for the ongoing resize operation. If the allocationState is steady, this property denotes - * the target node count for the previous resize operation. - * + * Get the targetNodeCount property: The target number of compute nodes for the compute. If the allocationState is + * resizing, this property denotes the target node count for the ongoing resize operation. If the allocationState is + * steady, this property denotes the target node count for the previous resize operation. + * * @return the targetNodeCount value. */ public Integer targetNodeCount() { @@ -403,7 +367,7 @@ public Integer targetNodeCount() { /** * Get the nodeStateCounts property: Counts of various node states on the compute. - * + * * @return the nodeStateCounts value. */ public NodeStateCounts nodeStateCounts() { @@ -411,12 +375,10 @@ public NodeStateCounts nodeStateCounts() { } /** - * Get the enableNodePublicIp property: Enable node public IP. - * - *

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. - * + * Get the enableNodePublicIp property: 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. + * * @return the enableNodePublicIp value. */ public Boolean enableNodePublicIp() { @@ -424,12 +386,10 @@ public Boolean enableNodePublicIp() { } /** - * Set the enableNodePublicIp property: Enable node public IP. - * - *

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. - * + * Set the enableNodePublicIp property: 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. + * * @param enableNodePublicIp the enableNodePublicIp value to set. * @return the AmlComputeProperties object itself. */ @@ -440,7 +400,7 @@ public AmlComputeProperties withEnableNodePublicIp(Boolean enableNodePublicIp) { /** * Get the propertyBag property: A property bag containing additional properties. - * + * * @return the propertyBag value. */ public Object propertyBag() { @@ -449,7 +409,7 @@ public Object propertyBag() { /** * Set the propertyBag property: A property bag containing additional properties. - * + * * @param propertyBag the propertyBag value to set. * @return the AmlComputeProperties object itself. */ @@ -460,7 +420,7 @@ public AmlComputeProperties withPropertyBag(Object propertyBag) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -480,4 +440,86 @@ public void validate() { nodeStateCounts().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("osType", this.osType == null ? null : this.osType.toString()); + jsonWriter.writeStringField("vmSize", this.vmSize); + jsonWriter.writeStringField("vmPriority", this.vmPriority == null ? null : this.vmPriority.toString()); + jsonWriter.writeJsonField("virtualMachineImage", this.virtualMachineImage); + jsonWriter.writeBooleanField("isolatedNetwork", this.isolatedNetwork); + jsonWriter.writeJsonField("scaleSettings", this.scaleSettings); + jsonWriter.writeJsonField("userAccountCredentials", this.userAccountCredentials); + jsonWriter.writeJsonField("subnet", this.subnet); + jsonWriter.writeStringField("remoteLoginPortPublicAccess", + this.remoteLoginPortPublicAccess == null ? null : this.remoteLoginPortPublicAccess.toString()); + jsonWriter.writeBooleanField("enableNodePublicIp", this.enableNodePublicIp); + jsonWriter.writeUntypedField("propertyBag", this.propertyBag); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AmlComputeProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AmlComputeProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AmlComputeProperties. + */ + public static AmlComputeProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AmlComputeProperties deserializedAmlComputeProperties = new AmlComputeProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("osType".equals(fieldName)) { + deserializedAmlComputeProperties.osType = OsType.fromString(reader.getString()); + } else if ("vmSize".equals(fieldName)) { + deserializedAmlComputeProperties.vmSize = reader.getString(); + } else if ("vmPriority".equals(fieldName)) { + deserializedAmlComputeProperties.vmPriority = VmPriority.fromString(reader.getString()); + } else if ("virtualMachineImage".equals(fieldName)) { + deserializedAmlComputeProperties.virtualMachineImage = VirtualMachineImage.fromJson(reader); + } else if ("isolatedNetwork".equals(fieldName)) { + deserializedAmlComputeProperties.isolatedNetwork = reader.getNullable(JsonReader::getBoolean); + } else if ("scaleSettings".equals(fieldName)) { + deserializedAmlComputeProperties.scaleSettings = ScaleSettings.fromJson(reader); + } else if ("userAccountCredentials".equals(fieldName)) { + deserializedAmlComputeProperties.userAccountCredentials = UserAccountCredentials.fromJson(reader); + } else if ("subnet".equals(fieldName)) { + deserializedAmlComputeProperties.subnet = ResourceId.fromJson(reader); + } else if ("remoteLoginPortPublicAccess".equals(fieldName)) { + deserializedAmlComputeProperties.remoteLoginPortPublicAccess + = RemoteLoginPortPublicAccess.fromString(reader.getString()); + } else if ("allocationState".equals(fieldName)) { + deserializedAmlComputeProperties.allocationState = AllocationState.fromString(reader.getString()); + } else if ("allocationStateTransitionTime".equals(fieldName)) { + deserializedAmlComputeProperties.allocationStateTransitionTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("errors".equals(fieldName)) { + List errors = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); + deserializedAmlComputeProperties.errors = errors; + } else if ("currentNodeCount".equals(fieldName)) { + deserializedAmlComputeProperties.currentNodeCount = reader.getNullable(JsonReader::getInt); + } else if ("targetNodeCount".equals(fieldName)) { + deserializedAmlComputeProperties.targetNodeCount = reader.getNullable(JsonReader::getInt); + } else if ("nodeStateCounts".equals(fieldName)) { + deserializedAmlComputeProperties.nodeStateCounts = NodeStateCounts.fromJson(reader); + } else if ("enableNodePublicIp".equals(fieldName)) { + deserializedAmlComputeProperties.enableNodePublicIp = reader.getNullable(JsonReader::getBoolean); + } else if ("propertyBag".equals(fieldName)) { + deserializedAmlComputeProperties.propertyBag = reader.readUntyped(); + } else { + reader.skipChildren(); + } + } + + return deserializedAmlComputeProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlComputeSchema.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlComputeSchema.java index d1c4ec002badb..a9716c1fae72d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlComputeSchema.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlComputeSchema.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Properties(top level) of AmlCompute. */ +/** + * Properties(top level) of AmlCompute. + */ @Fluent -public class AmlComputeSchema { +public class AmlComputeSchema implements JsonSerializable { /* * Properties of AmlCompute */ - @JsonProperty(value = "properties") private AmlComputeProperties properties; - /** Creates an instance of AmlComputeSchema class. */ + /** + * Creates an instance of AmlComputeSchema class. + */ public AmlComputeSchema() { } /** * Get the properties property: Properties of AmlCompute. - * + * * @return the properties value. */ public AmlComputeProperties properties() { @@ -31,7 +38,7 @@ public AmlComputeProperties properties() { /** * Set the properties property: Properties of AmlCompute. - * + * * @param properties the properties value to set. * @return the AmlComputeSchema object itself. */ @@ -42,7 +49,7 @@ public AmlComputeSchema withProperties(AmlComputeProperties properties) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -50,4 +57,40 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AmlComputeSchema from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AmlComputeSchema if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AmlComputeSchema. + */ + public static AmlComputeSchema fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AmlComputeSchema deserializedAmlComputeSchema = new AmlComputeSchema(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedAmlComputeSchema.properties = AmlComputeProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAmlComputeSchema; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlOperation.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlOperation.java deleted file mode 100644 index 89261a24cb42c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlOperation.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.models; - -import com.azure.resourcemanager.machinelearning.fluent.models.AmlOperationInner; - -/** An immutable client-side representation of AmlOperation. */ -public interface AmlOperation { - /** - * Gets the name property: Operation name: {provider}/{resource}/{operation}. - * - * @return the name value. - */ - String name(); - - /** - * Gets the display property: Display name of operation. - * - * @return the display value. - */ - AmlOperationDisplay display(); - - /** - * Gets the isDataAction property: Indicates whether the operation applies to data-plane. - * - * @return the isDataAction value. - */ - Boolean isDataAction(); - - /** - * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.AmlOperationInner object. - * - * @return the inner object. - */ - AmlOperationInner innerModel(); -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlOperationDisplay.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlOperationDisplay.java deleted file mode 100644 index 2bf229e370c1c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlOperationDisplay.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Display name of operation. */ -@Fluent -public final class AmlOperationDisplay { - /* - * The resource provider name: Microsoft.MachineLearningExperimentation - */ - @JsonProperty(value = "provider") - private String provider; - - /* - * The resource on which the operation is performed. - */ - @JsonProperty(value = "resource") - private String resource; - - /* - * The operation that users can perform. - */ - @JsonProperty(value = "operation") - private String operation; - - /* - * The description for the operation. - */ - @JsonProperty(value = "description") - private String description; - - /** Creates an instance of AmlOperationDisplay class. */ - public AmlOperationDisplay() { - } - - /** - * Get the provider property: The resource provider name: Microsoft.MachineLearningExperimentation. - * - * @return the provider value. - */ - public String provider() { - return this.provider; - } - - /** - * Set the provider property: The resource provider name: Microsoft.MachineLearningExperimentation. - * - * @param provider the provider value to set. - * @return the AmlOperationDisplay object itself. - */ - public AmlOperationDisplay withProvider(String provider) { - this.provider = provider; - return this; - } - - /** - * Get the resource property: The resource on which the operation is performed. - * - * @return the resource value. - */ - public String resource() { - return this.resource; - } - - /** - * Set the resource property: The resource on which the operation is performed. - * - * @param resource the resource value to set. - * @return the AmlOperationDisplay object itself. - */ - public AmlOperationDisplay withResource(String resource) { - this.resource = resource; - return this; - } - - /** - * Get the operation property: The operation that users can perform. - * - * @return the operation value. - */ - public String operation() { - return this.operation; - } - - /** - * Set the operation property: The operation that users can perform. - * - * @param operation the operation value to set. - * @return the AmlOperationDisplay object itself. - */ - public AmlOperationDisplay withOperation(String operation) { - this.operation = operation; - return this; - } - - /** - * Get the description property: The description for the operation. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The description for the operation. - * - * @param description the description value to set. - * @return the AmlOperationDisplay object itself. - */ - public AmlOperationDisplay withDescription(String description) { - this.description = description; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlOperationListResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlOperationListResult.java deleted file mode 100644 index 49d6cbce0d995..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlOperationListResult.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.machinelearning.fluent.models.AmlOperationInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** An array of operations supported by the resource provider. */ -@Fluent -public final class AmlOperationListResult { - /* - * List of AML workspace operations supported by the AML workspace resource provider. - */ - @JsonProperty(value = "value") - private List value; - - /** Creates an instance of AmlOperationListResult class. */ - public AmlOperationListResult() { - } - - /** - * Get the value property: List of AML workspace operations supported by the AML workspace resource provider. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of AML workspace operations supported by the AML workspace resource provider. - * - * @param value the value value to set. - * @return the AmlOperationListResult object itself. - */ - public AmlOperationListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlToken.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlToken.java index 03fbe387d4c74..daa2130aeb64d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlToken.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlToken.java @@ -5,25 +5,80 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** AML Token identity configuration. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "identityType") -@JsonTypeName("AMLToken") +/** + * AML Token identity configuration. + */ @Immutable public final class AmlToken extends IdentityConfiguration { - /** Creates an instance of AmlToken class. */ + /* + * [Required] Specifies the type of identity framework. + */ + private IdentityConfigurationType identityType = IdentityConfigurationType.AMLTOKEN; + + /** + * Creates an instance of AmlToken class. + */ public AmlToken() { } + /** + * Get the identityType property: [Required] Specifies the type of identity framework. + * + * @return the identityType value. + */ + @Override + public IdentityConfigurationType identityType() { + return this.identityType; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("identityType", this.identityType == null ? null : this.identityType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AmlToken from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AmlToken if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the AmlToken. + */ + public static AmlToken fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AmlToken deserializedAmlToken = new AmlToken(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("identityType".equals(fieldName)) { + deserializedAmlToken.identityType = IdentityConfigurationType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAmlToken; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlTokenComputeIdentity.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlTokenComputeIdentity.java new file mode 100644 index 0000000000000..4e321bb69e323 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlTokenComputeIdentity.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * AML token compute identity definition. + */ +@Immutable +public final class AmlTokenComputeIdentity extends MonitorComputeIdentityBase { + /* + * [Required] Specifies the type of identity to use within the monitoring jobs. + */ + private MonitorComputeIdentityType computeIdentityType = MonitorComputeIdentityType.AML_TOKEN; + + /** + * Creates an instance of AmlTokenComputeIdentity class. + */ + public AmlTokenComputeIdentity() { + } + + /** + * Get the computeIdentityType property: [Required] Specifies the type of identity to use within the monitoring + * jobs. + * + * @return the computeIdentityType value. + */ + @Override + public MonitorComputeIdentityType computeIdentityType() { + return this.computeIdentityType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("computeIdentityType", + this.computeIdentityType == null ? null : this.computeIdentityType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AmlTokenComputeIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AmlTokenComputeIdentity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AmlTokenComputeIdentity. + */ + public static AmlTokenComputeIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AmlTokenComputeIdentity deserializedAmlTokenComputeIdentity = new AmlTokenComputeIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("computeIdentityType".equals(fieldName)) { + deserializedAmlTokenComputeIdentity.computeIdentityType + = MonitorComputeIdentityType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAmlTokenComputeIdentity; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlUserFeature.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlUserFeature.java index 8fa6accfeb214..e1d9a199d6989 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlUserFeature.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AmlUserFeature.java @@ -6,32 +6,34 @@ import com.azure.resourcemanager.machinelearning.fluent.models.AmlUserFeatureInner; -/** An immutable client-side representation of AmlUserFeature. */ +/** + * An immutable client-side representation of AmlUserFeature. + */ public interface AmlUserFeature { /** * Gets the id property: Specifies the feature ID. - * + * * @return the id value. */ String id(); /** * Gets the displayName property: Specifies the feature name. - * + * * @return the displayName value. */ String displayName(); /** * Gets the description property: Describes the feature for user experience. - * + * * @return the description value. */ String description(); /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.AmlUserFeatureInner object. - * + * * @return the inner object. */ AmlUserFeatureInner innerModel(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AnonymousAccessCredential.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AnonymousAccessCredential.java new file mode 100644 index 0000000000000..062a8ec3b1797 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AnonymousAccessCredential.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Access credential with no credentials. + */ +@Immutable +public final class AnonymousAccessCredential extends DataReferenceCredential { + /* + * [Required] Credential type used to authentication with storage. + */ + private DataReferenceCredentialType credentialType = DataReferenceCredentialType.NO_CREDENTIALS; + + /** + * Creates an instance of AnonymousAccessCredential class. + */ + public AnonymousAccessCredential() { + } + + /** + * Get the credentialType property: [Required] Credential type used to authentication with storage. + * + * @return the credentialType value. + */ + @Override + public DataReferenceCredentialType credentialType() { + return this.credentialType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("credentialType", + this.credentialType == null ? null : this.credentialType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnonymousAccessCredential from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnonymousAccessCredential if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AnonymousAccessCredential. + */ + public static AnonymousAccessCredential fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AnonymousAccessCredential deserializedAnonymousAccessCredential = new AnonymousAccessCredential(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("credentialType".equals(fieldName)) { + deserializedAnonymousAccessCredential.credentialType + = DataReferenceCredentialType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAnonymousAccessCredential; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ApiKeyAuthWorkspaceConnectionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ApiKeyAuthWorkspaceConnectionProperties.java new file mode 100644 index 0000000000000..cab43ca41a15c --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ApiKeyAuthWorkspaceConnectionProperties.java @@ -0,0 +1,281 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; + +/** + * 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. + */ +@Fluent +public final class ApiKeyAuthWorkspaceConnectionProperties extends WorkspaceConnectionPropertiesV2 { + /* + * Authentication type of the connection target + */ + private ConnectionAuthType authType = ConnectionAuthType.API_KEY; + + /* + * Api key object for workspace connection credential. + */ + private WorkspaceConnectionApiKey credentials; + + /* + * The createdByWorkspaceArmId property. + */ + private String createdByWorkspaceArmId; + + /* + * Group based on connection category + */ + private ConnectionGroup group; + + /** + * Creates an instance of ApiKeyAuthWorkspaceConnectionProperties class. + */ + public ApiKeyAuthWorkspaceConnectionProperties() { + } + + /** + * Get the authType property: Authentication type of the connection target. + * + * @return the authType value. + */ + @Override + public ConnectionAuthType authType() { + return this.authType; + } + + /** + * Get the credentials property: Api key object for workspace connection credential. + * + * @return the credentials value. + */ + public WorkspaceConnectionApiKey credentials() { + return this.credentials; + } + + /** + * Set the credentials property: Api key object for workspace connection credential. + * + * @param credentials the credentials value to set. + * @return the ApiKeyAuthWorkspaceConnectionProperties object itself. + */ + public ApiKeyAuthWorkspaceConnectionProperties withCredentials(WorkspaceConnectionApiKey credentials) { + this.credentials = credentials; + return this; + } + + /** + * Get the createdByWorkspaceArmId property: The createdByWorkspaceArmId property. + * + * @return the createdByWorkspaceArmId value. + */ + @Override + public String createdByWorkspaceArmId() { + return this.createdByWorkspaceArmId; + } + + /** + * Get the group property: Group based on connection category. + * + * @return the group value. + */ + @Override + public ConnectionGroup group() { + return this.group; + } + + /** + * {@inheritDoc} + */ + @Override + public ApiKeyAuthWorkspaceConnectionProperties withCategory(ConnectionCategory category) { + super.withCategory(category); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ApiKeyAuthWorkspaceConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { + super.withExpiryTime(expiryTime); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ApiKeyAuthWorkspaceConnectionProperties withIsSharedToAll(Boolean isSharedToAll) { + super.withIsSharedToAll(isSharedToAll); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ApiKeyAuthWorkspaceConnectionProperties withTarget(String target) { + super.withTarget(target); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ApiKeyAuthWorkspaceConnectionProperties withMetadata(Map metadata) { + super.withMetadata(metadata); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ApiKeyAuthWorkspaceConnectionProperties withSharedUserList(List sharedUserList) { + super.withSharedUserList(sharedUserList); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ApiKeyAuthWorkspaceConnectionProperties withValue(String value) { + super.withValue(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ApiKeyAuthWorkspaceConnectionProperties withValueFormat(ValueFormat valueFormat) { + super.withValueFormat(valueFormat); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (credentials() != null) { + credentials().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", category() == null ? null : category().toString()); + jsonWriter.writeStringField("expiryTime", + expiryTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expiryTime())); + jsonWriter.writeBooleanField("isSharedToAll", isSharedToAll()); + jsonWriter.writeStringField("target", target()); + jsonWriter.writeMapField("metadata", metadata(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("sharedUserList", sharedUserList(), + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("value", value()); + jsonWriter.writeStringField("valueFormat", valueFormat() == null ? null : valueFormat().toString()); + jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); + jsonWriter.writeJsonField("credentials", this.credentials); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApiKeyAuthWorkspaceConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApiKeyAuthWorkspaceConnectionProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApiKeyAuthWorkspaceConnectionProperties. + */ + public static ApiKeyAuthWorkspaceConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApiKeyAuthWorkspaceConnectionProperties deserializedApiKeyAuthWorkspaceConnectionProperties + = new ApiKeyAuthWorkspaceConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedApiKeyAuthWorkspaceConnectionProperties + .withCategory(ConnectionCategory.fromString(reader.getString())); + } else if ("createdByWorkspaceArmId".equals(fieldName)) { + deserializedApiKeyAuthWorkspaceConnectionProperties.createdByWorkspaceArmId = reader.getString(); + } else if ("expiryTime".equals(fieldName)) { + deserializedApiKeyAuthWorkspaceConnectionProperties.withExpiryTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("group".equals(fieldName)) { + deserializedApiKeyAuthWorkspaceConnectionProperties.group + = ConnectionGroup.fromString(reader.getString()); + } else if ("isSharedToAll".equals(fieldName)) { + deserializedApiKeyAuthWorkspaceConnectionProperties + .withIsSharedToAll(reader.getNullable(JsonReader::getBoolean)); + } else if ("target".equals(fieldName)) { + deserializedApiKeyAuthWorkspaceConnectionProperties.withTarget(reader.getString()); + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedApiKeyAuthWorkspaceConnectionProperties.withMetadata(metadata); + } else if ("sharedUserList".equals(fieldName)) { + List sharedUserList = reader.readArray(reader1 -> reader1.getString()); + deserializedApiKeyAuthWorkspaceConnectionProperties.withSharedUserList(sharedUserList); + } else if ("value".equals(fieldName)) { + deserializedApiKeyAuthWorkspaceConnectionProperties.withValue(reader.getString()); + } else if ("valueFormat".equals(fieldName)) { + deserializedApiKeyAuthWorkspaceConnectionProperties + .withValueFormat(ValueFormat.fromString(reader.getString())); + } else if ("authType".equals(fieldName)) { + deserializedApiKeyAuthWorkspaceConnectionProperties.authType + = ConnectionAuthType.fromString(reader.getString()); + } else if ("credentials".equals(fieldName)) { + deserializedApiKeyAuthWorkspaceConnectionProperties.credentials + = WorkspaceConnectionApiKey.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedApiKeyAuthWorkspaceConnectionProperties; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ApplicationSharingPolicy.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ApplicationSharingPolicy.java index a653e0e150962..daa001324d7e8 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ApplicationSharingPolicy.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ApplicationSharingPolicy.java @@ -5,26 +5,29 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** * Sharing policy for applications on this compute instance - * - *

Policy for sharing applications on this compute instance among users of parent workspace. If Personal, only the + * + * Policy for sharing applications on this compute instance among users of parent workspace. If Personal, only the * creator can access applications on this compute instance. When Shared, any workspace user can access applications on * this instance depending on his/her assigned role. */ public final class ApplicationSharingPolicy extends ExpandableStringEnum { - /** Static value Personal for ApplicationSharingPolicy. */ + /** + * Static value Personal for ApplicationSharingPolicy. + */ public static final ApplicationSharingPolicy PERSONAL = fromString("Personal"); - /** Static value Shared for ApplicationSharingPolicy. */ + /** + * Static value Shared for ApplicationSharingPolicy. + */ public static final ApplicationSharingPolicy SHARED = fromString("Shared"); /** * Creates a new instance of ApplicationSharingPolicy value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,18 +36,17 @@ public ApplicationSharingPolicy() { /** * Creates or finds a ApplicationSharingPolicy from its string representation. - * + * * @param name a name to look for. * @return the corresponding ApplicationSharingPolicy. */ - @JsonCreator public static ApplicationSharingPolicy fromString(String name) { return fromString(name, ApplicationSharingPolicy.class); } /** * Gets known ApplicationSharingPolicy values. - * + * * @return known ApplicationSharingPolicy values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ArmResourceId.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ArmResourceId.java new file mode 100644 index 0000000000000..406b7f9482068 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ArmResourceId.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * ARM ResourceId of a resource. + */ +@Fluent +public final class ArmResourceId implements JsonSerializable { + /* + * 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}" + */ + private String resourceId; + + /** + * Creates an instance of ArmResourceId class. + */ + public ArmResourceId() { + } + + /** + * Get the resourceId property: 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}". + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: 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}". + * + * @param resourceId the resourceId value to set. + * @return the ArmResourceId object itself. + */ + public ArmResourceId withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ArmResourceId from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ArmResourceId if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ArmResourceId. + */ + public static ArmResourceId fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ArmResourceId deserializedArmResourceId = new ArmResourceId(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedArmResourceId.resourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedArmResourceId; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetBase.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetBase.java index 603e689cf5fa1..f5ad8d399654d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetBase.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetBase.java @@ -5,31 +5,36 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** The AssetBase model. */ +/** + * The AssetBase model. + */ @Fluent public class AssetBase extends ResourceBase { /* * If the name version are system generated (anonymous registration). */ - @JsonProperty(value = "isAnonymous") private Boolean isAnonymous; /* * Is the asset archived? */ - @JsonProperty(value = "isArchived") private Boolean isArchived; - /** Creates an instance of AssetBase class. */ + /** + * Creates an instance of AssetBase class. + */ public AssetBase() { } /** * Get the isAnonymous property: If the name version are system generated (anonymous registration). - * + * * @return the isAnonymous value. */ public Boolean isAnonymous() { @@ -38,7 +43,7 @@ public Boolean isAnonymous() { /** * Set the isAnonymous property: If the name version are system generated (anonymous registration). - * + * * @param isAnonymous the isAnonymous value to set. * @return the AssetBase object itself. */ @@ -49,7 +54,7 @@ public AssetBase withIsAnonymous(Boolean isAnonymous) { /** * Get the isArchived property: Is the asset archived?. - * + * * @return the isArchived value. */ public Boolean isArchived() { @@ -58,7 +63,7 @@ public Boolean isArchived() { /** * Set the isArchived property: Is the asset archived?. - * + * * @param isArchived the isArchived value to set. * @return the AssetBase object itself. */ @@ -67,21 +72,27 @@ public AssetBase withIsArchived(Boolean isArchived) { return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AssetBase withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AssetBase withProperties(Map properties) { super.withProperties(properties); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AssetBase withTags(Map tags) { super.withTags(tags); @@ -90,11 +101,61 @@ public AssetBase withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("isAnonymous", this.isAnonymous); + jsonWriter.writeBooleanField("isArchived", this.isArchived); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AssetBase from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssetBase if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the AssetBase. + */ + public static AssetBase fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssetBase deserializedAssetBase = new AssetBase(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedAssetBase.withDescription(reader.getString()); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedAssetBase.withProperties(properties); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAssetBase.withTags(tags); + } else if ("isAnonymous".equals(fieldName)) { + deserializedAssetBase.isAnonymous = reader.getNullable(JsonReader::getBoolean); + } else if ("isArchived".equals(fieldName)) { + deserializedAssetBase.isArchived = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedAssetBase; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetContainer.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetContainer.java index 6c5d657f3ba67..4e7c405962a86 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetContainer.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetContainer.java @@ -5,37 +5,41 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** The AssetContainer model. */ +/** + * The AssetContainer model. + */ @Fluent public class AssetContainer extends ResourceBase { /* * Is the asset archived? */ - @JsonProperty(value = "isArchived") private Boolean isArchived; /* * The latest version inside this container. */ - @JsonProperty(value = "latestVersion", access = JsonProperty.Access.WRITE_ONLY) private String latestVersion; /* * The next auto incremental version */ - @JsonProperty(value = "nextVersion", access = JsonProperty.Access.WRITE_ONLY) private String nextVersion; - /** Creates an instance of AssetContainer class. */ + /** + * Creates an instance of AssetContainer class. + */ public AssetContainer() { } /** * Get the isArchived property: Is the asset archived?. - * + * * @return the isArchived value. */ public Boolean isArchived() { @@ -44,7 +48,7 @@ public Boolean isArchived() { /** * Set the isArchived property: Is the asset archived?. - * + * * @param isArchived the isArchived value to set. * @return the AssetContainer object itself. */ @@ -55,37 +59,65 @@ public AssetContainer withIsArchived(Boolean isArchived) { /** * Get the latestVersion property: The latest version inside this container. - * + * * @return the latestVersion value. */ public String latestVersion() { return this.latestVersion; } + /** + * Set the latestVersion property: The latest version inside this container. + * + * @param latestVersion the latestVersion value to set. + * @return the AssetContainer object itself. + */ + AssetContainer withLatestVersion(String latestVersion) { + this.latestVersion = latestVersion; + return this; + } + /** * Get the nextVersion property: The next auto incremental version. - * + * * @return the nextVersion value. */ public String nextVersion() { return this.nextVersion; } - /** {@inheritDoc} */ + /** + * Set the nextVersion property: The next auto incremental version. + * + * @param nextVersion the nextVersion value to set. + * @return the AssetContainer object itself. + */ + AssetContainer withNextVersion(String nextVersion) { + this.nextVersion = nextVersion; + return this; + } + + /** + * {@inheritDoc} + */ @Override public AssetContainer withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AssetContainer withProperties(Map properties) { super.withProperties(properties); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AssetContainer withTags(Map tags) { super.withTags(tags); @@ -94,11 +126,62 @@ public AssetContainer withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("isArchived", this.isArchived); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AssetContainer from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssetContainer if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AssetContainer. + */ + public static AssetContainer fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssetContainer deserializedAssetContainer = new AssetContainer(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedAssetContainer.withDescription(reader.getString()); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedAssetContainer.withProperties(properties); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAssetContainer.withTags(tags); + } else if ("isArchived".equals(fieldName)) { + deserializedAssetContainer.isArchived = reader.getNullable(JsonReader::getBoolean); + } else if ("latestVersion".equals(fieldName)) { + deserializedAssetContainer.latestVersion = reader.getString(); + } else if ("nextVersion".equals(fieldName)) { + deserializedAssetContainer.nextVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAssetContainer; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetJobInput.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetJobInput.java index afeecb043691b..fd821b884c269 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetJobInput.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetJobInput.java @@ -6,30 +6,36 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Asset input type. */ +/** + * Asset input type. + */ @Fluent -public class AssetJobInput { +public class AssetJobInput implements JsonSerializable { /* * Input Asset Delivery Mode. */ - @JsonProperty(value = "mode") private InputDeliveryMode mode; /* * [Required] Input Asset URI. */ - @JsonProperty(value = "uri", required = true) private String uri; - /** Creates an instance of AssetJobInput class. */ + /** + * Creates an instance of AssetJobInput class. + */ public AssetJobInput() { } /** * Get the mode property: Input Asset Delivery Mode. - * + * * @return the mode value. */ public InputDeliveryMode mode() { @@ -38,7 +44,7 @@ public InputDeliveryMode mode() { /** * Set the mode property: Input Asset Delivery Mode. - * + * * @param mode the mode value to set. * @return the AssetJobInput object itself. */ @@ -49,7 +55,7 @@ public AssetJobInput withMode(InputDeliveryMode mode) { /** * Get the uri property: [Required] Input Asset URI. - * + * * @return the uri value. */ public String uri() { @@ -58,7 +64,7 @@ public String uri() { /** * Set the uri property: [Required] Input Asset URI. - * + * * @param uri the uri value to set. * @return the AssetJobInput object itself. */ @@ -69,16 +75,55 @@ public AssetJobInput withUri(String uri) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (uri() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property uri in model AssetJobInput")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property uri in model AssetJobInput")); } } private static final ClientLogger LOGGER = new ClientLogger(AssetJobInput.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("uri", this.uri); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AssetJobInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssetJobInput if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AssetJobInput. + */ + public static AssetJobInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssetJobInput deserializedAssetJobInput = new AssetJobInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("uri".equals(fieldName)) { + deserializedAssetJobInput.uri = reader.getString(); + } else if ("mode".equals(fieldName)) { + deserializedAssetJobInput.mode = InputDeliveryMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAssetJobInput; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetJobOutput.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetJobOutput.java index e6c3f9463eab9..44c5179d9f4c8 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetJobOutput.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetJobOutput.java @@ -5,30 +5,36 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Asset output type. */ +/** + * Asset output type. + */ @Fluent -public class AssetJobOutput { +public class AssetJobOutput implements JsonSerializable { /* * Output Asset Delivery Mode. */ - @JsonProperty(value = "mode") private OutputDeliveryMode mode; /* * Output Asset URI. */ - @JsonProperty(value = "uri") private String uri; - /** Creates an instance of AssetJobOutput class. */ + /** + * Creates an instance of AssetJobOutput class. + */ public AssetJobOutput() { } /** * Get the mode property: Output Asset Delivery Mode. - * + * * @return the mode value. */ public OutputDeliveryMode mode() { @@ -37,7 +43,7 @@ public OutputDeliveryMode mode() { /** * Set the mode property: Output Asset Delivery Mode. - * + * * @param mode the mode value to set. * @return the AssetJobOutput object itself. */ @@ -48,7 +54,7 @@ public AssetJobOutput withMode(OutputDeliveryMode mode) { /** * Get the uri property: Output Asset URI. - * + * * @return the uri value. */ public String uri() { @@ -57,7 +63,7 @@ public String uri() { /** * Set the uri property: Output Asset URI. - * + * * @param uri the uri value to set. * @return the AssetJobOutput object itself. */ @@ -68,9 +74,48 @@ public AssetJobOutput withUri(String uri) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + jsonWriter.writeStringField("uri", this.uri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AssetJobOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssetJobOutput if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AssetJobOutput. + */ + public static AssetJobOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssetJobOutput deserializedAssetJobOutput = new AssetJobOutput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("mode".equals(fieldName)) { + deserializedAssetJobOutput.mode = OutputDeliveryMode.fromString(reader.getString()); + } else if ("uri".equals(fieldName)) { + deserializedAssetJobOutput.uri = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAssetJobOutput; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetProvisioningState.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetProvisioningState.java new file mode 100644 index 0000000000000..4dab2c6ed4521 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetProvisioningState.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Provisioning state of registry asset. + */ +public final class AssetProvisioningState extends ExpandableStringEnum { + /** + * Static value Succeeded for AssetProvisioningState. + */ + public static final AssetProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for AssetProvisioningState. + */ + public static final AssetProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Canceled for AssetProvisioningState. + */ + public static final AssetProvisioningState CANCELED = fromString("Canceled"); + + /** + * Static value Creating for AssetProvisioningState. + */ + public static final AssetProvisioningState CREATING = fromString("Creating"); + + /** + * Static value Updating for AssetProvisioningState. + */ + public static final AssetProvisioningState UPDATING = fromString("Updating"); + + /** + * Static value Deleting for AssetProvisioningState. + */ + public static final AssetProvisioningState DELETING = fromString("Deleting"); + + /** + * Creates a new instance of AssetProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AssetProvisioningState() { + } + + /** + * Creates or finds a AssetProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding AssetProvisioningState. + */ + public static AssetProvisioningState fromString(String name) { + return fromString(name, AssetProvisioningState.class); + } + + /** + * Gets known AssetProvisioningState values. + * + * @return known AssetProvisioningState values. + */ + public static Collection values() { + return values(AssetProvisioningState.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetReferenceBase.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetReferenceBase.java index e19aef73ced20..7afbb2dd64013 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetReferenceBase.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssetReferenceBase.java @@ -5,33 +5,107 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Base definition for asset references. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "referenceType", - defaultImpl = AssetReferenceBase.class) -@JsonTypeName("AssetReferenceBase") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "DataPath", value = DataPathAssetReference.class), - @JsonSubTypes.Type(name = "Id", value = IdAssetReference.class), - @JsonSubTypes.Type(name = "OutputPath", value = OutputPathAssetReference.class) -}) +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Base definition for asset references. + */ @Immutable -public class AssetReferenceBase { - /** Creates an instance of AssetReferenceBase class. */ +public class AssetReferenceBase implements JsonSerializable { + /* + * [Required] Specifies the type of asset reference. + */ + private ReferenceType referenceType = ReferenceType.fromString("AssetReferenceBase"); + + /** + * Creates an instance of AssetReferenceBase class. + */ public AssetReferenceBase() { } + /** + * Get the referenceType property: [Required] Specifies the type of asset reference. + * + * @return the referenceType value. + */ + public ReferenceType referenceType() { + return this.referenceType; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("referenceType", this.referenceType == null ? null : this.referenceType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AssetReferenceBase from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssetReferenceBase if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AssetReferenceBase. + */ + public static AssetReferenceBase fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("referenceType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Id".equals(discriminatorValue)) { + return IdAssetReference.fromJson(readerToUse.reset()); + } else if ("DataPath".equals(discriminatorValue)) { + return DataPathAssetReference.fromJson(readerToUse.reset()); + } else if ("OutputPath".equals(discriminatorValue)) { + return OutputPathAssetReference.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static AssetReferenceBase fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssetReferenceBase deserializedAssetReferenceBase = new AssetReferenceBase(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("referenceType".equals(fieldName)) { + deserializedAssetReferenceBase.referenceType = ReferenceType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAssetReferenceBase; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssignedUser.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssignedUser.java index 722668be41094..8a2c105c6ab75 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssignedUser.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AssignedUser.java @@ -6,30 +6,36 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** A user that can be assigned to a compute instance. */ +/** + * A user that can be assigned to a compute instance. + */ @Fluent -public final class AssignedUser { +public final class AssignedUser implements JsonSerializable { /* * User’s AAD Object Id. */ - @JsonProperty(value = "objectId", required = true) private String objectId; /* * User’s AAD Tenant Id. */ - @JsonProperty(value = "tenantId", required = true) private String tenantId; - /** Creates an instance of AssignedUser class. */ + /** + * Creates an instance of AssignedUser class. + */ public AssignedUser() { } /** * Get the objectId property: User’s AAD Object Id. - * + * * @return the objectId value. */ public String objectId() { @@ -38,7 +44,7 @@ public String objectId() { /** * Set the objectId property: User’s AAD Object Id. - * + * * @param objectId the objectId value to set. * @return the AssignedUser object itself. */ @@ -49,7 +55,7 @@ public AssignedUser withObjectId(String objectId) { /** * Get the tenantId property: User’s AAD Tenant Id. - * + * * @return the tenantId value. */ public String tenantId() { @@ -58,7 +64,7 @@ public String tenantId() { /** * Set the tenantId property: User’s AAD Tenant Id. - * + * * @param tenantId the tenantId value to set. * @return the AssignedUser object itself. */ @@ -69,21 +75,59 @@ public AssignedUser withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (objectId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property objectId in model AssignedUser")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property objectId in model AssignedUser")); } if (tenantId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property tenantId in model AssignedUser")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property tenantId in model AssignedUser")); } } private static final ClientLogger LOGGER = new ClientLogger(AssignedUser.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("objectId", this.objectId); + jsonWriter.writeStringField("tenantId", this.tenantId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AssignedUser from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssignedUser if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AssignedUser. + */ + public static AssignedUser fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssignedUser deserializedAssignedUser = new AssignedUser(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("objectId".equals(fieldName)) { + deserializedAssignedUser.objectId = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedAssignedUser.tenantId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAssignedUser; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoForecastHorizon.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoForecastHorizon.java index bafe88b21f84a..3a85d223e13da 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoForecastHorizon.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoForecastHorizon.java @@ -5,25 +5,80 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Forecast horizon determined automatically by system. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "mode") -@JsonTypeName("Auto") +/** + * Forecast horizon determined automatically by system. + */ @Immutable public final class AutoForecastHorizon extends ForecastHorizon { - /** Creates an instance of AutoForecastHorizon class. */ + /* + * [Required] Set forecast horizon value selection mode. + */ + private ForecastHorizonMode mode = ForecastHorizonMode.AUTO; + + /** + * Creates an instance of AutoForecastHorizon class. + */ public AutoForecastHorizon() { } + /** + * Get the mode property: [Required] Set forecast horizon value selection mode. + * + * @return the mode value. + */ + @Override + public ForecastHorizonMode mode() { + return this.mode; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AutoForecastHorizon from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AutoForecastHorizon if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AutoForecastHorizon. + */ + public static AutoForecastHorizon fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AutoForecastHorizon deserializedAutoForecastHorizon = new AutoForecastHorizon(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("mode".equals(fieldName)) { + deserializedAutoForecastHorizon.mode = ForecastHorizonMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAutoForecastHorizon; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoMLJob.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoMLJob.java index a9118767dc85a..54d5ce2e0db60 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoMLJob.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoMLJob.java @@ -6,63 +6,82 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; /** - * AutoMLJob class. Use this class for executing AutoML tasks like Classification/Regression etc. See TaskType enum for - * all the tasks supported. + * AutoMLJob class. + * Use this class for executing AutoML tasks like Classification/Regression etc. + * See TaskType enum for all the tasks supported. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobType") -@JsonTypeName("AutoML") @Fluent public final class AutoMLJob extends JobBaseProperties { + /* + * [Required] Specifies the type of job. + */ + private JobType jobType = JobType.AUTO_ML; + /* * The ARM resource ID of the Environment specification for the job. * This is optional value to provide, if not provided, AutoML will default this to Production AutoML curated * environment version when running the job. */ - @JsonProperty(value = "environmentId") private String environmentId; /* * Environment variables included in the job. */ - @JsonProperty(value = "environmentVariables") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map environmentVariables; /* * Mapping of output data bindings used in the job. */ - @JsonProperty(value = "outputs") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map outputs; + /* + * Queue settings for the job + */ + private QueueSettings queueSettings; + /* * Compute Resource configuration for the job. */ - @JsonProperty(value = "resources") private JobResourceConfiguration resources; /* * [Required] This represents scenario which can be one of Tables/NLP/Image */ - @JsonProperty(value = "taskDetails", required = true) private AutoMLVertical taskDetails; - /** Creates an instance of AutoMLJob class. */ + /* + * Status of the job. + */ + private JobStatus status; + + /** + * Creates an instance of AutoMLJob class. + */ public AutoMLJob() { } /** - * Get the environmentId property: The ARM resource ID of the Environment specification for the job. This is - * optional value to provide, if not provided, AutoML will default this to Production AutoML curated environment - * version when running the job. - * + * Get the jobType property: [Required] Specifies the type of job. + * + * @return the jobType value. + */ + @Override + public JobType jobType() { + return this.jobType; + } + + /** + * Get the environmentId property: The ARM resource ID of the Environment specification for the job. + * This is optional value to provide, if not provided, AutoML will default this to Production AutoML curated + * environment version when running the job. + * * @return the environmentId value. */ public String environmentId() { @@ -70,10 +89,10 @@ public String environmentId() { } /** - * Set the environmentId property: The ARM resource ID of the Environment specification for the job. This is - * optional value to provide, if not provided, AutoML will default this to Production AutoML curated environment - * version when running the job. - * + * Set the environmentId property: The ARM resource ID of the Environment specification for the job. + * This is optional value to provide, if not provided, AutoML will default this to Production AutoML curated + * environment version when running the job. + * * @param environmentId the environmentId value to set. * @return the AutoMLJob object itself. */ @@ -84,7 +103,7 @@ public AutoMLJob withEnvironmentId(String environmentId) { /** * Get the environmentVariables property: Environment variables included in the job. - * + * * @return the environmentVariables value. */ public Map environmentVariables() { @@ -93,7 +112,7 @@ public Map environmentVariables() { /** * Set the environmentVariables property: Environment variables included in the job. - * + * * @param environmentVariables the environmentVariables value to set. * @return the AutoMLJob object itself. */ @@ -104,7 +123,7 @@ public AutoMLJob withEnvironmentVariables(Map environmentVariabl /** * Get the outputs property: Mapping of output data bindings used in the job. - * + * * @return the outputs value. */ public Map outputs() { @@ -113,7 +132,7 @@ public Map outputs() { /** * Set the outputs property: Mapping of output data bindings used in the job. - * + * * @param outputs the outputs value to set. * @return the AutoMLJob object itself. */ @@ -122,9 +141,29 @@ public AutoMLJob withOutputs(Map outputs) { return this; } + /** + * Get the queueSettings property: Queue settings for the job. + * + * @return the queueSettings value. + */ + public QueueSettings queueSettings() { + return this.queueSettings; + } + + /** + * Set the queueSettings property: Queue settings for the job. + * + * @param queueSettings the queueSettings value to set. + * @return the AutoMLJob object itself. + */ + public AutoMLJob withQueueSettings(QueueSettings queueSettings) { + this.queueSettings = queueSettings; + return this; + } + /** * Get the resources property: Compute Resource configuration for the job. - * + * * @return the resources value. */ public JobResourceConfiguration resources() { @@ -133,7 +172,7 @@ public JobResourceConfiguration resources() { /** * Set the resources property: Compute Resource configuration for the job. - * + * * @param resources the resources value to set. * @return the AutoMLJob object itself. */ @@ -144,7 +183,7 @@ public AutoMLJob withResources(JobResourceConfiguration resources) { /** * Get the taskDetails property: [Required] This represents scenario which can be one of Tables/NLP/Image. - * + * * @return the taskDetails value. */ public AutoMLVertical taskDetails() { @@ -153,7 +192,7 @@ public AutoMLVertical taskDetails() { /** * Set the taskDetails property: [Required] This represents scenario which can be one of Tables/NLP/Image. - * + * * @param taskDetails the taskDetails value to set. * @return the AutoMLJob object itself. */ @@ -162,70 +201,109 @@ public AutoMLJob withTaskDetails(AutoMLVertical taskDetails) { return this; } - /** {@inheritDoc} */ + /** + * Get the status property: Status of the job. + * + * @return the status value. + */ + @Override + public JobStatus status() { + return this.status; + } + + /** + * {@inheritDoc} + */ @Override public AutoMLJob withComponentId(String componentId) { super.withComponentId(componentId); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AutoMLJob withComputeId(String computeId) { super.withComputeId(computeId); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AutoMLJob withDisplayName(String displayName) { super.withDisplayName(displayName); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AutoMLJob withExperimentName(String experimentName) { super.withExperimentName(experimentName); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AutoMLJob withIdentity(IdentityConfiguration identity) { super.withIdentity(identity); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AutoMLJob withIsArchived(Boolean isArchived) { super.withIsArchived(isArchived); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ + @Override + public AutoMLJob withNotificationSetting(NotificationSetting notificationSetting) { + super.withNotificationSetting(notificationSetting); + return this; + } + + /** + * {@inheritDoc} + */ @Override public AutoMLJob withServices(Map services) { super.withServices(services); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AutoMLJob withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AutoMLJob withProperties(Map properties) { super.withProperties(properties); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AutoMLJob withTags(Map tags) { super.withTags(tags); @@ -234,33 +312,128 @@ public AutoMLJob withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (outputs() != null) { - outputs() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); + outputs().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + if (queueSettings() != null) { + queueSettings().validate(); } if (resources() != null) { resources().validate(); } if (taskDetails() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property taskDetails in model AutoMLJob")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property taskDetails in model AutoMLJob")); } else { taskDetails().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(AutoMLJob.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("componentId", componentId()); + jsonWriter.writeStringField("computeId", computeId()); + jsonWriter.writeStringField("displayName", displayName()); + jsonWriter.writeStringField("experimentName", experimentName()); + jsonWriter.writeJsonField("identity", identity()); + jsonWriter.writeBooleanField("isArchived", isArchived()); + jsonWriter.writeJsonField("notificationSetting", notificationSetting()); + jsonWriter.writeMapField("services", services(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("taskDetails", this.taskDetails); + jsonWriter.writeStringField("jobType", this.jobType == null ? null : this.jobType.toString()); + jsonWriter.writeStringField("environmentId", this.environmentId); + jsonWriter.writeMapField("environmentVariables", this.environmentVariables, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("outputs", this.outputs, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("queueSettings", this.queueSettings); + jsonWriter.writeJsonField("resources", this.resources); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AutoMLJob from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AutoMLJob if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AutoMLJob. + */ + public static AutoMLJob fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AutoMLJob deserializedAutoMLJob = new AutoMLJob(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedAutoMLJob.withDescription(reader.getString()); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedAutoMLJob.withProperties(properties); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAutoMLJob.withTags(tags); + } else if ("componentId".equals(fieldName)) { + deserializedAutoMLJob.withComponentId(reader.getString()); + } else if ("computeId".equals(fieldName)) { + deserializedAutoMLJob.withComputeId(reader.getString()); + } else if ("displayName".equals(fieldName)) { + deserializedAutoMLJob.withDisplayName(reader.getString()); + } else if ("experimentName".equals(fieldName)) { + deserializedAutoMLJob.withExperimentName(reader.getString()); + } else if ("identity".equals(fieldName)) { + deserializedAutoMLJob.withIdentity(IdentityConfiguration.fromJson(reader)); + } else if ("isArchived".equals(fieldName)) { + deserializedAutoMLJob.withIsArchived(reader.getNullable(JsonReader::getBoolean)); + } else if ("notificationSetting".equals(fieldName)) { + deserializedAutoMLJob.withNotificationSetting(NotificationSetting.fromJson(reader)); + } else if ("services".equals(fieldName)) { + Map services = reader.readMap(reader1 -> JobService.fromJson(reader1)); + deserializedAutoMLJob.withServices(services); + } else if ("status".equals(fieldName)) { + deserializedAutoMLJob.status = JobStatus.fromString(reader.getString()); + } else if ("taskDetails".equals(fieldName)) { + deserializedAutoMLJob.taskDetails = AutoMLVertical.fromJson(reader); + } else if ("jobType".equals(fieldName)) { + deserializedAutoMLJob.jobType = JobType.fromString(reader.getString()); + } else if ("environmentId".equals(fieldName)) { + deserializedAutoMLJob.environmentId = reader.getString(); + } else if ("environmentVariables".equals(fieldName)) { + Map environmentVariables = reader.readMap(reader1 -> reader1.getString()); + deserializedAutoMLJob.environmentVariables = environmentVariables; + } else if ("outputs".equals(fieldName)) { + Map outputs = reader.readMap(reader1 -> JobOutput.fromJson(reader1)); + deserializedAutoMLJob.outputs = outputs; + } else if ("queueSettings".equals(fieldName)) { + deserializedAutoMLJob.queueSettings = QueueSettings.fromJson(reader); + } else if ("resources".equals(fieldName)) { + deserializedAutoMLJob.resources = JobResourceConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAutoMLJob; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoMLVertical.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoMLVertical.java index 827fdba1ef48a..02ac07f9cec8b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoMLVertical.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoMLVertical.java @@ -6,58 +6,57 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** AutoML vertical class. Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "taskType", - defaultImpl = AutoMLVertical.class) -@JsonTypeName("AutoMLVertical") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "Classification", value = Classification.class), - @JsonSubTypes.Type(name = "Forecasting", value = Forecasting.class), - @JsonSubTypes.Type(name = "ImageClassification", value = ImageClassification.class), - @JsonSubTypes.Type(name = "ImageClassificationMultilabel", value = ImageClassificationMultilabel.class), - @JsonSubTypes.Type(name = "ImageInstanceSegmentation", value = ImageInstanceSegmentation.class), - @JsonSubTypes.Type(name = "ImageObjectDetection", value = ImageObjectDetection.class), - @JsonSubTypes.Type(name = "Regression", value = Regression.class), - @JsonSubTypes.Type(name = "TextClassification", value = TextClassification.class), - @JsonSubTypes.Type(name = "TextClassificationMultilabel", value = TextClassificationMultilabel.class), - @JsonSubTypes.Type(name = "TextNER", value = TextNer.class) -}) +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * AutoML vertical class. + * Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical. + */ @Fluent -public class AutoMLVertical { +public class AutoMLVertical implements JsonSerializable { + /* + * [Required] Task type for AutoMLJob. + */ + private TaskType taskType = TaskType.fromString("AutoMLVertical"); + /* * Log verbosity for the job. */ - @JsonProperty(value = "logVerbosity") private LogVerbosity logVerbosity; /* * Target column name: This is prediction values column. * Also known as label column name in context of classification tasks. */ - @JsonProperty(value = "targetColumnName") private String targetColumnName; /* * [Required] Training data input. */ - @JsonProperty(value = "trainingData", required = true) private MLTableJobInput trainingData; - /** Creates an instance of AutoMLVertical class. */ + /** + * Creates an instance of AutoMLVertical class. + */ public AutoMLVertical() { } + /** + * Get the taskType property: [Required] Task type for AutoMLJob. + * + * @return the taskType value. + */ + public TaskType taskType() { + return this.taskType; + } + /** * Get the logVerbosity property: Log verbosity for the job. - * + * * @return the logVerbosity value. */ public LogVerbosity logVerbosity() { @@ -66,7 +65,7 @@ public LogVerbosity logVerbosity() { /** * Set the logVerbosity property: Log verbosity for the job. - * + * * @param logVerbosity the logVerbosity value to set. * @return the AutoMLVertical object itself. */ @@ -76,9 +75,9 @@ public AutoMLVertical withLogVerbosity(LogVerbosity logVerbosity) { } /** - * Get the targetColumnName property: Target column name: This is prediction values column. Also known as label - * column name in context of classification tasks. - * + * Get the targetColumnName property: Target column name: This is prediction values column. + * Also known as label column name in context of classification tasks. + * * @return the targetColumnName value. */ public String targetColumnName() { @@ -86,9 +85,9 @@ public String targetColumnName() { } /** - * Set the targetColumnName property: Target column name: This is prediction values column. Also known as label - * column name in context of classification tasks. - * + * Set the targetColumnName property: Target column name: This is prediction values column. + * Also known as label column name in context of classification tasks. + * * @param targetColumnName the targetColumnName value to set. * @return the AutoMLVertical object itself. */ @@ -99,7 +98,7 @@ public AutoMLVertical withTargetColumnName(String targetColumnName) { /** * Get the trainingData property: [Required] Training data input. - * + * * @return the trainingData value. */ public MLTableJobInput trainingData() { @@ -108,7 +107,7 @@ public MLTableJobInput trainingData() { /** * Set the trainingData property: [Required] Training data input. - * + * * @param trainingData the trainingData value to set. * @return the AutoMLVertical object itself. */ @@ -119,18 +118,106 @@ public AutoMLVertical withTrainingData(MLTableJobInput trainingData) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (trainingData() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property trainingData in model AutoMLVertical")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property trainingData in model AutoMLVertical")); } else { trainingData().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(AutoMLVertical.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("trainingData", this.trainingData); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); + jsonWriter.writeStringField("logVerbosity", this.logVerbosity == null ? null : this.logVerbosity.toString()); + jsonWriter.writeStringField("targetColumnName", this.targetColumnName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AutoMLVertical from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AutoMLVertical if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AutoMLVertical. + */ + public static AutoMLVertical fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("taskType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Classification".equals(discriminatorValue)) { + return Classification.fromJson(readerToUse.reset()); + } else if ("Forecasting".equals(discriminatorValue)) { + return Forecasting.fromJson(readerToUse.reset()); + } else if ("ImageClassification".equals(discriminatorValue)) { + return ImageClassification.fromJson(readerToUse.reset()); + } else if ("ImageClassificationMultilabel".equals(discriminatorValue)) { + return ImageClassificationMultilabel.fromJson(readerToUse.reset()); + } else if ("ImageInstanceSegmentation".equals(discriminatorValue)) { + return ImageInstanceSegmentation.fromJson(readerToUse.reset()); + } else if ("ImageObjectDetection".equals(discriminatorValue)) { + return ImageObjectDetection.fromJson(readerToUse.reset()); + } else if ("Regression".equals(discriminatorValue)) { + return Regression.fromJson(readerToUse.reset()); + } else if ("TextClassification".equals(discriminatorValue)) { + return TextClassification.fromJson(readerToUse.reset()); + } else if ("TextClassificationMultilabel".equals(discriminatorValue)) { + return TextClassificationMultilabel.fromJson(readerToUse.reset()); + } else if ("TextNER".equals(discriminatorValue)) { + return TextNer.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static AutoMLVertical fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AutoMLVertical deserializedAutoMLVertical = new AutoMLVertical(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("trainingData".equals(fieldName)) { + deserializedAutoMLVertical.trainingData = MLTableJobInput.fromJson(reader); + } else if ("taskType".equals(fieldName)) { + deserializedAutoMLVertical.taskType = TaskType.fromString(reader.getString()); + } else if ("logVerbosity".equals(fieldName)) { + deserializedAutoMLVertical.logVerbosity = LogVerbosity.fromString(reader.getString()); + } else if ("targetColumnName".equals(fieldName)) { + deserializedAutoMLVertical.targetColumnName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAutoMLVertical; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoNCrossValidations.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoNCrossValidations.java index 28b2d6e001514..ee03326107830 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoNCrossValidations.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoNCrossValidations.java @@ -5,25 +5,80 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** N-Cross validations determined automatically. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "mode") -@JsonTypeName("Auto") +/** + * N-Cross validations determined automatically. + */ @Immutable public final class AutoNCrossValidations extends NCrossValidations { - /** Creates an instance of AutoNCrossValidations class. */ + /* + * [Required] Mode for determining N-Cross validations. + */ + private NCrossValidationsMode mode = NCrossValidationsMode.AUTO; + + /** + * Creates an instance of AutoNCrossValidations class. + */ public AutoNCrossValidations() { } + /** + * Get the mode property: [Required] Mode for determining N-Cross validations. + * + * @return the mode value. + */ + @Override + public NCrossValidationsMode mode() { + return this.mode; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AutoNCrossValidations from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AutoNCrossValidations if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AutoNCrossValidations. + */ + public static AutoNCrossValidations fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AutoNCrossValidations deserializedAutoNCrossValidations = new AutoNCrossValidations(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("mode".equals(fieldName)) { + deserializedAutoNCrossValidations.mode = NCrossValidationsMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAutoNCrossValidations; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoPauseProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoPauseProperties.java index 668bfa415df05..69ca2322eb0af 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoPauseProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoPauseProperties.java @@ -5,30 +5,36 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Auto pause properties. */ +/** + * Auto pause properties. + */ @Fluent -public final class AutoPauseProperties { +public final class AutoPauseProperties implements JsonSerializable { /* * The delayInMinutes property. */ - @JsonProperty(value = "delayInMinutes") private Integer delayInMinutes; /* * The enabled property. */ - @JsonProperty(value = "enabled") private Boolean enabled; - /** Creates an instance of AutoPauseProperties class. */ + /** + * Creates an instance of AutoPauseProperties class. + */ public AutoPauseProperties() { } /** * Get the delayInMinutes property: The delayInMinutes property. - * + * * @return the delayInMinutes value. */ public Integer delayInMinutes() { @@ -37,7 +43,7 @@ public Integer delayInMinutes() { /** * Set the delayInMinutes property: The delayInMinutes property. - * + * * @param delayInMinutes the delayInMinutes value to set. * @return the AutoPauseProperties object itself. */ @@ -48,7 +54,7 @@ public AutoPauseProperties withDelayInMinutes(Integer delayInMinutes) { /** * Get the enabled property: The enabled property. - * + * * @return the enabled value. */ public Boolean enabled() { @@ -57,7 +63,7 @@ public Boolean enabled() { /** * Set the enabled property: The enabled property. - * + * * @param enabled the enabled value to set. * @return the AutoPauseProperties object itself. */ @@ -68,9 +74,48 @@ public AutoPauseProperties withEnabled(Boolean enabled) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("delayInMinutes", this.delayInMinutes); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AutoPauseProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AutoPauseProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AutoPauseProperties. + */ + public static AutoPauseProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AutoPauseProperties deserializedAutoPauseProperties = new AutoPauseProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("delayInMinutes".equals(fieldName)) { + deserializedAutoPauseProperties.delayInMinutes = reader.getNullable(JsonReader::getInt); + } else if ("enabled".equals(fieldName)) { + deserializedAutoPauseProperties.enabled = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedAutoPauseProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoRebuildSetting.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoRebuildSetting.java index d22d8e77ba60f..90ca957d2bc8f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoRebuildSetting.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoRebuildSetting.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** AutoRebuild setting for the derived image. */ +/** + * AutoRebuild setting for the derived image. + */ public final class AutoRebuildSetting extends ExpandableStringEnum { - /** Static value Disabled for AutoRebuildSetting. */ + /** + * Static value Disabled for AutoRebuildSetting. + */ public static final AutoRebuildSetting DISABLED = fromString("Disabled"); - /** Static value OnBaseImageUpdate for AutoRebuildSetting. */ + /** + * Static value OnBaseImageUpdate for AutoRebuildSetting. + */ public static final AutoRebuildSetting ON_BASE_IMAGE_UPDATE = fromString("OnBaseImageUpdate"); /** * Creates a new instance of AutoRebuildSetting value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public AutoRebuildSetting() { /** * Creates or finds a AutoRebuildSetting from its string representation. - * + * * @param name a name to look for. * @return the corresponding AutoRebuildSetting. */ - @JsonCreator public static AutoRebuildSetting fromString(String name) { return fromString(name, AutoRebuildSetting.class); } /** * Gets known AutoRebuildSetting values. - * + * * @return known AutoRebuildSetting values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoScaleProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoScaleProperties.java index 46ef9432e5a7c..d4367d0673750 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoScaleProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoScaleProperties.java @@ -5,36 +5,41 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Auto scale properties. */ +/** + * Auto scale properties. + */ @Fluent -public final class AutoScaleProperties { +public final class AutoScaleProperties implements JsonSerializable { /* * The minNodeCount property. */ - @JsonProperty(value = "minNodeCount") private Integer minNodeCount; /* * The enabled property. */ - @JsonProperty(value = "enabled") private Boolean enabled; /* * The maxNodeCount property. */ - @JsonProperty(value = "maxNodeCount") private Integer maxNodeCount; - /** Creates an instance of AutoScaleProperties class. */ + /** + * Creates an instance of AutoScaleProperties class. + */ public AutoScaleProperties() { } /** * Get the minNodeCount property: The minNodeCount property. - * + * * @return the minNodeCount value. */ public Integer minNodeCount() { @@ -43,7 +48,7 @@ public Integer minNodeCount() { /** * Set the minNodeCount property: The minNodeCount property. - * + * * @param minNodeCount the minNodeCount value to set. * @return the AutoScaleProperties object itself. */ @@ -54,7 +59,7 @@ public AutoScaleProperties withMinNodeCount(Integer minNodeCount) { /** * Get the enabled property: The enabled property. - * + * * @return the enabled value. */ public Boolean enabled() { @@ -63,7 +68,7 @@ public Boolean enabled() { /** * Set the enabled property: The enabled property. - * + * * @param enabled the enabled value to set. * @return the AutoScaleProperties object itself. */ @@ -74,7 +79,7 @@ public AutoScaleProperties withEnabled(Boolean enabled) { /** * Get the maxNodeCount property: The maxNodeCount property. - * + * * @return the maxNodeCount value. */ public Integer maxNodeCount() { @@ -83,7 +88,7 @@ public Integer maxNodeCount() { /** * Set the maxNodeCount property: The maxNodeCount property. - * + * * @param maxNodeCount the maxNodeCount value to set. * @return the AutoScaleProperties object itself. */ @@ -94,9 +99,51 @@ public AutoScaleProperties withMaxNodeCount(Integer maxNodeCount) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("minNodeCount", this.minNodeCount); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeNumberField("maxNodeCount", this.maxNodeCount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AutoScaleProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AutoScaleProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AutoScaleProperties. + */ + public static AutoScaleProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AutoScaleProperties deserializedAutoScaleProperties = new AutoScaleProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("minNodeCount".equals(fieldName)) { + deserializedAutoScaleProperties.minNodeCount = reader.getNullable(JsonReader::getInt); + } else if ("enabled".equals(fieldName)) { + deserializedAutoScaleProperties.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("maxNodeCount".equals(fieldName)) { + deserializedAutoScaleProperties.maxNodeCount = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedAutoScaleProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoSeasonality.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoSeasonality.java index 6b224b5c8fa5a..4964bfdf4740f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoSeasonality.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoSeasonality.java @@ -5,25 +5,80 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The AutoSeasonality model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "mode") -@JsonTypeName("Auto") +/** + * The AutoSeasonality model. + */ @Immutable public final class AutoSeasonality extends Seasonality { - /** Creates an instance of AutoSeasonality class. */ + /* + * [Required] Seasonality mode. + */ + private SeasonalityMode mode = SeasonalityMode.AUTO; + + /** + * Creates an instance of AutoSeasonality class. + */ public AutoSeasonality() { } + /** + * Get the mode property: [Required] Seasonality mode. + * + * @return the mode value. + */ + @Override + public SeasonalityMode mode() { + return this.mode; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AutoSeasonality from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AutoSeasonality if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AutoSeasonality. + */ + public static AutoSeasonality fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AutoSeasonality deserializedAutoSeasonality = new AutoSeasonality(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("mode".equals(fieldName)) { + deserializedAutoSeasonality.mode = SeasonalityMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAutoSeasonality; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoTargetLags.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoTargetLags.java index ac77cc101f2ef..db38b2851e9c7 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoTargetLags.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoTargetLags.java @@ -5,25 +5,80 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The AutoTargetLags model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "mode") -@JsonTypeName("Auto") +/** + * The AutoTargetLags model. + */ @Immutable public final class AutoTargetLags extends TargetLags { - /** Creates an instance of AutoTargetLags class. */ + /* + * [Required] Set target lags mode - Auto/Custom + */ + private TargetLagsMode mode = TargetLagsMode.AUTO; + + /** + * Creates an instance of AutoTargetLags class. + */ public AutoTargetLags() { } + /** + * Get the mode property: [Required] Set target lags mode - Auto/Custom. + * + * @return the mode value. + */ + @Override + public TargetLagsMode mode() { + return this.mode; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AutoTargetLags from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AutoTargetLags if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AutoTargetLags. + */ + public static AutoTargetLags fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AutoTargetLags deserializedAutoTargetLags = new AutoTargetLags(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("mode".equals(fieldName)) { + deserializedAutoTargetLags.mode = TargetLagsMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAutoTargetLags; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoTargetRollingWindowSize.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoTargetRollingWindowSize.java index b628ecb4c4c5c..e323336c4253f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoTargetRollingWindowSize.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AutoTargetRollingWindowSize.java @@ -5,25 +5,81 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Target lags rolling window determined automatically. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "mode") -@JsonTypeName("Auto") +/** + * Target lags rolling window determined automatically. + */ @Immutable public final class AutoTargetRollingWindowSize extends TargetRollingWindowSize { - /** Creates an instance of AutoTargetRollingWindowSize class. */ + /* + * [Required] TargetRollingWindowSiz detection mode. + */ + private TargetRollingWindowSizeMode mode = TargetRollingWindowSizeMode.AUTO; + + /** + * Creates an instance of AutoTargetRollingWindowSize class. + */ public AutoTargetRollingWindowSize() { } + /** + * Get the mode property: [Required] TargetRollingWindowSiz detection mode. + * + * @return the mode value. + */ + @Override + public TargetRollingWindowSizeMode mode() { + return this.mode; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AutoTargetRollingWindowSize from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AutoTargetRollingWindowSize if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AutoTargetRollingWindowSize. + */ + public static AutoTargetRollingWindowSize fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AutoTargetRollingWindowSize deserializedAutoTargetRollingWindowSize = new AutoTargetRollingWindowSize(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("mode".equals(fieldName)) { + deserializedAutoTargetRollingWindowSize.mode + = TargetRollingWindowSizeMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAutoTargetRollingWindowSize; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Autosave.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Autosave.java index 64daa7358c787..2df4fb435612f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Autosave.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Autosave.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Auto save settings. */ +/** + * Auto save settings. + */ public final class Autosave extends ExpandableStringEnum { - /** Static value None for Autosave. */ + /** + * Static value None for Autosave. + */ public static final Autosave NONE = fromString("None"); - /** Static value Local for Autosave. */ + /** + * Static value Local for Autosave. + */ public static final Autosave LOCAL = fromString("Local"); - /** Static value Remote for Autosave. */ + /** + * Static value Remote for Autosave. + */ public static final Autosave REMOTE = fromString("Remote"); /** * Creates a new instance of Autosave value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public Autosave() { /** * Creates or finds a Autosave from its string representation. - * + * * @param name a name to look for. * @return the corresponding Autosave. */ - @JsonCreator public static Autosave fromString(String name) { return fromString(name, Autosave.class); } /** * Gets known Autosave values. - * + * * @return known Autosave values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureBlobDatastore.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureBlobDatastore.java index 24e0474c29dd5..d4f99d1ca0de5 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureBlobDatastore.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureBlobDatastore.java @@ -5,53 +5,81 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Azure Blob datastore configuration. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "datastoreType") -@JsonTypeName("AzureBlob") +/** + * Azure Blob datastore configuration. + */ @Fluent public final class AzureBlobDatastore extends DatastoreProperties { + /* + * [Required] Storage type backing the datastore. + */ + private DatastoreType datastoreType = DatastoreType.AZURE_BLOB; + /* * Storage account name. */ - @JsonProperty(value = "accountName") private String accountName; /* * Storage account container name. */ - @JsonProperty(value = "containerName") private String containerName; /* * Azure cloud endpoint for the storage account. */ - @JsonProperty(value = "endpoint") private String endpoint; /* * Protocol used to communicate with the storage account. */ - @JsonProperty(value = "protocol") private String protocol; /* * Indicates which identity to use to authenticate service data access to customer's storage. */ - @JsonProperty(value = "serviceDataAccessAuthIdentity") private ServiceDataAccessAuthIdentity serviceDataAccessAuthIdentity; - /** Creates an instance of AzureBlobDatastore class. */ + /* + * Azure Resource Group name + */ + private String resourceGroup; + + /* + * Azure Subscription Id + */ + private String subscriptionId; + + /* + * Readonly property to indicate if datastore is the workspace default datastore + */ + private Boolean isDefault; + + /** + * Creates an instance of AzureBlobDatastore class. + */ public AzureBlobDatastore() { } + /** + * Get the datastoreType property: [Required] Storage type backing the datastore. + * + * @return the datastoreType value. + */ + @Override + public DatastoreType datastoreType() { + return this.datastoreType; + } + /** * Get the accountName property: Storage account name. - * + * * @return the accountName value. */ public String accountName() { @@ -60,7 +88,7 @@ public String accountName() { /** * Set the accountName property: Storage account name. - * + * * @param accountName the accountName value to set. * @return the AzureBlobDatastore object itself. */ @@ -71,7 +99,7 @@ public AzureBlobDatastore withAccountName(String accountName) { /** * Get the containerName property: Storage account container name. - * + * * @return the containerName value. */ public String containerName() { @@ -80,7 +108,7 @@ public String containerName() { /** * Set the containerName property: Storage account container name. - * + * * @param containerName the containerName value to set. * @return the AzureBlobDatastore object itself. */ @@ -91,7 +119,7 @@ public AzureBlobDatastore withContainerName(String containerName) { /** * Get the endpoint property: Azure cloud endpoint for the storage account. - * + * * @return the endpoint value. */ public String endpoint() { @@ -100,7 +128,7 @@ public String endpoint() { /** * Set the endpoint property: Azure cloud endpoint for the storage account. - * + * * @param endpoint the endpoint value to set. * @return the AzureBlobDatastore object itself. */ @@ -111,7 +139,7 @@ public AzureBlobDatastore withEndpoint(String endpoint) { /** * Get the protocol property: Protocol used to communicate with the storage account. - * + * * @return the protocol value. */ public String protocol() { @@ -120,7 +148,7 @@ public String protocol() { /** * Set the protocol property: Protocol used to communicate with the storage account. - * + * * @param protocol the protocol value to set. * @return the AzureBlobDatastore object itself. */ @@ -132,7 +160,7 @@ public AzureBlobDatastore withProtocol(String protocol) { /** * Get the serviceDataAccessAuthIdentity property: Indicates which identity to use to authenticate service data * access to customer's storage. - * + * * @return the serviceDataAccessAuthIdentity value. */ public ServiceDataAccessAuthIdentity serviceDataAccessAuthIdentity() { @@ -142,38 +170,96 @@ public ServiceDataAccessAuthIdentity serviceDataAccessAuthIdentity() { /** * Set the serviceDataAccessAuthIdentity property: Indicates which identity to use to authenticate service data * access to customer's storage. - * + * * @param serviceDataAccessAuthIdentity the serviceDataAccessAuthIdentity value to set. * @return the AzureBlobDatastore object itself. */ - public AzureBlobDatastore withServiceDataAccessAuthIdentity( - ServiceDataAccessAuthIdentity serviceDataAccessAuthIdentity) { + public AzureBlobDatastore + withServiceDataAccessAuthIdentity(ServiceDataAccessAuthIdentity serviceDataAccessAuthIdentity) { this.serviceDataAccessAuthIdentity = serviceDataAccessAuthIdentity; return this; } - /** {@inheritDoc} */ + /** + * Get the resourceGroup property: Azure Resource Group name. + * + * @return the resourceGroup value. + */ + public String resourceGroup() { + return this.resourceGroup; + } + + /** + * Set the resourceGroup property: Azure Resource Group name. + * + * @param resourceGroup the resourceGroup value to set. + * @return the AzureBlobDatastore object itself. + */ + public AzureBlobDatastore withResourceGroup(String resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } + + /** + * Get the subscriptionId property: Azure Subscription Id. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the subscriptionId property: Azure Subscription Id. + * + * @param subscriptionId the subscriptionId value to set. + * @return the AzureBlobDatastore object itself. + */ + public AzureBlobDatastore withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get the isDefault property: Readonly property to indicate if datastore is the workspace default datastore. + * + * @return the isDefault value. + */ + @Override + public Boolean isDefault() { + return this.isDefault; + } + + /** + * {@inheritDoc} + */ @Override public AzureBlobDatastore withCredentials(DatastoreCredentials credentials) { super.withCredentials(credentials); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AzureBlobDatastore withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AzureBlobDatastore withProperties(Map properties) { super.withProperties(properties); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AzureBlobDatastore withTags(Map tags) { super.withTags(tags); @@ -182,11 +268,87 @@ public AzureBlobDatastore withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("credentials", credentials()); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("datastoreType", this.datastoreType == null ? null : this.datastoreType.toString()); + jsonWriter.writeStringField("accountName", this.accountName); + jsonWriter.writeStringField("containerName", this.containerName); + jsonWriter.writeStringField("endpoint", this.endpoint); + jsonWriter.writeStringField("protocol", this.protocol); + jsonWriter.writeStringField("serviceDataAccessAuthIdentity", + this.serviceDataAccessAuthIdentity == null ? null : this.serviceDataAccessAuthIdentity.toString()); + jsonWriter.writeStringField("resourceGroup", this.resourceGroup); + jsonWriter.writeStringField("subscriptionId", this.subscriptionId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureBlobDatastore from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureBlobDatastore if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AzureBlobDatastore. + */ + public static AzureBlobDatastore fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureBlobDatastore deserializedAzureBlobDatastore = new AzureBlobDatastore(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("credentials".equals(fieldName)) { + deserializedAzureBlobDatastore.withCredentials(DatastoreCredentials.fromJson(reader)); + } else if ("description".equals(fieldName)) { + deserializedAzureBlobDatastore.withDescription(reader.getString()); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedAzureBlobDatastore.withProperties(properties); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAzureBlobDatastore.withTags(tags); + } else if ("isDefault".equals(fieldName)) { + deserializedAzureBlobDatastore.isDefault = reader.getNullable(JsonReader::getBoolean); + } else if ("datastoreType".equals(fieldName)) { + deserializedAzureBlobDatastore.datastoreType = DatastoreType.fromString(reader.getString()); + } else if ("accountName".equals(fieldName)) { + deserializedAzureBlobDatastore.accountName = reader.getString(); + } else if ("containerName".equals(fieldName)) { + deserializedAzureBlobDatastore.containerName = reader.getString(); + } else if ("endpoint".equals(fieldName)) { + deserializedAzureBlobDatastore.endpoint = reader.getString(); + } else if ("protocol".equals(fieldName)) { + deserializedAzureBlobDatastore.protocol = reader.getString(); + } else if ("serviceDataAccessAuthIdentity".equals(fieldName)) { + deserializedAzureBlobDatastore.serviceDataAccessAuthIdentity + = ServiceDataAccessAuthIdentity.fromString(reader.getString()); + } else if ("resourceGroup".equals(fieldName)) { + deserializedAzureBlobDatastore.resourceGroup = reader.getString(); + } else if ("subscriptionId".equals(fieldName)) { + deserializedAzureBlobDatastore.subscriptionId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureBlobDatastore; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureDataLakeGen1Datastore.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureDataLakeGen1Datastore.java index f2512a5a47e5b..8021a816d758f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureDataLakeGen1Datastore.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureDataLakeGen1Datastore.java @@ -6,36 +6,67 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Azure Data Lake Gen1 datastore configuration. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "datastoreType") -@JsonTypeName("AzureDataLakeGen1") +/** + * Azure Data Lake Gen1 datastore configuration. + */ @Fluent public final class AzureDataLakeGen1Datastore extends DatastoreProperties { + /* + * [Required] Storage type backing the datastore. + */ + private DatastoreType datastoreType = DatastoreType.AZURE_DATA_LAKE_GEN1; + /* * Indicates which identity to use to authenticate service data access to customer's storage. */ - @JsonProperty(value = "serviceDataAccessAuthIdentity") private ServiceDataAccessAuthIdentity serviceDataAccessAuthIdentity; /* * [Required] Azure Data Lake store name. */ - @JsonProperty(value = "storeName", required = true) private String storeName; - /** Creates an instance of AzureDataLakeGen1Datastore class. */ + /* + * Azure Resource Group name + */ + private String resourceGroup; + + /* + * Azure Subscription Id + */ + private String subscriptionId; + + /* + * Readonly property to indicate if datastore is the workspace default datastore + */ + private Boolean isDefault; + + /** + * Creates an instance of AzureDataLakeGen1Datastore class. + */ public AzureDataLakeGen1Datastore() { } + /** + * Get the datastoreType property: [Required] Storage type backing the datastore. + * + * @return the datastoreType value. + */ + @Override + public DatastoreType datastoreType() { + return this.datastoreType; + } + /** * Get the serviceDataAccessAuthIdentity property: Indicates which identity to use to authenticate service data * access to customer's storage. - * + * * @return the serviceDataAccessAuthIdentity value. */ public ServiceDataAccessAuthIdentity serviceDataAccessAuthIdentity() { @@ -45,19 +76,19 @@ public ServiceDataAccessAuthIdentity serviceDataAccessAuthIdentity() { /** * Set the serviceDataAccessAuthIdentity property: Indicates which identity to use to authenticate service data * access to customer's storage. - * + * * @param serviceDataAccessAuthIdentity the serviceDataAccessAuthIdentity value to set. * @return the AzureDataLakeGen1Datastore object itself. */ - public AzureDataLakeGen1Datastore withServiceDataAccessAuthIdentity( - ServiceDataAccessAuthIdentity serviceDataAccessAuthIdentity) { + public AzureDataLakeGen1Datastore + withServiceDataAccessAuthIdentity(ServiceDataAccessAuthIdentity serviceDataAccessAuthIdentity) { this.serviceDataAccessAuthIdentity = serviceDataAccessAuthIdentity; return this; } /** * Get the storeName property: [Required] Azure Data Lake store name. - * + * * @return the storeName value. */ public String storeName() { @@ -66,7 +97,7 @@ public String storeName() { /** * Set the storeName property: [Required] Azure Data Lake store name. - * + * * @param storeName the storeName value to set. * @return the AzureDataLakeGen1Datastore object itself. */ @@ -75,28 +106,86 @@ public AzureDataLakeGen1Datastore withStoreName(String storeName) { return this; } - /** {@inheritDoc} */ + /** + * Get the resourceGroup property: Azure Resource Group name. + * + * @return the resourceGroup value. + */ + public String resourceGroup() { + return this.resourceGroup; + } + + /** + * Set the resourceGroup property: Azure Resource Group name. + * + * @param resourceGroup the resourceGroup value to set. + * @return the AzureDataLakeGen1Datastore object itself. + */ + public AzureDataLakeGen1Datastore withResourceGroup(String resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } + + /** + * Get the subscriptionId property: Azure Subscription Id. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the subscriptionId property: Azure Subscription Id. + * + * @param subscriptionId the subscriptionId value to set. + * @return the AzureDataLakeGen1Datastore object itself. + */ + public AzureDataLakeGen1Datastore withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get the isDefault property: Readonly property to indicate if datastore is the workspace default datastore. + * + * @return the isDefault value. + */ + @Override + public Boolean isDefault() { + return this.isDefault; + } + + /** + * {@inheritDoc} + */ @Override public AzureDataLakeGen1Datastore withCredentials(DatastoreCredentials credentials) { super.withCredentials(credentials); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AzureDataLakeGen1Datastore withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AzureDataLakeGen1Datastore withProperties(Map properties) { super.withProperties(properties); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AzureDataLakeGen1Datastore withTags(Map tags) { super.withTags(tags); @@ -105,19 +194,85 @@ public AzureDataLakeGen1Datastore withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (storeName() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property storeName in model AzureDataLakeGen1Datastore")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property storeName in model AzureDataLakeGen1Datastore")); } } private static final ClientLogger LOGGER = new ClientLogger(AzureDataLakeGen1Datastore.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("credentials", credentials()); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("storeName", this.storeName); + jsonWriter.writeStringField("datastoreType", this.datastoreType == null ? null : this.datastoreType.toString()); + jsonWriter.writeStringField("serviceDataAccessAuthIdentity", + this.serviceDataAccessAuthIdentity == null ? null : this.serviceDataAccessAuthIdentity.toString()); + jsonWriter.writeStringField("resourceGroup", this.resourceGroup); + jsonWriter.writeStringField("subscriptionId", this.subscriptionId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureDataLakeGen1Datastore from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureDataLakeGen1Datastore if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AzureDataLakeGen1Datastore. + */ + public static AzureDataLakeGen1Datastore fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureDataLakeGen1Datastore deserializedAzureDataLakeGen1Datastore = new AzureDataLakeGen1Datastore(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("credentials".equals(fieldName)) { + deserializedAzureDataLakeGen1Datastore.withCredentials(DatastoreCredentials.fromJson(reader)); + } else if ("description".equals(fieldName)) { + deserializedAzureDataLakeGen1Datastore.withDescription(reader.getString()); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedAzureDataLakeGen1Datastore.withProperties(properties); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAzureDataLakeGen1Datastore.withTags(tags); + } else if ("isDefault".equals(fieldName)) { + deserializedAzureDataLakeGen1Datastore.isDefault = reader.getNullable(JsonReader::getBoolean); + } else if ("storeName".equals(fieldName)) { + deserializedAzureDataLakeGen1Datastore.storeName = reader.getString(); + } else if ("datastoreType".equals(fieldName)) { + deserializedAzureDataLakeGen1Datastore.datastoreType = DatastoreType.fromString(reader.getString()); + } else if ("serviceDataAccessAuthIdentity".equals(fieldName)) { + deserializedAzureDataLakeGen1Datastore.serviceDataAccessAuthIdentity + = ServiceDataAccessAuthIdentity.fromString(reader.getString()); + } else if ("resourceGroup".equals(fieldName)) { + deserializedAzureDataLakeGen1Datastore.resourceGroup = reader.getString(); + } else if ("subscriptionId".equals(fieldName)) { + deserializedAzureDataLakeGen1Datastore.subscriptionId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureDataLakeGen1Datastore; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureDataLakeGen2Datastore.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureDataLakeGen2Datastore.java index 11fa5841c6ae6..b5847dd0cfa05 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureDataLakeGen2Datastore.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureDataLakeGen2Datastore.java @@ -6,53 +6,81 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Azure Data Lake Gen2 datastore configuration. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "datastoreType") -@JsonTypeName("AzureDataLakeGen2") +/** + * Azure Data Lake Gen2 datastore configuration. + */ @Fluent public final class AzureDataLakeGen2Datastore extends DatastoreProperties { + /* + * [Required] Storage type backing the datastore. + */ + private DatastoreType datastoreType = DatastoreType.AZURE_DATA_LAKE_GEN2; + /* * [Required] Storage account name. */ - @JsonProperty(value = "accountName", required = true) private String accountName; /* * Azure cloud endpoint for the storage account. */ - @JsonProperty(value = "endpoint") private String endpoint; /* * [Required] The name of the Data Lake Gen2 filesystem. */ - @JsonProperty(value = "filesystem", required = true) private String filesystem; /* * Protocol used to communicate with the storage account. */ - @JsonProperty(value = "protocol") private String protocol; /* * Indicates which identity to use to authenticate service data access to customer's storage. */ - @JsonProperty(value = "serviceDataAccessAuthIdentity") private ServiceDataAccessAuthIdentity serviceDataAccessAuthIdentity; - /** Creates an instance of AzureDataLakeGen2Datastore class. */ + /* + * Azure Resource Group name + */ + private String resourceGroup; + + /* + * Azure Subscription Id + */ + private String subscriptionId; + + /* + * Readonly property to indicate if datastore is the workspace default datastore + */ + private Boolean isDefault; + + /** + * Creates an instance of AzureDataLakeGen2Datastore class. + */ public AzureDataLakeGen2Datastore() { } + /** + * Get the datastoreType property: [Required] Storage type backing the datastore. + * + * @return the datastoreType value. + */ + @Override + public DatastoreType datastoreType() { + return this.datastoreType; + } + /** * Get the accountName property: [Required] Storage account name. - * + * * @return the accountName value. */ public String accountName() { @@ -61,7 +89,7 @@ public String accountName() { /** * Set the accountName property: [Required] Storage account name. - * + * * @param accountName the accountName value to set. * @return the AzureDataLakeGen2Datastore object itself. */ @@ -72,7 +100,7 @@ public AzureDataLakeGen2Datastore withAccountName(String accountName) { /** * Get the endpoint property: Azure cloud endpoint for the storage account. - * + * * @return the endpoint value. */ public String endpoint() { @@ -81,7 +109,7 @@ public String endpoint() { /** * Set the endpoint property: Azure cloud endpoint for the storage account. - * + * * @param endpoint the endpoint value to set. * @return the AzureDataLakeGen2Datastore object itself. */ @@ -92,7 +120,7 @@ public AzureDataLakeGen2Datastore withEndpoint(String endpoint) { /** * Get the filesystem property: [Required] The name of the Data Lake Gen2 filesystem. - * + * * @return the filesystem value. */ public String filesystem() { @@ -101,7 +129,7 @@ public String filesystem() { /** * Set the filesystem property: [Required] The name of the Data Lake Gen2 filesystem. - * + * * @param filesystem the filesystem value to set. * @return the AzureDataLakeGen2Datastore object itself. */ @@ -112,7 +140,7 @@ public AzureDataLakeGen2Datastore withFilesystem(String filesystem) { /** * Get the protocol property: Protocol used to communicate with the storage account. - * + * * @return the protocol value. */ public String protocol() { @@ -121,7 +149,7 @@ public String protocol() { /** * Set the protocol property: Protocol used to communicate with the storage account. - * + * * @param protocol the protocol value to set. * @return the AzureDataLakeGen2Datastore object itself. */ @@ -133,7 +161,7 @@ public AzureDataLakeGen2Datastore withProtocol(String protocol) { /** * Get the serviceDataAccessAuthIdentity property: Indicates which identity to use to authenticate service data * access to customer's storage. - * + * * @return the serviceDataAccessAuthIdentity value. */ public ServiceDataAccessAuthIdentity serviceDataAccessAuthIdentity() { @@ -143,38 +171,96 @@ public ServiceDataAccessAuthIdentity serviceDataAccessAuthIdentity() { /** * Set the serviceDataAccessAuthIdentity property: Indicates which identity to use to authenticate service data * access to customer's storage. - * + * * @param serviceDataAccessAuthIdentity the serviceDataAccessAuthIdentity value to set. * @return the AzureDataLakeGen2Datastore object itself. */ - public AzureDataLakeGen2Datastore withServiceDataAccessAuthIdentity( - ServiceDataAccessAuthIdentity serviceDataAccessAuthIdentity) { + public AzureDataLakeGen2Datastore + withServiceDataAccessAuthIdentity(ServiceDataAccessAuthIdentity serviceDataAccessAuthIdentity) { this.serviceDataAccessAuthIdentity = serviceDataAccessAuthIdentity; return this; } - /** {@inheritDoc} */ + /** + * Get the resourceGroup property: Azure Resource Group name. + * + * @return the resourceGroup value. + */ + public String resourceGroup() { + return this.resourceGroup; + } + + /** + * Set the resourceGroup property: Azure Resource Group name. + * + * @param resourceGroup the resourceGroup value to set. + * @return the AzureDataLakeGen2Datastore object itself. + */ + public AzureDataLakeGen2Datastore withResourceGroup(String resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } + + /** + * Get the subscriptionId property: Azure Subscription Id. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the subscriptionId property: Azure Subscription Id. + * + * @param subscriptionId the subscriptionId value to set. + * @return the AzureDataLakeGen2Datastore object itself. + */ + public AzureDataLakeGen2Datastore withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get the isDefault property: Readonly property to indicate if datastore is the workspace default datastore. + * + * @return the isDefault value. + */ + @Override + public Boolean isDefault() { + return this.isDefault; + } + + /** + * {@inheritDoc} + */ @Override public AzureDataLakeGen2Datastore withCredentials(DatastoreCredentials credentials) { super.withCredentials(credentials); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AzureDataLakeGen2Datastore withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AzureDataLakeGen2Datastore withProperties(Map properties) { super.withProperties(properties); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AzureDataLakeGen2Datastore withTags(Map tags) { super.withTags(tags); @@ -183,25 +269,99 @@ public AzureDataLakeGen2Datastore withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (accountName() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property accountName in model AzureDataLakeGen2Datastore")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property accountName in model AzureDataLakeGen2Datastore")); } if (filesystem() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property filesystem in model AzureDataLakeGen2Datastore")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property filesystem in model AzureDataLakeGen2Datastore")); } } private static final ClientLogger LOGGER = new ClientLogger(AzureDataLakeGen2Datastore.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("credentials", credentials()); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("accountName", this.accountName); + jsonWriter.writeStringField("filesystem", this.filesystem); + jsonWriter.writeStringField("datastoreType", this.datastoreType == null ? null : this.datastoreType.toString()); + jsonWriter.writeStringField("endpoint", this.endpoint); + jsonWriter.writeStringField("protocol", this.protocol); + jsonWriter.writeStringField("serviceDataAccessAuthIdentity", + this.serviceDataAccessAuthIdentity == null ? null : this.serviceDataAccessAuthIdentity.toString()); + jsonWriter.writeStringField("resourceGroup", this.resourceGroup); + jsonWriter.writeStringField("subscriptionId", this.subscriptionId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureDataLakeGen2Datastore from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureDataLakeGen2Datastore if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AzureDataLakeGen2Datastore. + */ + public static AzureDataLakeGen2Datastore fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureDataLakeGen2Datastore deserializedAzureDataLakeGen2Datastore = new AzureDataLakeGen2Datastore(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("credentials".equals(fieldName)) { + deserializedAzureDataLakeGen2Datastore.withCredentials(DatastoreCredentials.fromJson(reader)); + } else if ("description".equals(fieldName)) { + deserializedAzureDataLakeGen2Datastore.withDescription(reader.getString()); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedAzureDataLakeGen2Datastore.withProperties(properties); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAzureDataLakeGen2Datastore.withTags(tags); + } else if ("isDefault".equals(fieldName)) { + deserializedAzureDataLakeGen2Datastore.isDefault = reader.getNullable(JsonReader::getBoolean); + } else if ("accountName".equals(fieldName)) { + deserializedAzureDataLakeGen2Datastore.accountName = reader.getString(); + } else if ("filesystem".equals(fieldName)) { + deserializedAzureDataLakeGen2Datastore.filesystem = reader.getString(); + } else if ("datastoreType".equals(fieldName)) { + deserializedAzureDataLakeGen2Datastore.datastoreType = DatastoreType.fromString(reader.getString()); + } else if ("endpoint".equals(fieldName)) { + deserializedAzureDataLakeGen2Datastore.endpoint = reader.getString(); + } else if ("protocol".equals(fieldName)) { + deserializedAzureDataLakeGen2Datastore.protocol = reader.getString(); + } else if ("serviceDataAccessAuthIdentity".equals(fieldName)) { + deserializedAzureDataLakeGen2Datastore.serviceDataAccessAuthIdentity + = ServiceDataAccessAuthIdentity.fromString(reader.getString()); + } else if ("resourceGroup".equals(fieldName)) { + deserializedAzureDataLakeGen2Datastore.resourceGroup = reader.getString(); + } else if ("subscriptionId".equals(fieldName)) { + deserializedAzureDataLakeGen2Datastore.subscriptionId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureDataLakeGen2Datastore; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureDatastore.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureDatastore.java new file mode 100644 index 0000000000000..88a1b30f48472 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureDatastore.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Base definition for Azure datastore contents configuration. + */ +@Fluent +public class AzureDatastore implements JsonSerializable { + /* + * Azure Resource Group name + */ + private String resourceGroup; + + /* + * Azure Subscription Id + */ + private String subscriptionId; + + /** + * Creates an instance of AzureDatastore class. + */ + public AzureDatastore() { + } + + /** + * Get the resourceGroup property: Azure Resource Group name. + * + * @return the resourceGroup value. + */ + public String resourceGroup() { + return this.resourceGroup; + } + + /** + * Set the resourceGroup property: Azure Resource Group name. + * + * @param resourceGroup the resourceGroup value to set. + * @return the AzureDatastore object itself. + */ + public AzureDatastore withResourceGroup(String resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } + + /** + * Get the subscriptionId property: Azure Subscription Id. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the subscriptionId property: Azure Subscription Id. + * + * @param subscriptionId the subscriptionId value to set. + * @return the AzureDatastore object itself. + */ + public AzureDatastore withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceGroup", this.resourceGroup); + jsonWriter.writeStringField("subscriptionId", this.subscriptionId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureDatastore from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureDatastore if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureDatastore. + */ + public static AzureDatastore fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureDatastore deserializedAzureDatastore = new AzureDatastore(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceGroup".equals(fieldName)) { + deserializedAzureDatastore.resourceGroup = reader.getString(); + } else if ("subscriptionId".equals(fieldName)) { + deserializedAzureDatastore.subscriptionId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureDatastore; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureDevOpsWebhook.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureDevOpsWebhook.java new file mode 100644 index 0000000000000..d9c92e528d79c --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureDevOpsWebhook.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Webhook details specific for Azure DevOps. + */ +@Fluent +public final class AzureDevOpsWebhook extends Webhook { + /* + * [Required] Specifies the type of service to send a callback + */ + private WebhookType webhookType = WebhookType.AZURE_DEV_OPS; + + /** + * Creates an instance of AzureDevOpsWebhook class. + */ + public AzureDevOpsWebhook() { + } + + /** + * Get the webhookType property: [Required] Specifies the type of service to send a callback. + * + * @return the webhookType value. + */ + @Override + public WebhookType webhookType() { + return this.webhookType; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureDevOpsWebhook withEventType(String eventType) { + super.withEventType(eventType); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("eventType", eventType()); + jsonWriter.writeStringField("webhookType", this.webhookType == null ? null : this.webhookType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureDevOpsWebhook from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureDevOpsWebhook if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureDevOpsWebhook. + */ + public static AzureDevOpsWebhook fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureDevOpsWebhook deserializedAzureDevOpsWebhook = new AzureDevOpsWebhook(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("eventType".equals(fieldName)) { + deserializedAzureDevOpsWebhook.withEventType(reader.getString()); + } else if ("webhookType".equals(fieldName)) { + deserializedAzureDevOpsWebhook.webhookType = WebhookType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureDevOpsWebhook; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureFileDatastore.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureFileDatastore.java index af3f62739d13d..d7ee64f9f02d9 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureFileDatastore.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureFileDatastore.java @@ -6,53 +6,81 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Azure File datastore configuration. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "datastoreType") -@JsonTypeName("AzureFile") +/** + * Azure File datastore configuration. + */ @Fluent public final class AzureFileDatastore extends DatastoreProperties { + /* + * [Required] Storage type backing the datastore. + */ + private DatastoreType datastoreType = DatastoreType.AZURE_FILE; + /* * [Required] Storage account name. */ - @JsonProperty(value = "accountName", required = true) private String accountName; /* * Azure cloud endpoint for the storage account. */ - @JsonProperty(value = "endpoint") private String endpoint; /* * [Required] The name of the Azure file share that the datastore points to. */ - @JsonProperty(value = "fileShareName", required = true) private String fileShareName; /* * Protocol used to communicate with the storage account. */ - @JsonProperty(value = "protocol") private String protocol; /* * Indicates which identity to use to authenticate service data access to customer's storage. */ - @JsonProperty(value = "serviceDataAccessAuthIdentity") private ServiceDataAccessAuthIdentity serviceDataAccessAuthIdentity; - /** Creates an instance of AzureFileDatastore class. */ + /* + * Azure Resource Group name + */ + private String resourceGroup; + + /* + * Azure Subscription Id + */ + private String subscriptionId; + + /* + * Readonly property to indicate if datastore is the workspace default datastore + */ + private Boolean isDefault; + + /** + * Creates an instance of AzureFileDatastore class. + */ public AzureFileDatastore() { } + /** + * Get the datastoreType property: [Required] Storage type backing the datastore. + * + * @return the datastoreType value. + */ + @Override + public DatastoreType datastoreType() { + return this.datastoreType; + } + /** * Get the accountName property: [Required] Storage account name. - * + * * @return the accountName value. */ public String accountName() { @@ -61,7 +89,7 @@ public String accountName() { /** * Set the accountName property: [Required] Storage account name. - * + * * @param accountName the accountName value to set. * @return the AzureFileDatastore object itself. */ @@ -72,7 +100,7 @@ public AzureFileDatastore withAccountName(String accountName) { /** * Get the endpoint property: Azure cloud endpoint for the storage account. - * + * * @return the endpoint value. */ public String endpoint() { @@ -81,7 +109,7 @@ public String endpoint() { /** * Set the endpoint property: Azure cloud endpoint for the storage account. - * + * * @param endpoint the endpoint value to set. * @return the AzureFileDatastore object itself. */ @@ -92,7 +120,7 @@ public AzureFileDatastore withEndpoint(String endpoint) { /** * Get the fileShareName property: [Required] The name of the Azure file share that the datastore points to. - * + * * @return the fileShareName value. */ public String fileShareName() { @@ -101,7 +129,7 @@ public String fileShareName() { /** * Set the fileShareName property: [Required] The name of the Azure file share that the datastore points to. - * + * * @param fileShareName the fileShareName value to set. * @return the AzureFileDatastore object itself. */ @@ -112,7 +140,7 @@ public AzureFileDatastore withFileShareName(String fileShareName) { /** * Get the protocol property: Protocol used to communicate with the storage account. - * + * * @return the protocol value. */ public String protocol() { @@ -121,7 +149,7 @@ public String protocol() { /** * Set the protocol property: Protocol used to communicate with the storage account. - * + * * @param protocol the protocol value to set. * @return the AzureFileDatastore object itself. */ @@ -133,7 +161,7 @@ public AzureFileDatastore withProtocol(String protocol) { /** * Get the serviceDataAccessAuthIdentity property: Indicates which identity to use to authenticate service data * access to customer's storage. - * + * * @return the serviceDataAccessAuthIdentity value. */ public ServiceDataAccessAuthIdentity serviceDataAccessAuthIdentity() { @@ -143,38 +171,96 @@ public ServiceDataAccessAuthIdentity serviceDataAccessAuthIdentity() { /** * Set the serviceDataAccessAuthIdentity property: Indicates which identity to use to authenticate service data * access to customer's storage. - * + * * @param serviceDataAccessAuthIdentity the serviceDataAccessAuthIdentity value to set. * @return the AzureFileDatastore object itself. */ - public AzureFileDatastore withServiceDataAccessAuthIdentity( - ServiceDataAccessAuthIdentity serviceDataAccessAuthIdentity) { + public AzureFileDatastore + withServiceDataAccessAuthIdentity(ServiceDataAccessAuthIdentity serviceDataAccessAuthIdentity) { this.serviceDataAccessAuthIdentity = serviceDataAccessAuthIdentity; return this; } - /** {@inheritDoc} */ + /** + * Get the resourceGroup property: Azure Resource Group name. + * + * @return the resourceGroup value. + */ + public String resourceGroup() { + return this.resourceGroup; + } + + /** + * Set the resourceGroup property: Azure Resource Group name. + * + * @param resourceGroup the resourceGroup value to set. + * @return the AzureFileDatastore object itself. + */ + public AzureFileDatastore withResourceGroup(String resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } + + /** + * Get the subscriptionId property: Azure Subscription Id. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the subscriptionId property: Azure Subscription Id. + * + * @param subscriptionId the subscriptionId value to set. + * @return the AzureFileDatastore object itself. + */ + public AzureFileDatastore withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get the isDefault property: Readonly property to indicate if datastore is the workspace default datastore. + * + * @return the isDefault value. + */ + @Override + public Boolean isDefault() { + return this.isDefault; + } + + /** + * {@inheritDoc} + */ @Override public AzureFileDatastore withCredentials(DatastoreCredentials credentials) { super.withCredentials(credentials); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AzureFileDatastore withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AzureFileDatastore withProperties(Map properties) { super.withProperties(properties); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AzureFileDatastore withTags(Map tags) { super.withTags(tags); @@ -183,24 +269,98 @@ public AzureFileDatastore withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (accountName() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property accountName in model AzureFileDatastore")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property accountName in model AzureFileDatastore")); } if (fileShareName() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property fileShareName in model AzureFileDatastore")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property fileShareName in model AzureFileDatastore")); } } private static final ClientLogger LOGGER = new ClientLogger(AzureFileDatastore.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("credentials", credentials()); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("accountName", this.accountName); + jsonWriter.writeStringField("fileShareName", this.fileShareName); + jsonWriter.writeStringField("datastoreType", this.datastoreType == null ? null : this.datastoreType.toString()); + jsonWriter.writeStringField("endpoint", this.endpoint); + jsonWriter.writeStringField("protocol", this.protocol); + jsonWriter.writeStringField("serviceDataAccessAuthIdentity", + this.serviceDataAccessAuthIdentity == null ? null : this.serviceDataAccessAuthIdentity.toString()); + jsonWriter.writeStringField("resourceGroup", this.resourceGroup); + jsonWriter.writeStringField("subscriptionId", this.subscriptionId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureFileDatastore from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureFileDatastore if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AzureFileDatastore. + */ + public static AzureFileDatastore fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureFileDatastore deserializedAzureFileDatastore = new AzureFileDatastore(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("credentials".equals(fieldName)) { + deserializedAzureFileDatastore.withCredentials(DatastoreCredentials.fromJson(reader)); + } else if ("description".equals(fieldName)) { + deserializedAzureFileDatastore.withDescription(reader.getString()); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedAzureFileDatastore.withProperties(properties); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAzureFileDatastore.withTags(tags); + } else if ("isDefault".equals(fieldName)) { + deserializedAzureFileDatastore.isDefault = reader.getNullable(JsonReader::getBoolean); + } else if ("accountName".equals(fieldName)) { + deserializedAzureFileDatastore.accountName = reader.getString(); + } else if ("fileShareName".equals(fieldName)) { + deserializedAzureFileDatastore.fileShareName = reader.getString(); + } else if ("datastoreType".equals(fieldName)) { + deserializedAzureFileDatastore.datastoreType = DatastoreType.fromString(reader.getString()); + } else if ("endpoint".equals(fieldName)) { + deserializedAzureFileDatastore.endpoint = reader.getString(); + } else if ("protocol".equals(fieldName)) { + deserializedAzureFileDatastore.protocol = reader.getString(); + } else if ("serviceDataAccessAuthIdentity".equals(fieldName)) { + deserializedAzureFileDatastore.serviceDataAccessAuthIdentity + = ServiceDataAccessAuthIdentity.fromString(reader.getString()); + } else if ("resourceGroup".equals(fieldName)) { + deserializedAzureFileDatastore.resourceGroup = reader.getString(); + } else if ("subscriptionId".equals(fieldName)) { + deserializedAzureFileDatastore.subscriptionId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureFileDatastore; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureOpenAiFineTuning.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureOpenAiFineTuning.java new file mode 100644 index 0000000000000..72ba40443a36d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureOpenAiFineTuning.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The AzureOpenAiFineTuning model. + */ +@Fluent +public final class AzureOpenAiFineTuning extends FineTuningVertical { + /* + * [Required] Enum to determine the type of fine tuning. + */ + private ModelProvider modelProvider = ModelProvider.AZURE_OPEN_AI; + + /* + * HyperParameters for fine tuning Azure Open AI model. + */ + private AzureOpenAiHyperParameters hyperParameters; + + /** + * Creates an instance of AzureOpenAiFineTuning class. + */ + public AzureOpenAiFineTuning() { + } + + /** + * Get the modelProvider property: [Required] Enum to determine the type of fine tuning. + * + * @return the modelProvider value. + */ + @Override + public ModelProvider modelProvider() { + return this.modelProvider; + } + + /** + * Get the hyperParameters property: HyperParameters for fine tuning Azure Open AI model. + * + * @return the hyperParameters value. + */ + public AzureOpenAiHyperParameters hyperParameters() { + return this.hyperParameters; + } + + /** + * Set the hyperParameters property: HyperParameters for fine tuning Azure Open AI model. + * + * @param hyperParameters the hyperParameters value to set. + * @return the AzureOpenAiFineTuning object itself. + */ + public AzureOpenAiFineTuning withHyperParameters(AzureOpenAiHyperParameters hyperParameters) { + this.hyperParameters = hyperParameters; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureOpenAiFineTuning withTaskType(FineTuningTaskType taskType) { + super.withTaskType(taskType); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureOpenAiFineTuning withTrainingData(JobInput trainingData) { + super.withTrainingData(trainingData); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureOpenAiFineTuning withValidationData(JobInput validationData) { + super.withValidationData(validationData); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureOpenAiFineTuning withModel(MLFlowModelJobInput model) { + super.withModel(model); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (hyperParameters() != null) { + hyperParameters().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("taskType", taskType() == null ? null : taskType().toString()); + jsonWriter.writeJsonField("trainingData", trainingData()); + jsonWriter.writeJsonField("model", model()); + jsonWriter.writeJsonField("validationData", validationData()); + jsonWriter.writeStringField("modelProvider", this.modelProvider == null ? null : this.modelProvider.toString()); + jsonWriter.writeJsonField("hyperParameters", this.hyperParameters); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureOpenAiFineTuning from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureOpenAiFineTuning if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AzureOpenAiFineTuning. + */ + public static AzureOpenAiFineTuning fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureOpenAiFineTuning deserializedAzureOpenAiFineTuning = new AzureOpenAiFineTuning(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("taskType".equals(fieldName)) { + deserializedAzureOpenAiFineTuning.withTaskType(FineTuningTaskType.fromString(reader.getString())); + } else if ("trainingData".equals(fieldName)) { + deserializedAzureOpenAiFineTuning.withTrainingData(JobInput.fromJson(reader)); + } else if ("model".equals(fieldName)) { + deserializedAzureOpenAiFineTuning.withModel(MLFlowModelJobInput.fromJson(reader)); + } else if ("validationData".equals(fieldName)) { + deserializedAzureOpenAiFineTuning.withValidationData(JobInput.fromJson(reader)); + } else if ("modelProvider".equals(fieldName)) { + deserializedAzureOpenAiFineTuning.modelProvider = ModelProvider.fromString(reader.getString()); + } else if ("hyperParameters".equals(fieldName)) { + deserializedAzureOpenAiFineTuning.hyperParameters = AzureOpenAiHyperParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureOpenAiFineTuning; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureOpenAiHyperParameters.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureOpenAiHyperParameters.java new file mode 100644 index 0000000000000..17a928deb9e2a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/AzureOpenAiHyperParameters.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Azure Open AI hyperparameters for fine tuning. + */ +@Fluent +public final class AzureOpenAiHyperParameters implements JsonSerializable { + /* + * Scaling factor for the learning rate. A smaller learning rate may be useful to avoid over fitting. + */ + private Double learningRateMultiplier; + + /* + * Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, + * but with lower variance. + */ + private Integer batchSize; + + /* + * The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. + */ + private Integer nEpochs; + + /** + * Creates an instance of AzureOpenAiHyperParameters class. + */ + public AzureOpenAiHyperParameters() { + } + + /** + * Get the learningRateMultiplier property: Scaling factor for the learning rate. A smaller learning rate may be + * useful to avoid over fitting. + * + * @return the learningRateMultiplier value. + */ + public Double learningRateMultiplier() { + return this.learningRateMultiplier; + } + + /** + * Set the learningRateMultiplier property: Scaling factor for the learning rate. A smaller learning rate may be + * useful to avoid over fitting. + * + * @param learningRateMultiplier the learningRateMultiplier value to set. + * @return the AzureOpenAiHyperParameters object itself. + */ + public AzureOpenAiHyperParameters withLearningRateMultiplier(Double learningRateMultiplier) { + this.learningRateMultiplier = learningRateMultiplier; + return this; + } + + /** + * Get the batchSize property: Number of examples in each batch. A larger batch size means that model parameters are + * updated less frequently, but with lower variance. + * + * @return the batchSize value. + */ + public Integer batchSize() { + return this.batchSize; + } + + /** + * Set the batchSize property: Number of examples in each batch. A larger batch size means that model parameters are + * updated less frequently, but with lower variance. + * + * @param batchSize the batchSize value to set. + * @return the AzureOpenAiHyperParameters object itself. + */ + public AzureOpenAiHyperParameters withBatchSize(Integer batchSize) { + this.batchSize = batchSize; + return this; + } + + /** + * Get the nEpochs property: The number of epochs to train the model for. An epoch refers to one full cycle through + * the training dataset. + * + * @return the nEpochs value. + */ + public Integer nEpochs() { + return this.nEpochs; + } + + /** + * Set the nEpochs property: The number of epochs to train the model for. An epoch refers to one full cycle through + * the training dataset. + * + * @param nEpochs the nEpochs value to set. + * @return the AzureOpenAiHyperParameters object itself. + */ + public AzureOpenAiHyperParameters withNEpochs(Integer nEpochs) { + this.nEpochs = nEpochs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("learningRateMultiplier", this.learningRateMultiplier); + jsonWriter.writeNumberField("batchSize", this.batchSize); + jsonWriter.writeNumberField("nEpochs", this.nEpochs); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureOpenAiHyperParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureOpenAiHyperParameters if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureOpenAiHyperParameters. + */ + public static AzureOpenAiHyperParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureOpenAiHyperParameters deserializedAzureOpenAiHyperParameters = new AzureOpenAiHyperParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("learningRateMultiplier".equals(fieldName)) { + deserializedAzureOpenAiHyperParameters.learningRateMultiplier + = reader.getNullable(JsonReader::getDouble); + } else if ("batchSize".equals(fieldName)) { + deserializedAzureOpenAiHyperParameters.batchSize = reader.getNullable(JsonReader::getInt); + } else if ("nEpochs".equals(fieldName)) { + deserializedAzureOpenAiHyperParameters.nEpochs = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureOpenAiHyperParameters; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BanditPolicy.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BanditPolicy.java index 2fa766d834d85..67b34c27faa16 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BanditPolicy.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BanditPolicy.java @@ -5,34 +5,50 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Defines an early termination policy based on slack criteria, and a frequency and delay interval for evaluation. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "policyType") -@JsonTypeName("Bandit") +/** + * Defines an early termination policy based on slack criteria, and a frequency and delay interval for evaluation. + */ @Fluent public final class BanditPolicy extends EarlyTerminationPolicy { + /* + * [Required] Name of policy configuration + */ + private EarlyTerminationPolicyType policyType = EarlyTerminationPolicyType.BANDIT; + /* * Absolute distance allowed from the best performing run. */ - @JsonProperty(value = "slackAmount") private Float slackAmount; /* * Ratio of the allowed distance from the best performing run. */ - @JsonProperty(value = "slackFactor") private Float slackFactor; - /** Creates an instance of BanditPolicy class. */ + /** + * Creates an instance of BanditPolicy class. + */ public BanditPolicy() { } + /** + * Get the policyType property: [Required] Name of policy configuration. + * + * @return the policyType value. + */ + @Override + public EarlyTerminationPolicyType policyType() { + return this.policyType; + } + /** * Get the slackAmount property: Absolute distance allowed from the best performing run. - * + * * @return the slackAmount value. */ public Float slackAmount() { @@ -41,7 +57,7 @@ public Float slackAmount() { /** * Set the slackAmount property: Absolute distance allowed from the best performing run. - * + * * @param slackAmount the slackAmount value to set. * @return the BanditPolicy object itself. */ @@ -52,7 +68,7 @@ public BanditPolicy withSlackAmount(Float slackAmount) { /** * Get the slackFactor property: Ratio of the allowed distance from the best performing run. - * + * * @return the slackFactor value. */ public Float slackFactor() { @@ -61,7 +77,7 @@ public Float slackFactor() { /** * Set the slackFactor property: Ratio of the allowed distance from the best performing run. - * + * * @param slackFactor the slackFactor value to set. * @return the BanditPolicy object itself. */ @@ -70,14 +86,18 @@ public BanditPolicy withSlackFactor(Float slackFactor) { return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public BanditPolicy withDelayEvaluation(Integer delayEvaluation) { super.withDelayEvaluation(delayEvaluation); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public BanditPolicy withEvaluationInterval(Integer evaluationInterval) { super.withEvaluationInterval(evaluationInterval); @@ -86,11 +106,59 @@ public BanditPolicy withEvaluationInterval(Integer evaluationInterval) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("delayEvaluation", delayEvaluation()); + jsonWriter.writeNumberField("evaluationInterval", evaluationInterval()); + jsonWriter.writeStringField("policyType", this.policyType == null ? null : this.policyType.toString()); + jsonWriter.writeNumberField("slackAmount", this.slackAmount); + jsonWriter.writeNumberField("slackFactor", this.slackFactor); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BanditPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BanditPolicy if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the BanditPolicy. + */ + public static BanditPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BanditPolicy deserializedBanditPolicy = new BanditPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("delayEvaluation".equals(fieldName)) { + deserializedBanditPolicy.withDelayEvaluation(reader.getNullable(JsonReader::getInt)); + } else if ("evaluationInterval".equals(fieldName)) { + deserializedBanditPolicy.withEvaluationInterval(reader.getNullable(JsonReader::getInt)); + } else if ("policyType".equals(fieldName)) { + deserializedBanditPolicy.policyType = EarlyTerminationPolicyType.fromString(reader.getString()); + } else if ("slackAmount".equals(fieldName)) { + deserializedBanditPolicy.slackAmount = reader.getNullable(JsonReader::getFloat); + } else if ("slackFactor".equals(fieldName)) { + deserializedBanditPolicy.slackFactor = reader.getNullable(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return deserializedBanditPolicy; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchDeployment.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchDeployment.java index ff78009e7cdf7..8f626dc515f4c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchDeployment.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchDeployment.java @@ -10,46 +10,48 @@ import com.azure.resourcemanager.machinelearning.fluent.models.BatchDeploymentInner; import java.util.Map; -/** An immutable client-side representation of BatchDeployment. */ +/** + * An immutable client-side representation of BatchDeployment. + */ public interface BatchDeployment { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the location property: The geo-location where the resource lives. - * + * * @return the location value. */ String location(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); /** * Gets the identity property: Managed service identity (system assigned and/or user assigned identities). - * + * * @return the identity value. */ ManagedServiceIdentity identity(); @@ -57,78 +59,84 @@ public interface BatchDeployment { /** * Gets the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of * the same type. - * + * * @return the kind value. */ String kind(); /** * Gets the properties property: [Required] Additional attributes of the entity. - * + * * @return the properties value. */ BatchDeploymentProperties properties(); /** * Gets the sku property: Sku details required for ARM contract for Autoscaling. - * + * * @return the sku value. */ Sku sku(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.BatchDeploymentInner object. - * + * * @return the inner object. */ BatchDeploymentInner innerModel(); - /** The entirety of the BatchDeployment definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithParentResource, - DefinitionStages.WithProperties, - DefinitionStages.WithCreate { + /** + * The entirety of the BatchDeployment definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, DefinitionStages.WithProperties, DefinitionStages.WithCreate { } - /** The BatchDeployment definition stages. */ + + /** + * The BatchDeployment definition stages. + */ interface DefinitionStages { - /** The first stage of the BatchDeployment definition. */ + /** + * The first stage of the BatchDeployment definition. + */ interface Blank extends WithLocation { } - /** The stage of the BatchDeployment definition allowing to specify location. */ + + /** + * The stage of the BatchDeployment definition allowing to specify location. + */ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -136,160 +144,188 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithParentResource withRegion(String location); } - /** The stage of the BatchDeployment definition allowing to specify parent resource. */ + + /** + * The stage of the BatchDeployment definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, workspaceName, endpointName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. * @return the next definition stage. */ - WithProperties withExistingBatchEndpoint( - String resourceGroupName, String workspaceName, String endpointName); + WithProperties withExistingBatchEndpoint(String resourceGroupName, String workspaceName, + String endpointName); } - /** The stage of the BatchDeployment definition allowing to specify properties. */ + + /** + * The stage of the BatchDeployment definition allowing to specify properties. + */ interface WithProperties { /** * Specifies the properties property: [Required] Additional attributes of the entity.. - * + * * @param properties [Required] Additional attributes of the entity. * @return the next definition stage. */ WithCreate withProperties(BatchDeploymentProperties properties); } + /** * The stage of the BatchDeployment definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. */ - interface WithCreate - extends DefinitionStages.WithTags, - DefinitionStages.WithIdentity, - DefinitionStages.WithKind, - DefinitionStages.WithSku { + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, + DefinitionStages.WithKind, DefinitionStages.WithSku { /** * Executes the create request. - * + * * @return the created resource. */ BatchDeployment create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ BatchDeployment create(Context context); } - /** The stage of the BatchDeployment definition allowing to specify tags. */ + + /** + * The stage of the BatchDeployment definition allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ WithCreate withTags(Map tags); } - /** The stage of the BatchDeployment definition allowing to specify identity. */ + + /** + * The stage of the BatchDeployment definition allowing to specify identity. + */ interface WithIdentity { /** * Specifies the identity property: Managed service identity (system assigned and/or user assigned * identities). - * + * * @param identity Managed service identity (system assigned and/or user assigned identities). * @return the next definition stage. */ WithCreate withIdentity(ManagedServiceIdentity identity); } - /** The stage of the BatchDeployment definition allowing to specify kind. */ + + /** + * The stage of the BatchDeployment definition allowing to specify kind. + */ interface WithKind { /** * Specifies the kind property: Metadata used by portal/tooling/etc to render different UX experiences for * resources of the same type.. - * + * * @param kind Metadata used by portal/tooling/etc to render different UX experiences for resources of the - * same type. + * same type. * @return the next definition stage. */ WithCreate withKind(String kind); } - /** The stage of the BatchDeployment definition allowing to specify sku. */ + + /** + * The stage of the BatchDeployment definition allowing to specify sku. + */ interface WithSku { /** * Specifies the sku property: Sku details required for ARM contract for Autoscaling.. - * + * * @param sku Sku details required for ARM contract for Autoscaling. * @return the next definition stage. */ WithCreate withSku(Sku sku); } } + /** * Begins update for the BatchDeployment resource. - * + * * @return the stage of resource update. */ BatchDeployment.Update update(); - /** The template for BatchDeployment update. */ + /** + * The template for BatchDeployment update. + */ interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { /** * Executes the update request. - * + * * @return the updated resource. */ BatchDeployment apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ BatchDeployment apply(Context context); } - /** The BatchDeployment update stages. */ + + /** + * The BatchDeployment update stages. + */ interface UpdateStages { - /** The stage of the BatchDeployment update allowing to specify tags. */ + /** + * The stage of the BatchDeployment update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ Update withTags(Map tags); } - /** The stage of the BatchDeployment update allowing to specify properties. */ + + /** + * The stage of the BatchDeployment update allowing to specify properties. + */ interface WithProperties { /** * Specifies the properties property: Additional attributes of the entity.. - * + * * @param properties Additional attributes of the entity. * @return the next definition stage. */ Update withProperties(PartialBatchDeployment properties); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ BatchDeployment refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchDeploymentConfiguration.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchDeploymentConfiguration.java new file mode 100644 index 0000000000000..9cb759f0b14fe --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchDeploymentConfiguration.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties relevant to different deployment types. + */ +@Immutable +public class BatchDeploymentConfiguration implements JsonSerializable { + /* + * [Required] The type of the deployment + */ + private BatchDeploymentConfigurationType deploymentConfigurationType + = BatchDeploymentConfigurationType.fromString("BatchDeploymentConfiguration"); + + /** + * Creates an instance of BatchDeploymentConfiguration class. + */ + public BatchDeploymentConfiguration() { + } + + /** + * Get the deploymentConfigurationType property: [Required] The type of the deployment. + * + * @return the deploymentConfigurationType value. + */ + public BatchDeploymentConfigurationType deploymentConfigurationType() { + return this.deploymentConfigurationType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("deploymentConfigurationType", + this.deploymentConfigurationType == null ? null : this.deploymentConfigurationType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchDeploymentConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchDeploymentConfiguration if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BatchDeploymentConfiguration. + */ + public static BatchDeploymentConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("deploymentConfigurationType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("PipelineComponent".equals(discriminatorValue)) { + return BatchPipelineComponentDeploymentConfiguration.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static BatchDeploymentConfiguration fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BatchDeploymentConfiguration deserializedBatchDeploymentConfiguration = new BatchDeploymentConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deploymentConfigurationType".equals(fieldName)) { + deserializedBatchDeploymentConfiguration.deploymentConfigurationType + = BatchDeploymentConfigurationType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedBatchDeploymentConfiguration; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchDeploymentConfigurationType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchDeploymentConfigurationType.java new file mode 100644 index 0000000000000..bf9f0030c2ae6 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchDeploymentConfigurationType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The enumerated property types for batch deployments. + */ +public final class BatchDeploymentConfigurationType extends ExpandableStringEnum { + /** + * Static value Model for BatchDeploymentConfigurationType. + */ + public static final BatchDeploymentConfigurationType MODEL = fromString("Model"); + + /** + * Static value PipelineComponent for BatchDeploymentConfigurationType. + */ + public static final BatchDeploymentConfigurationType PIPELINE_COMPONENT = fromString("PipelineComponent"); + + /** + * Creates a new instance of BatchDeploymentConfigurationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BatchDeploymentConfigurationType() { + } + + /** + * Creates or finds a BatchDeploymentConfigurationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding BatchDeploymentConfigurationType. + */ + public static BatchDeploymentConfigurationType fromString(String name) { + return fromString(name, BatchDeploymentConfigurationType.class); + } + + /** + * Gets known BatchDeploymentConfigurationType values. + * + * @return known BatchDeploymentConfigurationType values. + */ + public static Collection values() { + return values(BatchDeploymentConfigurationType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchDeploymentProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchDeploymentProperties.java index c9edec18e058e..0bb90e524fd65 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchDeploymentProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchDeploymentProperties.java @@ -5,18 +5,27 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Batch inference settings per deployment. */ +/** + * Batch inference settings per deployment. + */ @Fluent public final class BatchDeploymentProperties extends EndpointDeploymentPropertiesBase { /* * Compute target for batch inference operation. */ - @JsonProperty(value = "compute") private String compute; + /* + * Properties relevant to different deployment types. + */ + private BatchDeploymentConfiguration deploymentConfiguration; + /* * Error threshold, if the error count for the entire input goes above this value, * the batch inference will be aborted. Range is [-1, int.MaxValue]. @@ -24,19 +33,16 @@ public final class BatchDeploymentProperties extends EndpointDeploymentPropertie * For TabularDataset, this value is the count of record failures. * If set to -1 (the lower bound), all failures during batch inference will be ignored. */ - @JsonProperty(value = "errorThreshold") private Integer errorThreshold; /* * Logging level for batch inference operation. */ - @JsonProperty(value = "loggingLevel") private BatchLoggingLevel loggingLevel; /* * Indicates maximum number of parallelism per instance. */ - @JsonProperty(value = "maxConcurrencyPerInstance") private Integer maxConcurrencyPerInstance; /* @@ -44,54 +50,49 @@ public final class BatchDeploymentProperties extends EndpointDeploymentPropertie * For FileDataset, this is the number of files per mini-batch. * For TabularDataset, this is the size of the records in bytes, per mini-batch. */ - @JsonProperty(value = "miniBatchSize") private Long miniBatchSize; /* * Reference to the model asset for the endpoint deployment. */ - @JsonProperty(value = "model") private AssetReferenceBase model; /* * Indicates how the output will be organized. */ - @JsonProperty(value = "outputAction") private BatchOutputAction outputAction; /* * Customized output file name for append_row output action. */ - @JsonProperty(value = "outputFileName") private String outputFileName; /* * Provisioning state for the endpoint deployment. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private DeploymentProvisioningState provisioningState; /* * Indicates compute configuration for the job. * If not provided, will default to the defaults defined in ResourceConfiguration. */ - @JsonProperty(value = "resources") private DeploymentResourceConfiguration resources; /* * Retry Settings for the batch inference operation. * If not provided, will default to the defaults defined in BatchRetrySettings. */ - @JsonProperty(value = "retrySettings") private BatchRetrySettings retrySettings; - /** Creates an instance of BatchDeploymentProperties class. */ + /** + * Creates an instance of BatchDeploymentProperties class. + */ public BatchDeploymentProperties() { } /** * Get the compute property: Compute target for batch inference operation. - * + * * @return the compute value. */ public String compute() { @@ -100,7 +101,7 @@ public String compute() { /** * Set the compute property: Compute target for batch inference operation. - * + * * @param compute the compute value to set. * @return the BatchDeploymentProperties object itself. */ @@ -109,12 +110,33 @@ public BatchDeploymentProperties withCompute(String compute) { return this; } + /** + * Get the deploymentConfiguration property: Properties relevant to different deployment types. + * + * @return the deploymentConfiguration value. + */ + public BatchDeploymentConfiguration deploymentConfiguration() { + return this.deploymentConfiguration; + } + + /** + * Set the deploymentConfiguration property: Properties relevant to different deployment types. + * + * @param deploymentConfiguration the deploymentConfiguration value to set. + * @return the BatchDeploymentProperties object itself. + */ + public BatchDeploymentProperties withDeploymentConfiguration(BatchDeploymentConfiguration deploymentConfiguration) { + this.deploymentConfiguration = deploymentConfiguration; + return this; + } + /** * Get the errorThreshold property: Error threshold, if the error count for the entire input goes above this value, - * the batch inference will be aborted. Range is [-1, int.MaxValue]. For FileDataset, this value is the count of - * file failures. For TabularDataset, this value is the count of record failures. If set to -1 (the lower bound), - * all failures during batch inference will be ignored. - * + * the batch inference will be aborted. Range is [-1, int.MaxValue]. + * For FileDataset, this value is the count of file failures. + * For TabularDataset, this value is the count of record failures. + * If set to -1 (the lower bound), all failures during batch inference will be ignored. + * * @return the errorThreshold value. */ public Integer errorThreshold() { @@ -123,10 +145,11 @@ public Integer errorThreshold() { /** * Set the errorThreshold property: Error threshold, if the error count for the entire input goes above this value, - * the batch inference will be aborted. Range is [-1, int.MaxValue]. For FileDataset, this value is the count of - * file failures. For TabularDataset, this value is the count of record failures. If set to -1 (the lower bound), - * all failures during batch inference will be ignored. - * + * the batch inference will be aborted. Range is [-1, int.MaxValue]. + * For FileDataset, this value is the count of file failures. + * For TabularDataset, this value is the count of record failures. + * If set to -1 (the lower bound), all failures during batch inference will be ignored. + * * @param errorThreshold the errorThreshold value to set. * @return the BatchDeploymentProperties object itself. */ @@ -137,7 +160,7 @@ public BatchDeploymentProperties withErrorThreshold(Integer errorThreshold) { /** * Get the loggingLevel property: Logging level for batch inference operation. - * + * * @return the loggingLevel value. */ public BatchLoggingLevel loggingLevel() { @@ -146,7 +169,7 @@ public BatchLoggingLevel loggingLevel() { /** * Set the loggingLevel property: Logging level for batch inference operation. - * + * * @param loggingLevel the loggingLevel value to set. * @return the BatchDeploymentProperties object itself. */ @@ -157,7 +180,7 @@ public BatchDeploymentProperties withLoggingLevel(BatchLoggingLevel loggingLevel /** * Get the maxConcurrencyPerInstance property: Indicates maximum number of parallelism per instance. - * + * * @return the maxConcurrencyPerInstance value. */ public Integer maxConcurrencyPerInstance() { @@ -166,7 +189,7 @@ public Integer maxConcurrencyPerInstance() { /** * Set the maxConcurrencyPerInstance property: Indicates maximum number of parallelism per instance. - * + * * @param maxConcurrencyPerInstance the maxConcurrencyPerInstance value to set. * @return the BatchDeploymentProperties object itself. */ @@ -176,9 +199,10 @@ public BatchDeploymentProperties withMaxConcurrencyPerInstance(Integer maxConcur } /** - * Get the miniBatchSize property: Size of the mini-batch passed to each batch invocation. For FileDataset, this is - * the number of files per mini-batch. For TabularDataset, this is the size of the records in bytes, per mini-batch. - * + * Get the miniBatchSize property: Size of the mini-batch passed to each batch invocation. + * For FileDataset, this is the number of files per mini-batch. + * For TabularDataset, this is the size of the records in bytes, per mini-batch. + * * @return the miniBatchSize value. */ public Long miniBatchSize() { @@ -186,9 +210,10 @@ public Long miniBatchSize() { } /** - * Set the miniBatchSize property: Size of the mini-batch passed to each batch invocation. For FileDataset, this is - * the number of files per mini-batch. For TabularDataset, this is the size of the records in bytes, per mini-batch. - * + * Set the miniBatchSize property: Size of the mini-batch passed to each batch invocation. + * For FileDataset, this is the number of files per mini-batch. + * For TabularDataset, this is the size of the records in bytes, per mini-batch. + * * @param miniBatchSize the miniBatchSize value to set. * @return the BatchDeploymentProperties object itself. */ @@ -199,7 +224,7 @@ public BatchDeploymentProperties withMiniBatchSize(Long miniBatchSize) { /** * Get the model property: Reference to the model asset for the endpoint deployment. - * + * * @return the model value. */ public AssetReferenceBase model() { @@ -208,7 +233,7 @@ public AssetReferenceBase model() { /** * Set the model property: Reference to the model asset for the endpoint deployment. - * + * * @param model the model value to set. * @return the BatchDeploymentProperties object itself. */ @@ -219,7 +244,7 @@ public BatchDeploymentProperties withModel(AssetReferenceBase model) { /** * Get the outputAction property: Indicates how the output will be organized. - * + * * @return the outputAction value. */ public BatchOutputAction outputAction() { @@ -228,7 +253,7 @@ public BatchOutputAction outputAction() { /** * Set the outputAction property: Indicates how the output will be organized. - * + * * @param outputAction the outputAction value to set. * @return the BatchDeploymentProperties object itself. */ @@ -239,7 +264,7 @@ public BatchDeploymentProperties withOutputAction(BatchOutputAction outputAction /** * Get the outputFileName property: Customized output file name for append_row output action. - * + * * @return the outputFileName value. */ public String outputFileName() { @@ -248,7 +273,7 @@ public String outputFileName() { /** * Set the outputFileName property: Customized output file name for append_row output action. - * + * * @param outputFileName the outputFileName value to set. * @return the BatchDeploymentProperties object itself. */ @@ -259,7 +284,7 @@ public BatchDeploymentProperties withOutputFileName(String outputFileName) { /** * Get the provisioningState property: Provisioning state for the endpoint deployment. - * + * * @return the provisioningState value. */ public DeploymentProvisioningState provisioningState() { @@ -267,9 +292,9 @@ public DeploymentProvisioningState provisioningState() { } /** - * Get the resources property: Indicates compute configuration for the job. If not provided, will default to the - * defaults defined in ResourceConfiguration. - * + * Get the resources property: Indicates compute configuration for the job. + * If not provided, will default to the defaults defined in ResourceConfiguration. + * * @return the resources value. */ public DeploymentResourceConfiguration resources() { @@ -277,9 +302,9 @@ public DeploymentResourceConfiguration resources() { } /** - * Set the resources property: Indicates compute configuration for the job. If not provided, will default to the - * defaults defined in ResourceConfiguration. - * + * Set the resources property: Indicates compute configuration for the job. + * If not provided, will default to the defaults defined in ResourceConfiguration. + * * @param resources the resources value to set. * @return the BatchDeploymentProperties object itself. */ @@ -289,9 +314,9 @@ public BatchDeploymentProperties withResources(DeploymentResourceConfiguration r } /** - * Get the retrySettings property: Retry Settings for the batch inference operation. If not provided, will default - * to the defaults defined in BatchRetrySettings. - * + * Get the retrySettings property: Retry Settings for the batch inference operation. + * If not provided, will default to the defaults defined in BatchRetrySettings. + * * @return the retrySettings value. */ public BatchRetrySettings retrySettings() { @@ -299,9 +324,9 @@ public BatchRetrySettings retrySettings() { } /** - * Set the retrySettings property: Retry Settings for the batch inference operation. If not provided, will default - * to the defaults defined in BatchRetrySettings. - * + * Set the retrySettings property: Retry Settings for the batch inference operation. + * If not provided, will default to the defaults defined in BatchRetrySettings. + * * @param retrySettings the retrySettings value to set. * @return the BatchDeploymentProperties object itself. */ @@ -310,35 +335,45 @@ public BatchDeploymentProperties withRetrySettings(BatchRetrySettings retrySetti return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public BatchDeploymentProperties withCodeConfiguration(CodeConfiguration codeConfiguration) { super.withCodeConfiguration(codeConfiguration); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public BatchDeploymentProperties withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public BatchDeploymentProperties withEnvironmentId(String environmentId) { super.withEnvironmentId(environmentId); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public BatchDeploymentProperties withEnvironmentVariables(Map environmentVariables) { super.withEnvironmentVariables(environmentVariables); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public BatchDeploymentProperties withProperties(Map properties) { super.withProperties(properties); @@ -347,12 +382,15 @@ public BatchDeploymentProperties withProperties(Map properties) /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); + if (deploymentConfiguration() != null) { + deploymentConfiguration().validate(); + } if (model() != null) { model().validate(); } @@ -363,4 +401,95 @@ public void validate() { retrySettings().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("codeConfiguration", codeConfiguration()); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("environmentId", environmentId()); + jsonWriter.writeMapField("environmentVariables", environmentVariables(), + (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("compute", this.compute); + jsonWriter.writeJsonField("deploymentConfiguration", this.deploymentConfiguration); + jsonWriter.writeNumberField("errorThreshold", this.errorThreshold); + jsonWriter.writeStringField("loggingLevel", this.loggingLevel == null ? null : this.loggingLevel.toString()); + jsonWriter.writeNumberField("maxConcurrencyPerInstance", this.maxConcurrencyPerInstance); + jsonWriter.writeNumberField("miniBatchSize", this.miniBatchSize); + jsonWriter.writeJsonField("model", this.model); + jsonWriter.writeStringField("outputAction", this.outputAction == null ? null : this.outputAction.toString()); + jsonWriter.writeStringField("outputFileName", this.outputFileName); + jsonWriter.writeJsonField("resources", this.resources); + jsonWriter.writeJsonField("retrySettings", this.retrySettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchDeploymentProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchDeploymentProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BatchDeploymentProperties. + */ + public static BatchDeploymentProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BatchDeploymentProperties deserializedBatchDeploymentProperties = new BatchDeploymentProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("codeConfiguration".equals(fieldName)) { + deserializedBatchDeploymentProperties.withCodeConfiguration(CodeConfiguration.fromJson(reader)); + } else if ("description".equals(fieldName)) { + deserializedBatchDeploymentProperties.withDescription(reader.getString()); + } else if ("environmentId".equals(fieldName)) { + deserializedBatchDeploymentProperties.withEnvironmentId(reader.getString()); + } else if ("environmentVariables".equals(fieldName)) { + Map environmentVariables = reader.readMap(reader1 -> reader1.getString()); + deserializedBatchDeploymentProperties.withEnvironmentVariables(environmentVariables); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedBatchDeploymentProperties.withProperties(properties); + } else if ("compute".equals(fieldName)) { + deserializedBatchDeploymentProperties.compute = reader.getString(); + } else if ("deploymentConfiguration".equals(fieldName)) { + deserializedBatchDeploymentProperties.deploymentConfiguration + = BatchDeploymentConfiguration.fromJson(reader); + } else if ("errorThreshold".equals(fieldName)) { + deserializedBatchDeploymentProperties.errorThreshold = reader.getNullable(JsonReader::getInt); + } else if ("loggingLevel".equals(fieldName)) { + deserializedBatchDeploymentProperties.loggingLevel + = BatchLoggingLevel.fromString(reader.getString()); + } else if ("maxConcurrencyPerInstance".equals(fieldName)) { + deserializedBatchDeploymentProperties.maxConcurrencyPerInstance + = reader.getNullable(JsonReader::getInt); + } else if ("miniBatchSize".equals(fieldName)) { + deserializedBatchDeploymentProperties.miniBatchSize = reader.getNullable(JsonReader::getLong); + } else if ("model".equals(fieldName)) { + deserializedBatchDeploymentProperties.model = AssetReferenceBase.fromJson(reader); + } else if ("outputAction".equals(fieldName)) { + deserializedBatchDeploymentProperties.outputAction + = BatchOutputAction.fromString(reader.getString()); + } else if ("outputFileName".equals(fieldName)) { + deserializedBatchDeploymentProperties.outputFileName = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedBatchDeploymentProperties.provisioningState + = DeploymentProvisioningState.fromString(reader.getString()); + } else if ("resources".equals(fieldName)) { + deserializedBatchDeploymentProperties.resources = DeploymentResourceConfiguration.fromJson(reader); + } else if ("retrySettings".equals(fieldName)) { + deserializedBatchDeploymentProperties.retrySettings = BatchRetrySettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBatchDeploymentProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchDeploymentTrackedResourceArmPaginatedResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchDeploymentTrackedResourceArmPaginatedResult.java index 32e17c4cdfd01..717749f548855 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchDeploymentTrackedResourceArmPaginatedResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchDeploymentTrackedResourceArmPaginatedResult.java @@ -5,33 +5,40 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.fluent.models.BatchDeploymentInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** A paginated list of BatchDeployment entities. */ +/** + * A paginated list of BatchDeployment entities. + */ @Fluent -public final class BatchDeploymentTrackedResourceArmPaginatedResult { +public final class BatchDeploymentTrackedResourceArmPaginatedResult + implements JsonSerializable { /* * The link to the next page of BatchDeployment objects. If null, there are no additional pages. */ - @JsonProperty(value = "nextLink") private String nextLink; /* * An array of objects of type BatchDeployment. */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of BatchDeploymentTrackedResourceArmPaginatedResult class. */ + /** + * Creates an instance of BatchDeploymentTrackedResourceArmPaginatedResult class. + */ public BatchDeploymentTrackedResourceArmPaginatedResult() { } /** * Get the nextLink property: The link to the next page of BatchDeployment objects. If null, there are no additional * pages. - * + * * @return the nextLink value. */ public String nextLink() { @@ -41,7 +48,7 @@ public String nextLink() { /** * Set the nextLink property: The link to the next page of BatchDeployment objects. If null, there are no additional * pages. - * + * * @param nextLink the nextLink value to set. * @return the BatchDeploymentTrackedResourceArmPaginatedResult object itself. */ @@ -52,7 +59,7 @@ public BatchDeploymentTrackedResourceArmPaginatedResult withNextLink(String next /** * Get the value property: An array of objects of type BatchDeployment. - * + * * @return the value value. */ public List value() { @@ -61,7 +68,7 @@ public List value() { /** * Set the value property: An array of objects of type BatchDeployment. - * + * * @param value the value value to set. * @return the BatchDeploymentTrackedResourceArmPaginatedResult object itself. */ @@ -72,7 +79,7 @@ public BatchDeploymentTrackedResourceArmPaginatedResult withValue(List e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchDeploymentTrackedResourceArmPaginatedResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchDeploymentTrackedResourceArmPaginatedResult if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BatchDeploymentTrackedResourceArmPaginatedResult. + */ + public static BatchDeploymentTrackedResourceArmPaginatedResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BatchDeploymentTrackedResourceArmPaginatedResult deserializedBatchDeploymentTrackedResourceArmPaginatedResult + = new BatchDeploymentTrackedResourceArmPaginatedResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedBatchDeploymentTrackedResourceArmPaginatedResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> BatchDeploymentInner.fromJson(reader1)); + deserializedBatchDeploymentTrackedResourceArmPaginatedResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedBatchDeploymentTrackedResourceArmPaginatedResult; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchDeployments.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchDeployments.java index 2566303aa8ad0..e01f17695683e 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchDeployments.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchDeployments.java @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of BatchDeployments. */ +/** + * Resource collection API of BatchDeployments. + */ public interface BatchDeployments { /** * Lists Batch inference deployments in the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Endpoint name. @@ -25,7 +27,7 @@ public interface BatchDeployments { /** * Lists Batch inference deployments in the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Endpoint name. @@ -38,18 +40,12 @@ public interface BatchDeployments { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of BatchDeployment entities as paginated response with {@link PagedIterable}. */ - PagedIterable list( - String resourceGroupName, - String workspaceName, - String endpointName, - String orderBy, - Integer top, - String skip, - Context context); + PagedIterable list(String resourceGroupName, String workspaceName, String endpointName, + String orderBy, Integer top, String skip, Context context); /** * Delete Batch Inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Endpoint name. @@ -62,7 +58,7 @@ PagedIterable list( /** * Delete Batch Inference deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Endpoint name. @@ -72,12 +68,12 @@ PagedIterable list( * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void delete( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName, Context context); + void delete(String resourceGroupName, String workspaceName, String endpointName, String deploymentName, + Context context); /** * Gets a batch inference deployment by id. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Endpoint name. @@ -88,12 +84,12 @@ void delete( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a batch inference deployment by id along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName, Context context); + Response getWithResponse(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName, Context context); /** * Gets a batch inference deployment by id. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Endpoint name. @@ -107,7 +103,7 @@ Response getWithResponse( /** * Gets a batch inference deployment by id. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -118,7 +114,7 @@ Response getWithResponse( /** * Gets a batch inference deployment by id. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -130,7 +126,7 @@ Response getWithResponse( /** * Delete Batch Inference deployment (asynchronous). - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -140,7 +136,7 @@ Response getWithResponse( /** * Delete Batch Inference deployment (asynchronous). - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -151,7 +147,7 @@ Response getWithResponse( /** * Begins definition for a new BatchDeployment resource. - * + * * @param name resource name. * @return the first stage of the new BatchDeployment definition. */ diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchEndpoint.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchEndpoint.java index 00170d2cfd23d..27ec5bc30610a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchEndpoint.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchEndpoint.java @@ -11,46 +11,48 @@ import com.azure.resourcemanager.machinelearning.fluent.models.BatchEndpointInner; import java.util.Map; -/** An immutable client-side representation of BatchEndpoint. */ +/** + * An immutable client-side representation of BatchEndpoint. + */ public interface BatchEndpoint { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the location property: The geo-location where the resource lives. - * + * * @return the location value. */ String location(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); /** * Gets the identity property: Managed service identity (system assigned and/or user assigned identities). - * + * * @return the identity value. */ ManagedServiceIdentity identity(); @@ -58,78 +60,84 @@ public interface BatchEndpoint { /** * Gets the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of * the same type. - * + * * @return the kind value. */ String kind(); /** * Gets the properties property: [Required] Additional attributes of the entity. - * + * * @return the properties value. */ BatchEndpointProperties properties(); /** * Gets the sku property: Sku details required for ARM contract for Autoscaling. - * + * * @return the sku value. */ Sku sku(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.BatchEndpointInner object. - * + * * @return the inner object. */ BatchEndpointInner innerModel(); - /** The entirety of the BatchEndpoint definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithParentResource, - DefinitionStages.WithProperties, - DefinitionStages.WithCreate { + /** + * The entirety of the BatchEndpoint definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, DefinitionStages.WithProperties, DefinitionStages.WithCreate { } - /** The BatchEndpoint definition stages. */ + + /** + * The BatchEndpoint definition stages. + */ interface DefinitionStages { - /** The first stage of the BatchEndpoint definition. */ + /** + * The first stage of the BatchEndpoint definition. + */ interface Blank extends WithLocation { } - /** The stage of the BatchEndpoint definition allowing to specify location. */ + + /** + * The stage of the BatchEndpoint definition allowing to specify location. + */ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -137,159 +145,187 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithParentResource withRegion(String location); } - /** The stage of the BatchEndpoint definition allowing to specify parent resource. */ + + /** + * The stage of the BatchEndpoint definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, workspaceName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @return the next definition stage. */ WithProperties withExistingWorkspace(String resourceGroupName, String workspaceName); } - /** The stage of the BatchEndpoint definition allowing to specify properties. */ + + /** + * The stage of the BatchEndpoint definition allowing to specify properties. + */ interface WithProperties { /** * Specifies the properties property: [Required] Additional attributes of the entity.. - * + * * @param properties [Required] Additional attributes of the entity. * @return the next definition stage. */ WithCreate withProperties(BatchEndpointProperties properties); } + /** * The stage of the BatchEndpoint definition which contains all the minimum required properties for the resource * to be created, but also allows for any other optional properties to be specified. */ - interface WithCreate - extends DefinitionStages.WithTags, - DefinitionStages.WithIdentity, - DefinitionStages.WithKind, - DefinitionStages.WithSku { + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, + DefinitionStages.WithKind, DefinitionStages.WithSku { /** * Executes the create request. - * + * * @return the created resource. */ BatchEndpoint create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ BatchEndpoint create(Context context); } - /** The stage of the BatchEndpoint definition allowing to specify tags. */ + + /** + * The stage of the BatchEndpoint definition allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ WithCreate withTags(Map tags); } - /** The stage of the BatchEndpoint definition allowing to specify identity. */ + + /** + * The stage of the BatchEndpoint definition allowing to specify identity. + */ interface WithIdentity { /** * Specifies the identity property: Managed service identity (system assigned and/or user assigned * identities). - * + * * @param identity Managed service identity (system assigned and/or user assigned identities). * @return the next definition stage. */ WithCreate withIdentity(ManagedServiceIdentity identity); } - /** The stage of the BatchEndpoint definition allowing to specify kind. */ + + /** + * The stage of the BatchEndpoint definition allowing to specify kind. + */ interface WithKind { /** * Specifies the kind property: Metadata used by portal/tooling/etc to render different UX experiences for * resources of the same type.. - * + * * @param kind Metadata used by portal/tooling/etc to render different UX experiences for resources of the - * same type. + * same type. * @return the next definition stage. */ WithCreate withKind(String kind); } - /** The stage of the BatchEndpoint definition allowing to specify sku. */ + + /** + * The stage of the BatchEndpoint definition allowing to specify sku. + */ interface WithSku { /** * Specifies the sku property: Sku details required for ARM contract for Autoscaling.. - * + * * @param sku Sku details required for ARM contract for Autoscaling. * @return the next definition stage. */ WithCreate withSku(Sku sku); } } + /** * Begins update for the BatchEndpoint resource. - * + * * @return the stage of resource update. */ BatchEndpoint.Update update(); - /** The template for BatchEndpoint update. */ + /** + * The template for BatchEndpoint update. + */ interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity { /** * Executes the update request. - * + * * @return the updated resource. */ BatchEndpoint apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ BatchEndpoint apply(Context context); } - /** The BatchEndpoint update stages. */ + + /** + * The BatchEndpoint update stages. + */ interface UpdateStages { - /** The stage of the BatchEndpoint update allowing to specify tags. */ + /** + * The stage of the BatchEndpoint update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ Update withTags(Map tags); } - /** The stage of the BatchEndpoint update allowing to specify identity. */ + + /** + * The stage of the BatchEndpoint update allowing to specify identity. + */ interface WithIdentity { /** * Specifies the identity property: Managed service identity (system assigned and/or user assigned * identities). - * + * * @param identity Managed service identity (system assigned and/or user assigned identities). * @return the next definition stage. */ Update withIdentity(PartialManagedServiceIdentity identity); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ BatchEndpoint refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ @@ -297,7 +333,7 @@ interface WithIdentity { /** * Lists batch Inference Endpoint keys. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -308,7 +344,7 @@ interface WithIdentity { /** * Lists batch Inference Endpoint keys. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return keys for endpoint authentication. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchEndpointDefaults.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchEndpointDefaults.java index aa25ce2802e2a..e86266985a56a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchEndpointDefaults.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchEndpointDefaults.java @@ -5,26 +5,33 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Batch endpoint default values. */ +/** + * Batch endpoint default values. + */ @Fluent -public final class BatchEndpointDefaults { +public final class BatchEndpointDefaults implements JsonSerializable { /* * Name of the deployment that will be default for the endpoint. * This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. */ - @JsonProperty(value = "deploymentName") private String deploymentName; - /** Creates an instance of BatchEndpointDefaults class. */ + /** + * Creates an instance of BatchEndpointDefaults class. + */ public BatchEndpointDefaults() { } /** - * Get the deploymentName property: Name of the deployment that will be default for the endpoint. This deployment - * will end up getting 100% traffic when the endpoint scoring URL is invoked. - * + * Get the deploymentName property: Name of the deployment that will be default for the endpoint. + * This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. + * * @return the deploymentName value. */ public String deploymentName() { @@ -32,9 +39,9 @@ public String deploymentName() { } /** - * Set the deploymentName property: Name of the deployment that will be default for the endpoint. This deployment - * will end up getting 100% traffic when the endpoint scoring URL is invoked. - * + * Set the deploymentName property: Name of the deployment that will be default for the endpoint. + * This deployment will end up getting 100% traffic when the endpoint scoring URL is invoked. + * * @param deploymentName the deploymentName value to set. * @return the BatchEndpointDefaults object itself. */ @@ -45,9 +52,45 @@ public BatchEndpointDefaults withDeploymentName(String deploymentName) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("deploymentName", this.deploymentName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchEndpointDefaults from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchEndpointDefaults if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the BatchEndpointDefaults. + */ + public static BatchEndpointDefaults fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BatchEndpointDefaults deserializedBatchEndpointDefaults = new BatchEndpointDefaults(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deploymentName".equals(fieldName)) { + deserializedBatchEndpointDefaults.deploymentName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBatchEndpointDefaults; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchEndpointProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchEndpointProperties.java index 91f737a4bd0fc..af7e50ec36ca2 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchEndpointProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchEndpointProperties.java @@ -5,33 +5,48 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.fluent.models.EndpointAuthKeysInner; import com.azure.resourcemanager.machinelearning.fluent.models.EndpointPropertiesBaseInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; -/** Batch endpoint configuration. */ +/** + * Batch endpoint configuration. + */ @Fluent public final class BatchEndpointProperties extends EndpointPropertiesBaseInner { /* * Default values for Batch Endpoint */ - @JsonProperty(value = "defaults") private BatchEndpointDefaults defaults; /* * Provisioning state for the endpoint. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private EndpointProvisioningState provisioningState; - /** Creates an instance of BatchEndpointProperties class. */ + /* + * Endpoint URI. + */ + private String scoringUri; + + /* + * Endpoint Swagger URI. + */ + private String swaggerUri; + + /** + * Creates an instance of BatchEndpointProperties class. + */ public BatchEndpointProperties() { } /** * Get the defaults property: Default values for Batch Endpoint. - * + * * @return the defaults value. */ public BatchEndpointDefaults defaults() { @@ -40,7 +55,7 @@ public BatchEndpointDefaults defaults() { /** * Set the defaults property: Default values for Batch Endpoint. - * + * * @param defaults the defaults value to set. * @return the BatchEndpointProperties object itself. */ @@ -51,35 +66,63 @@ public BatchEndpointProperties withDefaults(BatchEndpointDefaults defaults) { /** * Get the provisioningState property: Provisioning state for the endpoint. - * + * * @return the provisioningState value. */ public EndpointProvisioningState provisioningState() { return this.provisioningState; } - /** {@inheritDoc} */ + /** + * Get the scoringUri property: Endpoint URI. + * + * @return the scoringUri value. + */ + @Override + public String scoringUri() { + return this.scoringUri; + } + + /** + * Get the swaggerUri property: Endpoint Swagger URI. + * + * @return the swaggerUri value. + */ + @Override + public String swaggerUri() { + return this.swaggerUri; + } + + /** + * {@inheritDoc} + */ @Override public BatchEndpointProperties withAuthMode(EndpointAuthMode authMode) { super.withAuthMode(authMode); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public BatchEndpointProperties withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public BatchEndpointProperties withKeys(EndpointAuthKeysInner keys) { super.withKeys(keys); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public BatchEndpointProperties withProperties(Map properties) { super.withProperties(properties); @@ -88,7 +131,7 @@ public BatchEndpointProperties withProperties(Map properties) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -98,4 +141,61 @@ public void validate() { defaults().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("authMode", authMode() == null ? null : authMode().toString()); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeJsonField("keys", keys()); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("defaults", this.defaults); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchEndpointProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchEndpointProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BatchEndpointProperties. + */ + public static BatchEndpointProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BatchEndpointProperties deserializedBatchEndpointProperties = new BatchEndpointProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("authMode".equals(fieldName)) { + deserializedBatchEndpointProperties.withAuthMode(EndpointAuthMode.fromString(reader.getString())); + } else if ("description".equals(fieldName)) { + deserializedBatchEndpointProperties.withDescription(reader.getString()); + } else if ("keys".equals(fieldName)) { + deserializedBatchEndpointProperties.withKeys(EndpointAuthKeysInner.fromJson(reader)); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedBatchEndpointProperties.withProperties(properties); + } else if ("scoringUri".equals(fieldName)) { + deserializedBatchEndpointProperties.scoringUri = reader.getString(); + } else if ("swaggerUri".equals(fieldName)) { + deserializedBatchEndpointProperties.swaggerUri = reader.getString(); + } else if ("defaults".equals(fieldName)) { + deserializedBatchEndpointProperties.defaults = BatchEndpointDefaults.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedBatchEndpointProperties.provisioningState + = EndpointProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedBatchEndpointProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchEndpointTrackedResourceArmPaginatedResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchEndpointTrackedResourceArmPaginatedResult.java index d2984db78bd8e..14ad65c6b3211 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchEndpointTrackedResourceArmPaginatedResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchEndpointTrackedResourceArmPaginatedResult.java @@ -5,33 +5,40 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.fluent.models.BatchEndpointInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** A paginated list of BatchEndpoint entities. */ +/** + * A paginated list of BatchEndpoint entities. + */ @Fluent -public final class BatchEndpointTrackedResourceArmPaginatedResult { +public final class BatchEndpointTrackedResourceArmPaginatedResult + implements JsonSerializable { /* * The link to the next page of BatchEndpoint objects. If null, there are no additional pages. */ - @JsonProperty(value = "nextLink") private String nextLink; /* * An array of objects of type BatchEndpoint. */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of BatchEndpointTrackedResourceArmPaginatedResult class. */ + /** + * Creates an instance of BatchEndpointTrackedResourceArmPaginatedResult class. + */ public BatchEndpointTrackedResourceArmPaginatedResult() { } /** * Get the nextLink property: The link to the next page of BatchEndpoint objects. If null, there are no additional * pages. - * + * * @return the nextLink value. */ public String nextLink() { @@ -41,7 +48,7 @@ public String nextLink() { /** * Set the nextLink property: The link to the next page of BatchEndpoint objects. If null, there are no additional * pages. - * + * * @param nextLink the nextLink value to set. * @return the BatchEndpointTrackedResourceArmPaginatedResult object itself. */ @@ -52,7 +59,7 @@ public BatchEndpointTrackedResourceArmPaginatedResult withNextLink(String nextLi /** * Get the value property: An array of objects of type BatchEndpoint. - * + * * @return the value value. */ public List value() { @@ -61,7 +68,7 @@ public List value() { /** * Set the value property: An array of objects of type BatchEndpoint. - * + * * @param value the value value to set. * @return the BatchEndpointTrackedResourceArmPaginatedResult object itself. */ @@ -72,7 +79,7 @@ public BatchEndpointTrackedResourceArmPaginatedResult withValue(List e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchEndpointTrackedResourceArmPaginatedResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchEndpointTrackedResourceArmPaginatedResult if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BatchEndpointTrackedResourceArmPaginatedResult. + */ + public static BatchEndpointTrackedResourceArmPaginatedResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BatchEndpointTrackedResourceArmPaginatedResult deserializedBatchEndpointTrackedResourceArmPaginatedResult + = new BatchEndpointTrackedResourceArmPaginatedResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedBatchEndpointTrackedResourceArmPaginatedResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> BatchEndpointInner.fromJson(reader1)); + deserializedBatchEndpointTrackedResourceArmPaginatedResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedBatchEndpointTrackedResourceArmPaginatedResult; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchEndpoints.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchEndpoints.java index 4762c037a92c0..b53b23062d5d0 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchEndpoints.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchEndpoints.java @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of BatchEndpoints. */ +/** + * Resource collection API of BatchEndpoints. + */ public interface BatchEndpoints { /** * Lists Batch inference endpoint in the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -24,7 +26,7 @@ public interface BatchEndpoints { /** * Lists Batch inference endpoint in the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param count Number of endpoints to be retrieved in a page of results. @@ -35,12 +37,12 @@ public interface BatchEndpoints { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of BatchEndpoint entities as paginated response with {@link PagedIterable}. */ - PagedIterable list( - String resourceGroupName, String workspaceName, Integer count, String skip, Context context); + PagedIterable list(String resourceGroupName, String workspaceName, Integer count, String skip, + Context context); /** * Delete Batch Inference Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference Endpoint name. @@ -52,7 +54,7 @@ PagedIterable list( /** * Delete Batch Inference Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference Endpoint name. @@ -65,7 +67,7 @@ PagedIterable list( /** * Gets a batch inference endpoint by name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Name for the Batch Endpoint. @@ -75,12 +77,12 @@ PagedIterable list( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a batch inference endpoint by name along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String endpointName, Context context); + Response getWithResponse(String resourceGroupName, String workspaceName, String endpointName, + Context context); /** * Gets a batch inference endpoint by name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Name for the Batch Endpoint. @@ -93,7 +95,7 @@ Response getWithResponse( /** * Lists batch Inference Endpoint keys. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference Endpoint name. @@ -103,12 +105,12 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return keys for endpoint authentication along with {@link Response}. */ - Response listKeysWithResponse( - String resourceGroupName, String workspaceName, String endpointName, Context context); + Response listKeysWithResponse(String resourceGroupName, String workspaceName, String endpointName, + Context context); /** * Lists batch Inference Endpoint keys. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference Endpoint name. @@ -121,7 +123,7 @@ Response listKeysWithResponse( /** * Gets a batch inference endpoint by name. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -132,7 +134,7 @@ Response listKeysWithResponse( /** * Gets a batch inference endpoint by name. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -144,7 +146,7 @@ Response listKeysWithResponse( /** * Delete Batch Inference Endpoint (asynchronous). - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -154,7 +156,7 @@ Response listKeysWithResponse( /** * Delete Batch Inference Endpoint (asynchronous). - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -165,7 +167,7 @@ Response listKeysWithResponse( /** * Begins definition for a new BatchEndpoint resource. - * + * * @param name resource name. * @return the first stage of the new BatchEndpoint definition. */ diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchLoggingLevel.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchLoggingLevel.java index 75fc37922df39..e9c1596ca911c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchLoggingLevel.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchLoggingLevel.java @@ -5,26 +5,32 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** - * Log verbosity for batch inferencing. Increasing verbosity order for logging is : Warning, Info and Debug. The default - * value is Info. + * Log verbosity for batch inferencing. + * Increasing verbosity order for logging is : Warning, Info and Debug. + * The default value is Info. */ public final class BatchLoggingLevel extends ExpandableStringEnum { - /** Static value Info for BatchLoggingLevel. */ + /** + * Static value Info for BatchLoggingLevel. + */ public static final BatchLoggingLevel INFO = fromString("Info"); - /** Static value Warning for BatchLoggingLevel. */ + /** + * Static value Warning for BatchLoggingLevel. + */ public static final BatchLoggingLevel WARNING = fromString("Warning"); - /** Static value Debug for BatchLoggingLevel. */ + /** + * Static value Debug for BatchLoggingLevel. + */ public static final BatchLoggingLevel DEBUG = fromString("Debug"); /** * Creates a new instance of BatchLoggingLevel value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,18 +39,17 @@ public BatchLoggingLevel() { /** * Creates or finds a BatchLoggingLevel from its string representation. - * + * * @param name a name to look for. * @return the corresponding BatchLoggingLevel. */ - @JsonCreator public static BatchLoggingLevel fromString(String name) { return fromString(name, BatchLoggingLevel.class); } /** * Gets known BatchLoggingLevel values. - * + * * @return known BatchLoggingLevel values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchOutputAction.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchOutputAction.java index 3b8fd6878d965..2fb4652a0b7e1 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchOutputAction.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchOutputAction.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Enum to determine how batch inferencing will handle output. */ +/** + * Enum to determine how batch inferencing will handle output. + */ public final class BatchOutputAction extends ExpandableStringEnum { - /** Static value SummaryOnly for BatchOutputAction. */ + /** + * Static value SummaryOnly for BatchOutputAction. + */ public static final BatchOutputAction SUMMARY_ONLY = fromString("SummaryOnly"); - /** Static value AppendRow for BatchOutputAction. */ + /** + * Static value AppendRow for BatchOutputAction. + */ public static final BatchOutputAction APPEND_ROW = fromString("AppendRow"); /** * Creates a new instance of BatchOutputAction value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public BatchOutputAction() { /** * Creates or finds a BatchOutputAction from its string representation. - * + * * @param name a name to look for. * @return the corresponding BatchOutputAction. */ - @JsonCreator public static BatchOutputAction fromString(String name) { return fromString(name, BatchOutputAction.class); } /** * Gets known BatchOutputAction values. - * + * * @return known BatchOutputAction values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchPipelineComponentDeploymentConfiguration.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchPipelineComponentDeploymentConfiguration.java new file mode 100644 index 0000000000000..0f9049644ad90 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchPipelineComponentDeploymentConfiguration.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Properties for a Batch Pipeline Component Deployment. + */ +@Fluent +public final class BatchPipelineComponentDeploymentConfiguration extends BatchDeploymentConfiguration { + /* + * [Required] The type of the deployment + */ + private BatchDeploymentConfigurationType deploymentConfigurationType + = BatchDeploymentConfigurationType.PIPELINE_COMPONENT; + + /* + * The ARM id of the component to be run. + */ + private IdAssetReference componentId; + + /* + * The description which will be applied to the job. + */ + private String description; + + /* + * Run-time settings for the pipeline job. + */ + private Map settings; + + /* + * The tags which will be applied to the job. + */ + private Map tags; + + /** + * Creates an instance of BatchPipelineComponentDeploymentConfiguration class. + */ + public BatchPipelineComponentDeploymentConfiguration() { + } + + /** + * Get the deploymentConfigurationType property: [Required] The type of the deployment. + * + * @return the deploymentConfigurationType value. + */ + @Override + public BatchDeploymentConfigurationType deploymentConfigurationType() { + return this.deploymentConfigurationType; + } + + /** + * Get the componentId property: The ARM id of the component to be run. + * + * @return the componentId value. + */ + public IdAssetReference componentId() { + return this.componentId; + } + + /** + * Set the componentId property: The ARM id of the component to be run. + * + * @param componentId the componentId value to set. + * @return the BatchPipelineComponentDeploymentConfiguration object itself. + */ + public BatchPipelineComponentDeploymentConfiguration withComponentId(IdAssetReference componentId) { + this.componentId = componentId; + return this; + } + + /** + * Get the description property: The description which will be applied to the job. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description which will be applied to the job. + * + * @param description the description value to set. + * @return the BatchPipelineComponentDeploymentConfiguration object itself. + */ + public BatchPipelineComponentDeploymentConfiguration withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the settings property: Run-time settings for the pipeline job. + * + * @return the settings value. + */ + public Map settings() { + return this.settings; + } + + /** + * Set the settings property: Run-time settings for the pipeline job. + * + * @param settings the settings value to set. + * @return the BatchPipelineComponentDeploymentConfiguration object itself. + */ + public BatchPipelineComponentDeploymentConfiguration withSettings(Map settings) { + this.settings = settings; + return this; + } + + /** + * Get the tags property: The tags which will be applied to the job. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The tags which will be applied to the job. + * + * @param tags the tags value to set. + * @return the BatchPipelineComponentDeploymentConfiguration object itself. + */ + public BatchPipelineComponentDeploymentConfiguration withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (componentId() != null) { + componentId().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("deploymentConfigurationType", + this.deploymentConfigurationType == null ? null : this.deploymentConfigurationType.toString()); + jsonWriter.writeJsonField("componentId", this.componentId); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeMapField("settings", this.settings, (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchPipelineComponentDeploymentConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchPipelineComponentDeploymentConfiguration if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BatchPipelineComponentDeploymentConfiguration. + */ + public static BatchPipelineComponentDeploymentConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BatchPipelineComponentDeploymentConfiguration deserializedBatchPipelineComponentDeploymentConfiguration + = new BatchPipelineComponentDeploymentConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deploymentConfigurationType".equals(fieldName)) { + deserializedBatchPipelineComponentDeploymentConfiguration.deploymentConfigurationType + = BatchDeploymentConfigurationType.fromString(reader.getString()); + } else if ("componentId".equals(fieldName)) { + deserializedBatchPipelineComponentDeploymentConfiguration.componentId + = IdAssetReference.fromJson(reader); + } else if ("description".equals(fieldName)) { + deserializedBatchPipelineComponentDeploymentConfiguration.description = reader.getString(); + } else if ("settings".equals(fieldName)) { + Map settings = reader.readMap(reader1 -> reader1.getString()); + deserializedBatchPipelineComponentDeploymentConfiguration.settings = settings; + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedBatchPipelineComponentDeploymentConfiguration.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedBatchPipelineComponentDeploymentConfiguration; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchRetrySettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchRetrySettings.java index 1d98496b92ba5..bbd963a89f0c7 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchRetrySettings.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BatchRetrySettings.java @@ -5,31 +5,38 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.Duration; -/** Retry settings for a batch inference operation. */ +/** + * Retry settings for a batch inference operation. + */ @Fluent -public final class BatchRetrySettings { +public final class BatchRetrySettings implements JsonSerializable { /* * Maximum retry count for a mini-batch */ - @JsonProperty(value = "maxRetries") private Integer maxRetries; /* * Invocation timeout for a mini-batch, in ISO 8601 format. */ - @JsonProperty(value = "timeout") private Duration timeout; - /** Creates an instance of BatchRetrySettings class. */ + /** + * Creates an instance of BatchRetrySettings class. + */ public BatchRetrySettings() { } /** * Get the maxRetries property: Maximum retry count for a mini-batch. - * + * * @return the maxRetries value. */ public Integer maxRetries() { @@ -38,7 +45,7 @@ public Integer maxRetries() { /** * Set the maxRetries property: Maximum retry count for a mini-batch. - * + * * @param maxRetries the maxRetries value to set. * @return the BatchRetrySettings object itself. */ @@ -49,7 +56,7 @@ public BatchRetrySettings withMaxRetries(Integer maxRetries) { /** * Get the timeout property: Invocation timeout for a mini-batch, in ISO 8601 format. - * + * * @return the timeout value. */ public Duration timeout() { @@ -58,7 +65,7 @@ public Duration timeout() { /** * Set the timeout property: Invocation timeout for a mini-batch, in ISO 8601 format. - * + * * @param timeout the timeout value to set. * @return the BatchRetrySettings object itself. */ @@ -69,9 +76,49 @@ public BatchRetrySettings withTimeout(Duration timeout) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("maxRetries", this.maxRetries); + jsonWriter.writeStringField("timeout", CoreUtils.durationToStringWithDays(this.timeout)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchRetrySettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchRetrySettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the BatchRetrySettings. + */ + public static BatchRetrySettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BatchRetrySettings deserializedBatchRetrySettings = new BatchRetrySettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("maxRetries".equals(fieldName)) { + deserializedBatchRetrySettings.maxRetries = reader.getNullable(JsonReader::getInt); + } else if ("timeout".equals(fieldName)) { + deserializedBatchRetrySettings.timeout + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedBatchRetrySettings; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BayesianSamplingAlgorithm.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BayesianSamplingAlgorithm.java index 06e64fab91691..8468833775e5a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BayesianSamplingAlgorithm.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BayesianSamplingAlgorithm.java @@ -5,25 +5,83 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Defines a Sampling Algorithm that generates values based on previous values. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "samplingAlgorithmType") -@JsonTypeName("Bayesian") +/** + * Defines a Sampling Algorithm that generates values based on previous values. + */ @Immutable public final class BayesianSamplingAlgorithm extends SamplingAlgorithm { - /** Creates an instance of BayesianSamplingAlgorithm class. */ + /* + * [Required] The algorithm used for generating hyperparameter values, along with configuration properties + */ + private SamplingAlgorithmType samplingAlgorithmType = SamplingAlgorithmType.BAYESIAN; + + /** + * Creates an instance of BayesianSamplingAlgorithm class. + */ public BayesianSamplingAlgorithm() { } + /** + * Get the samplingAlgorithmType property: [Required] The algorithm used for generating hyperparameter values, along + * with configuration properties. + * + * @return the samplingAlgorithmType value. + */ + @Override + public SamplingAlgorithmType samplingAlgorithmType() { + return this.samplingAlgorithmType; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("samplingAlgorithmType", + this.samplingAlgorithmType == null ? null : this.samplingAlgorithmType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BayesianSamplingAlgorithm from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BayesianSamplingAlgorithm if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BayesianSamplingAlgorithm. + */ + public static BayesianSamplingAlgorithm fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BayesianSamplingAlgorithm deserializedBayesianSamplingAlgorithm = new BayesianSamplingAlgorithm(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("samplingAlgorithmType".equals(fieldName)) { + deserializedBayesianSamplingAlgorithm.samplingAlgorithmType + = SamplingAlgorithmType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedBayesianSamplingAlgorithm; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BillingCurrency.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BillingCurrency.java index 9f908f659abad..7d307afad8a3a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BillingCurrency.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BillingCurrency.java @@ -5,21 +5,22 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** * Billing currency - * - *

Three lettered code specifying the currency of the VM price. Example: USD. + * + * Three lettered code specifying the currency of the VM price. Example: USD. */ public final class BillingCurrency extends ExpandableStringEnum { - /** Static value USD for BillingCurrency. */ + /** + * Static value USD for BillingCurrency. + */ public static final BillingCurrency USD = fromString("USD"); /** * Creates a new instance of BillingCurrency value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -28,18 +29,17 @@ public BillingCurrency() { /** * Creates or finds a BillingCurrency from its string representation. - * + * * @param name a name to look for. * @return the corresponding BillingCurrency. */ - @JsonCreator public static BillingCurrency fromString(String name) { return fromString(name, BillingCurrency.class); } /** * Gets known BillingCurrency values. - * + * * @return known BillingCurrency values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BindOptions.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BindOptions.java new file mode 100644 index 0000000000000..403713c169075 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BindOptions.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes the bind options for the container. + */ +@Fluent +public final class BindOptions implements JsonSerializable { + /* + * Type of Bind Option + */ + private String propagation; + + /* + * Indicate whether to create host path. + */ + private Boolean createHostPath; + + /* + * Mention the selinux options. + */ + private String selinux; + + /** + * Creates an instance of BindOptions class. + */ + public BindOptions() { + } + + /** + * Get the propagation property: Type of Bind Option. + * + * @return the propagation value. + */ + public String propagation() { + return this.propagation; + } + + /** + * Set the propagation property: Type of Bind Option. + * + * @param propagation the propagation value to set. + * @return the BindOptions object itself. + */ + public BindOptions withPropagation(String propagation) { + this.propagation = propagation; + return this; + } + + /** + * Get the createHostPath property: Indicate whether to create host path. + * + * @return the createHostPath value. + */ + public Boolean createHostPath() { + return this.createHostPath; + } + + /** + * Set the createHostPath property: Indicate whether to create host path. + * + * @param createHostPath the createHostPath value to set. + * @return the BindOptions object itself. + */ + public BindOptions withCreateHostPath(Boolean createHostPath) { + this.createHostPath = createHostPath; + return this; + } + + /** + * Get the selinux property: Mention the selinux options. + * + * @return the selinux value. + */ + public String selinux() { + return this.selinux; + } + + /** + * Set the selinux property: Mention the selinux options. + * + * @param selinux the selinux value to set. + * @return the BindOptions object itself. + */ + public BindOptions withSelinux(String selinux) { + this.selinux = selinux; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("propagation", this.propagation); + jsonWriter.writeBooleanField("createHostPath", this.createHostPath); + jsonWriter.writeStringField("selinux", this.selinux); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BindOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BindOptions if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the BindOptions. + */ + public static BindOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BindOptions deserializedBindOptions = new BindOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("propagation".equals(fieldName)) { + deserializedBindOptions.propagation = reader.getString(); + } else if ("createHostPath".equals(fieldName)) { + deserializedBindOptions.createHostPath = reader.getNullable(JsonReader::getBoolean); + } else if ("selinux".equals(fieldName)) { + deserializedBindOptions.selinux = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBindOptions; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BlobReferenceForConsumptionDto.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BlobReferenceForConsumptionDto.java new file mode 100644 index 0000000000000..ad0dc35c844ba --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BlobReferenceForConsumptionDto.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The BlobReferenceForConsumptionDto model. + */ +@Fluent +public final class BlobReferenceForConsumptionDto implements JsonSerializable { + /* + * Blob URI path for client to upload data. + * Example: https://blob.windows.core.net/Container/Path + */ + private String blobUri; + + /* + * Credential info to access storage account + */ + private PendingUploadCredentialDto credential; + + /* + * Arm ID of the storage account to use + */ + private String storageAccountArmId; + + /** + * Creates an instance of BlobReferenceForConsumptionDto class. + */ + public BlobReferenceForConsumptionDto() { + } + + /** + * Get the blobUri property: Blob URI path for client to upload data. + * Example: https://blob.windows.core.net/Container/Path. + * + * @return the blobUri value. + */ + public String blobUri() { + return this.blobUri; + } + + /** + * Set the blobUri property: Blob URI path for client to upload data. + * Example: https://blob.windows.core.net/Container/Path. + * + * @param blobUri the blobUri value to set. + * @return the BlobReferenceForConsumptionDto object itself. + */ + public BlobReferenceForConsumptionDto withBlobUri(String blobUri) { + this.blobUri = blobUri; + return this; + } + + /** + * Get the credential property: Credential info to access storage account. + * + * @return the credential value. + */ + public PendingUploadCredentialDto credential() { + return this.credential; + } + + /** + * Set the credential property: Credential info to access storage account. + * + * @param credential the credential value to set. + * @return the BlobReferenceForConsumptionDto object itself. + */ + public BlobReferenceForConsumptionDto withCredential(PendingUploadCredentialDto credential) { + this.credential = credential; + return this; + } + + /** + * Get the storageAccountArmId property: Arm ID of the storage account to use. + * + * @return the storageAccountArmId value. + */ + public String storageAccountArmId() { + return this.storageAccountArmId; + } + + /** + * Set the storageAccountArmId property: Arm ID of the storage account to use. + * + * @param storageAccountArmId the storageAccountArmId value to set. + * @return the BlobReferenceForConsumptionDto object itself. + */ + public BlobReferenceForConsumptionDto withStorageAccountArmId(String storageAccountArmId) { + this.storageAccountArmId = storageAccountArmId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (credential() != null) { + credential().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("blobUri", this.blobUri); + jsonWriter.writeJsonField("credential", this.credential); + jsonWriter.writeStringField("storageAccountArmId", this.storageAccountArmId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BlobReferenceForConsumptionDto from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BlobReferenceForConsumptionDto if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BlobReferenceForConsumptionDto. + */ + public static BlobReferenceForConsumptionDto fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BlobReferenceForConsumptionDto deserializedBlobReferenceForConsumptionDto + = new BlobReferenceForConsumptionDto(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("blobUri".equals(fieldName)) { + deserializedBlobReferenceForConsumptionDto.blobUri = reader.getString(); + } else if ("credential".equals(fieldName)) { + deserializedBlobReferenceForConsumptionDto.credential = PendingUploadCredentialDto.fromJson(reader); + } else if ("storageAccountArmId".equals(fieldName)) { + deserializedBlobReferenceForConsumptionDto.storageAccountArmId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBlobReferenceForConsumptionDto; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BlockedTransformers.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BlockedTransformers.java index 2ac161f2f5a69..3ebb419525c63 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BlockedTransformers.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BlockedTransformers.java @@ -5,44 +5,65 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Enum for all classification models supported by AutoML. */ +/** + * Enum for all classification models supported by AutoML. + */ public final class BlockedTransformers extends ExpandableStringEnum { - /** Static value TextTargetEncoder for BlockedTransformers. */ + /** + * Static value TextTargetEncoder for BlockedTransformers. + */ public static final BlockedTransformers TEXT_TARGET_ENCODER = fromString("TextTargetEncoder"); - /** Static value OneHotEncoder for BlockedTransformers. */ + /** + * Static value OneHotEncoder for BlockedTransformers. + */ public static final BlockedTransformers ONE_HOT_ENCODER = fromString("OneHotEncoder"); - /** Static value CatTargetEncoder for BlockedTransformers. */ + /** + * Static value CatTargetEncoder for BlockedTransformers. + */ public static final BlockedTransformers CAT_TARGET_ENCODER = fromString("CatTargetEncoder"); - /** Static value TfIdf for BlockedTransformers. */ + /** + * Static value TfIdf for BlockedTransformers. + */ public static final BlockedTransformers TF_IDF = fromString("TfIdf"); - /** Static value WoETargetEncoder for BlockedTransformers. */ + /** + * Static value WoETargetEncoder for BlockedTransformers. + */ public static final BlockedTransformers WO_ETARGET_ENCODER = fromString("WoETargetEncoder"); - /** Static value LabelEncoder for BlockedTransformers. */ + /** + * Static value LabelEncoder for BlockedTransformers. + */ public static final BlockedTransformers LABEL_ENCODER = fromString("LabelEncoder"); - /** Static value WordEmbedding for BlockedTransformers. */ + /** + * Static value WordEmbedding for BlockedTransformers. + */ public static final BlockedTransformers WORD_EMBEDDING = fromString("WordEmbedding"); - /** Static value NaiveBayes for BlockedTransformers. */ + /** + * Static value NaiveBayes for BlockedTransformers. + */ public static final BlockedTransformers NAIVE_BAYES = fromString("NaiveBayes"); - /** Static value CountVectorizer for BlockedTransformers. */ + /** + * Static value CountVectorizer for BlockedTransformers. + */ public static final BlockedTransformers COUNT_VECTORIZER = fromString("CountVectorizer"); - /** Static value HashOneHotEncoder for BlockedTransformers. */ + /** + * Static value HashOneHotEncoder for BlockedTransformers. + */ public static final BlockedTransformers HASH_ONE_HOT_ENCODER = fromString("HashOneHotEncoder"); /** * Creates a new instance of BlockedTransformers value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -51,18 +72,17 @@ public BlockedTransformers() { /** * Creates or finds a BlockedTransformers from its string representation. - * + * * @param name a name to look for. * @return the corresponding BlockedTransformers. */ - @JsonCreator public static BlockedTransformers fromString(String name) { return fromString(name, BlockedTransformers.class); } /** * Gets known BlockedTransformers values. - * + * * @return known BlockedTransformers values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BuildContext.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BuildContext.java index 5ee7e93ad42bd..f8e515bea021c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BuildContext.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/BuildContext.java @@ -6,35 +6,41 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Configuration settings for Docker build context. */ +/** + * Configuration settings for Docker build context. + */ @Fluent -public final class BuildContext { +public final class BuildContext implements JsonSerializable { /* * [Required] URI of the Docker build context used to build the image. Supports blob URIs on environment creation * and may return blob or Git URIs. * */ - @JsonProperty(value = "contextUri", required = true) private String contextUri; /* * Path to the Dockerfile in the build context. * */ - @JsonProperty(value = "dockerfilePath") private String dockerfilePath; - /** Creates an instance of BuildContext class. */ + /** + * Creates an instance of BuildContext class. + */ public BuildContext() { } /** * Get the contextUri property: [Required] URI of the Docker build context used to build the image. Supports blob - * URIs on environment creation and may return blob or Git URIs. <seealso - * href="https://docs.docker.com/engine/reference/commandline/build/#extended-description" />. - * + * URIs on environment creation and may return blob or Git URIs. + * <seealso href="https://docs.docker.com/engine/reference/commandline/build/#extended-description" />. + * * @return the contextUri value. */ public String contextUri() { @@ -43,9 +49,9 @@ public String contextUri() { /** * Set the contextUri property: [Required] URI of the Docker build context used to build the image. Supports blob - * URIs on environment creation and may return blob or Git URIs. <seealso - * href="https://docs.docker.com/engine/reference/commandline/build/#extended-description" />. - * + * URIs on environment creation and may return blob or Git URIs. + * <seealso href="https://docs.docker.com/engine/reference/commandline/build/#extended-description" />. + * * @param contextUri the contextUri value to set. * @return the BuildContext object itself. */ @@ -55,9 +61,9 @@ public BuildContext withContextUri(String contextUri) { } /** - * Get the dockerfilePath property: Path to the Dockerfile in the build context. <seealso - * href="https://docs.docker.com/engine/reference/builder/" />. - * + * Get the dockerfilePath property: Path to the Dockerfile in the build context. + * <seealso href="https://docs.docker.com/engine/reference/builder/" />. + * * @return the dockerfilePath value. */ public String dockerfilePath() { @@ -65,9 +71,9 @@ public String dockerfilePath() { } /** - * Set the dockerfilePath property: Path to the Dockerfile in the build context. <seealso - * href="https://docs.docker.com/engine/reference/builder/" />. - * + * Set the dockerfilePath property: Path to the Dockerfile in the build context. + * <seealso href="https://docs.docker.com/engine/reference/builder/" />. + * * @param dockerfilePath the dockerfilePath value to set. * @return the BuildContext object itself. */ @@ -78,16 +84,55 @@ public BuildContext withDockerfilePath(String dockerfilePath) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (contextUri() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property contextUri in model BuildContext")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property contextUri in model BuildContext")); } } private static final ClientLogger LOGGER = new ClientLogger(BuildContext.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("contextUri", this.contextUri); + jsonWriter.writeStringField("dockerfilePath", this.dockerfilePath); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BuildContext from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BuildContext if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BuildContext. + */ + public static BuildContext fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BuildContext deserializedBuildContext = new BuildContext(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("contextUri".equals(fieldName)) { + deserializedBuildContext.contextUri = reader.getString(); + } else if ("dockerfilePath".equals(fieldName)) { + deserializedBuildContext.dockerfilePath = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBuildContext; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Caching.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Caching.java index 8ada219906473..eaf670a603535 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Caching.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Caching.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Caching type of Data Disk. */ +/** + * Caching type of Data Disk. + */ public final class Caching extends ExpandableStringEnum { - /** Static value None for Caching. */ + /** + * Static value None for Caching. + */ public static final Caching NONE = fromString("None"); - /** Static value ReadOnly for Caching. */ + /** + * Static value ReadOnly for Caching. + */ public static final Caching READ_ONLY = fromString("ReadOnly"); - /** Static value ReadWrite for Caching. */ + /** + * Static value ReadWrite for Caching. + */ public static final Caching READ_WRITE = fromString("ReadWrite"); /** * Creates a new instance of Caching value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public Caching() { /** * Creates or finds a Caching from its string representation. - * + * * @param name a name to look for. * @return the corresponding Caching. */ - @JsonCreator public static Caching fromString(String name) { return fromString(name, Caching.class); } /** * Gets known Caching values. - * + * * @return known Caching values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CategoricalDataDriftMetric.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CategoricalDataDriftMetric.java new file mode 100644 index 0000000000000..16dece761fa87 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CategoricalDataDriftMetric.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for CategoricalDataDriftMetric. + */ +public final class CategoricalDataDriftMetric extends ExpandableStringEnum { + /** + * Static value JensenShannonDistance for CategoricalDataDriftMetric. + */ + public static final CategoricalDataDriftMetric JENSEN_SHANNON_DISTANCE = fromString("JensenShannonDistance"); + + /** + * Static value PopulationStabilityIndex for CategoricalDataDriftMetric. + */ + public static final CategoricalDataDriftMetric POPULATION_STABILITY_INDEX = fromString("PopulationStabilityIndex"); + + /** + * Static value PearsonsChiSquaredTest for CategoricalDataDriftMetric. + */ + public static final CategoricalDataDriftMetric PEARSONS_CHI_SQUARED_TEST = fromString("PearsonsChiSquaredTest"); + + /** + * Creates a new instance of CategoricalDataDriftMetric value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CategoricalDataDriftMetric() { + } + + /** + * Creates or finds a CategoricalDataDriftMetric from its string representation. + * + * @param name a name to look for. + * @return the corresponding CategoricalDataDriftMetric. + */ + public static CategoricalDataDriftMetric fromString(String name) { + return fromString(name, CategoricalDataDriftMetric.class); + } + + /** + * Gets known CategoricalDataDriftMetric values. + * + * @return known CategoricalDataDriftMetric values. + */ + public static Collection values() { + return values(CategoricalDataDriftMetric.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CategoricalDataDriftMetricThreshold.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CategoricalDataDriftMetricThreshold.java new file mode 100644 index 0000000000000..2e1427398f0f6 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CategoricalDataDriftMetricThreshold.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The CategoricalDataDriftMetricThreshold model. + */ +@Fluent +public final class CategoricalDataDriftMetricThreshold extends DataDriftMetricThresholdBase { + /* + * [Required] Specifies the data type of the metric threshold. + */ + private MonitoringFeatureDataType dataType = MonitoringFeatureDataType.CATEGORICAL; + + /* + * [Required] The categorical data drift metric to calculate. + */ + private CategoricalDataDriftMetric metric; + + /** + * Creates an instance of CategoricalDataDriftMetricThreshold class. + */ + public CategoricalDataDriftMetricThreshold() { + } + + /** + * Get the dataType property: [Required] Specifies the data type of the metric threshold. + * + * @return the dataType value. + */ + @Override + public MonitoringFeatureDataType dataType() { + return this.dataType; + } + + /** + * Get the metric property: [Required] The categorical data drift metric to calculate. + * + * @return the metric value. + */ + public CategoricalDataDriftMetric metric() { + return this.metric; + } + + /** + * Set the metric property: [Required] The categorical data drift metric to calculate. + * + * @param metric the metric value to set. + * @return the CategoricalDataDriftMetricThreshold object itself. + */ + public CategoricalDataDriftMetricThreshold withMetric(CategoricalDataDriftMetric metric) { + this.metric = metric; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CategoricalDataDriftMetricThreshold withThreshold(MonitoringThreshold threshold) { + super.withThreshold(threshold); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (metric() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property metric in model CategoricalDataDriftMetricThreshold")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CategoricalDataDriftMetricThreshold.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("threshold", threshold()); + jsonWriter.writeStringField("metric", this.metric == null ? null : this.metric.toString()); + jsonWriter.writeStringField("dataType", this.dataType == null ? null : this.dataType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CategoricalDataDriftMetricThreshold from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CategoricalDataDriftMetricThreshold if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CategoricalDataDriftMetricThreshold. + */ + public static CategoricalDataDriftMetricThreshold fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CategoricalDataDriftMetricThreshold deserializedCategoricalDataDriftMetricThreshold + = new CategoricalDataDriftMetricThreshold(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("threshold".equals(fieldName)) { + deserializedCategoricalDataDriftMetricThreshold.withThreshold(MonitoringThreshold.fromJson(reader)); + } else if ("metric".equals(fieldName)) { + deserializedCategoricalDataDriftMetricThreshold.metric + = CategoricalDataDriftMetric.fromString(reader.getString()); + } else if ("dataType".equals(fieldName)) { + deserializedCategoricalDataDriftMetricThreshold.dataType + = MonitoringFeatureDataType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCategoricalDataDriftMetricThreshold; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CategoricalDataQualityMetric.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CategoricalDataQualityMetric.java new file mode 100644 index 0000000000000..0f054d638710d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CategoricalDataQualityMetric.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for CategoricalDataQualityMetric. + */ +public final class CategoricalDataQualityMetric extends ExpandableStringEnum { + /** + * Static value NullValueRate for CategoricalDataQualityMetric. + */ + public static final CategoricalDataQualityMetric NULL_VALUE_RATE = fromString("NullValueRate"); + + /** + * Static value DataTypeErrorRate for CategoricalDataQualityMetric. + */ + public static final CategoricalDataQualityMetric DATA_TYPE_ERROR_RATE = fromString("DataTypeErrorRate"); + + /** + * Static value OutOfBoundsRate for CategoricalDataQualityMetric. + */ + public static final CategoricalDataQualityMetric OUT_OF_BOUNDS_RATE = fromString("OutOfBoundsRate"); + + /** + * Creates a new instance of CategoricalDataQualityMetric value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CategoricalDataQualityMetric() { + } + + /** + * Creates or finds a CategoricalDataQualityMetric from its string representation. + * + * @param name a name to look for. + * @return the corresponding CategoricalDataQualityMetric. + */ + public static CategoricalDataQualityMetric fromString(String name) { + return fromString(name, CategoricalDataQualityMetric.class); + } + + /** + * Gets known CategoricalDataQualityMetric values. + * + * @return known CategoricalDataQualityMetric values. + */ + public static Collection values() { + return values(CategoricalDataQualityMetric.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CategoricalDataQualityMetricThreshold.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CategoricalDataQualityMetricThreshold.java new file mode 100644 index 0000000000000..4862103be229a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CategoricalDataQualityMetricThreshold.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The CategoricalDataQualityMetricThreshold model. + */ +@Fluent +public final class CategoricalDataQualityMetricThreshold extends DataQualityMetricThresholdBase { + /* + * [Required] Specifies the data type of the metric threshold. + */ + private MonitoringFeatureDataType dataType = MonitoringFeatureDataType.CATEGORICAL; + + /* + * [Required] The categorical data quality metric to calculate. + */ + private CategoricalDataQualityMetric metric; + + /** + * Creates an instance of CategoricalDataQualityMetricThreshold class. + */ + public CategoricalDataQualityMetricThreshold() { + } + + /** + * Get the dataType property: [Required] Specifies the data type of the metric threshold. + * + * @return the dataType value. + */ + @Override + public MonitoringFeatureDataType dataType() { + return this.dataType; + } + + /** + * Get the metric property: [Required] The categorical data quality metric to calculate. + * + * @return the metric value. + */ + public CategoricalDataQualityMetric metric() { + return this.metric; + } + + /** + * Set the metric property: [Required] The categorical data quality metric to calculate. + * + * @param metric the metric value to set. + * @return the CategoricalDataQualityMetricThreshold object itself. + */ + public CategoricalDataQualityMetricThreshold withMetric(CategoricalDataQualityMetric metric) { + this.metric = metric; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CategoricalDataQualityMetricThreshold withThreshold(MonitoringThreshold threshold) { + super.withThreshold(threshold); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (metric() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property metric in model CategoricalDataQualityMetricThreshold")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CategoricalDataQualityMetricThreshold.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("threshold", threshold()); + jsonWriter.writeStringField("metric", this.metric == null ? null : this.metric.toString()); + jsonWriter.writeStringField("dataType", this.dataType == null ? null : this.dataType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CategoricalDataQualityMetricThreshold from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CategoricalDataQualityMetricThreshold if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CategoricalDataQualityMetricThreshold. + */ + public static CategoricalDataQualityMetricThreshold fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CategoricalDataQualityMetricThreshold deserializedCategoricalDataQualityMetricThreshold + = new CategoricalDataQualityMetricThreshold(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("threshold".equals(fieldName)) { + deserializedCategoricalDataQualityMetricThreshold + .withThreshold(MonitoringThreshold.fromJson(reader)); + } else if ("metric".equals(fieldName)) { + deserializedCategoricalDataQualityMetricThreshold.metric + = CategoricalDataQualityMetric.fromString(reader.getString()); + } else if ("dataType".equals(fieldName)) { + deserializedCategoricalDataQualityMetricThreshold.dataType + = MonitoringFeatureDataType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCategoricalDataQualityMetricThreshold; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CategoricalPredictionDriftMetric.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CategoricalPredictionDriftMetric.java new file mode 100644 index 0000000000000..8f6b88e06a043 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CategoricalPredictionDriftMetric.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for CategoricalPredictionDriftMetric. + */ +public final class CategoricalPredictionDriftMetric extends ExpandableStringEnum { + /** + * Static value JensenShannonDistance for CategoricalPredictionDriftMetric. + */ + public static final CategoricalPredictionDriftMetric JENSEN_SHANNON_DISTANCE = fromString("JensenShannonDistance"); + + /** + * Static value PopulationStabilityIndex for CategoricalPredictionDriftMetric. + */ + public static final CategoricalPredictionDriftMetric POPULATION_STABILITY_INDEX + = fromString("PopulationStabilityIndex"); + + /** + * Static value PearsonsChiSquaredTest for CategoricalPredictionDriftMetric. + */ + public static final CategoricalPredictionDriftMetric PEARSONS_CHI_SQUARED_TEST + = fromString("PearsonsChiSquaredTest"); + + /** + * Creates a new instance of CategoricalPredictionDriftMetric value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CategoricalPredictionDriftMetric() { + } + + /** + * Creates or finds a CategoricalPredictionDriftMetric from its string representation. + * + * @param name a name to look for. + * @return the corresponding CategoricalPredictionDriftMetric. + */ + public static CategoricalPredictionDriftMetric fromString(String name) { + return fromString(name, CategoricalPredictionDriftMetric.class); + } + + /** + * Gets known CategoricalPredictionDriftMetric values. + * + * @return known CategoricalPredictionDriftMetric values. + */ + public static Collection values() { + return values(CategoricalPredictionDriftMetric.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CategoricalPredictionDriftMetricThreshold.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CategoricalPredictionDriftMetricThreshold.java new file mode 100644 index 0000000000000..aa10da87d9dfd --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CategoricalPredictionDriftMetricThreshold.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The CategoricalPredictionDriftMetricThreshold model. + */ +@Fluent +public final class CategoricalPredictionDriftMetricThreshold extends PredictionDriftMetricThresholdBase { + /* + * [Required] Specifies the data type of the metric threshold. + */ + private MonitoringFeatureDataType dataType = MonitoringFeatureDataType.CATEGORICAL; + + /* + * [Required] The categorical prediction drift metric to calculate. + */ + private CategoricalPredictionDriftMetric metric; + + /** + * Creates an instance of CategoricalPredictionDriftMetricThreshold class. + */ + public CategoricalPredictionDriftMetricThreshold() { + } + + /** + * Get the dataType property: [Required] Specifies the data type of the metric threshold. + * + * @return the dataType value. + */ + @Override + public MonitoringFeatureDataType dataType() { + return this.dataType; + } + + /** + * Get the metric property: [Required] The categorical prediction drift metric to calculate. + * + * @return the metric value. + */ + public CategoricalPredictionDriftMetric metric() { + return this.metric; + } + + /** + * Set the metric property: [Required] The categorical prediction drift metric to calculate. + * + * @param metric the metric value to set. + * @return the CategoricalPredictionDriftMetricThreshold object itself. + */ + public CategoricalPredictionDriftMetricThreshold withMetric(CategoricalPredictionDriftMetric metric) { + this.metric = metric; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CategoricalPredictionDriftMetricThreshold withThreshold(MonitoringThreshold threshold) { + super.withThreshold(threshold); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (metric() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property metric in model CategoricalPredictionDriftMetricThreshold")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CategoricalPredictionDriftMetricThreshold.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("threshold", threshold()); + jsonWriter.writeStringField("metric", this.metric == null ? null : this.metric.toString()); + jsonWriter.writeStringField("dataType", this.dataType == null ? null : this.dataType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CategoricalPredictionDriftMetricThreshold from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CategoricalPredictionDriftMetricThreshold if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CategoricalPredictionDriftMetricThreshold. + */ + public static CategoricalPredictionDriftMetricThreshold fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CategoricalPredictionDriftMetricThreshold deserializedCategoricalPredictionDriftMetricThreshold + = new CategoricalPredictionDriftMetricThreshold(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("threshold".equals(fieldName)) { + deserializedCategoricalPredictionDriftMetricThreshold + .withThreshold(MonitoringThreshold.fromJson(reader)); + } else if ("metric".equals(fieldName)) { + deserializedCategoricalPredictionDriftMetricThreshold.metric + = CategoricalPredictionDriftMetric.fromString(reader.getString()); + } else if ("dataType".equals(fieldName)) { + deserializedCategoricalPredictionDriftMetricThreshold.dataType + = MonitoringFeatureDataType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCategoricalPredictionDriftMetricThreshold; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CertificateDatastoreCredentials.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CertificateDatastoreCredentials.java index 028afea8b9672..effab256b2d0e 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CertificateDatastoreCredentials.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CertificateDatastoreCredentials.java @@ -6,59 +6,72 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Objects; import java.util.UUID; -/** Certificate datastore credentials configuration. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "credentialsType") -@JsonTypeName("Certificate") +/** + * Certificate datastore credentials configuration. + */ @Fluent public final class CertificateDatastoreCredentials extends DatastoreCredentials { + /* + * [Required] Credential type used to authentication with storage. + */ + private CredentialsType credentialsType = CredentialsType.CERTIFICATE; + /* * Authority URL used for authentication. */ - @JsonProperty(value = "authorityUrl") private String authorityUrl; /* * [Required] Service principal client ID. */ - @JsonProperty(value = "clientId", required = true) private UUID clientId; /* * Resource the service principal has access to. */ - @JsonProperty(value = "resourceUrl") private String resourceUrl; /* * [Required] Service principal secrets. */ - @JsonProperty(value = "secrets", required = true) private CertificateDatastoreSecrets secrets; /* * [Required] ID of the tenant to which the service principal belongs. */ - @JsonProperty(value = "tenantId", required = true) private UUID tenantId; /* * [Required] Thumbprint of the certificate used for authentication. */ - @JsonProperty(value = "thumbprint", required = true) private String thumbprint; - /** Creates an instance of CertificateDatastoreCredentials class. */ + /** + * Creates an instance of CertificateDatastoreCredentials class. + */ public CertificateDatastoreCredentials() { } + /** + * Get the credentialsType property: [Required] Credential type used to authentication with storage. + * + * @return the credentialsType value. + */ + @Override + public CredentialsType credentialsType() { + return this.credentialsType; + } + /** * Get the authorityUrl property: Authority URL used for authentication. - * + * * @return the authorityUrl value. */ public String authorityUrl() { @@ -67,7 +80,7 @@ public String authorityUrl() { /** * Set the authorityUrl property: Authority URL used for authentication. - * + * * @param authorityUrl the authorityUrl value to set. * @return the CertificateDatastoreCredentials object itself. */ @@ -78,7 +91,7 @@ public CertificateDatastoreCredentials withAuthorityUrl(String authorityUrl) { /** * Get the clientId property: [Required] Service principal client ID. - * + * * @return the clientId value. */ public UUID clientId() { @@ -87,7 +100,7 @@ public UUID clientId() { /** * Set the clientId property: [Required] Service principal client ID. - * + * * @param clientId the clientId value to set. * @return the CertificateDatastoreCredentials object itself. */ @@ -98,7 +111,7 @@ public CertificateDatastoreCredentials withClientId(UUID clientId) { /** * Get the resourceUrl property: Resource the service principal has access to. - * + * * @return the resourceUrl value. */ public String resourceUrl() { @@ -107,7 +120,7 @@ public String resourceUrl() { /** * Set the resourceUrl property: Resource the service principal has access to. - * + * * @param resourceUrl the resourceUrl value to set. * @return the CertificateDatastoreCredentials object itself. */ @@ -118,7 +131,7 @@ public CertificateDatastoreCredentials withResourceUrl(String resourceUrl) { /** * Get the secrets property: [Required] Service principal secrets. - * + * * @return the secrets value. */ public CertificateDatastoreSecrets secrets() { @@ -127,7 +140,7 @@ public CertificateDatastoreSecrets secrets() { /** * Set the secrets property: [Required] Service principal secrets. - * + * * @param secrets the secrets value to set. * @return the CertificateDatastoreCredentials object itself. */ @@ -138,7 +151,7 @@ public CertificateDatastoreCredentials withSecrets(CertificateDatastoreSecrets s /** * Get the tenantId property: [Required] ID of the tenant to which the service principal belongs. - * + * * @return the tenantId value. */ public UUID tenantId() { @@ -147,7 +160,7 @@ public UUID tenantId() { /** * Set the tenantId property: [Required] ID of the tenant to which the service principal belongs. - * + * * @param tenantId the tenantId value to set. * @return the CertificateDatastoreCredentials object itself. */ @@ -158,7 +171,7 @@ public CertificateDatastoreCredentials withTenantId(UUID tenantId) { /** * Get the thumbprint property: [Required] Thumbprint of the certificate used for authentication. - * + * * @return the thumbprint value. */ public String thumbprint() { @@ -167,7 +180,7 @@ public String thumbprint() { /** * Set the thumbprint property: [Required] Thumbprint of the certificate used for authentication. - * + * * @param thumbprint the thumbprint value to set. * @return the CertificateDatastoreCredentials object itself. */ @@ -178,39 +191,95 @@ public CertificateDatastoreCredentials withThumbprint(String thumbprint) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (clientId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property clientId in model CertificateDatastoreCredentials")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property clientId in model CertificateDatastoreCredentials")); } if (secrets() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property secrets in model CertificateDatastoreCredentials")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property secrets in model CertificateDatastoreCredentials")); } else { secrets().validate(); } if (tenantId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property tenantId in model CertificateDatastoreCredentials")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property tenantId in model CertificateDatastoreCredentials")); } if (thumbprint() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property thumbprint in model CertificateDatastoreCredentials")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property thumbprint in model CertificateDatastoreCredentials")); } } private static final ClientLogger LOGGER = new ClientLogger(CertificateDatastoreCredentials.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("clientId", Objects.toString(this.clientId, null)); + jsonWriter.writeJsonField("secrets", this.secrets); + jsonWriter.writeStringField("tenantId", Objects.toString(this.tenantId, null)); + jsonWriter.writeStringField("thumbprint", this.thumbprint); + jsonWriter.writeStringField("credentialsType", + this.credentialsType == null ? null : this.credentialsType.toString()); + jsonWriter.writeStringField("authorityUrl", this.authorityUrl); + jsonWriter.writeStringField("resourceUrl", this.resourceUrl); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CertificateDatastoreCredentials from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CertificateDatastoreCredentials if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CertificateDatastoreCredentials. + */ + public static CertificateDatastoreCredentials fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CertificateDatastoreCredentials deserializedCertificateDatastoreCredentials + = new CertificateDatastoreCredentials(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clientId".equals(fieldName)) { + deserializedCertificateDatastoreCredentials.clientId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("secrets".equals(fieldName)) { + deserializedCertificateDatastoreCredentials.secrets = CertificateDatastoreSecrets.fromJson(reader); + } else if ("tenantId".equals(fieldName)) { + deserializedCertificateDatastoreCredentials.tenantId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("thumbprint".equals(fieldName)) { + deserializedCertificateDatastoreCredentials.thumbprint = reader.getString(); + } else if ("credentialsType".equals(fieldName)) { + deserializedCertificateDatastoreCredentials.credentialsType + = CredentialsType.fromString(reader.getString()); + } else if ("authorityUrl".equals(fieldName)) { + deserializedCertificateDatastoreCredentials.authorityUrl = reader.getString(); + } else if ("resourceUrl".equals(fieldName)) { + deserializedCertificateDatastoreCredentials.resourceUrl = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCertificateDatastoreCredentials; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CertificateDatastoreSecrets.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CertificateDatastoreSecrets.java index 9024d4497f717..5f47f4efcf8ec 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CertificateDatastoreSecrets.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CertificateDatastoreSecrets.java @@ -5,29 +5,46 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.fluent.models.DatastoreSecretsInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.IOException; -/** Datastore certificate secrets. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "secretsType") -@JsonTypeName("Certificate") +/** + * Datastore certificate secrets. + */ @Fluent public final class CertificateDatastoreSecrets extends DatastoreSecretsInner { + /* + * [Required] Credential type used to authentication with storage. + */ + private SecretsType secretsType = SecretsType.CERTIFICATE; + /* * Service principal certificate. */ - @JsonProperty(value = "certificate") private String certificate; - /** Creates an instance of CertificateDatastoreSecrets class. */ + /** + * Creates an instance of CertificateDatastoreSecrets class. + */ public CertificateDatastoreSecrets() { } + /** + * Get the secretsType property: [Required] Credential type used to authentication with storage. + * + * @return the secretsType value. + */ + @Override + public SecretsType secretsType() { + return this.secretsType; + } + /** * Get the certificate property: Service principal certificate. - * + * * @return the certificate value. */ public String certificate() { @@ -36,7 +53,7 @@ public String certificate() { /** * Set the certificate property: Service principal certificate. - * + * * @param certificate the certificate value to set. * @return the CertificateDatastoreSecrets object itself. */ @@ -47,11 +64,50 @@ public CertificateDatastoreSecrets withCertificate(String certificate) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("secretsType", this.secretsType == null ? null : this.secretsType.toString()); + jsonWriter.writeStringField("certificate", this.certificate); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CertificateDatastoreSecrets from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CertificateDatastoreSecrets if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CertificateDatastoreSecrets. + */ + public static CertificateDatastoreSecrets fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CertificateDatastoreSecrets deserializedCertificateDatastoreSecrets = new CertificateDatastoreSecrets(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("secretsType".equals(fieldName)) { + deserializedCertificateDatastoreSecrets.secretsType = SecretsType.fromString(reader.getString()); + } else if ("certificate".equals(fieldName)) { + deserializedCertificateDatastoreSecrets.certificate = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCertificateDatastoreSecrets; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Classification.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Classification.java index 2a6e376d9a349..6bc9bfd6b529c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Classification.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Classification.java @@ -5,63 +5,61 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** Classification task in AutoML Table vertical. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") -@JsonTypeName("Classification") +/** + * Classification task in AutoML Table vertical. + */ @Fluent public final class Classification extends AutoMLVertical { + /* + * [Required] Task type for AutoMLJob. + */ + private TaskType taskType = TaskType.CLASSIFICATION; + /* * Positive label for binary metrics calculation. */ - @JsonProperty(value = "positiveLabel") private String positiveLabel; /* * Primary metric for the task. */ - @JsonProperty(value = "primaryMetric") private ClassificationPrimaryMetrics primaryMetric; /* * Inputs for training phase for an AutoML Job. */ - @JsonProperty(value = "trainingSettings") private ClassificationTrainingSettings trainingSettings; /* * Columns to use for CVSplit data. */ - @JsonProperty(value = "cvSplitColumnNames") private List cvSplitColumnNames; /* * Featurization inputs needed for AutoML job. */ - @JsonProperty(value = "featurizationSettings") private TableVerticalFeaturizationSettings featurizationSettings; /* * Execution constraints for AutoMLJob. */ - @JsonProperty(value = "limitSettings") private TableVerticalLimitSettings limitSettings; /* * Number of cross validation folds to be applied on training dataset * when validation dataset is not provided. */ - @JsonProperty(value = "nCrossValidations") private NCrossValidations nCrossValidations; /* * Test data input. */ - @JsonProperty(value = "testData") private MLTableJobInput testData; /* @@ -69,13 +67,11 @@ public final class Classification extends AutoMLVertical { * Values between (0.0 , 1.0) * Applied when validation dataset is not provided. */ - @JsonProperty(value = "testDataSize") private Double testDataSize; /* * Validation data inputs. */ - @JsonProperty(value = "validationData") private MLTableJobInput validationData; /* @@ -83,23 +79,33 @@ public final class Classification extends AutoMLVertical { * Values between (0.0 , 1.0) * Applied when validation dataset is not provided. */ - @JsonProperty(value = "validationDataSize") private Double validationDataSize; /* * 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. */ - @JsonProperty(value = "weightColumnName") private String weightColumnName; - /** Creates an instance of Classification class. */ + /** + * Creates an instance of Classification class. + */ public Classification() { } + /** + * Get the taskType property: [Required] Task type for AutoMLJob. + * + * @return the taskType value. + */ + @Override + public TaskType taskType() { + return this.taskType; + } + /** * Get the positiveLabel property: Positive label for binary metrics calculation. - * + * * @return the positiveLabel value. */ public String positiveLabel() { @@ -108,7 +114,7 @@ public String positiveLabel() { /** * Set the positiveLabel property: Positive label for binary metrics calculation. - * + * * @param positiveLabel the positiveLabel value to set. * @return the Classification object itself. */ @@ -119,7 +125,7 @@ public Classification withPositiveLabel(String positiveLabel) { /** * Get the primaryMetric property: Primary metric for the task. - * + * * @return the primaryMetric value. */ public ClassificationPrimaryMetrics primaryMetric() { @@ -128,7 +134,7 @@ public ClassificationPrimaryMetrics primaryMetric() { /** * Set the primaryMetric property: Primary metric for the task. - * + * * @param primaryMetric the primaryMetric value to set. * @return the Classification object itself. */ @@ -139,7 +145,7 @@ public Classification withPrimaryMetric(ClassificationPrimaryMetrics primaryMetr /** * Get the trainingSettings property: Inputs for training phase for an AutoML Job. - * + * * @return the trainingSettings value. */ public ClassificationTrainingSettings trainingSettings() { @@ -148,7 +154,7 @@ public ClassificationTrainingSettings trainingSettings() { /** * Set the trainingSettings property: Inputs for training phase for an AutoML Job. - * + * * @param trainingSettings the trainingSettings value to set. * @return the Classification object itself. */ @@ -159,7 +165,7 @@ public Classification withTrainingSettings(ClassificationTrainingSettings traini /** * Get the cvSplitColumnNames property: Columns to use for CVSplit data. - * + * * @return the cvSplitColumnNames value. */ public List cvSplitColumnNames() { @@ -168,7 +174,7 @@ public List cvSplitColumnNames() { /** * Set the cvSplitColumnNames property: Columns to use for CVSplit data. - * + * * @param cvSplitColumnNames the cvSplitColumnNames value to set. * @return the Classification object itself. */ @@ -179,7 +185,7 @@ public Classification withCvSplitColumnNames(List cvSplitColumnNames) { /** * Get the featurizationSettings property: Featurization inputs needed for AutoML job. - * + * * @return the featurizationSettings value. */ public TableVerticalFeaturizationSettings featurizationSettings() { @@ -188,7 +194,7 @@ public TableVerticalFeaturizationSettings featurizationSettings() { /** * Set the featurizationSettings property: Featurization inputs needed for AutoML job. - * + * * @param featurizationSettings the featurizationSettings value to set. * @return the Classification object itself. */ @@ -199,7 +205,7 @@ public Classification withFeaturizationSettings(TableVerticalFeaturizationSettin /** * Get the limitSettings property: Execution constraints for AutoMLJob. - * + * * @return the limitSettings value. */ public TableVerticalLimitSettings limitSettings() { @@ -208,7 +214,7 @@ public TableVerticalLimitSettings limitSettings() { /** * Set the limitSettings property: Execution constraints for AutoMLJob. - * + * * @param limitSettings the limitSettings value to set. * @return the Classification object itself. */ @@ -218,9 +224,9 @@ public Classification withLimitSettings(TableVerticalLimitSettings limitSettings } /** - * Get the nCrossValidations property: Number of cross validation folds to be applied on training dataset when - * validation dataset is not provided. - * + * Get the nCrossValidations property: Number of cross validation folds to be applied on training dataset + * when validation dataset is not provided. + * * @return the nCrossValidations value. */ public NCrossValidations nCrossValidations() { @@ -228,9 +234,9 @@ public NCrossValidations nCrossValidations() { } /** - * Set the nCrossValidations property: Number of cross validation folds to be applied on training dataset when - * validation dataset is not provided. - * + * Set the nCrossValidations property: Number of cross validation folds to be applied on training dataset + * when validation dataset is not provided. + * * @param nCrossValidations the nCrossValidations value to set. * @return the Classification object itself. */ @@ -241,7 +247,7 @@ public Classification withNCrossValidations(NCrossValidations nCrossValidations) /** * Get the testData property: Test data input. - * + * * @return the testData value. */ public MLTableJobInput testData() { @@ -250,7 +256,7 @@ public MLTableJobInput testData() { /** * Set the testData property: Test data input. - * + * * @param testData the testData value to set. * @return the Classification object itself. */ @@ -261,8 +267,9 @@ public Classification withTestData(MLTableJobInput testData) { /** * Get the testDataSize property: 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. - * + * Values between (0.0 , 1.0) + * Applied when validation dataset is not provided. + * * @return the testDataSize value. */ public Double testDataSize() { @@ -271,8 +278,9 @@ public Double testDataSize() { /** * Set the testDataSize property: 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. - * + * Values between (0.0 , 1.0) + * Applied when validation dataset is not provided. + * * @param testDataSize the testDataSize value to set. * @return the Classification object itself. */ @@ -283,7 +291,7 @@ public Classification withTestDataSize(Double testDataSize) { /** * Get the validationData property: Validation data inputs. - * + * * @return the validationData value. */ public MLTableJobInput validationData() { @@ -292,7 +300,7 @@ public MLTableJobInput validationData() { /** * Set the validationData property: Validation data inputs. - * + * * @param validationData the validationData value to set. * @return the Classification object itself. */ @@ -303,8 +311,10 @@ public Classification withValidationData(MLTableJobInput validationData) { /** * Get the validationDataSize property: 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. - * + * purpose. + * Values between (0.0 , 1.0) + * Applied when validation dataset is not provided. + * * @return the validationDataSize value. */ public Double validationDataSize() { @@ -313,8 +323,10 @@ public Double validationDataSize() { /** * Set the validationDataSize property: 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. - * + * purpose. + * Values between (0.0 , 1.0) + * Applied when validation dataset is not provided. + * * @param validationDataSize the validationDataSize value to set. * @return the Classification object itself. */ @@ -326,7 +338,7 @@ public Classification withValidationDataSize(Double validationDataSize) { /** * Get the weightColumnName property: 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. - * + * * @return the weightColumnName value. */ public String weightColumnName() { @@ -336,7 +348,7 @@ public String weightColumnName() { /** * Set the weightColumnName property: 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. - * + * * @param weightColumnName the weightColumnName value to set. * @return the Classification object itself. */ @@ -345,21 +357,27 @@ public Classification withWeightColumnName(String weightColumnName) { return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public Classification withLogVerbosity(LogVerbosity logVerbosity) { super.withLogVerbosity(logVerbosity); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public Classification withTargetColumnName(String targetColumnName) { super.withTargetColumnName(targetColumnName); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public Classification withTrainingData(MLTableJobInput trainingData) { super.withTrainingData(trainingData); @@ -368,7 +386,7 @@ public Classification withTrainingData(MLTableJobInput trainingData) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -393,4 +411,90 @@ public void validate() { validationData().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("trainingData", trainingData()); + jsonWriter.writeStringField("logVerbosity", logVerbosity() == null ? null : logVerbosity().toString()); + jsonWriter.writeStringField("targetColumnName", targetColumnName()); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); + jsonWriter.writeStringField("positiveLabel", this.positiveLabel); + jsonWriter.writeStringField("primaryMetric", this.primaryMetric == null ? null : this.primaryMetric.toString()); + jsonWriter.writeJsonField("trainingSettings", this.trainingSettings); + jsonWriter.writeArrayField("cvSplitColumnNames", this.cvSplitColumnNames, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("featurizationSettings", this.featurizationSettings); + jsonWriter.writeJsonField("limitSettings", this.limitSettings); + jsonWriter.writeJsonField("nCrossValidations", this.nCrossValidations); + jsonWriter.writeJsonField("testData", this.testData); + jsonWriter.writeNumberField("testDataSize", this.testDataSize); + jsonWriter.writeJsonField("validationData", this.validationData); + jsonWriter.writeNumberField("validationDataSize", this.validationDataSize); + jsonWriter.writeStringField("weightColumnName", this.weightColumnName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Classification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Classification if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Classification. + */ + public static Classification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Classification deserializedClassification = new Classification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("trainingData".equals(fieldName)) { + deserializedClassification.withTrainingData(MLTableJobInput.fromJson(reader)); + } else if ("logVerbosity".equals(fieldName)) { + deserializedClassification.withLogVerbosity(LogVerbosity.fromString(reader.getString())); + } else if ("targetColumnName".equals(fieldName)) { + deserializedClassification.withTargetColumnName(reader.getString()); + } else if ("taskType".equals(fieldName)) { + deserializedClassification.taskType = TaskType.fromString(reader.getString()); + } else if ("positiveLabel".equals(fieldName)) { + deserializedClassification.positiveLabel = reader.getString(); + } else if ("primaryMetric".equals(fieldName)) { + deserializedClassification.primaryMetric + = ClassificationPrimaryMetrics.fromString(reader.getString()); + } else if ("trainingSettings".equals(fieldName)) { + deserializedClassification.trainingSettings = ClassificationTrainingSettings.fromJson(reader); + } else if ("cvSplitColumnNames".equals(fieldName)) { + List cvSplitColumnNames = reader.readArray(reader1 -> reader1.getString()); + deserializedClassification.cvSplitColumnNames = cvSplitColumnNames; + } else if ("featurizationSettings".equals(fieldName)) { + deserializedClassification.featurizationSettings + = TableVerticalFeaturizationSettings.fromJson(reader); + } else if ("limitSettings".equals(fieldName)) { + deserializedClassification.limitSettings = TableVerticalLimitSettings.fromJson(reader); + } else if ("nCrossValidations".equals(fieldName)) { + deserializedClassification.nCrossValidations = NCrossValidations.fromJson(reader); + } else if ("testData".equals(fieldName)) { + deserializedClassification.testData = MLTableJobInput.fromJson(reader); + } else if ("testDataSize".equals(fieldName)) { + deserializedClassification.testDataSize = reader.getNullable(JsonReader::getDouble); + } else if ("validationData".equals(fieldName)) { + deserializedClassification.validationData = MLTableJobInput.fromJson(reader); + } else if ("validationDataSize".equals(fieldName)) { + deserializedClassification.validationDataSize = reader.getNullable(JsonReader::getDouble); + } else if ("weightColumnName".equals(fieldName)) { + deserializedClassification.weightColumnName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClassification; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ClassificationModels.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ClassificationModels.java index 362a874a3e1e1..f2da43698f82e 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ClassificationModels.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ClassificationModels.java @@ -5,53 +5,80 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Enum for all classification models supported by AutoML. */ +/** + * Enum for all classification models supported by AutoML. + */ public final class ClassificationModels extends ExpandableStringEnum { - /** Static value LogisticRegression for ClassificationModels. */ + /** + * Static value LogisticRegression for ClassificationModels. + */ public static final ClassificationModels LOGISTIC_REGRESSION = fromString("LogisticRegression"); - /** Static value SGD for ClassificationModels. */ + /** + * Static value SGD for ClassificationModels. + */ public static final ClassificationModels SGD = fromString("SGD"); - /** Static value MultinomialNaiveBayes for ClassificationModels. */ + /** + * Static value MultinomialNaiveBayes for ClassificationModels. + */ public static final ClassificationModels MULTINOMIAL_NAIVE_BAYES = fromString("MultinomialNaiveBayes"); - /** Static value BernoulliNaiveBayes for ClassificationModels. */ + /** + * Static value BernoulliNaiveBayes for ClassificationModels. + */ public static final ClassificationModels BERNOULLI_NAIVE_BAYES = fromString("BernoulliNaiveBayes"); - /** Static value SVM for ClassificationModels. */ + /** + * Static value SVM for ClassificationModels. + */ public static final ClassificationModels SVM = fromString("SVM"); - /** Static value LinearSVM for ClassificationModels. */ + /** + * Static value LinearSVM for ClassificationModels. + */ public static final ClassificationModels LINEAR_SVM = fromString("LinearSVM"); - /** Static value KNN for ClassificationModels. */ + /** + * Static value KNN for ClassificationModels. + */ public static final ClassificationModels KNN = fromString("KNN"); - /** Static value DecisionTree for ClassificationModels. */ + /** + * Static value DecisionTree for ClassificationModels. + */ public static final ClassificationModels DECISION_TREE = fromString("DecisionTree"); - /** Static value RandomForest for ClassificationModels. */ + /** + * Static value RandomForest for ClassificationModels. + */ public static final ClassificationModels RANDOM_FOREST = fromString("RandomForest"); - /** Static value ExtremeRandomTrees for ClassificationModels. */ + /** + * Static value ExtremeRandomTrees for ClassificationModels. + */ public static final ClassificationModels EXTREME_RANDOM_TREES = fromString("ExtremeRandomTrees"); - /** Static value LightGBM for ClassificationModels. */ + /** + * Static value LightGBM for ClassificationModels. + */ public static final ClassificationModels LIGHT_GBM = fromString("LightGBM"); - /** Static value GradientBoosting for ClassificationModels. */ + /** + * Static value GradientBoosting for ClassificationModels. + */ public static final ClassificationModels GRADIENT_BOOSTING = fromString("GradientBoosting"); - /** Static value XGBoostClassifier for ClassificationModels. */ + /** + * Static value XGBoostClassifier for ClassificationModels. + */ public static final ClassificationModels XGBOOST_CLASSIFIER = fromString("XGBoostClassifier"); /** * Creates a new instance of ClassificationModels value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -60,18 +87,17 @@ public ClassificationModels() { /** * Creates or finds a ClassificationModels from its string representation. - * + * * @param name a name to look for. * @return the corresponding ClassificationModels. */ - @JsonCreator public static ClassificationModels fromString(String name) { return fromString(name, ClassificationModels.class); } /** * Gets known ClassificationModels values. - * + * * @return known ClassificationModels values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ClassificationMultilabelPrimaryMetrics.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ClassificationMultilabelPrimaryMetrics.java index 9e75aa49e8a8c..e885b62994795 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ClassificationMultilabelPrimaryMetrics.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ClassificationMultilabelPrimaryMetrics.java @@ -5,35 +5,48 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Primary metrics for classification multilabel tasks. */ +/** + * Primary metrics for classification multilabel tasks. + */ public final class ClassificationMultilabelPrimaryMetrics extends ExpandableStringEnum { - /** Static value AUCWeighted for ClassificationMultilabelPrimaryMetrics. */ + /** + * Static value AUCWeighted for ClassificationMultilabelPrimaryMetrics. + */ public static final ClassificationMultilabelPrimaryMetrics AUCWEIGHTED = fromString("AUCWeighted"); - /** Static value Accuracy for ClassificationMultilabelPrimaryMetrics. */ + /** + * Static value Accuracy for ClassificationMultilabelPrimaryMetrics. + */ public static final ClassificationMultilabelPrimaryMetrics ACCURACY = fromString("Accuracy"); - /** Static value NormMacroRecall for ClassificationMultilabelPrimaryMetrics. */ + /** + * Static value NormMacroRecall for ClassificationMultilabelPrimaryMetrics. + */ public static final ClassificationMultilabelPrimaryMetrics NORM_MACRO_RECALL = fromString("NormMacroRecall"); - /** Static value AveragePrecisionScoreWeighted for ClassificationMultilabelPrimaryMetrics. */ - public static final ClassificationMultilabelPrimaryMetrics AVERAGE_PRECISION_SCORE_WEIGHTED = - fromString("AveragePrecisionScoreWeighted"); + /** + * Static value AveragePrecisionScoreWeighted for ClassificationMultilabelPrimaryMetrics. + */ + public static final ClassificationMultilabelPrimaryMetrics AVERAGE_PRECISION_SCORE_WEIGHTED + = fromString("AveragePrecisionScoreWeighted"); - /** Static value PrecisionScoreWeighted for ClassificationMultilabelPrimaryMetrics. */ - public static final ClassificationMultilabelPrimaryMetrics PRECISION_SCORE_WEIGHTED = - fromString("PrecisionScoreWeighted"); + /** + * Static value PrecisionScoreWeighted for ClassificationMultilabelPrimaryMetrics. + */ + public static final ClassificationMultilabelPrimaryMetrics PRECISION_SCORE_WEIGHTED + = fromString("PrecisionScoreWeighted"); - /** Static value IOU for ClassificationMultilabelPrimaryMetrics. */ + /** + * Static value IOU for ClassificationMultilabelPrimaryMetrics. + */ public static final ClassificationMultilabelPrimaryMetrics IOU = fromString("IOU"); /** * Creates a new instance of ClassificationMultilabelPrimaryMetrics value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -42,18 +55,17 @@ public ClassificationMultilabelPrimaryMetrics() { /** * Creates or finds a ClassificationMultilabelPrimaryMetrics from its string representation. - * + * * @param name a name to look for. * @return the corresponding ClassificationMultilabelPrimaryMetrics. */ - @JsonCreator public static ClassificationMultilabelPrimaryMetrics fromString(String name) { return fromString(name, ClassificationMultilabelPrimaryMetrics.class); } /** * Gets known ClassificationMultilabelPrimaryMetrics values. - * + * * @return known ClassificationMultilabelPrimaryMetrics values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ClassificationPrimaryMetrics.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ClassificationPrimaryMetrics.java index 5c3d5c4eaf341..cdf1c8bed2fd6 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ClassificationPrimaryMetrics.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ClassificationPrimaryMetrics.java @@ -5,30 +5,41 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Primary metrics for classification tasks. */ +/** + * Primary metrics for classification tasks. + */ public final class ClassificationPrimaryMetrics extends ExpandableStringEnum { - /** Static value AUCWeighted for ClassificationPrimaryMetrics. */ + /** + * Static value AUCWeighted for ClassificationPrimaryMetrics. + */ public static final ClassificationPrimaryMetrics AUCWEIGHTED = fromString("AUCWeighted"); - /** Static value Accuracy for ClassificationPrimaryMetrics. */ + /** + * Static value Accuracy for ClassificationPrimaryMetrics. + */ public static final ClassificationPrimaryMetrics ACCURACY = fromString("Accuracy"); - /** Static value NormMacroRecall for ClassificationPrimaryMetrics. */ + /** + * Static value NormMacroRecall for ClassificationPrimaryMetrics. + */ public static final ClassificationPrimaryMetrics NORM_MACRO_RECALL = fromString("NormMacroRecall"); - /** Static value AveragePrecisionScoreWeighted for ClassificationPrimaryMetrics. */ - public static final ClassificationPrimaryMetrics AVERAGE_PRECISION_SCORE_WEIGHTED = - fromString("AveragePrecisionScoreWeighted"); + /** + * Static value AveragePrecisionScoreWeighted for ClassificationPrimaryMetrics. + */ + public static final ClassificationPrimaryMetrics AVERAGE_PRECISION_SCORE_WEIGHTED + = fromString("AveragePrecisionScoreWeighted"); - /** Static value PrecisionScoreWeighted for ClassificationPrimaryMetrics. */ + /** + * Static value PrecisionScoreWeighted for ClassificationPrimaryMetrics. + */ public static final ClassificationPrimaryMetrics PRECISION_SCORE_WEIGHTED = fromString("PrecisionScoreWeighted"); /** * Creates a new instance of ClassificationPrimaryMetrics value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -37,18 +48,17 @@ public ClassificationPrimaryMetrics() { /** * Creates or finds a ClassificationPrimaryMetrics from its string representation. - * + * * @param name a name to look for. * @return the corresponding ClassificationPrimaryMetrics. */ - @JsonCreator public static ClassificationPrimaryMetrics fromString(String name) { return fromString(name, ClassificationPrimaryMetrics.class); } /** * Gets known ClassificationPrimaryMetrics values. - * + * * @return known ClassificationPrimaryMetrics values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ClassificationTrainingSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ClassificationTrainingSettings.java index bd667f5bbbc4b..1ba77bad0c71c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ClassificationTrainingSettings.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ClassificationTrainingSettings.java @@ -5,32 +5,38 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.Duration; import java.util.List; -/** Classification Training related configuration. */ +/** + * Classification Training related configuration. + */ @Fluent public final class ClassificationTrainingSettings extends TrainingSettings { /* * Allowed models for classification task. */ - @JsonProperty(value = "allowedTrainingAlgorithms") private List allowedTrainingAlgorithms; /* * Blocked models for classification task. */ - @JsonProperty(value = "blockedTrainingAlgorithms") private List blockedTrainingAlgorithms; - /** Creates an instance of ClassificationTrainingSettings class. */ + /** + * Creates an instance of ClassificationTrainingSettings class. + */ public ClassificationTrainingSettings() { } /** * Get the allowedTrainingAlgorithms property: Allowed models for classification task. - * + * * @return the allowedTrainingAlgorithms value. */ public List allowedTrainingAlgorithms() { @@ -39,19 +45,19 @@ public List allowedTrainingAlgorithms() { /** * Set the allowedTrainingAlgorithms property: Allowed models for classification task. - * + * * @param allowedTrainingAlgorithms the allowedTrainingAlgorithms value to set. * @return the ClassificationTrainingSettings object itself. */ - public ClassificationTrainingSettings withAllowedTrainingAlgorithms( - List allowedTrainingAlgorithms) { + public ClassificationTrainingSettings + withAllowedTrainingAlgorithms(List allowedTrainingAlgorithms) { this.allowedTrainingAlgorithms = allowedTrainingAlgorithms; return this; } /** * Get the blockedTrainingAlgorithms property: Blocked models for classification task. - * + * * @return the blockedTrainingAlgorithms value. */ public List blockedTrainingAlgorithms() { @@ -60,59 +66,73 @@ public List blockedTrainingAlgorithms() { /** * Set the blockedTrainingAlgorithms property: Blocked models for classification task. - * + * * @param blockedTrainingAlgorithms the blockedTrainingAlgorithms value to set. * @return the ClassificationTrainingSettings object itself. */ - public ClassificationTrainingSettings withBlockedTrainingAlgorithms( - List blockedTrainingAlgorithms) { + public ClassificationTrainingSettings + withBlockedTrainingAlgorithms(List blockedTrainingAlgorithms) { this.blockedTrainingAlgorithms = blockedTrainingAlgorithms; return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ClassificationTrainingSettings withEnableDnnTraining(Boolean enableDnnTraining) { super.withEnableDnnTraining(enableDnnTraining); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ClassificationTrainingSettings withEnableModelExplainability(Boolean enableModelExplainability) { super.withEnableModelExplainability(enableModelExplainability); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ClassificationTrainingSettings withEnableOnnxCompatibleModels(Boolean enableOnnxCompatibleModels) { super.withEnableOnnxCompatibleModels(enableOnnxCompatibleModels); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ClassificationTrainingSettings withEnableStackEnsemble(Boolean enableStackEnsemble) { super.withEnableStackEnsemble(enableStackEnsemble); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ClassificationTrainingSettings withEnableVoteEnsemble(Boolean enableVoteEnsemble) { super.withEnableVoteEnsemble(enableVoteEnsemble); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ClassificationTrainingSettings withEnsembleModelDownloadTimeout(Duration ensembleModelDownloadTimeout) { super.withEnsembleModelDownloadTimeout(ensembleModelDownloadTimeout); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ClassificationTrainingSettings withStackEnsembleSettings(StackEnsembleSettings stackEnsembleSettings) { super.withStackEnsembleSettings(stackEnsembleSettings); @@ -121,11 +141,86 @@ public ClassificationTrainingSettings withStackEnsembleSettings(StackEnsembleSet /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enableDnnTraining", enableDnnTraining()); + jsonWriter.writeBooleanField("enableModelExplainability", enableModelExplainability()); + jsonWriter.writeBooleanField("enableOnnxCompatibleModels", enableOnnxCompatibleModels()); + jsonWriter.writeBooleanField("enableStackEnsemble", enableStackEnsemble()); + jsonWriter.writeBooleanField("enableVoteEnsemble", enableVoteEnsemble()); + jsonWriter.writeStringField("ensembleModelDownloadTimeout", + CoreUtils.durationToStringWithDays(ensembleModelDownloadTimeout())); + jsonWriter.writeJsonField("stackEnsembleSettings", stackEnsembleSettings()); + jsonWriter.writeArrayField("allowedTrainingAlgorithms", this.allowedTrainingAlgorithms, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("blockedTrainingAlgorithms", this.blockedTrainingAlgorithms, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClassificationTrainingSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClassificationTrainingSettings if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ClassificationTrainingSettings. + */ + public static ClassificationTrainingSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClassificationTrainingSettings deserializedClassificationTrainingSettings + = new ClassificationTrainingSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enableDnnTraining".equals(fieldName)) { + deserializedClassificationTrainingSettings + .withEnableDnnTraining(reader.getNullable(JsonReader::getBoolean)); + } else if ("enableModelExplainability".equals(fieldName)) { + deserializedClassificationTrainingSettings + .withEnableModelExplainability(reader.getNullable(JsonReader::getBoolean)); + } else if ("enableOnnxCompatibleModels".equals(fieldName)) { + deserializedClassificationTrainingSettings + .withEnableOnnxCompatibleModels(reader.getNullable(JsonReader::getBoolean)); + } else if ("enableStackEnsemble".equals(fieldName)) { + deserializedClassificationTrainingSettings + .withEnableStackEnsemble(reader.getNullable(JsonReader::getBoolean)); + } else if ("enableVoteEnsemble".equals(fieldName)) { + deserializedClassificationTrainingSettings + .withEnableVoteEnsemble(reader.getNullable(JsonReader::getBoolean)); + } else if ("ensembleModelDownloadTimeout".equals(fieldName)) { + deserializedClassificationTrainingSettings.withEnsembleModelDownloadTimeout( + reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString()))); + } else if ("stackEnsembleSettings".equals(fieldName)) { + deserializedClassificationTrainingSettings + .withStackEnsembleSettings(StackEnsembleSettings.fromJson(reader)); + } else if ("allowedTrainingAlgorithms".equals(fieldName)) { + List allowedTrainingAlgorithms + = reader.readArray(reader1 -> ClassificationModels.fromString(reader1.getString())); + deserializedClassificationTrainingSettings.allowedTrainingAlgorithms = allowedTrainingAlgorithms; + } else if ("blockedTrainingAlgorithms".equals(fieldName)) { + List blockedTrainingAlgorithms + = reader.readArray(reader1 -> ClassificationModels.fromString(reader1.getString())); + deserializedClassificationTrainingSettings.blockedTrainingAlgorithms = blockedTrainingAlgorithms; + } else { + reader.skipChildren(); + } + } + + return deserializedClassificationTrainingSettings; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ClusterPurpose.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ClusterPurpose.java index 5a45258121559..24e49f2cbc2a4 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ClusterPurpose.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ClusterPurpose.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Intended usage of the cluster. */ +/** + * Intended usage of the cluster. + */ public final class ClusterPurpose extends ExpandableStringEnum { - /** Static value FastProd for ClusterPurpose. */ + /** + * Static value FastProd for ClusterPurpose. + */ public static final ClusterPurpose FAST_PROD = fromString("FastProd"); - /** Static value DenseProd for ClusterPurpose. */ + /** + * Static value DenseProd for ClusterPurpose. + */ public static final ClusterPurpose DENSE_PROD = fromString("DenseProd"); - /** Static value DevTest for ClusterPurpose. */ + /** + * Static value DevTest for ClusterPurpose. + */ public static final ClusterPurpose DEV_TEST = fromString("DevTest"); /** * Creates a new instance of ClusterPurpose value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public ClusterPurpose() { /** * Creates or finds a ClusterPurpose from its string representation. - * + * * @param name a name to look for. * @return the corresponding ClusterPurpose. */ - @JsonCreator public static ClusterPurpose fromString(String name) { return fromString(name, ClusterPurpose.class); } /** * Gets known ClusterPurpose values. - * + * * @return known ClusterPurpose values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ClusterUpdateParameters.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ClusterUpdateParameters.java index e375b833b2bf9..6d2e80d2c4940 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ClusterUpdateParameters.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ClusterUpdateParameters.java @@ -5,25 +5,32 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.fluent.models.ClusterUpdateProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** AmlCompute update parameters. */ +/** + * AmlCompute update parameters. + */ @Fluent -public final class ClusterUpdateParameters { +public final class ClusterUpdateParameters implements JsonSerializable { /* * The properties of the amlCompute. */ - @JsonProperty(value = "properties") private ClusterUpdateProperties innerProperties; - /** Creates an instance of ClusterUpdateParameters class. */ + /** + * Creates an instance of ClusterUpdateParameters class. + */ public ClusterUpdateParameters() { } /** * Get the innerProperties property: The properties of the amlCompute. - * + * * @return the innerProperties value. */ private ClusterUpdateProperties innerProperties() { @@ -32,7 +39,7 @@ private ClusterUpdateProperties innerProperties() { /** * Get the properties property: Properties of ClusterUpdate. - * + * * @return the properties value. */ public ScaleSettingsInformation properties() { @@ -41,7 +48,7 @@ public ScaleSettingsInformation properties() { /** * Set the properties property: Properties of ClusterUpdate. - * + * * @param properties the properties value to set. * @return the ClusterUpdateParameters object itself. */ @@ -55,7 +62,7 @@ public ClusterUpdateParameters withProperties(ScaleSettingsInformation propertie /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -63,4 +70,40 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterUpdateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterUpdateParameters if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ClusterUpdateParameters. + */ + public static ClusterUpdateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterUpdateParameters deserializedClusterUpdateParameters = new ClusterUpdateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedClusterUpdateParameters.innerProperties = ClusterUpdateProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterUpdateParameters; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeConfiguration.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeConfiguration.java index 1da5ea3ab59cc..e645bbbbacc39 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeConfiguration.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeConfiguration.java @@ -6,30 +6,36 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Configuration for a scoring code asset. */ +/** + * Configuration for a scoring code asset. + */ @Fluent -public final class CodeConfiguration { +public final class CodeConfiguration implements JsonSerializable { /* * ARM resource ID of the code asset. */ - @JsonProperty(value = "codeId") private String codeId; /* * [Required] The script to execute on startup. eg. "score.py" */ - @JsonProperty(value = "scoringScript", required = true) private String scoringScript; - /** Creates an instance of CodeConfiguration class. */ + /** + * Creates an instance of CodeConfiguration class. + */ public CodeConfiguration() { } /** * Get the codeId property: ARM resource ID of the code asset. - * + * * @return the codeId value. */ public String codeId() { @@ -38,7 +44,7 @@ public String codeId() { /** * Set the codeId property: ARM resource ID of the code asset. - * + * * @param codeId the codeId value to set. * @return the CodeConfiguration object itself. */ @@ -49,7 +55,7 @@ public CodeConfiguration withCodeId(String codeId) { /** * Get the scoringScript property: [Required] The script to execute on startup. eg. "score.py". - * + * * @return the scoringScript value. */ public String scoringScript() { @@ -58,7 +64,7 @@ public String scoringScript() { /** * Set the scoringScript property: [Required] The script to execute on startup. eg. "score.py". - * + * * @param scoringScript the scoringScript value to set. * @return the CodeConfiguration object itself. */ @@ -69,16 +75,56 @@ public CodeConfiguration withScoringScript(String scoringScript) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (scoringScript() == null) { - throw LOGGER - .logExceptionAsError( + throw LOGGER.atError() + .log( new IllegalArgumentException("Missing required property scoringScript in model CodeConfiguration")); } } private static final ClientLogger LOGGER = new ClientLogger(CodeConfiguration.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("scoringScript", this.scoringScript); + jsonWriter.writeStringField("codeId", this.codeId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CodeConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CodeConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CodeConfiguration. + */ + public static CodeConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CodeConfiguration deserializedCodeConfiguration = new CodeConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("scoringScript".equals(fieldName)) { + deserializedCodeConfiguration.scoringScript = reader.getString(); + } else if ("codeId".equals(fieldName)) { + deserializedCodeConfiguration.codeId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCodeConfiguration; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeContainer.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeContainer.java index 3d41404e0fc47..e5847914add87 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeContainer.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeContainer.java @@ -8,90 +8,103 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.machinelearning.fluent.models.CodeContainerInner; -/** An immutable client-side representation of CodeContainer. */ +/** + * An immutable client-side representation of CodeContainer. + */ public interface CodeContainer { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the properties property: [Required] Additional attributes of the entity. - * + * * @return the properties value. */ CodeContainerProperties properties(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.CodeContainerInner object. - * + * * @return the inner object. */ CodeContainerInner innerModel(); - /** The entirety of the CodeContainer definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithParentResource, - DefinitionStages.WithProperties, - DefinitionStages.WithCreate { + /** + * The entirety of the CodeContainer definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, DefinitionStages.WithCreate { } - /** The CodeContainer definition stages. */ + + /** + * The CodeContainer definition stages. + */ interface DefinitionStages { - /** The first stage of the CodeContainer definition. */ + /** + * The first stage of the CodeContainer definition. + */ interface Blank extends WithParentResource { } - /** The stage of the CodeContainer definition allowing to specify parent resource. */ + + /** + * The stage of the CodeContainer definition allowing to specify parent resource. + */ interface WithParentResource { /** - * Specifies resourceGroupName, workspaceName. - * + * Specifies resourceGroupName, registryName. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. * @return the next definition stage. */ - WithProperties withExistingWorkspace(String resourceGroupName, String workspaceName); + WithProperties withExistingRegistry(String resourceGroupName, String registryName); } - /** The stage of the CodeContainer definition allowing to specify properties. */ + + /** + * The stage of the CodeContainer definition allowing to specify properties. + */ interface WithProperties { /** * Specifies the properties property: [Required] Additional attributes of the entity.. - * + * * @param properties [Required] Additional attributes of the entity. * @return the next definition stage. */ WithCreate withProperties(CodeContainerProperties properties); } + /** * The stage of the CodeContainer definition which contains all the minimum required properties for the resource * to be created, but also allows for any other optional properties to be specified. @@ -99,67 +112,76 @@ interface WithProperties { interface WithCreate { /** * Executes the create request. - * + * * @return the created resource. */ CodeContainer create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ CodeContainer create(Context context); } } + /** * Begins update for the CodeContainer resource. - * + * * @return the stage of resource update. */ CodeContainer.Update update(); - /** The template for CodeContainer update. */ + /** + * The template for CodeContainer update. + */ interface Update extends UpdateStages.WithProperties { /** * Executes the update request. - * + * * @return the updated resource. */ CodeContainer apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ CodeContainer apply(Context context); } - /** The CodeContainer update stages. */ + + /** + * The CodeContainer update stages. + */ interface UpdateStages { - /** The stage of the CodeContainer update allowing to specify properties. */ + /** + * The stage of the CodeContainer update allowing to specify properties. + */ interface WithProperties { /** * Specifies the properties property: [Required] Additional attributes of the entity.. - * + * * @param properties [Required] Additional attributes of the entity. * @return the next definition stage. */ Update withProperties(CodeContainerProperties properties); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ CodeContainer refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeContainerProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeContainerProperties.java index 9f59aab192f14..37b58a022444a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeContainerProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeContainerProperties.java @@ -5,37 +5,97 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Container for code asset versions. */ +/** + * Container for code asset versions. + */ @Fluent public final class CodeContainerProperties extends AssetContainer { - /** Creates an instance of CodeContainerProperties class. */ + /* + * Provisioning state for the code container. + */ + private AssetProvisioningState provisioningState; + + /* + * The latest version inside this container. + */ + private String latestVersion; + + /* + * The next auto incremental version + */ + private String nextVersion; + + /** + * Creates an instance of CodeContainerProperties class. + */ public CodeContainerProperties() { } - /** {@inheritDoc} */ + /** + * Get the provisioningState property: Provisioning state for the code container. + * + * @return the provisioningState value. + */ + public AssetProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the latestVersion property: The latest version inside this container. + * + * @return the latestVersion value. + */ + @Override + public String latestVersion() { + return this.latestVersion; + } + + /** + * Get the nextVersion property: The next auto incremental version. + * + * @return the nextVersion value. + */ + @Override + public String nextVersion() { + return this.nextVersion; + } + + /** + * {@inheritDoc} + */ @Override public CodeContainerProperties withIsArchived(Boolean isArchived) { super.withIsArchived(isArchived); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public CodeContainerProperties withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public CodeContainerProperties withProperties(Map properties) { super.withProperties(properties); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public CodeContainerProperties withTags(Map tags) { super.withTags(tags); @@ -44,11 +104,65 @@ public CodeContainerProperties withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("isArchived", isArchived()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CodeContainerProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CodeContainerProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the CodeContainerProperties. + */ + public static CodeContainerProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CodeContainerProperties deserializedCodeContainerProperties = new CodeContainerProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedCodeContainerProperties.withDescription(reader.getString()); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedCodeContainerProperties.withProperties(properties); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedCodeContainerProperties.withTags(tags); + } else if ("isArchived".equals(fieldName)) { + deserializedCodeContainerProperties.withIsArchived(reader.getNullable(JsonReader::getBoolean)); + } else if ("latestVersion".equals(fieldName)) { + deserializedCodeContainerProperties.latestVersion = reader.getString(); + } else if ("nextVersion".equals(fieldName)) { + deserializedCodeContainerProperties.nextVersion = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedCodeContainerProperties.provisioningState + = AssetProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCodeContainerProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeContainerResourceArmPaginatedResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeContainerResourceArmPaginatedResult.java index fdb6888e079bd..6e1111d80ad5f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeContainerResourceArmPaginatedResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeContainerResourceArmPaginatedResult.java @@ -5,33 +5,40 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.fluent.models.CodeContainerInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** A paginated list of CodeContainer entities. */ +/** + * A paginated list of CodeContainer entities. + */ @Fluent -public final class CodeContainerResourceArmPaginatedResult { +public final class CodeContainerResourceArmPaginatedResult + implements JsonSerializable { /* * The link to the next page of CodeContainer objects. If null, there are no additional pages. */ - @JsonProperty(value = "nextLink") private String nextLink; /* * An array of objects of type CodeContainer. */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of CodeContainerResourceArmPaginatedResult class. */ + /** + * Creates an instance of CodeContainerResourceArmPaginatedResult class. + */ public CodeContainerResourceArmPaginatedResult() { } /** * Get the nextLink property: The link to the next page of CodeContainer objects. If null, there are no additional * pages. - * + * * @return the nextLink value. */ public String nextLink() { @@ -41,7 +48,7 @@ public String nextLink() { /** * Set the nextLink property: The link to the next page of CodeContainer objects. If null, there are no additional * pages. - * + * * @param nextLink the nextLink value to set. * @return the CodeContainerResourceArmPaginatedResult object itself. */ @@ -52,7 +59,7 @@ public CodeContainerResourceArmPaginatedResult withNextLink(String nextLink) { /** * Get the value property: An array of objects of type CodeContainer. - * + * * @return the value value. */ public List value() { @@ -61,7 +68,7 @@ public List value() { /** * Set the value property: An array of objects of type CodeContainer. - * + * * @param value the value value to set. * @return the CodeContainerResourceArmPaginatedResult object itself. */ @@ -72,7 +79,7 @@ public CodeContainerResourceArmPaginatedResult withValue(List e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CodeContainerResourceArmPaginatedResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CodeContainerResourceArmPaginatedResult if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CodeContainerResourceArmPaginatedResult. + */ + public static CodeContainerResourceArmPaginatedResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CodeContainerResourceArmPaginatedResult deserializedCodeContainerResourceArmPaginatedResult + = new CodeContainerResourceArmPaginatedResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedCodeContainerResourceArmPaginatedResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> CodeContainerInner.fromJson(reader1)); + deserializedCodeContainerResourceArmPaginatedResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedCodeContainerResourceArmPaginatedResult; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeContainers.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeContainers.java index ed9bae7d57a0e..dbe04a0a9ba7c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeContainers.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeContainers.java @@ -7,12 +7,15 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.CodeContainerInner; -/** Resource collection API of CodeContainers. */ +/** + * Resource collection API of CodeContainers. + */ public interface CodeContainers { /** * List containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -24,7 +27,7 @@ public interface CodeContainers { /** * List containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -38,7 +41,7 @@ public interface CodeContainers { /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -52,7 +55,7 @@ public interface CodeContainers { /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -64,7 +67,7 @@ public interface CodeContainers { /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -74,12 +77,12 @@ public interface CodeContainers { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return container along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String name, Context context); + Response getWithResponse(String resourceGroupName, String workspaceName, String name, + Context context); /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -91,55 +94,32 @@ Response getWithResponse( CodeContainer get(String resourceGroupName, String workspaceName, String name); /** - * Get container. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container along with {@link Response}. - */ - CodeContainer getById(String id); - - /** - * Get container. - * - * @param id the resource ID. + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container along with {@link Response}. + * @return azure Resource Manager resource envelope along with {@link Response}. */ - Response getByIdWithResponse(String id, Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, String name, + CodeContainerInner body, Context context); /** - * Delete container. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Delete container. - * - * @param id the resource ID. - * @param context The context to associate with this operation. + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new CodeContainer resource. - * - * @param name resource name. - * @return the first stage of the new CodeContainer definition. + * @return azure Resource Manager resource envelope. */ - CodeContainer.DefinitionStages.Blank define(String name); + CodeContainer createOrUpdate(String resourceGroupName, String workspaceName, String name, CodeContainerInner body); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeVersion.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeVersion.java index 74b92c620c7c1..5da88ef8260e8 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeVersion.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeVersion.java @@ -4,95 +4,109 @@ package com.azure.resourcemanager.machinelearning.models; +import com.azure.core.http.rest.Response; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.machinelearning.fluent.models.CodeVersionInner; -/** An immutable client-side representation of CodeVersion. */ +/** + * An immutable client-side representation of CodeVersion. + */ public interface CodeVersion { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the properties property: [Required] Additional attributes of the entity. - * + * * @return the properties value. */ CodeVersionProperties properties(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.CodeVersionInner object. - * + * * @return the inner object. */ CodeVersionInner innerModel(); - /** The entirety of the CodeVersion definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithParentResource, - DefinitionStages.WithProperties, - DefinitionStages.WithCreate { + /** + * The entirety of the CodeVersion definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, DefinitionStages.WithCreate { } - /** The CodeVersion definition stages. */ + + /** + * The CodeVersion definition stages. + */ interface DefinitionStages { - /** The first stage of the CodeVersion definition. */ + /** + * The first stage of the CodeVersion definition. + */ interface Blank extends WithParentResource { } - /** The stage of the CodeVersion definition allowing to specify parent resource. */ + + /** + * The stage of the CodeVersion definition allowing to specify parent resource. + */ interface WithParentResource { /** - * Specifies resourceGroupName, workspaceName, name. - * + * Specifies resourceGroupName, registryName, codeName. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. - * @param name Container name. This is case-sensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. * @return the next definition stage. */ - WithProperties withExistingCode(String resourceGroupName, String workspaceName, String name); + WithProperties withExistingCode(String resourceGroupName, String registryName, String codeName); } - /** The stage of the CodeVersion definition allowing to specify properties. */ + + /** + * The stage of the CodeVersion definition allowing to specify properties. + */ interface WithProperties { /** * Specifies the properties property: [Required] Additional attributes of the entity.. - * + * * @param properties [Required] Additional attributes of the entity. * @return the next definition stage. */ WithCreate withProperties(CodeVersionProperties properties); } + /** * The stage of the CodeVersion definition which contains all the minimum required properties for the resource * to be created, but also allows for any other optional properties to be specified. @@ -100,69 +114,102 @@ interface WithProperties { interface WithCreate { /** * Executes the create request. - * + * * @return the created resource. */ CodeVersion create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ CodeVersion create(Context context); } } + /** * Begins update for the CodeVersion resource. - * + * * @return the stage of resource update. */ CodeVersion.Update update(); - /** The template for CodeVersion update. */ + /** + * The template for CodeVersion update. + */ interface Update extends UpdateStages.WithProperties { /** * Executes the update request. - * + * * @return the updated resource. */ CodeVersion apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ CodeVersion apply(Context context); } - /** The CodeVersion update stages. */ + + /** + * The CodeVersion update stages. + */ interface UpdateStages { - /** The stage of the CodeVersion update allowing to specify properties. */ + /** + * The stage of the CodeVersion update allowing to specify properties. + */ interface WithProperties { /** * Specifies the properties property: [Required] Additional attributes of the entity.. - * + * * @param properties [Required] Additional attributes of the entity. * @return the next definition stage. */ Update withProperties(CodeVersionProperties properties); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ CodeVersion refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ CodeVersion refresh(Context context); + + /** + * Generate a storage location and credential for the client to upload a code asset to. + * + * @param body Pending upload request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + Response createOrGetStartPendingUploadWithResponse(PendingUploadRequestDto body, + Context context); + + /** + * Generate a storage location and credential for the client to upload a code asset to. + * + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + PendingUploadResponseDto createOrGetStartPendingUpload(PendingUploadRequestDto body); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeVersionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeVersionProperties.java index aa9586a3dcee5..9e5707eb55443 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeVersionProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeVersionProperties.java @@ -5,25 +5,36 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Code asset version details. */ +/** + * Code asset version details. + */ @Fluent public final class CodeVersionProperties extends AssetBase { /* * Uri where code is located */ - @JsonProperty(value = "codeUri") private String codeUri; - /** Creates an instance of CodeVersionProperties class. */ + /* + * Provisioning state for the code version. + */ + private AssetProvisioningState provisioningState; + + /** + * Creates an instance of CodeVersionProperties class. + */ public CodeVersionProperties() { } /** * Get the codeUri property: Uri where code is located. - * + * * @return the codeUri value. */ public String codeUri() { @@ -32,7 +43,7 @@ public String codeUri() { /** * Set the codeUri property: Uri where code is located. - * + * * @param codeUri the codeUri value to set. * @return the CodeVersionProperties object itself. */ @@ -41,35 +52,54 @@ public CodeVersionProperties withCodeUri(String codeUri) { return this; } - /** {@inheritDoc} */ + /** + * Get the provisioningState property: Provisioning state for the code version. + * + * @return the provisioningState value. + */ + public AssetProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ @Override public CodeVersionProperties withIsAnonymous(Boolean isAnonymous) { super.withIsAnonymous(isAnonymous); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public CodeVersionProperties withIsArchived(Boolean isArchived) { super.withIsArchived(isArchived); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public CodeVersionProperties withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public CodeVersionProperties withProperties(Map properties) { super.withProperties(properties); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public CodeVersionProperties withTags(Map tags) { super.withTags(tags); @@ -78,11 +108,67 @@ public CodeVersionProperties withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("isAnonymous", isAnonymous()); + jsonWriter.writeBooleanField("isArchived", isArchived()); + jsonWriter.writeStringField("codeUri", this.codeUri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CodeVersionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CodeVersionProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the CodeVersionProperties. + */ + public static CodeVersionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CodeVersionProperties deserializedCodeVersionProperties = new CodeVersionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedCodeVersionProperties.withDescription(reader.getString()); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedCodeVersionProperties.withProperties(properties); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedCodeVersionProperties.withTags(tags); + } else if ("isAnonymous".equals(fieldName)) { + deserializedCodeVersionProperties.withIsAnonymous(reader.getNullable(JsonReader::getBoolean)); + } else if ("isArchived".equals(fieldName)) { + deserializedCodeVersionProperties.withIsArchived(reader.getNullable(JsonReader::getBoolean)); + } else if ("codeUri".equals(fieldName)) { + deserializedCodeVersionProperties.codeUri = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedCodeVersionProperties.provisioningState + = AssetProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCodeVersionProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeVersionResourceArmPaginatedResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeVersionResourceArmPaginatedResult.java index 64ed58a5722f9..e6db3b58ba050 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeVersionResourceArmPaginatedResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeVersionResourceArmPaginatedResult.java @@ -5,33 +5,40 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.fluent.models.CodeVersionInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** A paginated list of CodeVersion entities. */ +/** + * A paginated list of CodeVersion entities. + */ @Fluent -public final class CodeVersionResourceArmPaginatedResult { +public final class CodeVersionResourceArmPaginatedResult + implements JsonSerializable { /* * The link to the next page of CodeVersion objects. If null, there are no additional pages. */ - @JsonProperty(value = "nextLink") private String nextLink; /* * An array of objects of type CodeVersion. */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of CodeVersionResourceArmPaginatedResult class. */ + /** + * Creates an instance of CodeVersionResourceArmPaginatedResult class. + */ public CodeVersionResourceArmPaginatedResult() { } /** * Get the nextLink property: The link to the next page of CodeVersion objects. If null, there are no additional * pages. - * + * * @return the nextLink value. */ public String nextLink() { @@ -41,7 +48,7 @@ public String nextLink() { /** * Set the nextLink property: The link to the next page of CodeVersion objects. If null, there are no additional * pages. - * + * * @param nextLink the nextLink value to set. * @return the CodeVersionResourceArmPaginatedResult object itself. */ @@ -52,7 +59,7 @@ public CodeVersionResourceArmPaginatedResult withNextLink(String nextLink) { /** * Get the value property: An array of objects of type CodeVersion. - * + * * @return the value value. */ public List value() { @@ -61,7 +68,7 @@ public List value() { /** * Set the value property: An array of objects of type CodeVersion. - * + * * @param value the value value to set. * @return the CodeVersionResourceArmPaginatedResult object itself. */ @@ -72,7 +79,7 @@ public CodeVersionResourceArmPaginatedResult withValue(List va /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -80,4 +87,45 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CodeVersionResourceArmPaginatedResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CodeVersionResourceArmPaginatedResult if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CodeVersionResourceArmPaginatedResult. + */ + public static CodeVersionResourceArmPaginatedResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CodeVersionResourceArmPaginatedResult deserializedCodeVersionResourceArmPaginatedResult + = new CodeVersionResourceArmPaginatedResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedCodeVersionResourceArmPaginatedResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> CodeVersionInner.fromJson(reader1)); + deserializedCodeVersionResourceArmPaginatedResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedCodeVersionResourceArmPaginatedResult; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeVersions.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeVersions.java index 832a78bf6085d..e3e98a98e959b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeVersions.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CodeVersions.java @@ -7,12 +7,15 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.CodeVersionInner; -/** Resource collection API of CodeVersions. */ +/** + * Resource collection API of CodeVersions. + */ public interface CodeVersions { /** * List versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -25,31 +28,27 @@ public interface CodeVersions { /** * List versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. * @param orderBy Ordering of list. * @param top Maximum number of records to return. * @param skip Continuation token for pagination. + * @param hash If specified, return CodeVersion assets with specified content hash value, regardless of name. + * @param hashVersion Hash algorithm version when listing by hash. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of CodeVersion entities as paginated response with {@link PagedIterable}. */ - PagedIterable list( - String resourceGroupName, - String workspaceName, - String name, - String orderBy, - Integer top, - String skip, - Context context); + PagedIterable list(String resourceGroupName, String workspaceName, String name, String orderBy, + Integer top, String skip, String hash, String hashVersion, Context context); /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -60,12 +59,12 @@ PagedIterable list( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ - Response deleteWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context); + Response deleteWithResponse(String resourceGroupName, String workspaceName, String name, String version, + Context context); /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -78,7 +77,7 @@ Response deleteWithResponse( /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -89,12 +88,12 @@ Response deleteWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return version along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context); + Response getWithResponse(String resourceGroupName, String workspaceName, String name, String version, + Context context); /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -107,55 +106,98 @@ Response getWithResponse( CodeVersion get(String resourceGroupName, String workspaceName, String name, String version); /** - * Get version. - * - * @param id the resource ID. + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return version along with {@link Response}. + * @return azure Resource Manager resource envelope along with {@link Response}. */ - CodeVersion getById(String id); + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, String name, + String version, CodeVersionInner body, Context context); /** - * Get version. - * - * @param id the resource ID. - * @param context The context to associate with this operation. + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return version along with {@link Response}. + * @return azure Resource Manager resource envelope. */ - Response getByIdWithResponse(String id, Context context); + CodeVersion createOrUpdate(String resourceGroupName, String workspaceName, String name, String version, + CodeVersionInner body); /** - * Delete version. - * - * @param id the resource ID. + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void deleteById(String id); + void publish(String resourceGroupName, String workspaceName, String name, String version, DestinationAsset body); /** - * Delete version. - * - * @param id the resource ID. + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. */ - Response deleteByIdWithResponse(String id, Context context); + void publish(String resourceGroupName, String workspaceName, String name, String version, DestinationAsset body, + Context context); /** - * Begins definition for a new CodeVersion resource. - * - * @param name resource name. - * @return the first stage of the new CodeVersion definition. + * Generate a storage location and credential for the client to upload a code asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + Response createOrGetStartPendingUploadWithResponse(String resourceGroupName, + String workspaceName, String name, String version, PendingUploadRequestDto body, Context context); + + /** + * Generate a storage location and credential for the client to upload a code asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. */ - CodeVersion.DefinitionStages.Blank define(String name); + PendingUploadResponseDto createOrGetStartPendingUpload(String resourceGroupName, String workspaceName, String name, + String version, PendingUploadRequestDto body); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Collection.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Collection.java new file mode 100644 index 0000000000000..88b958f2c6c5e --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Collection.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The Collection model. + */ +@Fluent +public final class Collection implements JsonSerializable { + /* + * The msi client id used to collect logging to blob storage. If it's null,backend will pick a registered endpoint + * identity to auth. + */ + private String clientId; + + /* + * Enable or disable data collection. + */ + private 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. + */ + private String dataId; + + /* + * The sampling rate for collection. Sampling rate 1.0 means we collect 100% of data by default. + */ + private Double samplingRate; + + /** + * Creates an instance of Collection class. + */ + public Collection() { + } + + /** + * Get the clientId property: The msi client id used to collect logging to blob storage. If it's null,backend will + * pick a registered endpoint identity to auth. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: The msi client id used to collect logging to blob storage. If it's null,backend will + * pick a registered endpoint identity to auth. + * + * @param clientId the clientId value to set. + * @return the Collection object itself. + */ + public Collection withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the dataCollectionMode property: Enable or disable data collection. + * + * @return the dataCollectionMode value. + */ + public DataCollectionMode dataCollectionMode() { + return this.dataCollectionMode; + } + + /** + * Set the dataCollectionMode property: Enable or disable data collection. + * + * @param dataCollectionMode the dataCollectionMode value to set. + * @return the Collection object itself. + */ + public Collection withDataCollectionMode(DataCollectionMode dataCollectionMode) { + this.dataCollectionMode = dataCollectionMode; + return this; + } + + /** + * Get the dataId property: 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. + * + * @return the dataId value. + */ + public String dataId() { + return this.dataId; + } + + /** + * Set the dataId property: 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. + * + * @param dataId the dataId value to set. + * @return the Collection object itself. + */ + public Collection withDataId(String dataId) { + this.dataId = dataId; + return this; + } + + /** + * Get the samplingRate property: The sampling rate for collection. Sampling rate 1.0 means we collect 100% of data + * by default. + * + * @return the samplingRate value. + */ + public Double samplingRate() { + return this.samplingRate; + } + + /** + * Set the samplingRate property: The sampling rate for collection. Sampling rate 1.0 means we collect 100% of data + * by default. + * + * @param samplingRate the samplingRate value to set. + * @return the Collection object itself. + */ + public Collection withSamplingRate(Double samplingRate) { + this.samplingRate = samplingRate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("clientId", this.clientId); + jsonWriter.writeStringField("dataCollectionMode", + this.dataCollectionMode == null ? null : this.dataCollectionMode.toString()); + jsonWriter.writeStringField("dataId", this.dataId); + jsonWriter.writeNumberField("samplingRate", this.samplingRate); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Collection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Collection if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Collection. + */ + public static Collection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Collection deserializedCollection = new Collection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clientId".equals(fieldName)) { + deserializedCollection.clientId = reader.getString(); + } else if ("dataCollectionMode".equals(fieldName)) { + deserializedCollection.dataCollectionMode = DataCollectionMode.fromString(reader.getString()); + } else if ("dataId".equals(fieldName)) { + deserializedCollection.dataId = reader.getString(); + } else if ("samplingRate".equals(fieldName)) { + deserializedCollection.samplingRate = reader.getNullable(JsonReader::getDouble); + } else { + reader.skipChildren(); + } + } + + return deserializedCollection; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ColumnTransformer.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ColumnTransformer.java index 649d7c1740715..b1bd2bd6febb6 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ColumnTransformer.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ColumnTransformer.java @@ -5,32 +5,38 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** Column transformer parameters. */ +/** + * Column transformer parameters. + */ @Fluent -public final class ColumnTransformer { +public final class ColumnTransformer implements JsonSerializable { /* * Fields to apply transformer logic on. */ - @JsonProperty(value = "fields") private List fields; /* * Different properties to be passed to transformer. * Input expected is dictionary of key,value pairs in JSON format. */ - @JsonProperty(value = "parameters") private Object parameters; - /** Creates an instance of ColumnTransformer class. */ + /** + * Creates an instance of ColumnTransformer class. + */ public ColumnTransformer() { } /** * Get the fields property: Fields to apply transformer logic on. - * + * * @return the fields value. */ public List fields() { @@ -39,7 +45,7 @@ public List fields() { /** * Set the fields property: Fields to apply transformer logic on. - * + * * @param fields the fields value to set. * @return the ColumnTransformer object itself. */ @@ -49,9 +55,9 @@ public ColumnTransformer withFields(List fields) { } /** - * Get the parameters property: Different properties to be passed to transformer. Input expected is dictionary of - * key,value pairs in JSON format. - * + * Get the parameters property: Different properties to be passed to transformer. + * Input expected is dictionary of key,value pairs in JSON format. + * * @return the parameters value. */ public Object parameters() { @@ -59,9 +65,9 @@ public Object parameters() { } /** - * Set the parameters property: Different properties to be passed to transformer. Input expected is dictionary of - * key,value pairs in JSON format. - * + * Set the parameters property: Different properties to be passed to transformer. + * Input expected is dictionary of key,value pairs in JSON format. + * * @param parameters the parameters value to set. * @return the ColumnTransformer object itself. */ @@ -72,9 +78,49 @@ public ColumnTransformer withParameters(Object parameters) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("fields", this.fields, (writer, element) -> writer.writeString(element)); + jsonWriter.writeUntypedField("parameters", this.parameters); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ColumnTransformer from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ColumnTransformer if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ColumnTransformer. + */ + public static ColumnTransformer fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ColumnTransformer deserializedColumnTransformer = new ColumnTransformer(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("fields".equals(fieldName)) { + List fields = reader.readArray(reader1 -> reader1.getString()); + deserializedColumnTransformer.fields = fields; + } else if ("parameters".equals(fieldName)) { + deserializedColumnTransformer.parameters = reader.readUntyped(); + } else { + reader.skipChildren(); + } + } + + return deserializedColumnTransformer; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CommandJob.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CommandJob.java index f7f423aed984f..892df79ac76cd 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CommandJob.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CommandJob.java @@ -6,87 +6,101 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Command job definition. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobType") -@JsonTypeName("Command") +/** + * Command job definition. + */ @Fluent public final class CommandJob extends JobBaseProperties { + /* + * [Required] Specifies the type of job. + */ + private JobType jobType = JobType.COMMAND; + /* * ARM resource ID of the code asset. */ - @JsonProperty(value = "codeId") private String codeId; /* * [Required] The command to execute on startup of the job. eg. "python train.py" */ - @JsonProperty(value = "command", required = true) private String command; /* * Distribution configuration of the job. If set, this should be one of Mpi, Tensorflow, PyTorch, or null. */ - @JsonProperty(value = "distribution") private DistributionConfiguration distribution; /* * [Required] The ARM resource ID of the Environment specification for the job. */ - @JsonProperty(value = "environmentId", required = true) private String environmentId; /* * Environment variables included in the job. */ - @JsonProperty(value = "environmentVariables") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map environmentVariables; /* * Mapping of input data bindings used in the job. */ - @JsonProperty(value = "inputs") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map inputs; /* * Command Job limit. */ - @JsonProperty(value = "limits") private CommandJobLimits limits; /* * Mapping of output data bindings used in the job. */ - @JsonProperty(value = "outputs") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map outputs; /* * Input parameters. */ - @JsonProperty(value = "parameters", access = JsonProperty.Access.WRITE_ONLY) private Object parameters; + /* + * Queue settings for the job + */ + private QueueSettings queueSettings; + /* * Compute Resource configuration for the job. */ - @JsonProperty(value = "resources") private JobResourceConfiguration resources; - /** Creates an instance of CommandJob class. */ + /* + * Status of the job. + */ + private JobStatus status; + + /** + * Creates an instance of CommandJob class. + */ public CommandJob() { } + /** + * Get the jobType property: [Required] Specifies the type of job. + * + * @return the jobType value. + */ + @Override + public JobType jobType() { + return this.jobType; + } + /** * Get the codeId property: ARM resource ID of the code asset. - * + * * @return the codeId value. */ public String codeId() { @@ -95,7 +109,7 @@ public String codeId() { /** * Set the codeId property: ARM resource ID of the code asset. - * + * * @param codeId the codeId value to set. * @return the CommandJob object itself. */ @@ -106,7 +120,7 @@ public CommandJob withCodeId(String codeId) { /** * Get the command property: [Required] The command to execute on startup of the job. eg. "python train.py". - * + * * @return the command value. */ public String command() { @@ -115,7 +129,7 @@ public String command() { /** * Set the command property: [Required] The command to execute on startup of the job. eg. "python train.py". - * + * * @param command the command value to set. * @return the CommandJob object itself. */ @@ -127,7 +141,7 @@ public CommandJob withCommand(String command) { /** * Get the distribution property: Distribution configuration of the job. If set, this should be one of Mpi, * Tensorflow, PyTorch, or null. - * + * * @return the distribution value. */ public DistributionConfiguration distribution() { @@ -137,7 +151,7 @@ public DistributionConfiguration distribution() { /** * Set the distribution property: Distribution configuration of the job. If set, this should be one of Mpi, * Tensorflow, PyTorch, or null. - * + * * @param distribution the distribution value to set. * @return the CommandJob object itself. */ @@ -148,7 +162,7 @@ public CommandJob withDistribution(DistributionConfiguration distribution) { /** * Get the environmentId property: [Required] The ARM resource ID of the Environment specification for the job. - * + * * @return the environmentId value. */ public String environmentId() { @@ -157,7 +171,7 @@ public String environmentId() { /** * Set the environmentId property: [Required] The ARM resource ID of the Environment specification for the job. - * + * * @param environmentId the environmentId value to set. * @return the CommandJob object itself. */ @@ -168,7 +182,7 @@ public CommandJob withEnvironmentId(String environmentId) { /** * Get the environmentVariables property: Environment variables included in the job. - * + * * @return the environmentVariables value. */ public Map environmentVariables() { @@ -177,7 +191,7 @@ public Map environmentVariables() { /** * Set the environmentVariables property: Environment variables included in the job. - * + * * @param environmentVariables the environmentVariables value to set. * @return the CommandJob object itself. */ @@ -188,7 +202,7 @@ public CommandJob withEnvironmentVariables(Map environmentVariab /** * Get the inputs property: Mapping of input data bindings used in the job. - * + * * @return the inputs value. */ public Map inputs() { @@ -197,7 +211,7 @@ public Map inputs() { /** * Set the inputs property: Mapping of input data bindings used in the job. - * + * * @param inputs the inputs value to set. * @return the CommandJob object itself. */ @@ -208,7 +222,7 @@ public CommandJob withInputs(Map inputs) { /** * Get the limits property: Command Job limit. - * + * * @return the limits value. */ public CommandJobLimits limits() { @@ -217,7 +231,7 @@ public CommandJobLimits limits() { /** * Set the limits property: Command Job limit. - * + * * @param limits the limits value to set. * @return the CommandJob object itself. */ @@ -228,7 +242,7 @@ public CommandJob withLimits(CommandJobLimits limits) { /** * Get the outputs property: Mapping of output data bindings used in the job. - * + * * @return the outputs value. */ public Map outputs() { @@ -237,7 +251,7 @@ public Map outputs() { /** * Set the outputs property: Mapping of output data bindings used in the job. - * + * * @param outputs the outputs value to set. * @return the CommandJob object itself. */ @@ -248,16 +262,36 @@ public CommandJob withOutputs(Map outputs) { /** * Get the parameters property: Input parameters. - * + * * @return the parameters value. */ public Object parameters() { return this.parameters; } + /** + * Get the queueSettings property: Queue settings for the job. + * + * @return the queueSettings value. + */ + public QueueSettings queueSettings() { + return this.queueSettings; + } + + /** + * Set the queueSettings property: Queue settings for the job. + * + * @param queueSettings the queueSettings value to set. + * @return the CommandJob object itself. + */ + public CommandJob withQueueSettings(QueueSettings queueSettings) { + this.queueSettings = queueSettings; + return this; + } + /** * Get the resources property: Compute Resource configuration for the job. - * + * * @return the resources value. */ public JobResourceConfiguration resources() { @@ -266,7 +300,7 @@ public JobResourceConfiguration resources() { /** * Set the resources property: Compute Resource configuration for the job. - * + * * @param resources the resources value to set. * @return the CommandJob object itself. */ @@ -275,70 +309,109 @@ public CommandJob withResources(JobResourceConfiguration resources) { return this; } - /** {@inheritDoc} */ + /** + * Get the status property: Status of the job. + * + * @return the status value. + */ + @Override + public JobStatus status() { + return this.status; + } + + /** + * {@inheritDoc} + */ @Override public CommandJob withComponentId(String componentId) { super.withComponentId(componentId); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public CommandJob withComputeId(String computeId) { super.withComputeId(computeId); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public CommandJob withDisplayName(String displayName) { super.withDisplayName(displayName); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public CommandJob withExperimentName(String experimentName) { super.withExperimentName(experimentName); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public CommandJob withIdentity(IdentityConfiguration identity) { super.withIdentity(identity); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public CommandJob withIsArchived(Boolean isArchived) { super.withIsArchived(isArchived); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ + @Override + public CommandJob withNotificationSetting(NotificationSetting notificationSetting) { + super.withNotificationSetting(notificationSetting); + return this; + } + + /** + * {@inheritDoc} + */ @Override public CommandJob withServices(Map services) { super.withServices(services); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public CommandJob withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public CommandJob withProperties(Map properties) { super.withProperties(properties); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public CommandJob withTags(Map tags) { super.withTags(tags); @@ -347,47 +420,42 @@ public CommandJob withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (command() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property command in model CommandJob")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property command in model CommandJob")); } if (distribution() != null) { distribution().validate(); } if (environmentId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property environmentId in model CommandJob")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property environmentId in model CommandJob")); } if (inputs() != null) { - inputs() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); + inputs().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); } if (limits() != null) { limits().validate(); } if (outputs() != null) { - outputs() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); + outputs().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + if (queueSettings() != null) { + queueSettings().validate(); } if (resources() != null) { resources().validate(); @@ -395,4 +463,115 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(CommandJob.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("componentId", componentId()); + jsonWriter.writeStringField("computeId", computeId()); + jsonWriter.writeStringField("displayName", displayName()); + jsonWriter.writeStringField("experimentName", experimentName()); + jsonWriter.writeJsonField("identity", identity()); + jsonWriter.writeBooleanField("isArchived", isArchived()); + jsonWriter.writeJsonField("notificationSetting", notificationSetting()); + jsonWriter.writeMapField("services", services(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("command", this.command); + jsonWriter.writeStringField("environmentId", this.environmentId); + jsonWriter.writeStringField("jobType", this.jobType == null ? null : this.jobType.toString()); + jsonWriter.writeStringField("codeId", this.codeId); + jsonWriter.writeJsonField("distribution", this.distribution); + jsonWriter.writeMapField("environmentVariables", this.environmentVariables, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("inputs", this.inputs, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("limits", this.limits); + jsonWriter.writeMapField("outputs", this.outputs, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("queueSettings", this.queueSettings); + jsonWriter.writeJsonField("resources", this.resources); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CommandJob from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CommandJob if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CommandJob. + */ + public static CommandJob fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CommandJob deserializedCommandJob = new CommandJob(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedCommandJob.withDescription(reader.getString()); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedCommandJob.withProperties(properties); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedCommandJob.withTags(tags); + } else if ("componentId".equals(fieldName)) { + deserializedCommandJob.withComponentId(reader.getString()); + } else if ("computeId".equals(fieldName)) { + deserializedCommandJob.withComputeId(reader.getString()); + } else if ("displayName".equals(fieldName)) { + deserializedCommandJob.withDisplayName(reader.getString()); + } else if ("experimentName".equals(fieldName)) { + deserializedCommandJob.withExperimentName(reader.getString()); + } else if ("identity".equals(fieldName)) { + deserializedCommandJob.withIdentity(IdentityConfiguration.fromJson(reader)); + } else if ("isArchived".equals(fieldName)) { + deserializedCommandJob.withIsArchived(reader.getNullable(JsonReader::getBoolean)); + } else if ("notificationSetting".equals(fieldName)) { + deserializedCommandJob.withNotificationSetting(NotificationSetting.fromJson(reader)); + } else if ("services".equals(fieldName)) { + Map services = reader.readMap(reader1 -> JobService.fromJson(reader1)); + deserializedCommandJob.withServices(services); + } else if ("status".equals(fieldName)) { + deserializedCommandJob.status = JobStatus.fromString(reader.getString()); + } else if ("command".equals(fieldName)) { + deserializedCommandJob.command = reader.getString(); + } else if ("environmentId".equals(fieldName)) { + deserializedCommandJob.environmentId = reader.getString(); + } else if ("jobType".equals(fieldName)) { + deserializedCommandJob.jobType = JobType.fromString(reader.getString()); + } else if ("codeId".equals(fieldName)) { + deserializedCommandJob.codeId = reader.getString(); + } else if ("distribution".equals(fieldName)) { + deserializedCommandJob.distribution = DistributionConfiguration.fromJson(reader); + } else if ("environmentVariables".equals(fieldName)) { + Map environmentVariables = reader.readMap(reader1 -> reader1.getString()); + deserializedCommandJob.environmentVariables = environmentVariables; + } else if ("inputs".equals(fieldName)) { + Map inputs = reader.readMap(reader1 -> JobInput.fromJson(reader1)); + deserializedCommandJob.inputs = inputs; + } else if ("limits".equals(fieldName)) { + deserializedCommandJob.limits = CommandJobLimits.fromJson(reader); + } else if ("outputs".equals(fieldName)) { + Map outputs = reader.readMap(reader1 -> JobOutput.fromJson(reader1)); + deserializedCommandJob.outputs = outputs; + } else if ("parameters".equals(fieldName)) { + deserializedCommandJob.parameters = reader.readUntyped(); + } else if ("queueSettings".equals(fieldName)) { + deserializedCommandJob.queueSettings = QueueSettings.fromJson(reader); + } else if ("resources".equals(fieldName)) { + deserializedCommandJob.resources = JobResourceConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCommandJob; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CommandJobLimits.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CommandJobLimits.java index 5b2b21d51c28d..a45e5518cd9b0 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CommandJobLimits.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CommandJobLimits.java @@ -5,20 +5,42 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.Duration; -/** Command Job limit class. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobLimitsType") -@JsonTypeName("Command") +/** + * Command Job limit class. + */ @Fluent public final class CommandJobLimits extends JobLimits { - /** Creates an instance of CommandJobLimits class. */ + /* + * [Required] JobLimit type. + */ + private JobLimitsType jobLimitsType = JobLimitsType.COMMAND; + + /** + * Creates an instance of CommandJobLimits class. + */ public CommandJobLimits() { } - /** {@inheritDoc} */ + /** + * Get the jobLimitsType property: [Required] JobLimit type. + * + * @return the jobLimitsType value. + */ + @Override + public JobLimitsType jobLimitsType() { + return this.jobLimitsType; + } + + /** + * {@inheritDoc} + */ @Override public CommandJobLimits withTimeout(Duration timeout) { super.withTimeout(timeout); @@ -27,11 +49,51 @@ public CommandJobLimits withTimeout(Duration timeout) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("timeout", CoreUtils.durationToStringWithDays(timeout())); + jsonWriter.writeStringField("jobLimitsType", this.jobLimitsType == null ? null : this.jobLimitsType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CommandJobLimits from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CommandJobLimits if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CommandJobLimits. + */ + public static CommandJobLimits fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CommandJobLimits deserializedCommandJobLimits = new CommandJobLimits(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("timeout".equals(fieldName)) { + deserializedCommandJobLimits + .withTimeout(reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString()))); + } else if ("jobLimitsType".equals(fieldName)) { + deserializedCommandJobLimits.jobLimitsType = JobLimitsType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCommandJobLimits; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentContainer.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentContainer.java index 2db458e03fb13..80096076fb885 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentContainer.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentContainer.java @@ -8,90 +8,103 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.machinelearning.fluent.models.ComponentContainerInner; -/** An immutable client-side representation of ComponentContainer. */ +/** + * An immutable client-side representation of ComponentContainer. + */ public interface ComponentContainer { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the properties property: [Required] Additional attributes of the entity. - * + * * @return the properties value. */ ComponentContainerProperties properties(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.ComponentContainerInner object. - * + * * @return the inner object. */ ComponentContainerInner innerModel(); - /** The entirety of the ComponentContainer definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithParentResource, - DefinitionStages.WithProperties, - DefinitionStages.WithCreate { + /** + * The entirety of the ComponentContainer definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, DefinitionStages.WithCreate { } - /** The ComponentContainer definition stages. */ + + /** + * The ComponentContainer definition stages. + */ interface DefinitionStages { - /** The first stage of the ComponentContainer definition. */ + /** + * The first stage of the ComponentContainer definition. + */ interface Blank extends WithParentResource { } - /** The stage of the ComponentContainer definition allowing to specify parent resource. */ + + /** + * The stage of the ComponentContainer definition allowing to specify parent resource. + */ interface WithParentResource { /** - * Specifies resourceGroupName, workspaceName. - * + * Specifies resourceGroupName, registryName. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. * @return the next definition stage. */ - WithProperties withExistingWorkspace(String resourceGroupName, String workspaceName); + WithProperties withExistingRegistry(String resourceGroupName, String registryName); } - /** The stage of the ComponentContainer definition allowing to specify properties. */ + + /** + * The stage of the ComponentContainer definition allowing to specify properties. + */ interface WithProperties { /** * Specifies the properties property: [Required] Additional attributes of the entity.. - * + * * @param properties [Required] Additional attributes of the entity. * @return the next definition stage. */ WithCreate withProperties(ComponentContainerProperties properties); } + /** * The stage of the ComponentContainer definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. @@ -99,67 +112,76 @@ interface WithProperties { interface WithCreate { /** * Executes the create request. - * + * * @return the created resource. */ ComponentContainer create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ ComponentContainer create(Context context); } } + /** * Begins update for the ComponentContainer resource. - * + * * @return the stage of resource update. */ ComponentContainer.Update update(); - /** The template for ComponentContainer update. */ + /** + * The template for ComponentContainer update. + */ interface Update extends UpdateStages.WithProperties { /** * Executes the update request. - * + * * @return the updated resource. */ ComponentContainer apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ ComponentContainer apply(Context context); } - /** The ComponentContainer update stages. */ + + /** + * The ComponentContainer update stages. + */ interface UpdateStages { - /** The stage of the ComponentContainer update allowing to specify properties. */ + /** + * The stage of the ComponentContainer update allowing to specify properties. + */ interface WithProperties { /** * Specifies the properties property: [Required] Additional attributes of the entity.. - * + * * @param properties [Required] Additional attributes of the entity. * @return the next definition stage. */ Update withProperties(ComponentContainerProperties properties); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ ComponentContainer refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentContainerProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentContainerProperties.java index 514b48b0968f2..7ca0bb0ce8227 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentContainerProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentContainerProperties.java @@ -5,40 +5,98 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; /** - * Component container definition. <see - * href="https://docs.microsoft.com/en-us/azure/machine-learning/reference-yaml-component-command" />. + * Component container definition. + * <see href="https://docs.microsoft.com/en-us/azure/machine-learning/reference-yaml-component-command" />. */ @Fluent public final class ComponentContainerProperties extends AssetContainer { - /** Creates an instance of ComponentContainerProperties class. */ + /* + * Provisioning state for the component container. + */ + private AssetProvisioningState provisioningState; + + /* + * The latest version inside this container. + */ + private String latestVersion; + + /* + * The next auto incremental version + */ + private String nextVersion; + + /** + * Creates an instance of ComponentContainerProperties class. + */ public ComponentContainerProperties() { } - /** {@inheritDoc} */ + /** + * Get the provisioningState property: Provisioning state for the component container. + * + * @return the provisioningState value. + */ + public AssetProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the latestVersion property: The latest version inside this container. + * + * @return the latestVersion value. + */ + @Override + public String latestVersion() { + return this.latestVersion; + } + + /** + * Get the nextVersion property: The next auto incremental version. + * + * @return the nextVersion value. + */ + @Override + public String nextVersion() { + return this.nextVersion; + } + + /** + * {@inheritDoc} + */ @Override public ComponentContainerProperties withIsArchived(Boolean isArchived) { super.withIsArchived(isArchived); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ComponentContainerProperties withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ComponentContainerProperties withProperties(Map properties) { super.withProperties(properties); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ComponentContainerProperties withTags(Map tags) { super.withTags(tags); @@ -47,11 +105,65 @@ public ComponentContainerProperties withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("isArchived", isArchived()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ComponentContainerProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ComponentContainerProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ComponentContainerProperties. + */ + public static ComponentContainerProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ComponentContainerProperties deserializedComponentContainerProperties = new ComponentContainerProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedComponentContainerProperties.withDescription(reader.getString()); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedComponentContainerProperties.withProperties(properties); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedComponentContainerProperties.withTags(tags); + } else if ("isArchived".equals(fieldName)) { + deserializedComponentContainerProperties.withIsArchived(reader.getNullable(JsonReader::getBoolean)); + } else if ("latestVersion".equals(fieldName)) { + deserializedComponentContainerProperties.latestVersion = reader.getString(); + } else if ("nextVersion".equals(fieldName)) { + deserializedComponentContainerProperties.nextVersion = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedComponentContainerProperties.provisioningState + = AssetProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedComponentContainerProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentContainerResourceArmPaginatedResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentContainerResourceArmPaginatedResult.java index 0be978c7adf26..ba90af3f12312 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentContainerResourceArmPaginatedResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentContainerResourceArmPaginatedResult.java @@ -5,33 +5,40 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.fluent.models.ComponentContainerInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** A paginated list of ComponentContainer entities. */ +/** + * A paginated list of ComponentContainer entities. + */ @Fluent -public final class ComponentContainerResourceArmPaginatedResult { +public final class ComponentContainerResourceArmPaginatedResult + implements JsonSerializable { /* * The link to the next page of ComponentContainer objects. If null, there are no additional pages. */ - @JsonProperty(value = "nextLink") private String nextLink; /* * An array of objects of type ComponentContainer. */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of ComponentContainerResourceArmPaginatedResult class. */ + /** + * Creates an instance of ComponentContainerResourceArmPaginatedResult class. + */ public ComponentContainerResourceArmPaginatedResult() { } /** * Get the nextLink property: The link to the next page of ComponentContainer objects. If null, there are no * additional pages. - * + * * @return the nextLink value. */ public String nextLink() { @@ -41,7 +48,7 @@ public String nextLink() { /** * Set the nextLink property: The link to the next page of ComponentContainer objects. If null, there are no * additional pages. - * + * * @param nextLink the nextLink value to set. * @return the ComponentContainerResourceArmPaginatedResult object itself. */ @@ -52,7 +59,7 @@ public ComponentContainerResourceArmPaginatedResult withNextLink(String nextLink /** * Get the value property: An array of objects of type ComponentContainer. - * + * * @return the value value. */ public List value() { @@ -61,7 +68,7 @@ public List value() { /** * Set the value property: An array of objects of type ComponentContainer. - * + * * @param value the value value to set. * @return the ComponentContainerResourceArmPaginatedResult object itself. */ @@ -72,7 +79,7 @@ public ComponentContainerResourceArmPaginatedResult withValue(List e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ComponentContainerResourceArmPaginatedResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ComponentContainerResourceArmPaginatedResult if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ComponentContainerResourceArmPaginatedResult. + */ + public static ComponentContainerResourceArmPaginatedResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ComponentContainerResourceArmPaginatedResult deserializedComponentContainerResourceArmPaginatedResult + = new ComponentContainerResourceArmPaginatedResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedComponentContainerResourceArmPaginatedResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ComponentContainerInner.fromJson(reader1)); + deserializedComponentContainerResourceArmPaginatedResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedComponentContainerResourceArmPaginatedResult; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentContainers.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentContainers.java index 4339a456fddc1..e91628c7c6216 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentContainers.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentContainers.java @@ -7,12 +7,15 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.ComponentContainerInner; -/** Resource collection API of ComponentContainers. */ +/** + * Resource collection API of ComponentContainers. + */ public interface ComponentContainers { /** * List component containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -24,7 +27,7 @@ public interface ComponentContainers { /** * List component containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -35,12 +38,12 @@ public interface ComponentContainers { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of ComponentContainer entities as paginated response with {@link PagedIterable}. */ - PagedIterable list( - String resourceGroupName, String workspaceName, String skip, ListViewType listViewType, Context context); + PagedIterable list(String resourceGroupName, String workspaceName, String skip, + ListViewType listViewType, Context context); /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -54,7 +57,7 @@ PagedIterable list( /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -66,7 +69,7 @@ PagedIterable list( /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -76,12 +79,12 @@ PagedIterable list( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return container along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String name, Context context); + Response getWithResponse(String resourceGroupName, String workspaceName, String name, + Context context); /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -93,55 +96,33 @@ Response getWithResponse( ComponentContainer get(String resourceGroupName, String workspaceName, String name); /** - * Get container. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container along with {@link Response}. - */ - ComponentContainer getById(String id); - - /** - * Get container. - * - * @param id the resource ID. + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param body Container entity to create or update. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container along with {@link Response}. + * @return azure Resource Manager resource envelope along with {@link Response}. */ - Response getByIdWithResponse(String id, Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, String name, + ComponentContainerInner body, Context context); /** - * Delete container. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Delete container. - * - * @param id the resource ID. - * @param context The context to associate with this operation. + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param body Container entity to create or update. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new ComponentContainer resource. - * - * @param name resource name. - * @return the first stage of the new ComponentContainer definition. + * @return azure Resource Manager resource envelope. */ - ComponentContainer.DefinitionStages.Blank define(String name); + ComponentContainer createOrUpdate(String resourceGroupName, String workspaceName, String name, + ComponentContainerInner body); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentVersion.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentVersion.java index 3b45a1f1eb5e9..313bc99202d41 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentVersion.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentVersion.java @@ -8,91 +8,104 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.machinelearning.fluent.models.ComponentVersionInner; -/** An immutable client-side representation of ComponentVersion. */ +/** + * An immutable client-side representation of ComponentVersion. + */ public interface ComponentVersion { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the properties property: [Required] Additional attributes of the entity. - * + * * @return the properties value. */ ComponentVersionProperties properties(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.ComponentVersionInner object. - * + * * @return the inner object. */ ComponentVersionInner innerModel(); - /** The entirety of the ComponentVersion definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithParentResource, - DefinitionStages.WithProperties, - DefinitionStages.WithCreate { + /** + * The entirety of the ComponentVersion definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, DefinitionStages.WithCreate { } - /** The ComponentVersion definition stages. */ + + /** + * The ComponentVersion definition stages. + */ interface DefinitionStages { - /** The first stage of the ComponentVersion definition. */ + /** + * The first stage of the ComponentVersion definition. + */ interface Blank extends WithParentResource { } - /** The stage of the ComponentVersion definition allowing to specify parent resource. */ + + /** + * The stage of the ComponentVersion definition allowing to specify parent resource. + */ interface WithParentResource { /** - * Specifies resourceGroupName, workspaceName, name. - * + * Specifies resourceGroupName, registryName, componentName. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. - * @param name Container name. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. * @return the next definition stage. */ - WithProperties withExistingComponent(String resourceGroupName, String workspaceName, String name); + WithProperties withExistingComponent(String resourceGroupName, String registryName, String componentName); } - /** The stage of the ComponentVersion definition allowing to specify properties. */ + + /** + * The stage of the ComponentVersion definition allowing to specify properties. + */ interface WithProperties { /** * Specifies the properties property: [Required] Additional attributes of the entity.. - * + * * @param properties [Required] Additional attributes of the entity. * @return the next definition stage. */ WithCreate withProperties(ComponentVersionProperties properties); } + /** * The stage of the ComponentVersion definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. @@ -100,67 +113,76 @@ interface WithProperties { interface WithCreate { /** * Executes the create request. - * + * * @return the created resource. */ ComponentVersion create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ ComponentVersion create(Context context); } } + /** * Begins update for the ComponentVersion resource. - * + * * @return the stage of resource update. */ ComponentVersion.Update update(); - /** The template for ComponentVersion update. */ + /** + * The template for ComponentVersion update. + */ interface Update extends UpdateStages.WithProperties { /** * Executes the update request. - * + * * @return the updated resource. */ ComponentVersion apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ ComponentVersion apply(Context context); } - /** The ComponentVersion update stages. */ + + /** + * The ComponentVersion update stages. + */ interface UpdateStages { - /** The stage of the ComponentVersion update allowing to specify properties. */ + /** + * The stage of the ComponentVersion update allowing to specify properties. + */ interface WithProperties { /** * Specifies the properties property: [Required] Additional attributes of the entity.. - * + * * @param properties [Required] Additional attributes of the entity. * @return the next definition stage. */ Update withProperties(ComponentVersionProperties properties); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ ComponentVersion refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentVersionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentVersionProperties.java index 0dde26bb4437f..8518e15ac68ad 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentVersionProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentVersionProperties.java @@ -5,27 +5,38 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Definition of a component version: defines resources that span component types. */ +/** + * Definition of a component version: defines resources that span component types. + */ @Fluent public final class ComponentVersionProperties extends AssetBase { /* * Defines Component definition details. * */ - @JsonProperty(value = "componentSpec") private Object componentSpec; - /** Creates an instance of ComponentVersionProperties class. */ + /* + * Provisioning state for the component version. + */ + private AssetProvisioningState provisioningState; + + /** + * Creates an instance of ComponentVersionProperties class. + */ public ComponentVersionProperties() { } /** - * Get the componentSpec property: Defines Component definition details. <see - * href="https://docs.microsoft.com/en-us/azure/machine-learning/reference-yaml-component-command" />. - * + * Get the componentSpec property: Defines Component definition details. + * <see href="https://docs.microsoft.com/en-us/azure/machine-learning/reference-yaml-component-command" />. + * * @return the componentSpec value. */ public Object componentSpec() { @@ -33,9 +44,9 @@ public Object componentSpec() { } /** - * Set the componentSpec property: Defines Component definition details. <see - * href="https://docs.microsoft.com/en-us/azure/machine-learning/reference-yaml-component-command" />. - * + * Set the componentSpec property: Defines Component definition details. + * <see href="https://docs.microsoft.com/en-us/azure/machine-learning/reference-yaml-component-command" />. + * * @param componentSpec the componentSpec value to set. * @return the ComponentVersionProperties object itself. */ @@ -44,35 +55,54 @@ public ComponentVersionProperties withComponentSpec(Object componentSpec) { return this; } - /** {@inheritDoc} */ + /** + * Get the provisioningState property: Provisioning state for the component version. + * + * @return the provisioningState value. + */ + public AssetProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ @Override public ComponentVersionProperties withIsAnonymous(Boolean isAnonymous) { super.withIsAnonymous(isAnonymous); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ComponentVersionProperties withIsArchived(Boolean isArchived) { super.withIsArchived(isArchived); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ComponentVersionProperties withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ComponentVersionProperties withProperties(Map properties) { super.withProperties(properties); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ComponentVersionProperties withTags(Map tags) { super.withTags(tags); @@ -81,11 +111,67 @@ public ComponentVersionProperties withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("isAnonymous", isAnonymous()); + jsonWriter.writeBooleanField("isArchived", isArchived()); + jsonWriter.writeUntypedField("componentSpec", this.componentSpec); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ComponentVersionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ComponentVersionProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ComponentVersionProperties. + */ + public static ComponentVersionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ComponentVersionProperties deserializedComponentVersionProperties = new ComponentVersionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedComponentVersionProperties.withDescription(reader.getString()); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedComponentVersionProperties.withProperties(properties); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedComponentVersionProperties.withTags(tags); + } else if ("isAnonymous".equals(fieldName)) { + deserializedComponentVersionProperties.withIsAnonymous(reader.getNullable(JsonReader::getBoolean)); + } else if ("isArchived".equals(fieldName)) { + deserializedComponentVersionProperties.withIsArchived(reader.getNullable(JsonReader::getBoolean)); + } else if ("componentSpec".equals(fieldName)) { + deserializedComponentVersionProperties.componentSpec = reader.readUntyped(); + } else if ("provisioningState".equals(fieldName)) { + deserializedComponentVersionProperties.provisioningState + = AssetProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedComponentVersionProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentVersionResourceArmPaginatedResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentVersionResourceArmPaginatedResult.java index d78b0c57e190f..11a989b4a1f52 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentVersionResourceArmPaginatedResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentVersionResourceArmPaginatedResult.java @@ -5,33 +5,40 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.fluent.models.ComponentVersionInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** A paginated list of ComponentVersion entities. */ +/** + * A paginated list of ComponentVersion entities. + */ @Fluent -public final class ComponentVersionResourceArmPaginatedResult { +public final class ComponentVersionResourceArmPaginatedResult + implements JsonSerializable { /* * The link to the next page of ComponentVersion objects. If null, there are no additional pages. */ - @JsonProperty(value = "nextLink") private String nextLink; /* * An array of objects of type ComponentVersion. */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of ComponentVersionResourceArmPaginatedResult class. */ + /** + * Creates an instance of ComponentVersionResourceArmPaginatedResult class. + */ public ComponentVersionResourceArmPaginatedResult() { } /** * Get the nextLink property: The link to the next page of ComponentVersion objects. If null, there are no * additional pages. - * + * * @return the nextLink value. */ public String nextLink() { @@ -41,7 +48,7 @@ public String nextLink() { /** * Set the nextLink property: The link to the next page of ComponentVersion objects. If null, there are no * additional pages. - * + * * @param nextLink the nextLink value to set. * @return the ComponentVersionResourceArmPaginatedResult object itself. */ @@ -52,7 +59,7 @@ public ComponentVersionResourceArmPaginatedResult withNextLink(String nextLink) /** * Get the value property: An array of objects of type ComponentVersion. - * + * * @return the value value. */ public List value() { @@ -61,7 +68,7 @@ public List value() { /** * Set the value property: An array of objects of type ComponentVersion. - * + * * @param value the value value to set. * @return the ComponentVersionResourceArmPaginatedResult object itself. */ @@ -72,7 +79,7 @@ public ComponentVersionResourceArmPaginatedResult withValue(List e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ComponentVersionResourceArmPaginatedResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ComponentVersionResourceArmPaginatedResult if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ComponentVersionResourceArmPaginatedResult. + */ + public static ComponentVersionResourceArmPaginatedResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ComponentVersionResourceArmPaginatedResult deserializedComponentVersionResourceArmPaginatedResult + = new ComponentVersionResourceArmPaginatedResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedComponentVersionResourceArmPaginatedResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ComponentVersionInner.fromJson(reader1)); + deserializedComponentVersionResourceArmPaginatedResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedComponentVersionResourceArmPaginatedResult; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentVersions.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentVersions.java index ee49889d97588..2bcd7bba68f48 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentVersions.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComponentVersions.java @@ -7,12 +7,15 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.ComponentVersionInner; -/** Resource collection API of ComponentVersions. */ +/** + * Resource collection API of ComponentVersions. + */ public interface ComponentVersions { /** * List component versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Component name. @@ -25,7 +28,7 @@ public interface ComponentVersions { /** * List component versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Component name. @@ -39,19 +42,12 @@ public interface ComponentVersions { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of ComponentVersion entities as paginated response with {@link PagedIterable}. */ - PagedIterable list( - String resourceGroupName, - String workspaceName, - String name, - String orderBy, - Integer top, - String skip, - ListViewType listViewType, - Context context); + PagedIterable list(String resourceGroupName, String workspaceName, String name, String orderBy, + Integer top, String skip, ListViewType listViewType, Context context); /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -62,12 +58,12 @@ PagedIterable list( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ - Response deleteWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context); + Response deleteWithResponse(String resourceGroupName, String workspaceName, String name, String version, + Context context); /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -80,7 +76,7 @@ Response deleteWithResponse( /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -91,12 +87,12 @@ Response deleteWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return version along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context); + Response getWithResponse(String resourceGroupName, String workspaceName, String name, + String version, Context context); /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -109,55 +105,65 @@ Response getWithResponse( ComponentVersion get(String resourceGroupName, String workspaceName, String name, String version); /** - * Get version. - * - * @param id the resource ID. + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return version along with {@link Response}. + * @return azure Resource Manager resource envelope along with {@link Response}. */ - ComponentVersion getById(String id); + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, String name, + String version, ComponentVersionInner body, Context context); /** - * Get version. - * - * @param id the resource ID. - * @param context The context to associate with this operation. + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Version entity to create or update. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return version along with {@link Response}. + * @return azure Resource Manager resource envelope. */ - Response getByIdWithResponse(String id, Context context); + ComponentVersion createOrUpdate(String resourceGroupName, String workspaceName, String name, String version, + ComponentVersionInner body); /** - * Delete version. - * - * @param id the resource ID. + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void deleteById(String id); + void publish(String resourceGroupName, String workspaceName, String name, String version, DestinationAsset body); /** - * Delete version. - * - * @param id the resource ID. + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new ComponentVersion resource. - * - * @param name resource name. - * @return the first stage of the new ComponentVersion definition. - */ - ComponentVersion.DefinitionStages.Blank define(String name); + void publish(String resourceGroupName, String workspaceName, String name, String version, DestinationAsset body, + Context context); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Compute.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Compute.java index 1ed2a4317c3a8..9a9e4bc15142c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Compute.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Compute.java @@ -6,96 +6,89 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.exception.ManagementError; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.List; -/** Machine Learning compute object. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "computeType", - defaultImpl = Compute.class) -@JsonTypeName("Compute") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "AKS", value = Aks.class), - @JsonSubTypes.Type(name = "Kubernetes", value = Kubernetes.class), - @JsonSubTypes.Type(name = "AmlCompute", value = AmlCompute.class), - @JsonSubTypes.Type(name = "ComputeInstance", value = ComputeInstance.class), - @JsonSubTypes.Type(name = "VirtualMachine", value = VirtualMachine.class), - @JsonSubTypes.Type(name = "HDInsight", value = HDInsight.class), - @JsonSubTypes.Type(name = "DataFactory", value = DataFactory.class), - @JsonSubTypes.Type(name = "Databricks", value = Databricks.class), - @JsonSubTypes.Type(name = "DataLakeAnalytics", value = DataLakeAnalytics.class), - @JsonSubTypes.Type(name = "SynapseSpark", value = SynapseSpark.class) -}) +/** + * Machine Learning compute object. + */ @Fluent -public class Compute { +public class Compute implements JsonSerializable { + /* + * The type of compute + */ + private ComputeType computeType = ComputeType.fromString("Compute"); + /* * Location for the underlying compute */ - @JsonProperty(value = "computeLocation") private String computeLocation; /* * The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; /* * The description of the Machine Learning compute. */ - @JsonProperty(value = "description") private String description; /* * The time at which the compute was created. */ - @JsonProperty(value = "createdOn", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime createdOn; /* * The time at which the compute was last modified. */ - @JsonProperty(value = "modifiedOn", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime modifiedOn; /* * ARM resource id of the underlying compute */ - @JsonProperty(value = "resourceId") private String resourceId; /* * Errors during provisioning */ - @JsonProperty(value = "provisioningErrors", access = JsonProperty.Access.WRITE_ONLY) private List provisioningErrors; /* * Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning * service provisioned it if false. */ - @JsonProperty(value = "isAttachedCompute", access = JsonProperty.Access.WRITE_ONLY) private Boolean isAttachedCompute; /* * Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. */ - @JsonProperty(value = "disableLocalAuth") private Boolean disableLocalAuth; - /** Creates an instance of Compute class. */ + /** + * Creates an instance of Compute class. + */ public Compute() { } + /** + * Get the computeType property: The type of compute. + * + * @return the computeType value. + */ + public ComputeType computeType() { + return this.computeType; + } + /** * Get the computeLocation property: Location for the underlying compute. - * + * * @return the computeLocation value. */ public String computeLocation() { @@ -104,7 +97,7 @@ public String computeLocation() { /** * Set the computeLocation property: Location for the underlying compute. - * + * * @param computeLocation the computeLocation value to set. * @return the Compute object itself. */ @@ -116,16 +109,28 @@ public Compute withComputeLocation(String computeLocation) { /** * Get the provisioningState property: The provision state of the cluster. Valid values are Unknown, Updating, * Provisioning, Succeeded, and Failed. - * + * * @return the provisioningState value. */ public ProvisioningState provisioningState() { return this.provisioningState; } + /** + * Set the provisioningState property: The provision state of the cluster. Valid values are Unknown, Updating, + * Provisioning, Succeeded, and Failed. + * + * @param provisioningState the provisioningState value to set. + * @return the Compute object itself. + */ + Compute withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + /** * Get the description property: The description of the Machine Learning compute. - * + * * @return the description value. */ public String description() { @@ -134,7 +139,7 @@ public String description() { /** * Set the description property: The description of the Machine Learning compute. - * + * * @param description the description value to set. * @return the Compute object itself. */ @@ -145,25 +150,47 @@ public Compute withDescription(String description) { /** * Get the createdOn property: The time at which the compute was created. - * + * * @return the createdOn value. */ public OffsetDateTime createdOn() { return this.createdOn; } + /** + * Set the createdOn property: The time at which the compute was created. + * + * @param createdOn the createdOn value to set. + * @return the Compute object itself. + */ + Compute withCreatedOn(OffsetDateTime createdOn) { + this.createdOn = createdOn; + return this; + } + /** * Get the modifiedOn property: The time at which the compute was last modified. - * + * * @return the modifiedOn value. */ public OffsetDateTime modifiedOn() { return this.modifiedOn; } + /** + * Set the modifiedOn property: The time at which the compute was last modified. + * + * @param modifiedOn the modifiedOn value to set. + * @return the Compute object itself. + */ + Compute withModifiedOn(OffsetDateTime modifiedOn) { + this.modifiedOn = modifiedOn; + return this; + } + /** * Get the resourceId property: ARM resource id of the underlying compute. - * + * * @return the resourceId value. */ public String resourceId() { @@ -172,7 +199,7 @@ public String resourceId() { /** * Set the resourceId property: ARM resource id of the underlying compute. - * + * * @param resourceId the resourceId value to set. * @return the Compute object itself. */ @@ -183,27 +210,50 @@ public Compute withResourceId(String resourceId) { /** * Get the provisioningErrors property: Errors during provisioning. - * + * * @return the provisioningErrors value. */ public List provisioningErrors() { return this.provisioningErrors; } + /** + * Set the provisioningErrors property: Errors during provisioning. + * + * @param provisioningErrors the provisioningErrors value to set. + * @return the Compute object itself. + */ + Compute withProvisioningErrors(List provisioningErrors) { + this.provisioningErrors = provisioningErrors; + return this; + } + /** * Get the isAttachedCompute property: Indicating whether the compute was provisioned by user and brought from * outside if true, or machine learning service provisioned it if false. - * + * * @return the isAttachedCompute value. */ public Boolean isAttachedCompute() { return this.isAttachedCompute; } + /** + * Set the isAttachedCompute property: Indicating whether the compute was provisioned by user and brought from + * outside if true, or machine learning service provisioned it if false. + * + * @param isAttachedCompute the isAttachedCompute value to set. + * @return the Compute object itself. + */ + Compute withIsAttachedCompute(Boolean isAttachedCompute) { + this.isAttachedCompute = isAttachedCompute; + return this; + } + /** * Get the disableLocalAuth property: Opt-out of local authentication and ensure customers can use only MSI and AAD * exclusively for authentication. - * + * * @return the disableLocalAuth value. */ public Boolean disableLocalAuth() { @@ -213,7 +263,7 @@ public Boolean disableLocalAuth() { /** * Set the disableLocalAuth property: Opt-out of local authentication and ensure customers can use only MSI and AAD * exclusively for authentication. - * + * * @param disableLocalAuth the disableLocalAuth value to set. * @return the Compute object itself. */ @@ -224,9 +274,114 @@ public Compute withDisableLocalAuth(Boolean disableLocalAuth) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("computeType", this.computeType == null ? null : this.computeType.toString()); + jsonWriter.writeStringField("computeLocation", this.computeLocation); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeBooleanField("disableLocalAuth", this.disableLocalAuth); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Compute from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Compute if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Compute. + */ + public static Compute fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("computeType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("AKS".equals(discriminatorValue)) { + return Aks.fromJson(readerToUse.reset()); + } else if ("Kubernetes".equals(discriminatorValue)) { + return Kubernetes.fromJson(readerToUse.reset()); + } else if ("AmlCompute".equals(discriminatorValue)) { + return AmlCompute.fromJson(readerToUse.reset()); + } else if ("ComputeInstance".equals(discriminatorValue)) { + return ComputeInstance.fromJson(readerToUse.reset()); + } else if ("VirtualMachine".equals(discriminatorValue)) { + return VirtualMachine.fromJson(readerToUse.reset()); + } else if ("HDInsight".equals(discriminatorValue)) { + return HDInsight.fromJson(readerToUse.reset()); + } else if ("DataFactory".equals(discriminatorValue)) { + return DataFactory.fromJson(readerToUse.reset()); + } else if ("Databricks".equals(discriminatorValue)) { + return Databricks.fromJson(readerToUse.reset()); + } else if ("DataLakeAnalytics".equals(discriminatorValue)) { + return DataLakeAnalytics.fromJson(readerToUse.reset()); + } else if ("SynapseSpark".equals(discriminatorValue)) { + return SynapseSpark.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static Compute fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Compute deserializedCompute = new Compute(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("computeType".equals(fieldName)) { + deserializedCompute.computeType = ComputeType.fromString(reader.getString()); + } else if ("computeLocation".equals(fieldName)) { + deserializedCompute.computeLocation = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedCompute.provisioningState = ProvisioningState.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedCompute.description = reader.getString(); + } else if ("createdOn".equals(fieldName)) { + deserializedCompute.createdOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("modifiedOn".equals(fieldName)) { + deserializedCompute.modifiedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("resourceId".equals(fieldName)) { + deserializedCompute.resourceId = reader.getString(); + } else if ("provisioningErrors".equals(fieldName)) { + List provisioningErrors + = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); + deserializedCompute.provisioningErrors = provisioningErrors; + } else if ("isAttachedCompute".equals(fieldName)) { + deserializedCompute.isAttachedCompute = reader.getNullable(JsonReader::getBoolean); + } else if ("disableLocalAuth".equals(fieldName)) { + deserializedCompute.disableLocalAuth = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedCompute; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstance.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstance.java index 3c1201eb45463..1bfa1ed54b165 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstance.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstance.java @@ -5,28 +5,75 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; -/** An Azure Machine Learning compute instance. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "computeType") -@JsonTypeName("ComputeInstance") +/** + * An Azure Machine Learning compute instance. + */ @Fluent public final class ComputeInstance extends Compute { + /* + * The type of compute + */ + private ComputeType computeType = ComputeType.COMPUTE_INSTANCE; + /* * Properties of ComputeInstance */ - @JsonProperty(value = "properties") private ComputeInstanceProperties properties; - /** Creates an instance of ComputeInstance class. */ + /* + * The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. + */ + private ProvisioningState provisioningState; + + /* + * The time at which the compute was created. + */ + private OffsetDateTime createdOn; + + /* + * The time at which the compute was last modified. + */ + private OffsetDateTime modifiedOn; + + /* + * Errors during provisioning + */ + private List provisioningErrors; + + /* + * Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning + * service provisioned it if false. + */ + private Boolean isAttachedCompute; + + /** + * Creates an instance of ComputeInstance class. + */ public ComputeInstance() { } + /** + * Get the computeType property: The type of compute. + * + * @return the computeType value. + */ + @Override + public ComputeType computeType() { + return this.computeType; + } + /** * Get the properties property: Properties of ComputeInstance. - * + * * @return the properties value. */ public ComputeInstanceProperties properties() { @@ -35,7 +82,7 @@ public ComputeInstanceProperties properties() { /** * Set the properties property: Properties of ComputeInstance. - * + * * @param properties the properties value to set. * @return the ComputeInstance object itself. */ @@ -44,28 +91,88 @@ public ComputeInstance withProperties(ComputeInstanceProperties properties) { return this; } - /** {@inheritDoc} */ + /** + * Get the provisioningState property: The provision state of the cluster. Valid values are Unknown, Updating, + * Provisioning, Succeeded, and Failed. + * + * @return the provisioningState value. + */ + @Override + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the createdOn property: The time at which the compute was created. + * + * @return the createdOn value. + */ + @Override + public OffsetDateTime createdOn() { + return this.createdOn; + } + + /** + * Get the modifiedOn property: The time at which the compute was last modified. + * + * @return the modifiedOn value. + */ + @Override + public OffsetDateTime modifiedOn() { + return this.modifiedOn; + } + + /** + * Get the provisioningErrors property: Errors during provisioning. + * + * @return the provisioningErrors value. + */ + @Override + public List provisioningErrors() { + return this.provisioningErrors; + } + + /** + * Get the isAttachedCompute property: Indicating whether the compute was provisioned by user and brought from + * outside if true, or machine learning service provisioned it if false. + * + * @return the isAttachedCompute value. + */ + @Override + public Boolean isAttachedCompute() { + return this.isAttachedCompute; + } + + /** + * {@inheritDoc} + */ @Override public ComputeInstance withComputeLocation(String computeLocation) { super.withComputeLocation(computeLocation); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ComputeInstance withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ComputeInstance withResourceId(String resourceId) { super.withResourceId(resourceId); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ComputeInstance withDisableLocalAuth(Boolean disableLocalAuth) { super.withDisableLocalAuth(disableLocalAuth); @@ -74,7 +181,7 @@ public ComputeInstance withDisableLocalAuth(Boolean disableLocalAuth) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -84,4 +191,69 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("computeLocation", computeLocation()); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("resourceId", resourceId()); + jsonWriter.writeBooleanField("disableLocalAuth", disableLocalAuth()); + jsonWriter.writeStringField("computeType", this.computeType == null ? null : this.computeType.toString()); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ComputeInstance from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ComputeInstance if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ComputeInstance. + */ + public static ComputeInstance fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ComputeInstance deserializedComputeInstance = new ComputeInstance(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("computeLocation".equals(fieldName)) { + deserializedComputeInstance.withComputeLocation(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedComputeInstance.provisioningState = ProvisioningState.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedComputeInstance.withDescription(reader.getString()); + } else if ("createdOn".equals(fieldName)) { + deserializedComputeInstance.createdOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("modifiedOn".equals(fieldName)) { + deserializedComputeInstance.modifiedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("resourceId".equals(fieldName)) { + deserializedComputeInstance.withResourceId(reader.getString()); + } else if ("provisioningErrors".equals(fieldName)) { + List provisioningErrors + = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); + deserializedComputeInstance.provisioningErrors = provisioningErrors; + } else if ("isAttachedCompute".equals(fieldName)) { + deserializedComputeInstance.isAttachedCompute = reader.getNullable(JsonReader::getBoolean); + } else if ("disableLocalAuth".equals(fieldName)) { + deserializedComputeInstance.withDisableLocalAuth(reader.getNullable(JsonReader::getBoolean)); + } else if ("computeType".equals(fieldName)) { + deserializedComputeInstance.computeType = ComputeType.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedComputeInstance.properties = ComputeInstanceProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedComputeInstance; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceApplication.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceApplication.java index efaf0271b71eb..cdf3190545525 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceApplication.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceApplication.java @@ -5,30 +5,36 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Defines an Aml Instance application and its connectivity endpoint URI. */ +/** + * Defines an Aml Instance application and its connectivity endpoint URI. + */ @Fluent -public final class ComputeInstanceApplication { +public final class ComputeInstanceApplication implements JsonSerializable { /* * Name of the ComputeInstance application. */ - @JsonProperty(value = "displayName") private String displayName; /* * Application' endpoint URI. */ - @JsonProperty(value = "endpointUri") private String endpointUri; - /** Creates an instance of ComputeInstanceApplication class. */ + /** + * Creates an instance of ComputeInstanceApplication class. + */ public ComputeInstanceApplication() { } /** * Get the displayName property: Name of the ComputeInstance application. - * + * * @return the displayName value. */ public String displayName() { @@ -37,7 +43,7 @@ public String displayName() { /** * Set the displayName property: Name of the ComputeInstance application. - * + * * @param displayName the displayName value to set. * @return the ComputeInstanceApplication object itself. */ @@ -48,7 +54,7 @@ public ComputeInstanceApplication withDisplayName(String displayName) { /** * Get the endpointUri property: Application' endpoint URI. - * + * * @return the endpointUri value. */ public String endpointUri() { @@ -57,7 +63,7 @@ public String endpointUri() { /** * Set the endpointUri property: Application' endpoint URI. - * + * * @param endpointUri the endpointUri value to set. * @return the ComputeInstanceApplication object itself. */ @@ -68,9 +74,48 @@ public ComputeInstanceApplication withEndpointUri(String endpointUri) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("endpointUri", this.endpointUri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ComputeInstanceApplication from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ComputeInstanceApplication if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ComputeInstanceApplication. + */ + public static ComputeInstanceApplication fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ComputeInstanceApplication deserializedComputeInstanceApplication = new ComputeInstanceApplication(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("displayName".equals(fieldName)) { + deserializedComputeInstanceApplication.displayName = reader.getString(); + } else if ("endpointUri".equals(fieldName)) { + deserializedComputeInstanceApplication.endpointUri = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedComputeInstanceApplication; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceAuthorizationType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceAuthorizationType.java index 998bf39f0692e..f70a147ad7865 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceAuthorizationType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceAuthorizationType.java @@ -5,21 +5,22 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** * Compute Instance Authorization type. - * - *

The Compute Instance Authorization type. Available values are personal (default). + * + * The Compute Instance Authorization type. Available values are personal (default). */ public final class ComputeInstanceAuthorizationType extends ExpandableStringEnum { - /** Static value personal for ComputeInstanceAuthorizationType. */ + /** + * Static value personal for ComputeInstanceAuthorizationType. + */ public static final ComputeInstanceAuthorizationType PERSONAL = fromString("personal"); /** * Creates a new instance of ComputeInstanceAuthorizationType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -28,18 +29,17 @@ public ComputeInstanceAuthorizationType() { /** * Creates or finds a ComputeInstanceAuthorizationType from its string representation. - * + * * @param name a name to look for. * @return the corresponding ComputeInstanceAuthorizationType. */ - @JsonCreator public static ComputeInstanceAuthorizationType fromString(String name) { return fromString(name, ComputeInstanceAuthorizationType.class); } /** * Gets known ComputeInstanceAuthorizationType values. - * + * * @return known ComputeInstanceAuthorizationType values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceConnectivityEndpoints.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceConnectivityEndpoints.java index f0cb84e7f4058..8332cf71567a4 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceConnectivityEndpoints.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceConnectivityEndpoints.java @@ -5,30 +5,37 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Defines all connectivity endpoints and properties for an ComputeInstance. */ +/** + * Defines all connectivity endpoints and properties for an ComputeInstance. + */ @Immutable -public final class ComputeInstanceConnectivityEndpoints { +public final class ComputeInstanceConnectivityEndpoints + implements JsonSerializable { /* * Public IP Address of this ComputeInstance. */ - @JsonProperty(value = "publicIpAddress", access = JsonProperty.Access.WRITE_ONLY) private String publicIpAddress; /* * Private IP Address of this ComputeInstance (local to the VNET in which the compute instance is deployed). */ - @JsonProperty(value = "privateIpAddress", access = JsonProperty.Access.WRITE_ONLY) private String privateIpAddress; - /** Creates an instance of ComputeInstanceConnectivityEndpoints class. */ + /** + * Creates an instance of ComputeInstanceConnectivityEndpoints class. + */ public ComputeInstanceConnectivityEndpoints() { } /** * Get the publicIpAddress property: Public IP Address of this ComputeInstance. - * + * * @return the publicIpAddress value. */ public String publicIpAddress() { @@ -38,7 +45,7 @@ public String publicIpAddress() { /** * Get the privateIpAddress property: Private IP Address of this ComputeInstance (local to the VNET in which the * compute instance is deployed). - * + * * @return the privateIpAddress value. */ public String privateIpAddress() { @@ -47,9 +54,47 @@ public String privateIpAddress() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ComputeInstanceConnectivityEndpoints from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ComputeInstanceConnectivityEndpoints if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ComputeInstanceConnectivityEndpoints. + */ + public static ComputeInstanceConnectivityEndpoints fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ComputeInstanceConnectivityEndpoints deserializedComputeInstanceConnectivityEndpoints + = new ComputeInstanceConnectivityEndpoints(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("publicIpAddress".equals(fieldName)) { + deserializedComputeInstanceConnectivityEndpoints.publicIpAddress = reader.getString(); + } else if ("privateIpAddress".equals(fieldName)) { + deserializedComputeInstanceConnectivityEndpoints.privateIpAddress = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedComputeInstanceConnectivityEndpoints; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceContainer.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceContainer.java index e9b49d9885472..6460065125a0f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceContainer.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceContainer.java @@ -5,55 +5,57 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** Defines an Aml Instance container. */ +/** + * Defines an Aml Instance container. + */ @Fluent -public final class ComputeInstanceContainer { +public final class ComputeInstanceContainer implements JsonSerializable { /* * Name of the ComputeInstance container. */ - @JsonProperty(value = "name") private String name; /* * Auto save settings. */ - @JsonProperty(value = "autosave") private Autosave autosave; /* * Information of GPU. */ - @JsonProperty(value = "gpu") private String gpu; /* * network of this container. */ - @JsonProperty(value = "network") private Network network; /* * Environment information of this container. */ - @JsonProperty(value = "environment") private ComputeInstanceEnvironmentInfo environment; /* * services of this containers. */ - @JsonProperty(value = "services", access = JsonProperty.Access.WRITE_ONLY) private List services; - /** Creates an instance of ComputeInstanceContainer class. */ + /** + * Creates an instance of ComputeInstanceContainer class. + */ public ComputeInstanceContainer() { } /** * Get the name property: Name of the ComputeInstance container. - * + * * @return the name value. */ public String name() { @@ -62,7 +64,7 @@ public String name() { /** * Set the name property: Name of the ComputeInstance container. - * + * * @param name the name value to set. * @return the ComputeInstanceContainer object itself. */ @@ -73,7 +75,7 @@ public ComputeInstanceContainer withName(String name) { /** * Get the autosave property: Auto save settings. - * + * * @return the autosave value. */ public Autosave autosave() { @@ -82,7 +84,7 @@ public Autosave autosave() { /** * Set the autosave property: Auto save settings. - * + * * @param autosave the autosave value to set. * @return the ComputeInstanceContainer object itself. */ @@ -93,7 +95,7 @@ public ComputeInstanceContainer withAutosave(Autosave autosave) { /** * Get the gpu property: Information of GPU. - * + * * @return the gpu value. */ public String gpu() { @@ -102,7 +104,7 @@ public String gpu() { /** * Set the gpu property: Information of GPU. - * + * * @param gpu the gpu value to set. * @return the ComputeInstanceContainer object itself. */ @@ -113,7 +115,7 @@ public ComputeInstanceContainer withGpu(String gpu) { /** * Get the network property: network of this container. - * + * * @return the network value. */ public Network network() { @@ -122,7 +124,7 @@ public Network network() { /** * Set the network property: network of this container. - * + * * @param network the network value to set. * @return the ComputeInstanceContainer object itself. */ @@ -133,7 +135,7 @@ public ComputeInstanceContainer withNetwork(Network network) { /** * Get the environment property: Environment information of this container. - * + * * @return the environment value. */ public ComputeInstanceEnvironmentInfo environment() { @@ -142,7 +144,7 @@ public ComputeInstanceEnvironmentInfo environment() { /** * Set the environment property: Environment information of this container. - * + * * @param environment the environment value to set. * @return the ComputeInstanceContainer object itself. */ @@ -153,7 +155,7 @@ public ComputeInstanceContainer withEnvironment(ComputeInstanceEnvironmentInfo e /** * Get the services property: services of this containers. - * + * * @return the services value. */ public List services() { @@ -162,7 +164,7 @@ public List services() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -170,4 +172,55 @@ public void validate() { environment().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("autosave", this.autosave == null ? null : this.autosave.toString()); + jsonWriter.writeStringField("gpu", this.gpu); + jsonWriter.writeStringField("network", this.network == null ? null : this.network.toString()); + jsonWriter.writeJsonField("environment", this.environment); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ComputeInstanceContainer from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ComputeInstanceContainer if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ComputeInstanceContainer. + */ + public static ComputeInstanceContainer fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ComputeInstanceContainer deserializedComputeInstanceContainer = new ComputeInstanceContainer(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedComputeInstanceContainer.name = reader.getString(); + } else if ("autosave".equals(fieldName)) { + deserializedComputeInstanceContainer.autosave = Autosave.fromString(reader.getString()); + } else if ("gpu".equals(fieldName)) { + deserializedComputeInstanceContainer.gpu = reader.getString(); + } else if ("network".equals(fieldName)) { + deserializedComputeInstanceContainer.network = Network.fromString(reader.getString()); + } else if ("environment".equals(fieldName)) { + deserializedComputeInstanceContainer.environment = ComputeInstanceEnvironmentInfo.fromJson(reader); + } else if ("services".equals(fieldName)) { + List services = reader.readArray(reader1 -> reader1.readUntyped()); + deserializedComputeInstanceContainer.services = services; + } else { + reader.skipChildren(); + } + } + + return deserializedComputeInstanceContainer; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceCreatedBy.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceCreatedBy.java index 91652991d01ba..0af4b6db865d2 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceCreatedBy.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceCreatedBy.java @@ -5,36 +5,41 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Describes information on user who created this ComputeInstance. */ +/** + * Describes information on user who created this ComputeInstance. + */ @Immutable -public final class ComputeInstanceCreatedBy { +public final class ComputeInstanceCreatedBy implements JsonSerializable { /* * Name of the user. */ - @JsonProperty(value = "userName", access = JsonProperty.Access.WRITE_ONLY) private String username; /* * Uniquely identifies user' Azure Active Directory organization. */ - @JsonProperty(value = "userOrgId", access = JsonProperty.Access.WRITE_ONLY) private String userOrgId; /* * Uniquely identifies the user within his/her organization. */ - @JsonProperty(value = "userId", access = JsonProperty.Access.WRITE_ONLY) private String userId; - /** Creates an instance of ComputeInstanceCreatedBy class. */ + /** + * Creates an instance of ComputeInstanceCreatedBy class. + */ public ComputeInstanceCreatedBy() { } /** * Get the username property: Name of the user. - * + * * @return the username value. */ public String username() { @@ -43,7 +48,7 @@ public String username() { /** * Get the userOrgId property: Uniquely identifies user' Azure Active Directory organization. - * + * * @return the userOrgId value. */ public String userOrgId() { @@ -52,7 +57,7 @@ public String userOrgId() { /** * Get the userId property: Uniquely identifies the user within his/her organization. - * + * * @return the userId value. */ public String userId() { @@ -61,9 +66,48 @@ public String userId() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ComputeInstanceCreatedBy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ComputeInstanceCreatedBy if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ComputeInstanceCreatedBy. + */ + public static ComputeInstanceCreatedBy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ComputeInstanceCreatedBy deserializedComputeInstanceCreatedBy = new ComputeInstanceCreatedBy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("userName".equals(fieldName)) { + deserializedComputeInstanceCreatedBy.username = reader.getString(); + } else if ("userOrgId".equals(fieldName)) { + deserializedComputeInstanceCreatedBy.userOrgId = reader.getString(); + } else if ("userId".equals(fieldName)) { + deserializedComputeInstanceCreatedBy.userId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedComputeInstanceCreatedBy; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceDataDisk.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceDataDisk.java index 3c23d8dd308dd..159463c01d798 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceDataDisk.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceDataDisk.java @@ -5,45 +5,47 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Defines an Aml Instance DataDisk. */ +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines an Aml Instance DataDisk. + */ @Fluent -public final class ComputeInstanceDataDisk { +public final class ComputeInstanceDataDisk implements JsonSerializable { /* * Caching type of Data Disk. */ - @JsonProperty(value = "caching") private Caching caching; /* * The initial disk size in gigabytes. */ - @JsonProperty(value = "diskSizeGB") private Integer diskSizeGB; /* - * The logical unit number. - * * The lun is used to uniquely identify each data disk. If attaching multiple disks, each should have a distinct * lun. */ - @JsonProperty(value = "lun") private Integer lun; /* * type of this storage account. */ - @JsonProperty(value = "storageAccountType") private StorageAccountType storageAccountType; - /** Creates an instance of ComputeInstanceDataDisk class. */ + /** + * Creates an instance of ComputeInstanceDataDisk class. + */ public ComputeInstanceDataDisk() { } /** * Get the caching property: Caching type of Data Disk. - * + * * @return the caching value. */ public Caching caching() { @@ -52,7 +54,7 @@ public Caching caching() { /** * Set the caching property: Caching type of Data Disk. - * + * * @param caching the caching value to set. * @return the ComputeInstanceDataDisk object itself. */ @@ -63,7 +65,7 @@ public ComputeInstanceDataDisk withCaching(Caching caching) { /** * Get the diskSizeGB property: The initial disk size in gigabytes. - * + * * @return the diskSizeGB value. */ public Integer diskSizeGB() { @@ -72,7 +74,7 @@ public Integer diskSizeGB() { /** * Set the diskSizeGB property: The initial disk size in gigabytes. - * + * * @param diskSizeGB the diskSizeGB value to set. * @return the ComputeInstanceDataDisk object itself. */ @@ -82,11 +84,9 @@ public ComputeInstanceDataDisk withDiskSizeGB(Integer diskSizeGB) { } /** - * Get the lun property: The logical unit number. - * - *

The lun is used to uniquely identify each data disk. If attaching multiple disks, each should have a distinct - * lun. - * + * Get the lun property: The lun is used to uniquely identify each data disk. If attaching multiple disks, each + * should have a distinct lun. + * * @return the lun value. */ public Integer lun() { @@ -94,11 +94,9 @@ public Integer lun() { } /** - * Set the lun property: The logical unit number. - * - *

The lun is used to uniquely identify each data disk. If attaching multiple disks, each should have a distinct - * lun. - * + * Set the lun property: The lun is used to uniquely identify each data disk. If attaching multiple disks, each + * should have a distinct lun. + * * @param lun the lun value to set. * @return the ComputeInstanceDataDisk object itself. */ @@ -109,7 +107,7 @@ public ComputeInstanceDataDisk withLun(Integer lun) { /** * Get the storageAccountType property: type of this storage account. - * + * * @return the storageAccountType value. */ public StorageAccountType storageAccountType() { @@ -118,7 +116,7 @@ public StorageAccountType storageAccountType() { /** * Set the storageAccountType property: type of this storage account. - * + * * @param storageAccountType the storageAccountType value to set. * @return the ComputeInstanceDataDisk object itself. */ @@ -129,9 +127,56 @@ public ComputeInstanceDataDisk withStorageAccountType(StorageAccountType storage /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("caching", this.caching == null ? null : this.caching.toString()); + jsonWriter.writeNumberField("diskSizeGB", this.diskSizeGB); + jsonWriter.writeNumberField("lun", this.lun); + jsonWriter.writeStringField("storageAccountType", + this.storageAccountType == null ? null : this.storageAccountType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ComputeInstanceDataDisk from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ComputeInstanceDataDisk if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ComputeInstanceDataDisk. + */ + public static ComputeInstanceDataDisk fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ComputeInstanceDataDisk deserializedComputeInstanceDataDisk = new ComputeInstanceDataDisk(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("caching".equals(fieldName)) { + deserializedComputeInstanceDataDisk.caching = Caching.fromString(reader.getString()); + } else if ("diskSizeGB".equals(fieldName)) { + deserializedComputeInstanceDataDisk.diskSizeGB = reader.getNullable(JsonReader::getInt); + } else if ("lun".equals(fieldName)) { + deserializedComputeInstanceDataDisk.lun = reader.getNullable(JsonReader::getInt); + } else if ("storageAccountType".equals(fieldName)) { + deserializedComputeInstanceDataDisk.storageAccountType + = StorageAccountType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedComputeInstanceDataDisk; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceDataMount.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceDataMount.java index b5c6decae93df..0dd370593ab47 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceDataMount.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceDataMount.java @@ -5,75 +5,74 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; -/** Defines an Aml Instance DataMount. */ +/** + * Defines an Aml Instance DataMount. + */ @Fluent -public final class ComputeInstanceDataMount { +public final class ComputeInstanceDataMount implements JsonSerializable { /* * Source of the ComputeInstance data mount. */ - @JsonProperty(value = "source") private String source; /* * Data source type. */ - @JsonProperty(value = "sourceType") private SourceType sourceType; /* * name of the ComputeInstance data mount. */ - @JsonProperty(value = "mountName") private String mountName; /* * Mount Action. */ - @JsonProperty(value = "mountAction") private MountAction mountAction; /* * who this data mount created by. */ - @JsonProperty(value = "createdBy") private String createdBy; /* * Path of this data mount. */ - @JsonProperty(value = "mountPath") private String mountPath; /* * Mount state. */ - @JsonProperty(value = "mountState") private MountState mountState; /* - * Mounted time. - * * The time when the disk mounted. */ - @JsonProperty(value = "mountedOn") private OffsetDateTime mountedOn; /* * Error of this data mount. */ - @JsonProperty(value = "error") private String error; - /** Creates an instance of ComputeInstanceDataMount class. */ + /** + * Creates an instance of ComputeInstanceDataMount class. + */ public ComputeInstanceDataMount() { } /** * Get the source property: Source of the ComputeInstance data mount. - * + * * @return the source value. */ public String source() { @@ -82,7 +81,7 @@ public String source() { /** * Set the source property: Source of the ComputeInstance data mount. - * + * * @param source the source value to set. * @return the ComputeInstanceDataMount object itself. */ @@ -93,7 +92,7 @@ public ComputeInstanceDataMount withSource(String source) { /** * Get the sourceType property: Data source type. - * + * * @return the sourceType value. */ public SourceType sourceType() { @@ -102,7 +101,7 @@ public SourceType sourceType() { /** * Set the sourceType property: Data source type. - * + * * @param sourceType the sourceType value to set. * @return the ComputeInstanceDataMount object itself. */ @@ -113,7 +112,7 @@ public ComputeInstanceDataMount withSourceType(SourceType sourceType) { /** * Get the mountName property: name of the ComputeInstance data mount. - * + * * @return the mountName value. */ public String mountName() { @@ -122,7 +121,7 @@ public String mountName() { /** * Set the mountName property: name of the ComputeInstance data mount. - * + * * @param mountName the mountName value to set. * @return the ComputeInstanceDataMount object itself. */ @@ -133,7 +132,7 @@ public ComputeInstanceDataMount withMountName(String mountName) { /** * Get the mountAction property: Mount Action. - * + * * @return the mountAction value. */ public MountAction mountAction() { @@ -142,7 +141,7 @@ public MountAction mountAction() { /** * Set the mountAction property: Mount Action. - * + * * @param mountAction the mountAction value to set. * @return the ComputeInstanceDataMount object itself. */ @@ -153,7 +152,7 @@ public ComputeInstanceDataMount withMountAction(MountAction mountAction) { /** * Get the createdBy property: who this data mount created by. - * + * * @return the createdBy value. */ public String createdBy() { @@ -162,7 +161,7 @@ public String createdBy() { /** * Set the createdBy property: who this data mount created by. - * + * * @param createdBy the createdBy value to set. * @return the ComputeInstanceDataMount object itself. */ @@ -173,7 +172,7 @@ public ComputeInstanceDataMount withCreatedBy(String createdBy) { /** * Get the mountPath property: Path of this data mount. - * + * * @return the mountPath value. */ public String mountPath() { @@ -182,7 +181,7 @@ public String mountPath() { /** * Set the mountPath property: Path of this data mount. - * + * * @param mountPath the mountPath value to set. * @return the ComputeInstanceDataMount object itself. */ @@ -193,7 +192,7 @@ public ComputeInstanceDataMount withMountPath(String mountPath) { /** * Get the mountState property: Mount state. - * + * * @return the mountState value. */ public MountState mountState() { @@ -202,7 +201,7 @@ public MountState mountState() { /** * Set the mountState property: Mount state. - * + * * @param mountState the mountState value to set. * @return the ComputeInstanceDataMount object itself. */ @@ -212,10 +211,8 @@ public ComputeInstanceDataMount withMountState(MountState mountState) { } /** - * Get the mountedOn property: Mounted time. - * - *

The time when the disk mounted. - * + * Get the mountedOn property: The time when the disk mounted. + * * @return the mountedOn value. */ public OffsetDateTime mountedOn() { @@ -223,10 +220,8 @@ public OffsetDateTime mountedOn() { } /** - * Set the mountedOn property: Mounted time. - * - *

The time when the disk mounted. - * + * Set the mountedOn property: The time when the disk mounted. + * * @param mountedOn the mountedOn value to set. * @return the ComputeInstanceDataMount object itself. */ @@ -237,7 +232,7 @@ public ComputeInstanceDataMount withMountedOn(OffsetDateTime mountedOn) { /** * Get the error property: Error of this data mount. - * + * * @return the error value. */ public String error() { @@ -246,7 +241,7 @@ public String error() { /** * Set the error property: Error of this data mount. - * + * * @param error the error value to set. * @return the ComputeInstanceDataMount object itself. */ @@ -257,9 +252,71 @@ public ComputeInstanceDataMount withError(String error) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("source", this.source); + jsonWriter.writeStringField("sourceType", this.sourceType == null ? null : this.sourceType.toString()); + jsonWriter.writeStringField("mountName", this.mountName); + jsonWriter.writeStringField("mountAction", this.mountAction == null ? null : this.mountAction.toString()); + jsonWriter.writeStringField("createdBy", this.createdBy); + jsonWriter.writeStringField("mountPath", this.mountPath); + jsonWriter.writeStringField("mountState", this.mountState == null ? null : this.mountState.toString()); + jsonWriter.writeStringField("mountedOn", + this.mountedOn == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.mountedOn)); + jsonWriter.writeStringField("error", this.error); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ComputeInstanceDataMount from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ComputeInstanceDataMount if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ComputeInstanceDataMount. + */ + public static ComputeInstanceDataMount fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ComputeInstanceDataMount deserializedComputeInstanceDataMount = new ComputeInstanceDataMount(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("source".equals(fieldName)) { + deserializedComputeInstanceDataMount.source = reader.getString(); + } else if ("sourceType".equals(fieldName)) { + deserializedComputeInstanceDataMount.sourceType = SourceType.fromString(reader.getString()); + } else if ("mountName".equals(fieldName)) { + deserializedComputeInstanceDataMount.mountName = reader.getString(); + } else if ("mountAction".equals(fieldName)) { + deserializedComputeInstanceDataMount.mountAction = MountAction.fromString(reader.getString()); + } else if ("createdBy".equals(fieldName)) { + deserializedComputeInstanceDataMount.createdBy = reader.getString(); + } else if ("mountPath".equals(fieldName)) { + deserializedComputeInstanceDataMount.mountPath = reader.getString(); + } else if ("mountState".equals(fieldName)) { + deserializedComputeInstanceDataMount.mountState = MountState.fromString(reader.getString()); + } else if ("mountedOn".equals(fieldName)) { + deserializedComputeInstanceDataMount.mountedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("error".equals(fieldName)) { + deserializedComputeInstanceDataMount.error = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedComputeInstanceDataMount; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceEnvironmentInfo.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceEnvironmentInfo.java index d0e05ed76298f..20afb15c2286f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceEnvironmentInfo.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceEnvironmentInfo.java @@ -5,30 +5,36 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Environment information. */ +/** + * Environment information. + */ @Fluent -public final class ComputeInstanceEnvironmentInfo { +public final class ComputeInstanceEnvironmentInfo implements JsonSerializable { /* * name of environment. */ - @JsonProperty(value = "name") private String name; /* * version of environment. */ - @JsonProperty(value = "version") private String version; - /** Creates an instance of ComputeInstanceEnvironmentInfo class. */ + /** + * Creates an instance of ComputeInstanceEnvironmentInfo class. + */ public ComputeInstanceEnvironmentInfo() { } /** * Get the name property: name of environment. - * + * * @return the name value. */ public String name() { @@ -37,7 +43,7 @@ public String name() { /** * Set the name property: name of environment. - * + * * @param name the name value to set. * @return the ComputeInstanceEnvironmentInfo object itself. */ @@ -48,7 +54,7 @@ public ComputeInstanceEnvironmentInfo withName(String name) { /** * Get the version property: version of environment. - * + * * @return the version value. */ public String version() { @@ -57,7 +63,7 @@ public String version() { /** * Set the version property: version of environment. - * + * * @param version the version value to set. * @return the ComputeInstanceEnvironmentInfo object itself. */ @@ -68,9 +74,49 @@ public ComputeInstanceEnvironmentInfo withVersion(String version) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("version", this.version); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ComputeInstanceEnvironmentInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ComputeInstanceEnvironmentInfo if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ComputeInstanceEnvironmentInfo. + */ + public static ComputeInstanceEnvironmentInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ComputeInstanceEnvironmentInfo deserializedComputeInstanceEnvironmentInfo + = new ComputeInstanceEnvironmentInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedComputeInstanceEnvironmentInfo.name = reader.getString(); + } else if ("version".equals(fieldName)) { + deserializedComputeInstanceEnvironmentInfo.version = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedComputeInstanceEnvironmentInfo; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceLastOperation.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceLastOperation.java index 3f656ff40efca..e90c944896588 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceLastOperation.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceLastOperation.java @@ -5,43 +5,49 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; -/** The last operation on ComputeInstance. */ +/** + * The last operation on ComputeInstance. + */ @Fluent -public final class ComputeInstanceLastOperation { +public final class ComputeInstanceLastOperation implements JsonSerializable { /* * Name of the last operation. */ - @JsonProperty(value = "operationName") private OperationName operationName; /* * Time of the last operation. */ - @JsonProperty(value = "operationTime") private OffsetDateTime operationTime; /* * Operation status. */ - @JsonProperty(value = "operationStatus") private OperationStatus operationStatus; /* * Trigger of operation. */ - @JsonProperty(value = "operationTrigger") private OperationTrigger operationTrigger; - /** Creates an instance of ComputeInstanceLastOperation class. */ + /** + * Creates an instance of ComputeInstanceLastOperation class. + */ public ComputeInstanceLastOperation() { } /** * Get the operationName property: Name of the last operation. - * + * * @return the operationName value. */ public OperationName operationName() { @@ -50,7 +56,7 @@ public OperationName operationName() { /** * Set the operationName property: Name of the last operation. - * + * * @param operationName the operationName value to set. * @return the ComputeInstanceLastOperation object itself. */ @@ -61,7 +67,7 @@ public ComputeInstanceLastOperation withOperationName(OperationName operationNam /** * Get the operationTime property: Time of the last operation. - * + * * @return the operationTime value. */ public OffsetDateTime operationTime() { @@ -70,7 +76,7 @@ public OffsetDateTime operationTime() { /** * Set the operationTime property: Time of the last operation. - * + * * @param operationTime the operationTime value to set. * @return the ComputeInstanceLastOperation object itself. */ @@ -81,7 +87,7 @@ public ComputeInstanceLastOperation withOperationTime(OffsetDateTime operationTi /** * Get the operationStatus property: Operation status. - * + * * @return the operationStatus value. */ public OperationStatus operationStatus() { @@ -90,7 +96,7 @@ public OperationStatus operationStatus() { /** * Set the operationStatus property: Operation status. - * + * * @param operationStatus the operationStatus value to set. * @return the ComputeInstanceLastOperation object itself. */ @@ -101,7 +107,7 @@ public ComputeInstanceLastOperation withOperationStatus(OperationStatus operatio /** * Get the operationTrigger property: Trigger of operation. - * + * * @return the operationTrigger value. */ public OperationTrigger operationTrigger() { @@ -110,7 +116,7 @@ public OperationTrigger operationTrigger() { /** * Set the operationTrigger property: Trigger of operation. - * + * * @param operationTrigger the operationTrigger value to set. * @return the ComputeInstanceLastOperation object itself. */ @@ -121,9 +127,61 @@ public ComputeInstanceLastOperation withOperationTrigger(OperationTrigger operat /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("operationName", this.operationName == null ? null : this.operationName.toString()); + jsonWriter.writeStringField("operationTime", + this.operationTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.operationTime)); + jsonWriter.writeStringField("operationStatus", + this.operationStatus == null ? null : this.operationStatus.toString()); + jsonWriter.writeStringField("operationTrigger", + this.operationTrigger == null ? null : this.operationTrigger.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ComputeInstanceLastOperation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ComputeInstanceLastOperation if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ComputeInstanceLastOperation. + */ + public static ComputeInstanceLastOperation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ComputeInstanceLastOperation deserializedComputeInstanceLastOperation = new ComputeInstanceLastOperation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operationName".equals(fieldName)) { + deserializedComputeInstanceLastOperation.operationName + = OperationName.fromString(reader.getString()); + } else if ("operationTime".equals(fieldName)) { + deserializedComputeInstanceLastOperation.operationTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("operationStatus".equals(fieldName)) { + deserializedComputeInstanceLastOperation.operationStatus + = OperationStatus.fromString(reader.getString()); + } else if ("operationTrigger".equals(fieldName)) { + deserializedComputeInstanceLastOperation.operationTrigger + = OperationTrigger.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedComputeInstanceLastOperation; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceProperties.java index c5332ebf01e8b..76d16e48a75a0 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceProperties.java @@ -6,145 +6,136 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.exception.ManagementError; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** Compute Instance properties. */ +/** + * Compute Instance properties. + */ @Fluent -public final class ComputeInstanceProperties { +public final class ComputeInstanceProperties implements JsonSerializable { /* * Virtual Machine Size */ - @JsonProperty(value = "vmSize") private String vmSize; /* * Virtual network subnet resource ID the compute nodes belong to. */ - @JsonProperty(value = "subnet") private ResourceId subnet; /* - * Sharing policy for applications on this compute instance - * * Policy for sharing applications on this compute instance among users of parent workspace. If Personal, only the - * creator can access applications on this compute instance. When Shared, any workspace user can access - * applications on this instance depending on his/her assigned role. + * creator can access applications on this compute instance. When Shared, any workspace user can access applications + * on this instance depending on his/her assigned role. */ - @JsonProperty(value = "applicationSharingPolicy") private ApplicationSharingPolicy applicationSharingPolicy; /* * Specifies policy and settings for SSH access. */ - @JsonProperty(value = "sshSettings") private ComputeInstanceSshSettings sshSettings; + /* + * List of Custom Services added to the compute. + */ + private List customServices; + + /* + * Returns metadata about the operating system image for this compute instance. + */ + private ImageMetadata osImageMetadata; + /* * Describes all connectivity endpoints available for this ComputeInstance. */ - @JsonProperty(value = "connectivityEndpoints", access = JsonProperty.Access.WRITE_ONLY) private ComputeInstanceConnectivityEndpoints connectivityEndpoints; /* * Describes available applications and their endpoints on this ComputeInstance. */ - @JsonProperty(value = "applications", access = JsonProperty.Access.WRITE_ONLY) private List applications; /* * Describes information on user who created this ComputeInstance. */ - @JsonProperty(value = "createdBy", access = JsonProperty.Access.WRITE_ONLY) private ComputeInstanceCreatedBy createdBy; /* - * Errors. - * * Collection of errors encountered on this ComputeInstance. */ - @JsonProperty(value = "errors", access = JsonProperty.Access.WRITE_ONLY) private List errors; /* * The current state of this ComputeInstance. */ - @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) private ComputeInstanceState state; /* - * Compute Instance Authorization type. - * * The Compute Instance Authorization type. Available values are personal (default). */ - @JsonProperty(value = "computeInstanceAuthorizationType") private ComputeInstanceAuthorizationType computeInstanceAuthorizationType; /* * Settings for a personal compute instance. */ - @JsonProperty(value = "personalComputeInstanceSettings") private PersonalComputeInstanceSettings personalComputeInstanceSettings; /* * Details of customized scripts to execute for setting up the cluster. */ - @JsonProperty(value = "setupScripts") private SetupScripts setupScripts; /* * The last operation on ComputeInstance. */ - @JsonProperty(value = "lastOperation", access = JsonProperty.Access.WRITE_ONLY) private ComputeInstanceLastOperation lastOperation; /* * The list of schedules to be applied on the computes. */ - @JsonProperty(value = "schedules", access = JsonProperty.Access.WRITE_ONLY) private ComputeSchedules schedules; /* - * Enable node public IP. - * - * 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. + * 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. */ - @JsonProperty(value = "enableNodePublicIp") private Boolean enableNodePublicIp; /* * Describes informations of containers on this ComputeInstance. */ - @JsonProperty(value = "containers", access = JsonProperty.Access.WRITE_ONLY) private List containers; /* * Describes informations of dataDisks on this ComputeInstance. */ - @JsonProperty(value = "dataDisks", access = JsonProperty.Access.WRITE_ONLY) private List dataDisks; /* * Describes informations of dataMounts on this ComputeInstance. */ - @JsonProperty(value = "dataMounts", access = JsonProperty.Access.WRITE_ONLY) private List dataMounts; /* * ComputeInstance version. */ - @JsonProperty(value = "versions", access = JsonProperty.Access.WRITE_ONLY) private ComputeInstanceVersion versions; - /** Creates an instance of ComputeInstanceProperties class. */ + /** + * Creates an instance of ComputeInstanceProperties class. + */ public ComputeInstanceProperties() { } /** * Get the vmSize property: Virtual Machine Size. - * + * * @return the vmSize value. */ public String vmSize() { @@ -153,7 +144,7 @@ public String vmSize() { /** * Set the vmSize property: Virtual Machine Size. - * + * * @param vmSize the vmSize value to set. * @return the ComputeInstanceProperties object itself. */ @@ -164,7 +155,7 @@ public ComputeInstanceProperties withVmSize(String vmSize) { /** * Get the subnet property: Virtual network subnet resource ID the compute nodes belong to. - * + * * @return the subnet value. */ public ResourceId subnet() { @@ -173,7 +164,7 @@ public ResourceId subnet() { /** * Set the subnet property: Virtual network subnet resource ID the compute nodes belong to. - * + * * @param subnet the subnet value to set. * @return the ComputeInstanceProperties object itself. */ @@ -183,12 +174,10 @@ public ComputeInstanceProperties withSubnet(ResourceId subnet) { } /** - * Get the applicationSharingPolicy property: Sharing policy for applications on this compute instance - * - *

Policy for sharing applications on this compute instance among users of parent workspace. If Personal, only - * the creator can access applications on this compute instance. When Shared, any workspace user can access - * applications on this instance depending on his/her assigned role. - * + * Get the applicationSharingPolicy property: Policy for sharing applications on this compute instance among users + * of parent workspace. If Personal, only the creator can access applications on this compute instance. When Shared, + * any workspace user can access applications on this instance depending on his/her assigned role. + * * @return the applicationSharingPolicy value. */ public ApplicationSharingPolicy applicationSharingPolicy() { @@ -196,12 +185,10 @@ public ApplicationSharingPolicy applicationSharingPolicy() { } /** - * Set the applicationSharingPolicy property: Sharing policy for applications on this compute instance - * - *

Policy for sharing applications on this compute instance among users of parent workspace. If Personal, only - * the creator can access applications on this compute instance. When Shared, any workspace user can access - * applications on this instance depending on his/her assigned role. - * + * Set the applicationSharingPolicy property: Policy for sharing applications on this compute instance among users + * of parent workspace. If Personal, only the creator can access applications on this compute instance. When Shared, + * any workspace user can access applications on this instance depending on his/her assigned role. + * * @param applicationSharingPolicy the applicationSharingPolicy value to set. * @return the ComputeInstanceProperties object itself. */ @@ -212,7 +199,7 @@ public ComputeInstanceProperties withApplicationSharingPolicy(ApplicationSharing /** * Get the sshSettings property: Specifies policy and settings for SSH access. - * + * * @return the sshSettings value. */ public ComputeInstanceSshSettings sshSettings() { @@ -221,7 +208,7 @@ public ComputeInstanceSshSettings sshSettings() { /** * Set the sshSettings property: Specifies policy and settings for SSH access. - * + * * @param sshSettings the sshSettings value to set. * @return the ComputeInstanceProperties object itself. */ @@ -230,9 +217,38 @@ public ComputeInstanceProperties withSshSettings(ComputeInstanceSshSettings sshS return this; } + /** + * Get the customServices property: List of Custom Services added to the compute. + * + * @return the customServices value. + */ + public List customServices() { + return this.customServices; + } + + /** + * Set the customServices property: List of Custom Services added to the compute. + * + * @param customServices the customServices value to set. + * @return the ComputeInstanceProperties object itself. + */ + public ComputeInstanceProperties withCustomServices(List customServices) { + this.customServices = customServices; + return this; + } + + /** + * Get the osImageMetadata property: Returns metadata about the operating system image for this compute instance. + * + * @return the osImageMetadata value. + */ + public ImageMetadata osImageMetadata() { + return this.osImageMetadata; + } + /** * Get the connectivityEndpoints property: Describes all connectivity endpoints available for this ComputeInstance. - * + * * @return the connectivityEndpoints value. */ public ComputeInstanceConnectivityEndpoints connectivityEndpoints() { @@ -241,7 +257,7 @@ public ComputeInstanceConnectivityEndpoints connectivityEndpoints() { /** * Get the applications property: Describes available applications and their endpoints on this ComputeInstance. - * + * * @return the applications value. */ public List applications() { @@ -250,7 +266,7 @@ public List applications() { /** * Get the createdBy property: Describes information on user who created this ComputeInstance. - * + * * @return the createdBy value. */ public ComputeInstanceCreatedBy createdBy() { @@ -258,10 +274,8 @@ public ComputeInstanceCreatedBy createdBy() { } /** - * Get the errors property: Errors. - * - *

Collection of errors encountered on this ComputeInstance. - * + * Get the errors property: Collection of errors encountered on this ComputeInstance. + * * @return the errors value. */ public List errors() { @@ -270,7 +284,7 @@ public List errors() { /** * Get the state property: The current state of this ComputeInstance. - * + * * @return the state value. */ public ComputeInstanceState state() { @@ -278,10 +292,9 @@ public ComputeInstanceState state() { } /** - * Get the computeInstanceAuthorizationType property: Compute Instance Authorization type. - * - *

The Compute Instance Authorization type. Available values are personal (default). - * + * Get the computeInstanceAuthorizationType property: The Compute Instance Authorization type. Available values are + * personal (default). + * * @return the computeInstanceAuthorizationType value. */ public ComputeInstanceAuthorizationType computeInstanceAuthorizationType() { @@ -289,22 +302,21 @@ public ComputeInstanceAuthorizationType computeInstanceAuthorizationType() { } /** - * Set the computeInstanceAuthorizationType property: Compute Instance Authorization type. - * - *

The Compute Instance Authorization type. Available values are personal (default). - * + * Set the computeInstanceAuthorizationType property: The Compute Instance Authorization type. Available values are + * personal (default). + * * @param computeInstanceAuthorizationType the computeInstanceAuthorizationType value to set. * @return the ComputeInstanceProperties object itself. */ - public ComputeInstanceProperties withComputeInstanceAuthorizationType( - ComputeInstanceAuthorizationType computeInstanceAuthorizationType) { + public ComputeInstanceProperties + withComputeInstanceAuthorizationType(ComputeInstanceAuthorizationType computeInstanceAuthorizationType) { this.computeInstanceAuthorizationType = computeInstanceAuthorizationType; return this; } /** * Get the personalComputeInstanceSettings property: Settings for a personal compute instance. - * + * * @return the personalComputeInstanceSettings value. */ public PersonalComputeInstanceSettings personalComputeInstanceSettings() { @@ -313,19 +325,19 @@ public PersonalComputeInstanceSettings personalComputeInstanceSettings() { /** * Set the personalComputeInstanceSettings property: Settings for a personal compute instance. - * + * * @param personalComputeInstanceSettings the personalComputeInstanceSettings value to set. * @return the ComputeInstanceProperties object itself. */ - public ComputeInstanceProperties withPersonalComputeInstanceSettings( - PersonalComputeInstanceSettings personalComputeInstanceSettings) { + public ComputeInstanceProperties + withPersonalComputeInstanceSettings(PersonalComputeInstanceSettings personalComputeInstanceSettings) { this.personalComputeInstanceSettings = personalComputeInstanceSettings; return this; } /** * Get the setupScripts property: Details of customized scripts to execute for setting up the cluster. - * + * * @return the setupScripts value. */ public SetupScripts setupScripts() { @@ -334,7 +346,7 @@ public SetupScripts setupScripts() { /** * Set the setupScripts property: Details of customized scripts to execute for setting up the cluster. - * + * * @param setupScripts the setupScripts value to set. * @return the ComputeInstanceProperties object itself. */ @@ -345,7 +357,7 @@ public ComputeInstanceProperties withSetupScripts(SetupScripts setupScripts) { /** * Get the lastOperation property: The last operation on ComputeInstance. - * + * * @return the lastOperation value. */ public ComputeInstanceLastOperation lastOperation() { @@ -354,7 +366,7 @@ public ComputeInstanceLastOperation lastOperation() { /** * Get the schedules property: The list of schedules to be applied on the computes. - * + * * @return the schedules value. */ public ComputeSchedules schedules() { @@ -362,12 +374,21 @@ public ComputeSchedules schedules() { } /** - * Get the enableNodePublicIp property: Enable node public IP. - * - *

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. - * + * Set the schedules property: The list of schedules to be applied on the computes. + * + * @param schedules the schedules value to set. + * @return the ComputeInstanceProperties object itself. + */ + public ComputeInstanceProperties withSchedules(ComputeSchedules schedules) { + this.schedules = schedules; + return this; + } + + /** + * Get the enableNodePublicIp property: 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. + * * @return the enableNodePublicIp value. */ public Boolean enableNodePublicIp() { @@ -375,12 +396,10 @@ public Boolean enableNodePublicIp() { } /** - * Set the enableNodePublicIp property: Enable node public IP. - * - *

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. - * + * Set the enableNodePublicIp property: 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. + * * @param enableNodePublicIp the enableNodePublicIp value to set. * @return the ComputeInstanceProperties object itself. */ @@ -391,7 +410,7 @@ public ComputeInstanceProperties withEnableNodePublicIp(Boolean enableNodePublic /** * Get the containers property: Describes informations of containers on this ComputeInstance. - * + * * @return the containers value. */ public List containers() { @@ -400,7 +419,7 @@ public List containers() { /** * Get the dataDisks property: Describes informations of dataDisks on this ComputeInstance. - * + * * @return the dataDisks value. */ public List dataDisks() { @@ -409,7 +428,7 @@ public List dataDisks() { /** * Get the dataMounts property: Describes informations of dataMounts on this ComputeInstance. - * + * * @return the dataMounts value. */ public List dataMounts() { @@ -418,7 +437,7 @@ public List dataMounts() { /** * Get the versions property: ComputeInstance version. - * + * * @return the versions value. */ public ComputeInstanceVersion versions() { @@ -427,7 +446,7 @@ public ComputeInstanceVersion versions() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -437,6 +456,12 @@ public void validate() { if (sshSettings() != null) { sshSettings().validate(); } + if (customServices() != null) { + customServices().forEach(e -> e.validate()); + } + if (osImageMetadata() != null) { + osImageMetadata().validate(); + } if (connectivityEndpoints() != null) { connectivityEndpoints().validate(); } @@ -471,4 +496,107 @@ public void validate() { versions().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("vmSize", this.vmSize); + jsonWriter.writeJsonField("subnet", this.subnet); + jsonWriter.writeStringField("applicationSharingPolicy", + this.applicationSharingPolicy == null ? null : this.applicationSharingPolicy.toString()); + jsonWriter.writeJsonField("sshSettings", this.sshSettings); + jsonWriter.writeArrayField("customServices", this.customServices, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("computeInstanceAuthorizationType", + this.computeInstanceAuthorizationType == null ? null : this.computeInstanceAuthorizationType.toString()); + jsonWriter.writeJsonField("personalComputeInstanceSettings", this.personalComputeInstanceSettings); + jsonWriter.writeJsonField("setupScripts", this.setupScripts); + jsonWriter.writeJsonField("schedules", this.schedules); + jsonWriter.writeBooleanField("enableNodePublicIp", this.enableNodePublicIp); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ComputeInstanceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ComputeInstanceProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ComputeInstanceProperties. + */ + public static ComputeInstanceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ComputeInstanceProperties deserializedComputeInstanceProperties = new ComputeInstanceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vmSize".equals(fieldName)) { + deserializedComputeInstanceProperties.vmSize = reader.getString(); + } else if ("subnet".equals(fieldName)) { + deserializedComputeInstanceProperties.subnet = ResourceId.fromJson(reader); + } else if ("applicationSharingPolicy".equals(fieldName)) { + deserializedComputeInstanceProperties.applicationSharingPolicy + = ApplicationSharingPolicy.fromString(reader.getString()); + } else if ("sshSettings".equals(fieldName)) { + deserializedComputeInstanceProperties.sshSettings = ComputeInstanceSshSettings.fromJson(reader); + } else if ("customServices".equals(fieldName)) { + List customServices = reader.readArray(reader1 -> CustomService.fromJson(reader1)); + deserializedComputeInstanceProperties.customServices = customServices; + } else if ("osImageMetadata".equals(fieldName)) { + deserializedComputeInstanceProperties.osImageMetadata = ImageMetadata.fromJson(reader); + } else if ("connectivityEndpoints".equals(fieldName)) { + deserializedComputeInstanceProperties.connectivityEndpoints + = ComputeInstanceConnectivityEndpoints.fromJson(reader); + } else if ("applications".equals(fieldName)) { + List applications + = reader.readArray(reader1 -> ComputeInstanceApplication.fromJson(reader1)); + deserializedComputeInstanceProperties.applications = applications; + } else if ("createdBy".equals(fieldName)) { + deserializedComputeInstanceProperties.createdBy = ComputeInstanceCreatedBy.fromJson(reader); + } else if ("errors".equals(fieldName)) { + List errors = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); + deserializedComputeInstanceProperties.errors = errors; + } else if ("state".equals(fieldName)) { + deserializedComputeInstanceProperties.state = ComputeInstanceState.fromString(reader.getString()); + } else if ("computeInstanceAuthorizationType".equals(fieldName)) { + deserializedComputeInstanceProperties.computeInstanceAuthorizationType + = ComputeInstanceAuthorizationType.fromString(reader.getString()); + } else if ("personalComputeInstanceSettings".equals(fieldName)) { + deserializedComputeInstanceProperties.personalComputeInstanceSettings + = PersonalComputeInstanceSettings.fromJson(reader); + } else if ("setupScripts".equals(fieldName)) { + deserializedComputeInstanceProperties.setupScripts = SetupScripts.fromJson(reader); + } else if ("lastOperation".equals(fieldName)) { + deserializedComputeInstanceProperties.lastOperation = ComputeInstanceLastOperation.fromJson(reader); + } else if ("schedules".equals(fieldName)) { + deserializedComputeInstanceProperties.schedules = ComputeSchedules.fromJson(reader); + } else if ("enableNodePublicIp".equals(fieldName)) { + deserializedComputeInstanceProperties.enableNodePublicIp + = reader.getNullable(JsonReader::getBoolean); + } else if ("containers".equals(fieldName)) { + List containers + = reader.readArray(reader1 -> ComputeInstanceContainer.fromJson(reader1)); + deserializedComputeInstanceProperties.containers = containers; + } else if ("dataDisks".equals(fieldName)) { + List dataDisks + = reader.readArray(reader1 -> ComputeInstanceDataDisk.fromJson(reader1)); + deserializedComputeInstanceProperties.dataDisks = dataDisks; + } else if ("dataMounts".equals(fieldName)) { + List dataMounts + = reader.readArray(reader1 -> ComputeInstanceDataMount.fromJson(reader1)); + deserializedComputeInstanceProperties.dataMounts = dataMounts; + } else if ("versions".equals(fieldName)) { + deserializedComputeInstanceProperties.versions = ComputeInstanceVersion.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedComputeInstanceProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceSchema.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceSchema.java index 48d4b12a0ab3e..be7024d12bcaf 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceSchema.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceSchema.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Properties(top level) of ComputeInstance. */ +/** + * Properties(top level) of ComputeInstance. + */ @Fluent -public class ComputeInstanceSchema { +public class ComputeInstanceSchema implements JsonSerializable { /* * Properties of ComputeInstance */ - @JsonProperty(value = "properties") private ComputeInstanceProperties properties; - /** Creates an instance of ComputeInstanceSchema class. */ + /** + * Creates an instance of ComputeInstanceSchema class. + */ public ComputeInstanceSchema() { } /** * Get the properties property: Properties of ComputeInstance. - * + * * @return the properties value. */ public ComputeInstanceProperties properties() { @@ -31,7 +38,7 @@ public ComputeInstanceProperties properties() { /** * Set the properties property: Properties of ComputeInstance. - * + * * @param properties the properties value to set. * @return the ComputeInstanceSchema object itself. */ @@ -42,7 +49,7 @@ public ComputeInstanceSchema withProperties(ComputeInstanceProperties properties /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -50,4 +57,40 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ComputeInstanceSchema from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ComputeInstanceSchema if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ComputeInstanceSchema. + */ + public static ComputeInstanceSchema fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ComputeInstanceSchema deserializedComputeInstanceSchema = new ComputeInstanceSchema(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedComputeInstanceSchema.properties = ComputeInstanceProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedComputeInstanceSchema; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceSshSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceSshSettings.java index fa34e74a58897..1c616449229b4 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceSshSettings.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceSshSettings.java @@ -5,51 +5,51 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Specifies policy and settings for SSH access. */ +/** + * Specifies policy and settings for SSH access. + */ @Fluent -public final class ComputeInstanceSshSettings { +public final class ComputeInstanceSshSettings implements JsonSerializable { /* - * Access policy for SSH - * * State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on * this instance. Enabled - Indicates that the public ssh port is open and accessible according to the VNet/subnet * policy if applicable. */ - @JsonProperty(value = "sshPublicAccess") private SshPublicAccess sshPublicAccess; /* * Describes the admin user name. */ - @JsonProperty(value = "adminUserName", access = JsonProperty.Access.WRITE_ONLY) private String adminUsername; /* * Describes the port for connecting through SSH. */ - @JsonProperty(value = "sshPort", access = JsonProperty.Access.WRITE_ONLY) private Integer sshPort; /* * Specifies the SSH rsa public key file as a string. Use "ssh-keygen -t rsa -b 2048" to generate your SSH key * pairs. */ - @JsonProperty(value = "adminPublicKey") private String adminPublicKey; - /** Creates an instance of ComputeInstanceSshSettings class. */ + /** + * Creates an instance of ComputeInstanceSshSettings class. + */ public ComputeInstanceSshSettings() { } /** - * Get the sshPublicAccess property: Access policy for SSH - * - *

State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on - * this instance. Enabled - Indicates that the public ssh port is open and accessible according to the VNet/subnet - * policy if applicable. - * + * Get the sshPublicAccess property: State of the public SSH port. Possible values are: Disabled - Indicates that + * the public ssh port is closed on this instance. Enabled - Indicates that the public ssh port is open and + * accessible according to the VNet/subnet policy if applicable. + * * @return the sshPublicAccess value. */ public SshPublicAccess sshPublicAccess() { @@ -57,12 +57,10 @@ public SshPublicAccess sshPublicAccess() { } /** - * Set the sshPublicAccess property: Access policy for SSH - * - *

State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on - * this instance. Enabled - Indicates that the public ssh port is open and accessible according to the VNet/subnet - * policy if applicable. - * + * Set the sshPublicAccess property: State of the public SSH port. Possible values are: Disabled - Indicates that + * the public ssh port is closed on this instance. Enabled - Indicates that the public ssh port is open and + * accessible according to the VNet/subnet policy if applicable. + * * @param sshPublicAccess the sshPublicAccess value to set. * @return the ComputeInstanceSshSettings object itself. */ @@ -73,7 +71,7 @@ public ComputeInstanceSshSettings withSshPublicAccess(SshPublicAccess sshPublicA /** * Get the adminUsername property: Describes the admin user name. - * + * * @return the adminUsername value. */ public String adminUsername() { @@ -82,7 +80,7 @@ public String adminUsername() { /** * Get the sshPort property: Describes the port for connecting through SSH. - * + * * @return the sshPort value. */ public Integer sshPort() { @@ -92,7 +90,7 @@ public Integer sshPort() { /** * Get the adminPublicKey property: Specifies the SSH rsa public key file as a string. Use "ssh-keygen -t rsa -b * 2048" to generate your SSH key pairs. - * + * * @return the adminPublicKey value. */ public String adminPublicKey() { @@ -102,7 +100,7 @@ public String adminPublicKey() { /** * Set the adminPublicKey property: Specifies the SSH rsa public key file as a string. Use "ssh-keygen -t rsa -b * 2048" to generate your SSH key pairs. - * + * * @param adminPublicKey the adminPublicKey value to set. * @return the ComputeInstanceSshSettings object itself. */ @@ -113,9 +111,54 @@ public ComputeInstanceSshSettings withAdminPublicKey(String adminPublicKey) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sshPublicAccess", + this.sshPublicAccess == null ? null : this.sshPublicAccess.toString()); + jsonWriter.writeStringField("adminPublicKey", this.adminPublicKey); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ComputeInstanceSshSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ComputeInstanceSshSettings if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ComputeInstanceSshSettings. + */ + public static ComputeInstanceSshSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ComputeInstanceSshSettings deserializedComputeInstanceSshSettings = new ComputeInstanceSshSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sshPublicAccess".equals(fieldName)) { + deserializedComputeInstanceSshSettings.sshPublicAccess + = SshPublicAccess.fromString(reader.getString()); + } else if ("adminUserName".equals(fieldName)) { + deserializedComputeInstanceSshSettings.adminUsername = reader.getString(); + } else if ("sshPort".equals(fieldName)) { + deserializedComputeInstanceSshSettings.sshPort = reader.getNullable(JsonReader::getInt); + } else if ("adminPublicKey".equals(fieldName)) { + deserializedComputeInstanceSshSettings.adminPublicKey = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedComputeInstanceSshSettings; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceState.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceState.java index 7e62436e09e71..6c26b3a23bdb4 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceState.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceState.java @@ -5,59 +5,90 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Current state of an ComputeInstance. */ +/** + * Current state of an ComputeInstance. + */ public final class ComputeInstanceState extends ExpandableStringEnum { - /** Static value Creating for ComputeInstanceState. */ + /** + * Static value Creating for ComputeInstanceState. + */ public static final ComputeInstanceState CREATING = fromString("Creating"); - /** Static value CreateFailed for ComputeInstanceState. */ + /** + * Static value CreateFailed for ComputeInstanceState. + */ public static final ComputeInstanceState CREATE_FAILED = fromString("CreateFailed"); - /** Static value Deleting for ComputeInstanceState. */ + /** + * Static value Deleting for ComputeInstanceState. + */ public static final ComputeInstanceState DELETING = fromString("Deleting"); - /** Static value Running for ComputeInstanceState. */ + /** + * Static value Running for ComputeInstanceState. + */ public static final ComputeInstanceState RUNNING = fromString("Running"); - /** Static value Restarting for ComputeInstanceState. */ + /** + * Static value Restarting for ComputeInstanceState. + */ public static final ComputeInstanceState RESTARTING = fromString("Restarting"); - /** Static value JobRunning for ComputeInstanceState. */ + /** + * Static value JobRunning for ComputeInstanceState. + */ public static final ComputeInstanceState JOB_RUNNING = fromString("JobRunning"); - /** Static value SettingUp for ComputeInstanceState. */ + /** + * Static value SettingUp for ComputeInstanceState. + */ public static final ComputeInstanceState SETTING_UP = fromString("SettingUp"); - /** Static value SetupFailed for ComputeInstanceState. */ + /** + * Static value SetupFailed for ComputeInstanceState. + */ public static final ComputeInstanceState SETUP_FAILED = fromString("SetupFailed"); - /** Static value Starting for ComputeInstanceState. */ + /** + * Static value Starting for ComputeInstanceState. + */ public static final ComputeInstanceState STARTING = fromString("Starting"); - /** Static value Stopped for ComputeInstanceState. */ + /** + * Static value Stopped for ComputeInstanceState. + */ public static final ComputeInstanceState STOPPED = fromString("Stopped"); - /** Static value Stopping for ComputeInstanceState. */ + /** + * Static value Stopping for ComputeInstanceState. + */ public static final ComputeInstanceState STOPPING = fromString("Stopping"); - /** Static value UserSettingUp for ComputeInstanceState. */ + /** + * Static value UserSettingUp for ComputeInstanceState. + */ public static final ComputeInstanceState USER_SETTING_UP = fromString("UserSettingUp"); - /** Static value UserSetupFailed for ComputeInstanceState. */ + /** + * Static value UserSetupFailed for ComputeInstanceState. + */ public static final ComputeInstanceState USER_SETUP_FAILED = fromString("UserSetupFailed"); - /** Static value Unknown for ComputeInstanceState. */ + /** + * Static value Unknown for ComputeInstanceState. + */ public static final ComputeInstanceState UNKNOWN = fromString("Unknown"); - /** Static value Unusable for ComputeInstanceState. */ + /** + * Static value Unusable for ComputeInstanceState. + */ public static final ComputeInstanceState UNUSABLE = fromString("Unusable"); /** * Creates a new instance of ComputeInstanceState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -66,18 +97,17 @@ public ComputeInstanceState() { /** * Creates or finds a ComputeInstanceState from its string representation. - * + * * @param name a name to look for. * @return the corresponding ComputeInstanceState. */ - @JsonCreator public static ComputeInstanceState fromString(String name) { return fromString(name, ComputeInstanceState.class); } /** * Gets known ComputeInstanceState values. - * + * * @return known ComputeInstanceState values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceVersion.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceVersion.java index e8b7f1b2d1cbb..cce27fbc395c2 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceVersion.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeInstanceVersion.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Version of computeInstance. */ +/** + * Version of computeInstance. + */ @Fluent -public final class ComputeInstanceVersion { +public final class ComputeInstanceVersion implements JsonSerializable { /* * Runtime of compute instance. */ - @JsonProperty(value = "runtime") private String runtime; - /** Creates an instance of ComputeInstanceVersion class. */ + /** + * Creates an instance of ComputeInstanceVersion class. + */ public ComputeInstanceVersion() { } /** * Get the runtime property: Runtime of compute instance. - * + * * @return the runtime value. */ public String runtime() { @@ -31,7 +38,7 @@ public String runtime() { /** * Set the runtime property: Runtime of compute instance. - * + * * @param runtime the runtime value to set. * @return the ComputeInstanceVersion object itself. */ @@ -42,9 +49,45 @@ public ComputeInstanceVersion withRuntime(String runtime) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("runtime", this.runtime); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ComputeInstanceVersion from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ComputeInstanceVersion if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ComputeInstanceVersion. + */ + public static ComputeInstanceVersion fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ComputeInstanceVersion deserializedComputeInstanceVersion = new ComputeInstanceVersion(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("runtime".equals(fieldName)) { + deserializedComputeInstanceVersion.runtime = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedComputeInstanceVersion; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputePowerAction.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputePowerAction.java index e486bcfd2863c..9cd09cdf9bea2 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputePowerAction.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputePowerAction.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The compute power action. */ +/** + * The compute power action. + */ public final class ComputePowerAction extends ExpandableStringEnum { - /** Static value Start for ComputePowerAction. */ + /** + * Static value Start for ComputePowerAction. + */ public static final ComputePowerAction START = fromString("Start"); - /** Static value Stop for ComputePowerAction. */ + /** + * Static value Stop for ComputePowerAction. + */ public static final ComputePowerAction STOP = fromString("Stop"); /** * Creates a new instance of ComputePowerAction value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public ComputePowerAction() { /** * Creates or finds a ComputePowerAction from its string representation. - * + * * @param name a name to look for. * @return the corresponding ComputePowerAction. */ - @JsonCreator public static ComputePowerAction fromString(String name) { return fromString(name, ComputePowerAction.class); } /** * Gets known ComputePowerAction values. - * + * * @return known ComputePowerAction values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeRecurrenceFrequency.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeRecurrenceFrequency.java new file mode 100644 index 0000000000000..81a219975c79d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeRecurrenceFrequency.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum to describe the frequency of a compute recurrence schedule. + */ +public final class ComputeRecurrenceFrequency extends ExpandableStringEnum { + /** + * Static value Minute for ComputeRecurrenceFrequency. + */ + public static final ComputeRecurrenceFrequency MINUTE = fromString("Minute"); + + /** + * Static value Hour for ComputeRecurrenceFrequency. + */ + public static final ComputeRecurrenceFrequency HOUR = fromString("Hour"); + + /** + * Static value Day for ComputeRecurrenceFrequency. + */ + public static final ComputeRecurrenceFrequency DAY = fromString("Day"); + + /** + * Static value Week for ComputeRecurrenceFrequency. + */ + public static final ComputeRecurrenceFrequency WEEK = fromString("Week"); + + /** + * Static value Month for ComputeRecurrenceFrequency. + */ + public static final ComputeRecurrenceFrequency MONTH = fromString("Month"); + + /** + * Creates a new instance of ComputeRecurrenceFrequency value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ComputeRecurrenceFrequency() { + } + + /** + * Creates or finds a ComputeRecurrenceFrequency from its string representation. + * + * @param name a name to look for. + * @return the corresponding ComputeRecurrenceFrequency. + */ + public static ComputeRecurrenceFrequency fromString(String name) { + return fromString(name, ComputeRecurrenceFrequency.class); + } + + /** + * Gets known ComputeRecurrenceFrequency values. + * + * @return known ComputeRecurrenceFrequency values. + */ + public static Collection values() { + return values(ComputeRecurrenceFrequency.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeRecurrenceSchedule.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeRecurrenceSchedule.java new file mode 100644 index 0000000000000..8d738d7ad55aa --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeRecurrenceSchedule.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The ComputeRecurrenceSchedule model. + */ +@Fluent +public final class ComputeRecurrenceSchedule implements JsonSerializable { + /* + * [Required] List of hours for the schedule. + */ + private List hours; + + /* + * [Required] List of minutes for the schedule. + */ + private List minutes; + + /* + * List of month days for the schedule + */ + private List monthDays; + + /* + * List of days for the schedule. + */ + private List weekDays; + + /** + * Creates an instance of ComputeRecurrenceSchedule class. + */ + public ComputeRecurrenceSchedule() { + } + + /** + * Get the hours property: [Required] List of hours for the schedule. + * + * @return the hours value. + */ + public List hours() { + return this.hours; + } + + /** + * Set the hours property: [Required] List of hours for the schedule. + * + * @param hours the hours value to set. + * @return the ComputeRecurrenceSchedule object itself. + */ + public ComputeRecurrenceSchedule withHours(List hours) { + this.hours = hours; + return this; + } + + /** + * Get the minutes property: [Required] List of minutes for the schedule. + * + * @return the minutes value. + */ + public List minutes() { + return this.minutes; + } + + /** + * Set the minutes property: [Required] List of minutes for the schedule. + * + * @param minutes the minutes value to set. + * @return the ComputeRecurrenceSchedule object itself. + */ + public ComputeRecurrenceSchedule withMinutes(List minutes) { + this.minutes = minutes; + return this; + } + + /** + * Get the monthDays property: List of month days for the schedule. + * + * @return the monthDays value. + */ + public List monthDays() { + return this.monthDays; + } + + /** + * Set the monthDays property: List of month days for the schedule. + * + * @param monthDays the monthDays value to set. + * @return the ComputeRecurrenceSchedule object itself. + */ + public ComputeRecurrenceSchedule withMonthDays(List monthDays) { + this.monthDays = monthDays; + return this; + } + + /** + * Get the weekDays property: List of days for the schedule. + * + * @return the weekDays value. + */ + public List weekDays() { + return this.weekDays; + } + + /** + * Set the weekDays property: List of days for the schedule. + * + * @param weekDays the weekDays value to set. + * @return the ComputeRecurrenceSchedule object itself. + */ + public ComputeRecurrenceSchedule withWeekDays(List weekDays) { + this.weekDays = weekDays; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hours() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property hours in model ComputeRecurrenceSchedule")); + } + if (minutes() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property minutes in model ComputeRecurrenceSchedule")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ComputeRecurrenceSchedule.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("hours", this.hours, (writer, element) -> writer.writeInt(element)); + jsonWriter.writeArrayField("minutes", this.minutes, (writer, element) -> writer.writeInt(element)); + jsonWriter.writeArrayField("monthDays", this.monthDays, (writer, element) -> writer.writeInt(element)); + jsonWriter.writeArrayField("weekDays", this.weekDays, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ComputeRecurrenceSchedule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ComputeRecurrenceSchedule if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ComputeRecurrenceSchedule. + */ + public static ComputeRecurrenceSchedule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ComputeRecurrenceSchedule deserializedComputeRecurrenceSchedule = new ComputeRecurrenceSchedule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hours".equals(fieldName)) { + List hours = reader.readArray(reader1 -> reader1.getInt()); + deserializedComputeRecurrenceSchedule.hours = hours; + } else if ("minutes".equals(fieldName)) { + List minutes = reader.readArray(reader1 -> reader1.getInt()); + deserializedComputeRecurrenceSchedule.minutes = minutes; + } else if ("monthDays".equals(fieldName)) { + List monthDays = reader.readArray(reader1 -> reader1.getInt()); + deserializedComputeRecurrenceSchedule.monthDays = monthDays; + } else if ("weekDays".equals(fieldName)) { + List weekDays + = reader.readArray(reader1 -> ComputeWeekDay.fromString(reader1.getString())); + deserializedComputeRecurrenceSchedule.weekDays = weekDays; + } else { + reader.skipChildren(); + } + } + + return deserializedComputeRecurrenceSchedule; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeResource.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeResource.java index 2a15fb09ae3ff..df09ca34c41ab 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeResource.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeResource.java @@ -12,149 +12,161 @@ import com.azure.resourcemanager.machinelearning.fluent.models.ComputeResourceInner; import java.util.Map; -/** An immutable client-side representation of ComputeResource. */ +/** + * An immutable client-side representation of ComputeResource. + */ public interface ComputeResource { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the identity property: The identity of the resource. - * + * * @return the identity value. */ ManagedServiceIdentity identity(); /** * Gets the location property: Specifies the location of the resource. - * + * * @return the location value. */ String location(); /** * Gets the tags property: Contains resource tags defined as key/value pairs. - * + * * @return the tags value. */ Map tags(); /** * Gets the sku property: The sku of the workspace. - * + * * @return the sku value. */ Sku sku(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the properties property: Compute properties. - * + * * @return the properties value. */ Compute properties(); /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.ComputeResourceInner object. - * + * * @return the inner object. */ ComputeResourceInner innerModel(); - /** The entirety of the ComputeResource definition. */ + /** + * The entirety of the ComputeResource definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } - /** The ComputeResource definition stages. */ + + /** + * The ComputeResource definition stages. + */ interface DefinitionStages { - /** The first stage of the ComputeResource definition. */ + /** + * The first stage of the ComputeResource definition. + */ interface Blank extends WithParentResource { } - /** The stage of the ComputeResource definition allowing to specify parent resource. */ + + /** + * The stage of the ComputeResource definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, workspaceName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @return the next definition stage. */ WithCreate withExistingWorkspace(String resourceGroupName, String workspaceName); } + /** * The stage of the ComputeResource definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. */ - interface WithCreate - extends DefinitionStages.WithLocation, - DefinitionStages.WithTags, - DefinitionStages.WithIdentity, - DefinitionStages.WithSku, - DefinitionStages.WithProperties { + interface WithCreate extends DefinitionStages.WithLocation, DefinitionStages.WithTags, + DefinitionStages.WithIdentity, DefinitionStages.WithSku, DefinitionStages.WithProperties { /** * Executes the create request. - * + * * @return the created resource. */ ComputeResource create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ ComputeResource create(Context context); } - /** The stage of the ComputeResource definition allowing to specify location. */ + + /** + * The stage of the ComputeResource definition allowing to specify location. + */ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location Specifies the location of the resource. * @return the next definition stage. */ @@ -162,100 +174,121 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location Specifies the location of the resource. * @return the next definition stage. */ WithCreate withRegion(String location); } - /** The stage of the ComputeResource definition allowing to specify tags. */ + + /** + * The stage of the ComputeResource definition allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Contains resource tags defined as key/value pairs.. - * + * * @param tags Contains resource tags defined as key/value pairs. * @return the next definition stage. */ WithCreate withTags(Map tags); } - /** The stage of the ComputeResource definition allowing to specify identity. */ + + /** + * The stage of the ComputeResource definition allowing to specify identity. + */ interface WithIdentity { /** * Specifies the identity property: The identity of the resource.. - * + * * @param identity The identity of the resource. * @return the next definition stage. */ WithCreate withIdentity(ManagedServiceIdentity identity); } - /** The stage of the ComputeResource definition allowing to specify sku. */ + + /** + * The stage of the ComputeResource definition allowing to specify sku. + */ interface WithSku { /** * Specifies the sku property: The sku of the workspace.. - * + * * @param sku The sku of the workspace. * @return the next definition stage. */ WithCreate withSku(Sku sku); } - /** The stage of the ComputeResource definition allowing to specify properties. */ + + /** + * The stage of the ComputeResource definition allowing to specify properties. + */ interface WithProperties { /** * Specifies the properties property: Compute properties. - * + * * @param properties Compute properties. * @return the next definition stage. */ WithCreate withProperties(Compute properties); } } + /** * Begins update for the ComputeResource resource. - * + * * @return the stage of resource update. */ ComputeResource.Update update(); - /** The template for ComputeResource update. */ + /** + * The template for ComputeResource update. + */ interface Update extends UpdateStages.WithProperties { /** * Executes the update request. - * + * * @return the updated resource. */ ComputeResource apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ ComputeResource apply(Context context); } - /** The ComputeResource update stages. */ + + /** + * The ComputeResource update stages. + */ interface UpdateStages { - /** The stage of the ComputeResource update allowing to specify properties. */ + /** + * The stage of the ComputeResource update allowing to specify properties. + */ interface WithProperties { /** * Specifies the properties property: Properties of ClusterUpdate. - * + * * @param properties Properties of ClusterUpdate. * @return the next definition stage. */ Update withProperties(ScaleSettingsInformation properties); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ ComputeResource refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ @@ -263,41 +296,41 @@ interface WithProperties { /** * Get the details (e.g IP address, port etc) of all the compute nodes in the compute. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the details (e.g IP address, port etc) of all the compute nodes in the compute as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ PagedIterable listNodes(); /** * Get the details (e.g IP address, port etc) of all the compute nodes in the compute. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the details (e.g IP address, port etc) of all the compute nodes in the compute as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ PagedIterable listNodes(Context context); /** * Gets secrets related to Machine Learning compute (storage keys, service credentials, etc). - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secrets related to Machine Learning compute (storage keys, service credentials, etc) along with {@link - * Response}. + * @return secrets related to Machine Learning compute (storage keys, service credentials, etc) along with + * {@link Response}. */ Response listKeysWithResponse(Context context); /** * Gets secrets related to Machine Learning compute (storage keys, service credentials, etc). - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return secrets related to Machine Learning compute (storage keys, service credentials, etc). @@ -306,7 +339,7 @@ interface WithProperties { /** * Posts a start action to a compute instance. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @@ -314,7 +347,7 @@ interface WithProperties { /** * Posts a start action to a compute instance. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -324,7 +357,7 @@ interface WithProperties { /** * Posts a stop action to a compute instance. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @@ -332,7 +365,7 @@ interface WithProperties { /** * Posts a stop action to a compute instance. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -342,7 +375,7 @@ interface WithProperties { /** * Posts a restart action to a compute instance. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @@ -350,7 +383,7 @@ interface WithProperties { /** * Posts a restart action to a compute instance. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeResourceSchema.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeResourceSchema.java index 4b0b7c7000d23..018f7e1e33889 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeResourceSchema.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeResourceSchema.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The ComputeResourceSchema model. */ +/** + * The ComputeResourceSchema model. + */ @Fluent -public class ComputeResourceSchema { +public class ComputeResourceSchema implements JsonSerializable { /* * Compute properties */ - @JsonProperty(value = "properties") private Compute properties; - /** Creates an instance of ComputeResourceSchema class. */ + /** + * Creates an instance of ComputeResourceSchema class. + */ public ComputeResourceSchema() { } /** * Get the properties property: Compute properties. - * + * * @return the properties value. */ public Compute properties() { @@ -31,7 +38,7 @@ public Compute properties() { /** * Set the properties property: Compute properties. - * + * * @param properties the properties value to set. * @return the ComputeResourceSchema object itself. */ @@ -42,7 +49,7 @@ public ComputeResourceSchema withProperties(Compute properties) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -50,4 +57,40 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ComputeResourceSchema from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ComputeResourceSchema if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ComputeResourceSchema. + */ + public static ComputeResourceSchema fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ComputeResourceSchema deserializedComputeResourceSchema = new ComputeResourceSchema(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedComputeResourceSchema.properties = Compute.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedComputeResourceSchema; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeRuntimeDto.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeRuntimeDto.java new file mode 100644 index 0000000000000..ad32d64c5000c --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeRuntimeDto.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Compute runtime config for feature store type workspace. + */ +@Fluent +public final class ComputeRuntimeDto implements JsonSerializable { + /* + * The sparkRuntimeVersion property. + */ + private String sparkRuntimeVersion; + + /** + * Creates an instance of ComputeRuntimeDto class. + */ + public ComputeRuntimeDto() { + } + + /** + * Get the sparkRuntimeVersion property: The sparkRuntimeVersion property. + * + * @return the sparkRuntimeVersion value. + */ + public String sparkRuntimeVersion() { + return this.sparkRuntimeVersion; + } + + /** + * Set the sparkRuntimeVersion property: The sparkRuntimeVersion property. + * + * @param sparkRuntimeVersion the sparkRuntimeVersion value to set. + * @return the ComputeRuntimeDto object itself. + */ + public ComputeRuntimeDto withSparkRuntimeVersion(String sparkRuntimeVersion) { + this.sparkRuntimeVersion = sparkRuntimeVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sparkRuntimeVersion", this.sparkRuntimeVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ComputeRuntimeDto from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ComputeRuntimeDto if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ComputeRuntimeDto. + */ + public static ComputeRuntimeDto fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ComputeRuntimeDto deserializedComputeRuntimeDto = new ComputeRuntimeDto(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sparkRuntimeVersion".equals(fieldName)) { + deserializedComputeRuntimeDto.sparkRuntimeVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedComputeRuntimeDto; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeSchedules.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeSchedules.java index 78b9effb9a9f6..d40a2846fa07d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeSchedules.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeSchedules.java @@ -5,25 +5,32 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** The list of schedules to be applied on the computes. */ +/** + * The list of schedules to be applied on the computes. + */ @Fluent -public final class ComputeSchedules { +public final class ComputeSchedules implements JsonSerializable { /* * The list of compute start stop schedules to be applied. */ - @JsonProperty(value = "computeStartStop") private List computeStartStop; - /** Creates an instance of ComputeSchedules class. */ + /** + * Creates an instance of ComputeSchedules class. + */ public ComputeSchedules() { } /** * Get the computeStartStop property: The list of compute start stop schedules to be applied. - * + * * @return the computeStartStop value. */ public List computeStartStop() { @@ -32,7 +39,7 @@ public List computeStartStop() { /** * Set the computeStartStop property: The list of compute start stop schedules to be applied. - * + * * @param computeStartStop the computeStartStop value to set. * @return the ComputeSchedules object itself. */ @@ -43,7 +50,7 @@ public ComputeSchedules withComputeStartStop(List comp /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -51,4 +58,43 @@ public void validate() { computeStartStop().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("computeStartStop", this.computeStartStop, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ComputeSchedules from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ComputeSchedules if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ComputeSchedules. + */ + public static ComputeSchedules fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ComputeSchedules deserializedComputeSchedules = new ComputeSchedules(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("computeStartStop".equals(fieldName)) { + List computeStartStop + = reader.readArray(reader1 -> ComputeStartStopSchedule.fromJson(reader1)); + deserializedComputeSchedules.computeStartStop = computeStartStop; + } else { + reader.skipChildren(); + } + } + + return deserializedComputeSchedules; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeSecrets.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeSecrets.java index ab0429a6d9da3..9a9ecbac7777b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeSecrets.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeSecrets.java @@ -6,11 +6,20 @@ import com.azure.resourcemanager.machinelearning.fluent.models.ComputeSecretsInner; -/** An immutable client-side representation of ComputeSecrets. */ +/** + * An immutable client-side representation of ComputeSecrets. + */ public interface ComputeSecrets { + /** + * Gets the computeType property: The type of compute. + * + * @return the computeType value. + */ + ComputeType computeType(); + /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.ComputeSecretsInner object. - * + * * @return the inner object. */ ComputeSecretsInner innerModel(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeStartStopSchedule.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeStartStopSchedule.java index 609941e651ab6..02bd326c80a41 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeStartStopSchedule.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeStartStopSchedule.java @@ -5,66 +5,66 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Compute start stop schedule properties. */ +/** + * Compute start stop schedule properties. + */ @Fluent -public final class ComputeStartStopSchedule { +public final class ComputeStartStopSchedule implements JsonSerializable { /* * A system assigned id for the schedule. */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; /* * The current deployment state of schedule. */ - @JsonProperty(value = "provisioningStatus", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningStatus provisioningStatus; /* * Is the schedule enabled or disabled? */ - @JsonProperty(value = "status") private ScheduleStatus status; /* * [Required] The compute power action. */ - @JsonProperty(value = "action") private ComputePowerAction action; /* * [Required] The schedule trigger type. */ - @JsonProperty(value = "triggerType") - private TriggerType triggerType; + private ComputeTriggerType triggerType; /* * Required if triggerType is Recurrence. */ - @JsonProperty(value = "recurrence") - private RecurrenceTrigger recurrence; + private Recurrence recurrence; /* * Required if triggerType is Cron. */ - @JsonProperty(value = "cron") - private CronTrigger cron; + private Cron cron; /* * [Deprecated] Not used any more. */ - @JsonProperty(value = "schedule") private ScheduleBase schedule; - /** Creates an instance of ComputeStartStopSchedule class. */ + /** + * Creates an instance of ComputeStartStopSchedule class. + */ public ComputeStartStopSchedule() { } /** * Get the id property: A system assigned id for the schedule. - * + * * @return the id value. */ public String id() { @@ -73,7 +73,7 @@ public String id() { /** * Get the provisioningStatus property: The current deployment state of schedule. - * + * * @return the provisioningStatus value. */ public ProvisioningStatus provisioningStatus() { @@ -82,7 +82,7 @@ public ProvisioningStatus provisioningStatus() { /** * Get the status property: Is the schedule enabled or disabled?. - * + * * @return the status value. */ public ScheduleStatus status() { @@ -91,7 +91,7 @@ public ScheduleStatus status() { /** * Set the status property: Is the schedule enabled or disabled?. - * + * * @param status the status value to set. * @return the ComputeStartStopSchedule object itself. */ @@ -102,7 +102,7 @@ public ComputeStartStopSchedule withStatus(ScheduleStatus status) { /** * Get the action property: [Required] The compute power action. - * + * * @return the action value. */ public ComputePowerAction action() { @@ -111,7 +111,7 @@ public ComputePowerAction action() { /** * Set the action property: [Required] The compute power action. - * + * * @param action the action value to set. * @return the ComputeStartStopSchedule object itself. */ @@ -122,67 +122,67 @@ public ComputeStartStopSchedule withAction(ComputePowerAction action) { /** * Get the triggerType property: [Required] The schedule trigger type. - * + * * @return the triggerType value. */ - public TriggerType triggerType() { + public ComputeTriggerType triggerType() { return this.triggerType; } /** * Set the triggerType property: [Required] The schedule trigger type. - * + * * @param triggerType the triggerType value to set. * @return the ComputeStartStopSchedule object itself. */ - public ComputeStartStopSchedule withTriggerType(TriggerType triggerType) { + public ComputeStartStopSchedule withTriggerType(ComputeTriggerType triggerType) { this.triggerType = triggerType; return this; } /** * Get the recurrence property: Required if triggerType is Recurrence. - * + * * @return the recurrence value. */ - public RecurrenceTrigger recurrence() { + public Recurrence recurrence() { return this.recurrence; } /** * Set the recurrence property: Required if triggerType is Recurrence. - * + * * @param recurrence the recurrence value to set. * @return the ComputeStartStopSchedule object itself. */ - public ComputeStartStopSchedule withRecurrence(RecurrenceTrigger recurrence) { + public ComputeStartStopSchedule withRecurrence(Recurrence recurrence) { this.recurrence = recurrence; return this; } /** * Get the cron property: Required if triggerType is Cron. - * + * * @return the cron value. */ - public CronTrigger cron() { + public Cron cron() { return this.cron; } /** * Set the cron property: Required if triggerType is Cron. - * + * * @param cron the cron value to set. * @return the ComputeStartStopSchedule object itself. */ - public ComputeStartStopSchedule withCron(CronTrigger cron) { + public ComputeStartStopSchedule withCron(Cron cron) { this.cron = cron; return this; } /** * Get the schedule property: [Deprecated] Not used any more. - * + * * @return the schedule value. */ public ScheduleBase schedule() { @@ -191,7 +191,7 @@ public ScheduleBase schedule() { /** * Set the schedule property: [Deprecated] Not used any more. - * + * * @param schedule the schedule value to set. * @return the ComputeStartStopSchedule object itself. */ @@ -202,7 +202,7 @@ public ComputeStartStopSchedule withSchedule(ScheduleBase schedule) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -216,4 +216,61 @@ public void validate() { schedule().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); + jsonWriter.writeStringField("triggerType", this.triggerType == null ? null : this.triggerType.toString()); + jsonWriter.writeJsonField("recurrence", this.recurrence); + jsonWriter.writeJsonField("cron", this.cron); + jsonWriter.writeJsonField("schedule", this.schedule); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ComputeStartStopSchedule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ComputeStartStopSchedule if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ComputeStartStopSchedule. + */ + public static ComputeStartStopSchedule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ComputeStartStopSchedule deserializedComputeStartStopSchedule = new ComputeStartStopSchedule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedComputeStartStopSchedule.id = reader.getString(); + } else if ("provisioningStatus".equals(fieldName)) { + deserializedComputeStartStopSchedule.provisioningStatus + = ProvisioningStatus.fromString(reader.getString()); + } else if ("status".equals(fieldName)) { + deserializedComputeStartStopSchedule.status = ScheduleStatus.fromString(reader.getString()); + } else if ("action".equals(fieldName)) { + deserializedComputeStartStopSchedule.action = ComputePowerAction.fromString(reader.getString()); + } else if ("triggerType".equals(fieldName)) { + deserializedComputeStartStopSchedule.triggerType + = ComputeTriggerType.fromString(reader.getString()); + } else if ("recurrence".equals(fieldName)) { + deserializedComputeStartStopSchedule.recurrence = Recurrence.fromJson(reader); + } else if ("cron".equals(fieldName)) { + deserializedComputeStartStopSchedule.cron = Cron.fromJson(reader); + } else if ("schedule".equals(fieldName)) { + deserializedComputeStartStopSchedule.schedule = ScheduleBase.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedComputeStartStopSchedule; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeTriggerType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeTriggerType.java new file mode 100644 index 0000000000000..3fde166513a07 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeTriggerType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Is the trigger type recurrence or cron. + */ +public final class ComputeTriggerType extends ExpandableStringEnum { + /** + * Static value Recurrence for ComputeTriggerType. + */ + public static final ComputeTriggerType RECURRENCE = fromString("Recurrence"); + + /** + * Static value Cron for ComputeTriggerType. + */ + public static final ComputeTriggerType CRON = fromString("Cron"); + + /** + * Creates a new instance of ComputeTriggerType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ComputeTriggerType() { + } + + /** + * Creates or finds a ComputeTriggerType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ComputeTriggerType. + */ + public static ComputeTriggerType fromString(String name) { + return fromString(name, ComputeTriggerType.class); + } + + /** + * Gets known ComputeTriggerType values. + * + * @return known ComputeTriggerType values. + */ + public static Collection values() { + return values(ComputeTriggerType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeType.java index c3a28e6d05608..c57b6fc0c1879 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeType.java @@ -5,44 +5,65 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The type of compute. */ +/** + * The type of compute. + */ public final class ComputeType extends ExpandableStringEnum { - /** Static value AKS for ComputeType. */ + /** + * Static value AKS for ComputeType. + */ public static final ComputeType AKS = fromString("AKS"); - /** Static value Kubernetes for ComputeType. */ + /** + * Static value Kubernetes for ComputeType. + */ public static final ComputeType KUBERNETES = fromString("Kubernetes"); - /** Static value AmlCompute for ComputeType. */ + /** + * Static value AmlCompute for ComputeType. + */ public static final ComputeType AML_COMPUTE = fromString("AmlCompute"); - /** Static value ComputeInstance for ComputeType. */ + /** + * Static value ComputeInstance for ComputeType. + */ public static final ComputeType COMPUTE_INSTANCE = fromString("ComputeInstance"); - /** Static value DataFactory for ComputeType. */ + /** + * Static value DataFactory for ComputeType. + */ public static final ComputeType DATA_FACTORY = fromString("DataFactory"); - /** Static value VirtualMachine for ComputeType. */ + /** + * Static value VirtualMachine for ComputeType. + */ public static final ComputeType VIRTUAL_MACHINE = fromString("VirtualMachine"); - /** Static value HDInsight for ComputeType. */ + /** + * Static value HDInsight for ComputeType. + */ public static final ComputeType HDINSIGHT = fromString("HDInsight"); - /** Static value Databricks for ComputeType. */ + /** + * Static value Databricks for ComputeType. + */ public static final ComputeType DATABRICKS = fromString("Databricks"); - /** Static value DataLakeAnalytics for ComputeType. */ + /** + * Static value DataLakeAnalytics for ComputeType. + */ public static final ComputeType DATA_LAKE_ANALYTICS = fromString("DataLakeAnalytics"); - /** Static value SynapseSpark for ComputeType. */ + /** + * Static value SynapseSpark for ComputeType. + */ public static final ComputeType SYNAPSE_SPARK = fromString("SynapseSpark"); /** * Creates a new instance of ComputeType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -51,18 +72,17 @@ public ComputeType() { /** * Creates or finds a ComputeType from its string representation. - * + * * @param name a name to look for. * @return the corresponding ComputeType. */ - @JsonCreator public static ComputeType fromString(String name) { return fromString(name, ComputeType.class); } /** * Gets known ComputeType values. - * + * * @return known ComputeType values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeWeekDay.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeWeekDay.java new file mode 100644 index 0000000000000..40c64d9e242c9 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ComputeWeekDay.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum of weekday. + */ +public final class ComputeWeekDay extends ExpandableStringEnum { + /** + * Static value Monday for ComputeWeekDay. + */ + public static final ComputeWeekDay MONDAY = fromString("Monday"); + + /** + * Static value Tuesday for ComputeWeekDay. + */ + public static final ComputeWeekDay TUESDAY = fromString("Tuesday"); + + /** + * Static value Wednesday for ComputeWeekDay. + */ + public static final ComputeWeekDay WEDNESDAY = fromString("Wednesday"); + + /** + * Static value Thursday for ComputeWeekDay. + */ + public static final ComputeWeekDay THURSDAY = fromString("Thursday"); + + /** + * Static value Friday for ComputeWeekDay. + */ + public static final ComputeWeekDay FRIDAY = fromString("Friday"); + + /** + * Static value Saturday for ComputeWeekDay. + */ + public static final ComputeWeekDay SATURDAY = fromString("Saturday"); + + /** + * Static value Sunday for ComputeWeekDay. + */ + public static final ComputeWeekDay SUNDAY = fromString("Sunday"); + + /** + * Creates a new instance of ComputeWeekDay value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ComputeWeekDay() { + } + + /** + * Creates or finds a ComputeWeekDay from its string representation. + * + * @param name a name to look for. + * @return the corresponding ComputeWeekDay. + */ + public static ComputeWeekDay fromString(String name) { + return fromString(name, ComputeWeekDay.class); + } + + /** + * Gets known ComputeWeekDay values. + * + * @return known ComputeWeekDay values. + */ + public static Collection values() { + return values(ComputeWeekDay.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Computes.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Computes.java index 007d1460f249f..23ed47cce1777 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Computes.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Computes.java @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Computes. */ +/** + * Resource collection API of Computes. + */ public interface Computes { /** * Gets computes in specified workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -24,7 +26,7 @@ public interface Computes { /** * Gets computes in specified workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -39,7 +41,7 @@ public interface Computes { /** * Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are not returned - use * 'keys' nested resource to get them. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -49,13 +51,13 @@ public interface Computes { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return compute definition by its name along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String computeName, Context context); + Response getWithResponse(String resourceGroupName, String workspaceName, String computeName, + Context context); /** * Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are not returned - use * 'keys' nested resource to get them. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -68,45 +70,38 @@ Response getWithResponse( /** * Deletes specified Machine Learning compute. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. * @param underlyingResourceAction Delete the underlying compute if 'Delete', or detach the underlying compute from - * workspace if 'Detach'. + * workspace if 'Detach'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void delete( - String resourceGroupName, - String workspaceName, - String computeName, + void delete(String resourceGroupName, String workspaceName, String computeName, UnderlyingResourceAction underlyingResourceAction); /** * Deletes specified Machine Learning compute. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. * @param underlyingResourceAction Delete the underlying compute if 'Delete', or detach the underlying compute from - * workspace if 'Detach'. + * workspace if 'Detach'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void delete( - String resourceGroupName, - String workspaceName, - String computeName, - UnderlyingResourceAction underlyingResourceAction, - Context context); + void delete(String resourceGroupName, String workspaceName, String computeName, + UnderlyingResourceAction underlyingResourceAction, Context context); /** * Get the details (e.g IP address, port etc) of all the compute nodes in the compute. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -114,14 +109,14 @@ void delete( * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the details (e.g IP address, port etc) of all the compute nodes in the compute as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ - PagedIterable listNodes( - String resourceGroupName, String workspaceName, String computeName); + PagedIterable listNodes(String resourceGroupName, String workspaceName, + String computeName); /** * Get the details (e.g IP address, port etc) of all the compute nodes in the compute. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -130,14 +125,14 @@ PagedIterable listNodes( * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the details (e.g IP address, port etc) of all the compute nodes in the compute as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ - PagedIterable listNodes( - String resourceGroupName, String workspaceName, String computeName, Context context); + PagedIterable listNodes(String resourceGroupName, String workspaceName, + String computeName, Context context); /** * Gets secrets related to Machine Learning compute (storage keys, service credentials, etc). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -145,15 +140,15 @@ PagedIterable listNodes( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secrets related to Machine Learning compute (storage keys, service credentials, etc) along with {@link - * Response}. + * @return secrets related to Machine Learning compute (storage keys, service credentials, etc) along with + * {@link Response}. */ - Response listKeysWithResponse( - String resourceGroupName, String workspaceName, String computeName, Context context); + Response listKeysWithResponse(String resourceGroupName, String workspaceName, String computeName, + Context context); /** * Gets secrets related to Machine Learning compute (storage keys, service credentials, etc). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -166,7 +161,7 @@ Response listKeysWithResponse( /** * Posts a start action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -178,7 +173,7 @@ Response listKeysWithResponse( /** * Posts a start action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -191,7 +186,7 @@ Response listKeysWithResponse( /** * Posts a stop action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -203,7 +198,7 @@ Response listKeysWithResponse( /** * Posts a stop action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -216,7 +211,7 @@ Response listKeysWithResponse( /** * Posts a restart action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -228,7 +223,7 @@ Response listKeysWithResponse( /** * Posts a restart action to a compute instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param computeName Name of the Azure Machine Learning compute. @@ -242,7 +237,7 @@ Response listKeysWithResponse( /** * Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are not returned - use * 'keys' nested resource to get them. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -254,7 +249,7 @@ Response listKeysWithResponse( /** * Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are not returned - use * 'keys' nested resource to get them. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -266,7 +261,7 @@ Response listKeysWithResponse( /** * Begins definition for a new ComputeResource resource. - * + * * @param name resource name. * @return the first stage of the new ComputeResource definition. */ diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ConnectionAuthType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ConnectionAuthType.java index 04ac12e98553a..8256a868a1bd8 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ConnectionAuthType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ConnectionAuthType.java @@ -5,29 +5,75 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Authentication type of the connection target. */ +/** + * Authentication type of the connection target. + */ public final class ConnectionAuthType extends ExpandableStringEnum { - /** Static value PAT for ConnectionAuthType. */ + /** + * Static value PAT for ConnectionAuthType. + */ public static final ConnectionAuthType PAT = fromString("PAT"); - /** Static value ManagedIdentity for ConnectionAuthType. */ + /** + * Static value ManagedIdentity for ConnectionAuthType. + */ public static final ConnectionAuthType MANAGED_IDENTITY = fromString("ManagedIdentity"); - /** Static value UsernamePassword for ConnectionAuthType. */ + /** + * Static value UsernamePassword for ConnectionAuthType. + */ public static final ConnectionAuthType USERNAME_PASSWORD = fromString("UsernamePassword"); - /** Static value None for ConnectionAuthType. */ + /** + * Static value None for ConnectionAuthType. + */ public static final ConnectionAuthType NONE = fromString("None"); - /** Static value SAS for ConnectionAuthType. */ + /** + * Static value SAS for ConnectionAuthType. + */ public static final ConnectionAuthType SAS = fromString("SAS"); + /** + * Static value AccountKey for ConnectionAuthType. + */ + public static final ConnectionAuthType ACCOUNT_KEY = fromString("AccountKey"); + + /** + * Static value ServicePrincipal for ConnectionAuthType. + */ + public static final ConnectionAuthType SERVICE_PRINCIPAL = fromString("ServicePrincipal"); + + /** + * Static value AccessKey for ConnectionAuthType. + */ + public static final ConnectionAuthType ACCESS_KEY = fromString("AccessKey"); + + /** + * Static value ApiKey for ConnectionAuthType. + */ + public static final ConnectionAuthType API_KEY = fromString("ApiKey"); + + /** + * Static value CustomKeys for ConnectionAuthType. + */ + public static final ConnectionAuthType CUSTOM_KEYS = fromString("CustomKeys"); + + /** + * Static value OAuth2 for ConnectionAuthType. + */ + public static final ConnectionAuthType OAUTH2 = fromString("OAuth2"); + + /** + * Static value AAD for ConnectionAuthType. + */ + public static final ConnectionAuthType AAD = fromString("AAD"); + /** * Creates a new instance of ConnectionAuthType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -36,18 +82,17 @@ public ConnectionAuthType() { /** * Creates or finds a ConnectionAuthType from its string representation. - * + * * @param name a name to look for. * @return the corresponding ConnectionAuthType. */ - @JsonCreator public static ConnectionAuthType fromString(String name) { return fromString(name, ConnectionAuthType.class); } /** * Gets known ConnectionAuthType values. - * + * * @return known ConnectionAuthType values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ConnectionCategory.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ConnectionCategory.java index bbddfa94d65d7..4de28370a2302 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ConnectionCategory.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ConnectionCategory.java @@ -5,23 +5,525 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Category of the connection. */ +/** + * Category of the connection. + */ public final class ConnectionCategory extends ExpandableStringEnum { - /** Static value PythonFeed for ConnectionCategory. */ + /** + * Static value PythonFeed for ConnectionCategory. + */ public static final ConnectionCategory PYTHON_FEED = fromString("PythonFeed"); - /** Static value ContainerRegistry for ConnectionCategory. */ + /** + * Static value ContainerRegistry for ConnectionCategory. + */ public static final ConnectionCategory CONTAINER_REGISTRY = fromString("ContainerRegistry"); - /** Static value Git for ConnectionCategory. */ + /** + * Static value Git for ConnectionCategory. + */ public static final ConnectionCategory GIT = fromString("Git"); + /** + * Static value S3 for ConnectionCategory. + */ + public static final ConnectionCategory S3 = fromString("S3"); + + /** + * Static value Snowflake for ConnectionCategory. + */ + public static final ConnectionCategory SNOWFLAKE = fromString("Snowflake"); + + /** + * Static value AzureSqlDb for ConnectionCategory. + */ + public static final ConnectionCategory AZURE_SQL_DB = fromString("AzureSqlDb"); + + /** + * Static value AzureSynapseAnalytics for ConnectionCategory. + */ + public static final ConnectionCategory AZURE_SYNAPSE_ANALYTICS = fromString("AzureSynapseAnalytics"); + + /** + * Static value AzureMySqlDb for ConnectionCategory. + */ + public static final ConnectionCategory AZURE_MY_SQL_DB = fromString("AzureMySqlDb"); + + /** + * Static value AzurePostgresDb for ConnectionCategory. + */ + public static final ConnectionCategory AZURE_POSTGRES_DB = fromString("AzurePostgresDb"); + + /** + * Static value ADLSGen2 for ConnectionCategory. + */ + public static final ConnectionCategory ADLSGEN2 = fromString("ADLSGen2"); + + /** + * Static value Redis for ConnectionCategory. + */ + public static final ConnectionCategory REDIS = fromString("Redis"); + + /** + * Static value ApiKey for ConnectionCategory. + */ + public static final ConnectionCategory API_KEY = fromString("ApiKey"); + + /** + * Static value AzureOpenAI for ConnectionCategory. + */ + public static final ConnectionCategory AZURE_OPEN_AI = fromString("AzureOpenAI"); + + /** + * Static value CognitiveSearch for ConnectionCategory. + */ + public static final ConnectionCategory COGNITIVE_SEARCH = fromString("CognitiveSearch"); + + /** + * Static value CognitiveService for ConnectionCategory. + */ + public static final ConnectionCategory COGNITIVE_SERVICE = fromString("CognitiveService"); + + /** + * Static value CustomKeys for ConnectionCategory. + */ + public static final ConnectionCategory CUSTOM_KEYS = fromString("CustomKeys"); + + /** + * Static value AzureBlob for ConnectionCategory. + */ + public static final ConnectionCategory AZURE_BLOB = fromString("AzureBlob"); + + /** + * Static value AzureOneLake for ConnectionCategory. + */ + public static final ConnectionCategory AZURE_ONE_LAKE = fromString("AzureOneLake"); + + /** + * Static value CosmosDb for ConnectionCategory. + */ + public static final ConnectionCategory COSMOS_DB = fromString("CosmosDb"); + + /** + * Static value CosmosDbMongoDbApi for ConnectionCategory. + */ + public static final ConnectionCategory COSMOS_DB_MONGO_DB_API = fromString("CosmosDbMongoDbApi"); + + /** + * Static value AzureDataExplorer for ConnectionCategory. + */ + public static final ConnectionCategory AZURE_DATA_EXPLORER = fromString("AzureDataExplorer"); + + /** + * Static value AzureMariaDb for ConnectionCategory. + */ + public static final ConnectionCategory AZURE_MARIA_DB = fromString("AzureMariaDb"); + + /** + * Static value AzureDatabricksDeltaLake for ConnectionCategory. + */ + public static final ConnectionCategory AZURE_DATABRICKS_DELTA_LAKE = fromString("AzureDatabricksDeltaLake"); + + /** + * Static value AzureSqlMi for ConnectionCategory. + */ + public static final ConnectionCategory AZURE_SQL_MI = fromString("AzureSqlMi"); + + /** + * Static value AzureTableStorage for ConnectionCategory. + */ + public static final ConnectionCategory AZURE_TABLE_STORAGE = fromString("AzureTableStorage"); + + /** + * Static value AmazonRdsForOracle for ConnectionCategory. + */ + public static final ConnectionCategory AMAZON_RDS_FOR_ORACLE = fromString("AmazonRdsForOracle"); + + /** + * Static value AmazonRdsForSqlServer for ConnectionCategory. + */ + public static final ConnectionCategory AMAZON_RDS_FOR_SQL_SERVER = fromString("AmazonRdsForSqlServer"); + + /** + * Static value AmazonRedshift for ConnectionCategory. + */ + public static final ConnectionCategory AMAZON_REDSHIFT = fromString("AmazonRedshift"); + + /** + * Static value Db2 for ConnectionCategory. + */ + public static final ConnectionCategory DB2 = fromString("Db2"); + + /** + * Static value Drill for ConnectionCategory. + */ + public static final ConnectionCategory DRILL = fromString("Drill"); + + /** + * Static value GoogleBigQuery for ConnectionCategory. + */ + public static final ConnectionCategory GOOGLE_BIG_QUERY = fromString("GoogleBigQuery"); + + /** + * Static value Greenplum for ConnectionCategory. + */ + public static final ConnectionCategory GREENPLUM = fromString("Greenplum"); + + /** + * Static value Hbase for ConnectionCategory. + */ + public static final ConnectionCategory HBASE = fromString("Hbase"); + + /** + * Static value Hive for ConnectionCategory. + */ + public static final ConnectionCategory HIVE = fromString("Hive"); + + /** + * Static value Impala for ConnectionCategory. + */ + public static final ConnectionCategory IMPALA = fromString("Impala"); + + /** + * Static value Informix for ConnectionCategory. + */ + public static final ConnectionCategory INFORMIX = fromString("Informix"); + + /** + * Static value MariaDb for ConnectionCategory. + */ + public static final ConnectionCategory MARIA_DB = fromString("MariaDb"); + + /** + * Static value MicrosoftAccess for ConnectionCategory. + */ + public static final ConnectionCategory MICROSOFT_ACCESS = fromString("MicrosoftAccess"); + + /** + * Static value MySql for ConnectionCategory. + */ + public static final ConnectionCategory MY_SQL = fromString("MySql"); + + /** + * Static value Netezza for ConnectionCategory. + */ + public static final ConnectionCategory NETEZZA = fromString("Netezza"); + + /** + * Static value Oracle for ConnectionCategory. + */ + public static final ConnectionCategory ORACLE = fromString("Oracle"); + + /** + * Static value Phoenix for ConnectionCategory. + */ + public static final ConnectionCategory PHOENIX = fromString("Phoenix"); + + /** + * Static value PostgreSql for ConnectionCategory. + */ + public static final ConnectionCategory POSTGRE_SQL = fromString("PostgreSql"); + + /** + * Static value Presto for ConnectionCategory. + */ + public static final ConnectionCategory PRESTO = fromString("Presto"); + + /** + * Static value SapOpenHub for ConnectionCategory. + */ + public static final ConnectionCategory SAP_OPEN_HUB = fromString("SapOpenHub"); + + /** + * Static value SapBw for ConnectionCategory. + */ + public static final ConnectionCategory SAP_BW = fromString("SapBw"); + + /** + * Static value SapHana for ConnectionCategory. + */ + public static final ConnectionCategory SAP_HANA = fromString("SapHana"); + + /** + * Static value SapTable for ConnectionCategory. + */ + public static final ConnectionCategory SAP_TABLE = fromString("SapTable"); + + /** + * Static value Spark for ConnectionCategory. + */ + public static final ConnectionCategory SPARK = fromString("Spark"); + + /** + * Static value SqlServer for ConnectionCategory. + */ + public static final ConnectionCategory SQL_SERVER = fromString("SqlServer"); + + /** + * Static value Sybase for ConnectionCategory. + */ + public static final ConnectionCategory SYBASE = fromString("Sybase"); + + /** + * Static value Teradata for ConnectionCategory. + */ + public static final ConnectionCategory TERADATA = fromString("Teradata"); + + /** + * Static value Vertica for ConnectionCategory. + */ + public static final ConnectionCategory VERTICA = fromString("Vertica"); + + /** + * Static value Cassandra for ConnectionCategory. + */ + public static final ConnectionCategory CASSANDRA = fromString("Cassandra"); + + /** + * Static value Couchbase for ConnectionCategory. + */ + public static final ConnectionCategory COUCHBASE = fromString("Couchbase"); + + /** + * Static value MongoDbV2 for ConnectionCategory. + */ + public static final ConnectionCategory MONGO_DB_V2 = fromString("MongoDbV2"); + + /** + * Static value MongoDbAtlas for ConnectionCategory. + */ + public static final ConnectionCategory MONGO_DB_ATLAS = fromString("MongoDbAtlas"); + + /** + * Static value AmazonS3Compatible for ConnectionCategory. + */ + public static final ConnectionCategory AMAZON_S3COMPATIBLE = fromString("AmazonS3Compatible"); + + /** + * Static value FileServer for ConnectionCategory. + */ + public static final ConnectionCategory FILE_SERVER = fromString("FileServer"); + + /** + * Static value FtpServer for ConnectionCategory. + */ + public static final ConnectionCategory FTP_SERVER = fromString("FtpServer"); + + /** + * Static value GoogleCloudStorage for ConnectionCategory. + */ + public static final ConnectionCategory GOOGLE_CLOUD_STORAGE = fromString("GoogleCloudStorage"); + + /** + * Static value Hdfs for ConnectionCategory. + */ + public static final ConnectionCategory HDFS = fromString("Hdfs"); + + /** + * Static value OracleCloudStorage for ConnectionCategory. + */ + public static final ConnectionCategory ORACLE_CLOUD_STORAGE = fromString("OracleCloudStorage"); + + /** + * Static value Sftp for ConnectionCategory. + */ + public static final ConnectionCategory SFTP = fromString("Sftp"); + + /** + * Static value GenericHttp for ConnectionCategory. + */ + public static final ConnectionCategory GENERIC_HTTP = fromString("GenericHttp"); + + /** + * Static value ODataRest for ConnectionCategory. + */ + public static final ConnectionCategory ODATA_REST = fromString("ODataRest"); + + /** + * Static value Odbc for ConnectionCategory. + */ + public static final ConnectionCategory ODBC = fromString("Odbc"); + + /** + * Static value GenericRest for ConnectionCategory. + */ + public static final ConnectionCategory GENERIC_REST = fromString("GenericRest"); + + /** + * Static value AmazonMws for ConnectionCategory. + */ + public static final ConnectionCategory AMAZON_MWS = fromString("AmazonMws"); + + /** + * Static value Concur for ConnectionCategory. + */ + public static final ConnectionCategory CONCUR = fromString("Concur"); + + /** + * Static value Dynamics for ConnectionCategory. + */ + public static final ConnectionCategory DYNAMICS = fromString("Dynamics"); + + /** + * Static value DynamicsAx for ConnectionCategory. + */ + public static final ConnectionCategory DYNAMICS_AX = fromString("DynamicsAx"); + + /** + * Static value DynamicsCrm for ConnectionCategory. + */ + public static final ConnectionCategory DYNAMICS_CRM = fromString("DynamicsCrm"); + + /** + * Static value GoogleAdWords for ConnectionCategory. + */ + public static final ConnectionCategory GOOGLE_AD_WORDS = fromString("GoogleAdWords"); + + /** + * Static value Hubspot for ConnectionCategory. + */ + public static final ConnectionCategory HUBSPOT = fromString("Hubspot"); + + /** + * Static value Jira for ConnectionCategory. + */ + public static final ConnectionCategory JIRA = fromString("Jira"); + + /** + * Static value Magento for ConnectionCategory. + */ + public static final ConnectionCategory MAGENTO = fromString("Magento"); + + /** + * Static value Marketo for ConnectionCategory. + */ + public static final ConnectionCategory MARKETO = fromString("Marketo"); + + /** + * Static value Office365 for ConnectionCategory. + */ + public static final ConnectionCategory OFFICE365 = fromString("Office365"); + + /** + * Static value Eloqua for ConnectionCategory. + */ + public static final ConnectionCategory ELOQUA = fromString("Eloqua"); + + /** + * Static value Responsys for ConnectionCategory. + */ + public static final ConnectionCategory RESPONSYS = fromString("Responsys"); + + /** + * Static value OracleServiceCloud for ConnectionCategory. + */ + public static final ConnectionCategory ORACLE_SERVICE_CLOUD = fromString("OracleServiceCloud"); + + /** + * Static value PayPal for ConnectionCategory. + */ + public static final ConnectionCategory PAY_PAL = fromString("PayPal"); + + /** + * Static value QuickBooks for ConnectionCategory. + */ + public static final ConnectionCategory QUICK_BOOKS = fromString("QuickBooks"); + + /** + * Static value Salesforce for ConnectionCategory. + */ + public static final ConnectionCategory SALESFORCE = fromString("Salesforce"); + + /** + * Static value SalesforceServiceCloud for ConnectionCategory. + */ + public static final ConnectionCategory SALESFORCE_SERVICE_CLOUD = fromString("SalesforceServiceCloud"); + + /** + * Static value SalesforceMarketingCloud for ConnectionCategory. + */ + public static final ConnectionCategory SALESFORCE_MARKETING_CLOUD = fromString("SalesforceMarketingCloud"); + + /** + * Static value SapCloudForCustomer for ConnectionCategory. + */ + public static final ConnectionCategory SAP_CLOUD_FOR_CUSTOMER = fromString("SapCloudForCustomer"); + + /** + * Static value SapEcc for ConnectionCategory. + */ + public static final ConnectionCategory SAP_ECC = fromString("SapEcc"); + + /** + * Static value ServiceNow for ConnectionCategory. + */ + public static final ConnectionCategory SERVICE_NOW = fromString("ServiceNow"); + + /** + * Static value SharePointOnlineList for ConnectionCategory. + */ + public static final ConnectionCategory SHARE_POINT_ONLINE_LIST = fromString("SharePointOnlineList"); + + /** + * Static value Shopify for ConnectionCategory. + */ + public static final ConnectionCategory SHOPIFY = fromString("Shopify"); + + /** + * Static value Square for ConnectionCategory. + */ + public static final ConnectionCategory SQUARE = fromString("Square"); + + /** + * Static value WebTable for ConnectionCategory. + */ + public static final ConnectionCategory WEB_TABLE = fromString("WebTable"); + + /** + * Static value Xero for ConnectionCategory. + */ + public static final ConnectionCategory XERO = fromString("Xero"); + + /** + * Static value Zoho for ConnectionCategory. + */ + public static final ConnectionCategory ZOHO = fromString("Zoho"); + + /** + * Static value GenericContainerRegistry for ConnectionCategory. + */ + public static final ConnectionCategory GENERIC_CONTAINER_REGISTRY = fromString("GenericContainerRegistry"); + + /** + * Static value OpenAI for ConnectionCategory. + */ + public static final ConnectionCategory OPEN_AI = fromString("OpenAI"); + + /** + * Static value Serp for ConnectionCategory. + */ + public static final ConnectionCategory SERP = fromString("Serp"); + + /** + * Static value BingLLMSearch for ConnectionCategory. + */ + public static final ConnectionCategory BING_LLMSEARCH = fromString("BingLLMSearch"); + + /** + * Static value Serverless for ConnectionCategory. + */ + public static final ConnectionCategory SERVERLESS = fromString("Serverless"); + + /** + * Static value AIServices for ConnectionCategory. + */ + public static final ConnectionCategory AISERVICES = fromString("AIServices"); + /** * Creates a new instance of ConnectionCategory value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +532,17 @@ public ConnectionCategory() { /** * Creates or finds a ConnectionCategory from its string representation. - * + * * @param name a name to look for. * @return the corresponding ConnectionCategory. */ - @JsonCreator public static ConnectionCategory fromString(String name) { return fromString(name, ConnectionCategory.class); } /** * Gets known ConnectionCategory values. - * + * * @return known ConnectionCategory values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ConnectionGroup.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ConnectionGroup.java new file mode 100644 index 0000000000000..095930dc350f1 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ConnectionGroup.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Group based on connection category. + */ +public final class ConnectionGroup extends ExpandableStringEnum { + /** + * Static value Azure for ConnectionGroup. + */ + public static final ConnectionGroup AZURE = fromString("Azure"); + + /** + * Static value AzureAI for ConnectionGroup. + */ + public static final ConnectionGroup AZURE_AI = fromString("AzureAI"); + + /** + * Static value Database for ConnectionGroup. + */ + public static final ConnectionGroup DATABASE = fromString("Database"); + + /** + * Static value NoSQL for ConnectionGroup. + */ + public static final ConnectionGroup NO_SQL = fromString("NoSQL"); + + /** + * Static value File for ConnectionGroup. + */ + public static final ConnectionGroup FILE = fromString("File"); + + /** + * Static value GenericProtocol for ConnectionGroup. + */ + public static final ConnectionGroup GENERIC_PROTOCOL = fromString("GenericProtocol"); + + /** + * Static value ServicesAndApps for ConnectionGroup. + */ + public static final ConnectionGroup SERVICES_AND_APPS = fromString("ServicesAndApps"); + + /** + * Creates a new instance of ConnectionGroup value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConnectionGroup() { + } + + /** + * Creates or finds a ConnectionGroup from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectionGroup. + */ + public static ConnectionGroup fromString(String name) { + return fromString(name, ConnectionGroup.class); + } + + /** + * Gets known ConnectionGroup values. + * + * @return known ConnectionGroup values. + */ + public static Collection values() { + return values(ConnectionGroup.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ContainerResourceRequirements.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ContainerResourceRequirements.java index 433207abb0904..c97f343dcc245 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ContainerResourceRequirements.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ContainerResourceRequirements.java @@ -5,30 +5,36 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Resource requirements for each container instance within an online deployment. */ +/** + * Resource requirements for each container instance within an online deployment. + */ @Fluent -public final class ContainerResourceRequirements { +public final class ContainerResourceRequirements implements JsonSerializable { /* * Container resource limit info: */ - @JsonProperty(value = "containerResourceLimits") private ContainerResourceSettings containerResourceLimits; /* * Container resource request info: */ - @JsonProperty(value = "containerResourceRequests") private ContainerResourceSettings containerResourceRequests; - /** Creates an instance of ContainerResourceRequirements class. */ + /** + * Creates an instance of ContainerResourceRequirements class. + */ public ContainerResourceRequirements() { } /** * Get the containerResourceLimits property: Container resource limit info:. - * + * * @return the containerResourceLimits value. */ public ContainerResourceSettings containerResourceLimits() { @@ -37,19 +43,19 @@ public ContainerResourceSettings containerResourceLimits() { /** * Set the containerResourceLimits property: Container resource limit info:. - * + * * @param containerResourceLimits the containerResourceLimits value to set. * @return the ContainerResourceRequirements object itself. */ - public ContainerResourceRequirements withContainerResourceLimits( - ContainerResourceSettings containerResourceLimits) { + public ContainerResourceRequirements + withContainerResourceLimits(ContainerResourceSettings containerResourceLimits) { this.containerResourceLimits = containerResourceLimits; return this; } /** * Get the containerResourceRequests property: Container resource request info:. - * + * * @return the containerResourceRequests value. */ public ContainerResourceSettings containerResourceRequests() { @@ -58,19 +64,19 @@ public ContainerResourceSettings containerResourceRequests() { /** * Set the containerResourceRequests property: Container resource request info:. - * + * * @param containerResourceRequests the containerResourceRequests value to set. * @return the ContainerResourceRequirements object itself. */ - public ContainerResourceRequirements withContainerResourceRequests( - ContainerResourceSettings containerResourceRequests) { + public ContainerResourceRequirements + withContainerResourceRequests(ContainerResourceSettings containerResourceRequests) { this.containerResourceRequests = containerResourceRequests; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -81,4 +87,46 @@ public void validate() { containerResourceRequests().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("containerResourceLimits", this.containerResourceLimits); + jsonWriter.writeJsonField("containerResourceRequests", this.containerResourceRequests); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerResourceRequirements from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerResourceRequirements if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ContainerResourceRequirements. + */ + public static ContainerResourceRequirements fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerResourceRequirements deserializedContainerResourceRequirements + = new ContainerResourceRequirements(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("containerResourceLimits".equals(fieldName)) { + deserializedContainerResourceRequirements.containerResourceLimits + = ContainerResourceSettings.fromJson(reader); + } else if ("containerResourceRequests".equals(fieldName)) { + deserializedContainerResourceRequirements.containerResourceRequests + = ContainerResourceSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerResourceRequirements; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ContainerResourceSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ContainerResourceSettings.java index ef47459f3731e..6747613c38088 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ContainerResourceSettings.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ContainerResourceSettings.java @@ -5,40 +5,45 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The ContainerResourceSettings model. */ +/** + * The ContainerResourceSettings model. + */ @Fluent -public final class ContainerResourceSettings { +public final class ContainerResourceSettings implements JsonSerializable { /* * Number of vCPUs request/limit for container. More info: * https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ */ - @JsonProperty(value = "cpu") private String cpu; /* * Number of Nvidia GPU cards request/limit for container. More info: * https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ */ - @JsonProperty(value = "gpu") private String gpu; /* * Memory size request/limit for container. More info: * https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ */ - @JsonProperty(value = "memory") private String memory; - /** Creates an instance of ContainerResourceSettings class. */ + /** + * Creates an instance of ContainerResourceSettings class. + */ public ContainerResourceSettings() { } /** * Get the cpu property: Number of vCPUs request/limit for container. More info: * https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - * + * * @return the cpu value. */ public String cpu() { @@ -48,7 +53,7 @@ public String cpu() { /** * Set the cpu property: Number of vCPUs request/limit for container. More info: * https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - * + * * @param cpu the cpu value to set. * @return the ContainerResourceSettings object itself. */ @@ -60,7 +65,7 @@ public ContainerResourceSettings withCpu(String cpu) { /** * Get the gpu property: Number of Nvidia GPU cards request/limit for container. More info: * https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - * + * * @return the gpu value. */ public String gpu() { @@ -70,7 +75,7 @@ public String gpu() { /** * Set the gpu property: Number of Nvidia GPU cards request/limit for container. More info: * https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - * + * * @param gpu the gpu value to set. * @return the ContainerResourceSettings object itself. */ @@ -82,7 +87,7 @@ public ContainerResourceSettings withGpu(String gpu) { /** * Get the memory property: Memory size request/limit for container. More info: * https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - * + * * @return the memory value. */ public String memory() { @@ -92,7 +97,7 @@ public String memory() { /** * Set the memory property: Memory size request/limit for container. More info: * https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/. - * + * * @param memory the memory value to set. * @return the ContainerResourceSettings object itself. */ @@ -103,9 +108,51 @@ public ContainerResourceSettings withMemory(String memory) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("cpu", this.cpu); + jsonWriter.writeStringField("gpu", this.gpu); + jsonWriter.writeStringField("memory", this.memory); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerResourceSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerResourceSettings if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ContainerResourceSettings. + */ + public static ContainerResourceSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerResourceSettings deserializedContainerResourceSettings = new ContainerResourceSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cpu".equals(fieldName)) { + deserializedContainerResourceSettings.cpu = reader.getString(); + } else if ("gpu".equals(fieldName)) { + deserializedContainerResourceSettings.gpu = reader.getString(); + } else if ("memory".equals(fieldName)) { + deserializedContainerResourceSettings.memory = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerResourceSettings; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ContainerType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ContainerType.java index 68f7ef4621c57..31f8e6fb84c1b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ContainerType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ContainerType.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ContainerType. */ +/** + * Defines values for ContainerType. + */ public final class ContainerType extends ExpandableStringEnum { - /** Static value StorageInitializer for ContainerType. */ + /** + * Static value StorageInitializer for ContainerType. + */ public static final ContainerType STORAGE_INITIALIZER = fromString("StorageInitializer"); - /** Static value InferenceServer for ContainerType. */ + /** + * Static value InferenceServer for ContainerType. + */ public static final ContainerType INFERENCE_SERVER = fromString("InferenceServer"); /** * Creates a new instance of ContainerType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public ContainerType() { /** * Creates or finds a ContainerType from its string representation. - * + * * @param name a name to look for. * @return the corresponding ContainerType. */ - @JsonCreator public static ContainerType fromString(String name) { return fromString(name, ContainerType.class); } /** * Gets known ContainerType values. - * + * * @return known ContainerType values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ContentSafety.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ContentSafety.java new file mode 100644 index 0000000000000..e804a39a53b57 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ContentSafety.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The ContentSafety model. + */ +@Fluent +public final class ContentSafety implements JsonSerializable { + /* + * [Required] Specifies the status of content safety. + */ + private ContentSafetyStatus contentSafetyStatus; + + /** + * Creates an instance of ContentSafety class. + */ + public ContentSafety() { + } + + /** + * Get the contentSafetyStatus property: [Required] Specifies the status of content safety. + * + * @return the contentSafetyStatus value. + */ + public ContentSafetyStatus contentSafetyStatus() { + return this.contentSafetyStatus; + } + + /** + * Set the contentSafetyStatus property: [Required] Specifies the status of content safety. + * + * @param contentSafetyStatus the contentSafetyStatus value to set. + * @return the ContentSafety object itself. + */ + public ContentSafety withContentSafetyStatus(ContentSafetyStatus contentSafetyStatus) { + this.contentSafetyStatus = contentSafetyStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (contentSafetyStatus() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property contentSafetyStatus in model ContentSafety")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContentSafety.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("contentSafetyStatus", + this.contentSafetyStatus == null ? null : this.contentSafetyStatus.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContentSafety from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContentSafety if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ContentSafety. + */ + public static ContentSafety fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContentSafety deserializedContentSafety = new ContentSafety(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("contentSafetyStatus".equals(fieldName)) { + deserializedContentSafety.contentSafetyStatus = ContentSafetyStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedContentSafety; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ContentSafetyStatus.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ContentSafetyStatus.java new file mode 100644 index 0000000000000..22cba5cdda410 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ContentSafetyStatus.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specifies the status of content safety. + */ +public final class ContentSafetyStatus extends ExpandableStringEnum { + /** + * Static value Enabled for ContentSafetyStatus. + */ + public static final ContentSafetyStatus ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for ContentSafetyStatus. + */ + public static final ContentSafetyStatus DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of ContentSafetyStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ContentSafetyStatus() { + } + + /** + * Creates or finds a ContentSafetyStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContentSafetyStatus. + */ + public static ContentSafetyStatus fromString(String name) { + return fromString(name, ContentSafetyStatus.class); + } + + /** + * Gets known ContentSafetyStatus values. + * + * @return known ContentSafetyStatus values. + */ + public static Collection values() { + return values(ContentSafetyStatus.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CosmosDbSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CosmosDbSettings.java index 0b05e1cfaf609..1578c354e5d99 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CosmosDbSettings.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CosmosDbSettings.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The CosmosDbSettings model. */ +/** + * The CosmosDbSettings model. + */ @Fluent -public final class CosmosDbSettings { +public final class CosmosDbSettings implements JsonSerializable { /* * The throughput of the collections in cosmosdb database */ - @JsonProperty(value = "collectionsThroughput") private Integer collectionsThroughput; - /** Creates an instance of CosmosDbSettings class. */ + /** + * Creates an instance of CosmosDbSettings class. + */ public CosmosDbSettings() { } /** * Get the collectionsThroughput property: The throughput of the collections in cosmosdb database. - * + * * @return the collectionsThroughput value. */ public Integer collectionsThroughput() { @@ -31,7 +38,7 @@ public Integer collectionsThroughput() { /** * Set the collectionsThroughput property: The throughput of the collections in cosmosdb database. - * + * * @param collectionsThroughput the collectionsThroughput value to set. * @return the CosmosDbSettings object itself. */ @@ -42,9 +49,45 @@ public CosmosDbSettings withCollectionsThroughput(Integer collectionsThroughput) /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("collectionsThroughput", this.collectionsThroughput); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CosmosDbSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CosmosDbSettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CosmosDbSettings. + */ + public static CosmosDbSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CosmosDbSettings deserializedCosmosDbSettings = new CosmosDbSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("collectionsThroughput".equals(fieldName)) { + deserializedCosmosDbSettings.collectionsThroughput = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedCosmosDbSettings; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CreateMonitorAction.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CreateMonitorAction.java new file mode 100644 index 0000000000000..c98290a484ccb --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CreateMonitorAction.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The CreateMonitorAction model. + */ +@Fluent +public final class CreateMonitorAction extends ScheduleActionBase { + /* + * [Required] Specifies the action type of the schedule + */ + private ScheduleActionType actionType = ScheduleActionType.CREATE_MONITOR; + + /* + * [Required] Defines the monitor. + */ + private MonitorDefinition monitorDefinition; + + /** + * Creates an instance of CreateMonitorAction class. + */ + public CreateMonitorAction() { + } + + /** + * Get the actionType property: [Required] Specifies the action type of the schedule. + * + * @return the actionType value. + */ + @Override + public ScheduleActionType actionType() { + return this.actionType; + } + + /** + * Get the monitorDefinition property: [Required] Defines the monitor. + * + * @return the monitorDefinition value. + */ + public MonitorDefinition monitorDefinition() { + return this.monitorDefinition; + } + + /** + * Set the monitorDefinition property: [Required] Defines the monitor. + * + * @param monitorDefinition the monitorDefinition value to set. + * @return the CreateMonitorAction object itself. + */ + public CreateMonitorAction withMonitorDefinition(MonitorDefinition monitorDefinition) { + this.monitorDefinition = monitorDefinition; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (monitorDefinition() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property monitorDefinition in model CreateMonitorAction")); + } else { + monitorDefinition().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CreateMonitorAction.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("monitorDefinition", this.monitorDefinition); + jsonWriter.writeStringField("actionType", this.actionType == null ? null : this.actionType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CreateMonitorAction from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CreateMonitorAction if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CreateMonitorAction. + */ + public static CreateMonitorAction fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CreateMonitorAction deserializedCreateMonitorAction = new CreateMonitorAction(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("monitorDefinition".equals(fieldName)) { + deserializedCreateMonitorAction.monitorDefinition = MonitorDefinition.fromJson(reader); + } else if ("actionType".equals(fieldName)) { + deserializedCreateMonitorAction.actionType = ScheduleActionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCreateMonitorAction; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CredentialsType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CredentialsType.java index 7596a8d963da1..da5ce9a5ee0a3 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CredentialsType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CredentialsType.java @@ -5,29 +5,40 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Enum to determine the datastore credentials type. */ +/** + * Enum to determine the datastore credentials type. + */ public final class CredentialsType extends ExpandableStringEnum { - /** Static value AccountKey for CredentialsType. */ + /** + * Static value AccountKey for CredentialsType. + */ public static final CredentialsType ACCOUNT_KEY = fromString("AccountKey"); - /** Static value Certificate for CredentialsType. */ + /** + * Static value Certificate for CredentialsType. + */ public static final CredentialsType CERTIFICATE = fromString("Certificate"); - /** Static value None for CredentialsType. */ + /** + * Static value None for CredentialsType. + */ public static final CredentialsType NONE = fromString("None"); - /** Static value Sas for CredentialsType. */ + /** + * Static value Sas for CredentialsType. + */ public static final CredentialsType SAS = fromString("Sas"); - /** Static value ServicePrincipal for CredentialsType. */ + /** + * Static value ServicePrincipal for CredentialsType. + */ public static final CredentialsType SERVICE_PRINCIPAL = fromString("ServicePrincipal"); /** * Creates a new instance of CredentialsType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -36,18 +47,17 @@ public CredentialsType() { /** * Creates or finds a CredentialsType from its string representation. - * + * * @param name a name to look for. * @return the corresponding CredentialsType. */ - @JsonCreator public static CredentialsType fromString(String name) { return fromString(name, CredentialsType.class); } /** * Gets known CredentialsType values. - * + * * @return known CredentialsType values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Cron.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Cron.java new file mode 100644 index 0000000000000..bdfe885b64375 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Cron.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The workflow trigger cron for ComputeStartStop schedule type. + */ +@Fluent +public final class Cron implements JsonSerializable { + /* + * The start time in yyyy-MM-ddTHH:mm:ss format. + */ + private String startTime; + + /* + * 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 + */ + private String timeZone; + + /* + * [Required] Specifies cron expression of schedule. + * The expression should follow NCronTab format. + */ + private String expression; + + /** + * Creates an instance of Cron class. + */ + public Cron() { + } + + /** + * Get the startTime property: The start time in yyyy-MM-ddTHH:mm:ss format. + * + * @return the startTime value. + */ + public String startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The start time in yyyy-MM-ddTHH:mm:ss format. + * + * @param startTime the startTime value to set. + * @return the Cron object itself. + */ + public Cron withStartTime(String startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the timeZone property: 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. + * + * @return the timeZone value. + */ + public String timeZone() { + return this.timeZone; + } + + /** + * Set the timeZone property: 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. + * + * @param timeZone the timeZone value to set. + * @return the Cron object itself. + */ + public Cron withTimeZone(String timeZone) { + this.timeZone = timeZone; + return this; + } + + /** + * Get the expression property: [Required] Specifies cron expression of schedule. + * The expression should follow NCronTab format. + * + * @return the expression value. + */ + public String expression() { + return this.expression; + } + + /** + * Set the expression property: [Required] Specifies cron expression of schedule. + * The expression should follow NCronTab format. + * + * @param expression the expression value to set. + * @return the Cron object itself. + */ + public Cron withExpression(String expression) { + this.expression = expression; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("startTime", this.startTime); + jsonWriter.writeStringField("timeZone", this.timeZone); + jsonWriter.writeStringField("expression", this.expression); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Cron from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Cron if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Cron. + */ + public static Cron fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Cron deserializedCron = new Cron(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("startTime".equals(fieldName)) { + deserializedCron.startTime = reader.getString(); + } else if ("timeZone".equals(fieldName)) { + deserializedCron.timeZone = reader.getString(); + } else if ("expression".equals(fieldName)) { + deserializedCron.expression = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCron; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CronTrigger.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CronTrigger.java index 362c9d532dc84..bcf293efc9743 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CronTrigger.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CronTrigger.java @@ -6,30 +6,47 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The CronTrigger model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "triggerType") -@JsonTypeName("Cron") +/** + * The CronTrigger model. + */ @Fluent public final class CronTrigger extends TriggerBase { + /* + * [Required] + */ + private TriggerType triggerType = TriggerType.CRON; + /* * [Required] Specifies cron expression of schedule. * The expression should follow NCronTab format. */ - @JsonProperty(value = "expression", required = true) private String expression; - /** Creates an instance of CronTrigger class. */ + /** + * Creates an instance of CronTrigger class. + */ public CronTrigger() { } /** - * Get the expression property: [Required] Specifies cron expression of schedule. The expression should follow - * NCronTab format. - * + * Get the triggerType property: [Required]. + * + * @return the triggerType value. + */ + @Override + public TriggerType triggerType() { + return this.triggerType; + } + + /** + * Get the expression property: [Required] Specifies cron expression of schedule. + * The expression should follow NCronTab format. + * * @return the expression value. */ public String expression() { @@ -37,9 +54,9 @@ public String expression() { } /** - * Set the expression property: [Required] Specifies cron expression of schedule. The expression should follow - * NCronTab format. - * + * Set the expression property: [Required] Specifies cron expression of schedule. + * The expression should follow NCronTab format. + * * @param expression the expression value to set. * @return the CronTrigger object itself. */ @@ -48,21 +65,27 @@ public CronTrigger withExpression(String expression) { return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public CronTrigger withEndTime(String endTime) { super.withEndTime(endTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public CronTrigger withStartTime(String startTime) { super.withStartTime(startTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public CronTrigger withTimeZone(String timeZone) { super.withTimeZone(timeZone); @@ -71,18 +94,66 @@ public CronTrigger withTimeZone(String timeZone) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (expression() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property expression in model CronTrigger")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property expression in model CronTrigger")); } } private static final ClientLogger LOGGER = new ClientLogger(CronTrigger.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("endTime", endTime()); + jsonWriter.writeStringField("startTime", startTime()); + jsonWriter.writeStringField("timeZone", timeZone()); + jsonWriter.writeStringField("expression", this.expression); + jsonWriter.writeStringField("triggerType", this.triggerType == null ? null : this.triggerType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CronTrigger from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CronTrigger if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CronTrigger. + */ + public static CronTrigger fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CronTrigger deserializedCronTrigger = new CronTrigger(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("endTime".equals(fieldName)) { + deserializedCronTrigger.withEndTime(reader.getString()); + } else if ("startTime".equals(fieldName)) { + deserializedCronTrigger.withStartTime(reader.getString()); + } else if ("timeZone".equals(fieldName)) { + deserializedCronTrigger.withTimeZone(reader.getString()); + } else if ("expression".equals(fieldName)) { + deserializedCronTrigger.expression = reader.getString(); + } else if ("triggerType".equals(fieldName)) { + deserializedCronTrigger.triggerType = TriggerType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCronTrigger; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomForecastHorizon.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomForecastHorizon.java index 495856b62f74e..b3d3c25650eb1 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomForecastHorizon.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomForecastHorizon.java @@ -5,28 +5,45 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The desired maximum forecast horizon in units of time-series frequency. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "mode") -@JsonTypeName("Custom") +/** + * The desired maximum forecast horizon in units of time-series frequency. + */ @Fluent public final class CustomForecastHorizon extends ForecastHorizon { + /* + * [Required] Set forecast horizon value selection mode. + */ + private ForecastHorizonMode mode = ForecastHorizonMode.CUSTOM; + /* * [Required] Forecast horizon value. */ - @JsonProperty(value = "value", required = true) private int value; - /** Creates an instance of CustomForecastHorizon class. */ + /** + * Creates an instance of CustomForecastHorizon class. + */ public CustomForecastHorizon() { } + /** + * Get the mode property: [Required] Set forecast horizon value selection mode. + * + * @return the mode value. + */ + @Override + public ForecastHorizonMode mode() { + return this.mode; + } + /** * Get the value property: [Required] Forecast horizon value. - * + * * @return the value value. */ public int value() { @@ -35,7 +52,7 @@ public int value() { /** * Set the value property: [Required] Forecast horizon value. - * + * * @param value the value value to set. * @return the CustomForecastHorizon object itself. */ @@ -46,11 +63,51 @@ public CustomForecastHorizon withValue(int value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("value", this.value); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomForecastHorizon from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomForecastHorizon if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CustomForecastHorizon. + */ + public static CustomForecastHorizon fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomForecastHorizon deserializedCustomForecastHorizon = new CustomForecastHorizon(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedCustomForecastHorizon.value = reader.getInt(); + } else if ("mode".equals(fieldName)) { + deserializedCustomForecastHorizon.mode = ForecastHorizonMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomForecastHorizon; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomKeys.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomKeys.java new file mode 100644 index 0000000000000..cde6f6ddac283 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomKeys.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Custom Keys credential object. + */ +@Fluent +public final class CustomKeys implements JsonSerializable { + /* + * Dictionary of + */ + private Map keys; + + /** + * Creates an instance of CustomKeys class. + */ + public CustomKeys() { + } + + /** + * Get the keys property: Dictionary of <string>. + * + * @return the keys value. + */ + public Map keys() { + return this.keys; + } + + /** + * Set the keys property: Dictionary of <string>. + * + * @param keys the keys value to set. + * @return the CustomKeys object itself. + */ + public CustomKeys withKeys(Map keys) { + this.keys = keys; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("keys", this.keys, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomKeys from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomKeys if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the CustomKeys. + */ + public static CustomKeys fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomKeys deserializedCustomKeys = new CustomKeys(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keys".equals(fieldName)) { + Map keys = reader.readMap(reader1 -> reader1.getString()); + deserializedCustomKeys.keys = keys; + } else { + reader.skipChildren(); + } + } + + return deserializedCustomKeys; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomKeysWorkspaceConnectionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomKeysWorkspaceConnectionProperties.java new file mode 100644 index 0000000000000..3b2acc870c515 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomKeysWorkspaceConnectionProperties.java @@ -0,0 +1,265 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; + +/** + * 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. + */ +@Fluent +public final class CustomKeysWorkspaceConnectionProperties extends WorkspaceConnectionPropertiesV2 { + /* + * Authentication type of the connection target + */ + private ConnectionAuthType authType = ConnectionAuthType.CUSTOM_KEYS; + + /* + * Custom Keys credential object + */ + private CustomKeys credentials; + + /* + * The createdByWorkspaceArmId property. + */ + private String createdByWorkspaceArmId; + + /* + * Group based on connection category + */ + private ConnectionGroup group; + + /** + * Creates an instance of CustomKeysWorkspaceConnectionProperties class. + */ + public CustomKeysWorkspaceConnectionProperties() { + } + + /** + * Get the authType property: Authentication type of the connection target. + * + * @return the authType value. + */ + @Override + public ConnectionAuthType authType() { + return this.authType; + } + + /** + * Get the credentials property: Custom Keys credential object. + * + * @return the credentials value. + */ + public CustomKeys credentials() { + return this.credentials; + } + + /** + * Set the credentials property: Custom Keys credential object. + * + * @param credentials the credentials value to set. + * @return the CustomKeysWorkspaceConnectionProperties object itself. + */ + public CustomKeysWorkspaceConnectionProperties withCredentials(CustomKeys credentials) { + this.credentials = credentials; + return this; + } + + /** + * Get the createdByWorkspaceArmId property: The createdByWorkspaceArmId property. + * + * @return the createdByWorkspaceArmId value. + */ + @Override + public String createdByWorkspaceArmId() { + return this.createdByWorkspaceArmId; + } + + /** + * Get the group property: Group based on connection category. + * + * @return the group value. + */ + @Override + public ConnectionGroup group() { + return this.group; + } + + /** + * {@inheritDoc} + */ + @Override + public CustomKeysWorkspaceConnectionProperties withCategory(ConnectionCategory category) { + super.withCategory(category); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CustomKeysWorkspaceConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { + super.withExpiryTime(expiryTime); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CustomKeysWorkspaceConnectionProperties withIsSharedToAll(Boolean isSharedToAll) { + super.withIsSharedToAll(isSharedToAll); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CustomKeysWorkspaceConnectionProperties withTarget(String target) { + super.withTarget(target); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CustomKeysWorkspaceConnectionProperties withMetadata(Map metadata) { + super.withMetadata(metadata); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CustomKeysWorkspaceConnectionProperties withSharedUserList(List sharedUserList) { + super.withSharedUserList(sharedUserList); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CustomKeysWorkspaceConnectionProperties withValue(String value) { + super.withValue(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CustomKeysWorkspaceConnectionProperties withValueFormat(ValueFormat valueFormat) { + super.withValueFormat(valueFormat); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (credentials() != null) { + credentials().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", category() == null ? null : category().toString()); + jsonWriter.writeStringField("expiryTime", + expiryTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expiryTime())); + jsonWriter.writeBooleanField("isSharedToAll", isSharedToAll()); + jsonWriter.writeStringField("target", target()); + jsonWriter.writeMapField("metadata", metadata(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("sharedUserList", sharedUserList(), + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("value", value()); + jsonWriter.writeStringField("valueFormat", valueFormat() == null ? null : valueFormat().toString()); + jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); + jsonWriter.writeJsonField("credentials", this.credentials); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomKeysWorkspaceConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomKeysWorkspaceConnectionProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CustomKeysWorkspaceConnectionProperties. + */ + public static CustomKeysWorkspaceConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomKeysWorkspaceConnectionProperties deserializedCustomKeysWorkspaceConnectionProperties + = new CustomKeysWorkspaceConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedCustomKeysWorkspaceConnectionProperties + .withCategory(ConnectionCategory.fromString(reader.getString())); + } else if ("createdByWorkspaceArmId".equals(fieldName)) { + deserializedCustomKeysWorkspaceConnectionProperties.createdByWorkspaceArmId = reader.getString(); + } else if ("expiryTime".equals(fieldName)) { + deserializedCustomKeysWorkspaceConnectionProperties.withExpiryTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("group".equals(fieldName)) { + deserializedCustomKeysWorkspaceConnectionProperties.group + = ConnectionGroup.fromString(reader.getString()); + } else if ("isSharedToAll".equals(fieldName)) { + deserializedCustomKeysWorkspaceConnectionProperties + .withIsSharedToAll(reader.getNullable(JsonReader::getBoolean)); + } else if ("target".equals(fieldName)) { + deserializedCustomKeysWorkspaceConnectionProperties.withTarget(reader.getString()); + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedCustomKeysWorkspaceConnectionProperties.withMetadata(metadata); + } else if ("sharedUserList".equals(fieldName)) { + List sharedUserList = reader.readArray(reader1 -> reader1.getString()); + deserializedCustomKeysWorkspaceConnectionProperties.withSharedUserList(sharedUserList); + } else if ("value".equals(fieldName)) { + deserializedCustomKeysWorkspaceConnectionProperties.withValue(reader.getString()); + } else if ("valueFormat".equals(fieldName)) { + deserializedCustomKeysWorkspaceConnectionProperties + .withValueFormat(ValueFormat.fromString(reader.getString())); + } else if ("authType".equals(fieldName)) { + deserializedCustomKeysWorkspaceConnectionProperties.authType + = ConnectionAuthType.fromString(reader.getString()); + } else if ("credentials".equals(fieldName)) { + deserializedCustomKeysWorkspaceConnectionProperties.credentials = CustomKeys.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomKeysWorkspaceConnectionProperties; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomMetricThreshold.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomMetricThreshold.java new file mode 100644 index 0000000000000..150faa7665585 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomMetricThreshold.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The CustomMetricThreshold model. + */ +@Fluent +public final class CustomMetricThreshold implements JsonSerializable { + /* + * [Required] The user-defined metric to calculate. + */ + private String metric; + + /* + * The threshold value. If null, a default value will be set depending on the selected metric. + */ + private MonitoringThreshold threshold; + + /** + * Creates an instance of CustomMetricThreshold class. + */ + public CustomMetricThreshold() { + } + + /** + * Get the metric property: [Required] The user-defined metric to calculate. + * + * @return the metric value. + */ + public String metric() { + return this.metric; + } + + /** + * Set the metric property: [Required] The user-defined metric to calculate. + * + * @param metric the metric value to set. + * @return the CustomMetricThreshold object itself. + */ + public CustomMetricThreshold withMetric(String metric) { + this.metric = metric; + return this; + } + + /** + * Get the threshold property: The threshold value. If null, a default value will be set depending on the selected + * metric. + * + * @return the threshold value. + */ + public MonitoringThreshold threshold() { + return this.threshold; + } + + /** + * Set the threshold property: The threshold value. If null, a default value will be set depending on the selected + * metric. + * + * @param threshold the threshold value to set. + * @return the CustomMetricThreshold object itself. + */ + public CustomMetricThreshold withThreshold(MonitoringThreshold threshold) { + this.threshold = threshold; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metric() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property metric in model CustomMetricThreshold")); + } + if (threshold() != null) { + threshold().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CustomMetricThreshold.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("metric", this.metric); + jsonWriter.writeJsonField("threshold", this.threshold); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomMetricThreshold from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomMetricThreshold if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CustomMetricThreshold. + */ + public static CustomMetricThreshold fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomMetricThreshold deserializedCustomMetricThreshold = new CustomMetricThreshold(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("metric".equals(fieldName)) { + deserializedCustomMetricThreshold.metric = reader.getString(); + } else if ("threshold".equals(fieldName)) { + deserializedCustomMetricThreshold.threshold = MonitoringThreshold.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomMetricThreshold; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomModelFineTuning.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomModelFineTuning.java new file mode 100644 index 0000000000000..cd5d32258cc78 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomModelFineTuning.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The CustomModelFineTuning model. + */ +@Fluent +public final class CustomModelFineTuning extends FineTuningVertical { + /* + * [Required] Enum to determine the type of fine tuning. + */ + private ModelProvider modelProvider = ModelProvider.CUSTOM; + + /* + * HyperParameters for fine tuning custom model. + */ + private Map hyperParameters; + + /** + * Creates an instance of CustomModelFineTuning class. + */ + public CustomModelFineTuning() { + } + + /** + * Get the modelProvider property: [Required] Enum to determine the type of fine tuning. + * + * @return the modelProvider value. + */ + @Override + public ModelProvider modelProvider() { + return this.modelProvider; + } + + /** + * Get the hyperParameters property: HyperParameters for fine tuning custom model. + * + * @return the hyperParameters value. + */ + public Map hyperParameters() { + return this.hyperParameters; + } + + /** + * Set the hyperParameters property: HyperParameters for fine tuning custom model. + * + * @param hyperParameters the hyperParameters value to set. + * @return the CustomModelFineTuning object itself. + */ + public CustomModelFineTuning withHyperParameters(Map hyperParameters) { + this.hyperParameters = hyperParameters; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CustomModelFineTuning withTaskType(FineTuningTaskType taskType) { + super.withTaskType(taskType); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CustomModelFineTuning withTrainingData(JobInput trainingData) { + super.withTrainingData(trainingData); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CustomModelFineTuning withValidationData(JobInput validationData) { + super.withValidationData(validationData); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CustomModelFineTuning withModel(MLFlowModelJobInput model) { + super.withModel(model); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("taskType", taskType() == null ? null : taskType().toString()); + jsonWriter.writeJsonField("trainingData", trainingData()); + jsonWriter.writeJsonField("model", model()); + jsonWriter.writeJsonField("validationData", validationData()); + jsonWriter.writeStringField("modelProvider", this.modelProvider == null ? null : this.modelProvider.toString()); + jsonWriter.writeMapField("hyperParameters", this.hyperParameters, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomModelFineTuning from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomModelFineTuning if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CustomModelFineTuning. + */ + public static CustomModelFineTuning fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomModelFineTuning deserializedCustomModelFineTuning = new CustomModelFineTuning(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("taskType".equals(fieldName)) { + deserializedCustomModelFineTuning.withTaskType(FineTuningTaskType.fromString(reader.getString())); + } else if ("trainingData".equals(fieldName)) { + deserializedCustomModelFineTuning.withTrainingData(JobInput.fromJson(reader)); + } else if ("model".equals(fieldName)) { + deserializedCustomModelFineTuning.withModel(MLFlowModelJobInput.fromJson(reader)); + } else if ("validationData".equals(fieldName)) { + deserializedCustomModelFineTuning.withValidationData(JobInput.fromJson(reader)); + } else if ("modelProvider".equals(fieldName)) { + deserializedCustomModelFineTuning.modelProvider = ModelProvider.fromString(reader.getString()); + } else if ("hyperParameters".equals(fieldName)) { + Map hyperParameters = reader.readMap(reader1 -> reader1.getString()); + deserializedCustomModelFineTuning.hyperParameters = hyperParameters; + } else { + reader.skipChildren(); + } + } + + return deserializedCustomModelFineTuning; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomModelJobInput.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomModelJobInput.java index 65061d9cdf229..3bf262f1e7cf7 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomModelJobInput.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomModelJobInput.java @@ -6,34 +6,50 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The CustomModelJobInput model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobInputType") -@JsonTypeName("custom_model") +/** + * The CustomModelJobInput model. + */ @Fluent public final class CustomModelJobInput extends JobInput { + /* + * [Required] Specifies the type of job. + */ + private JobInputType jobInputType = JobInputType.CUSTOM_MODEL; + /* * Input Asset Delivery Mode. */ - @JsonProperty(value = "mode") private InputDeliveryMode mode; /* * [Required] Input Asset URI. */ - @JsonProperty(value = "uri", required = true) private String uri; - /** Creates an instance of CustomModelJobInput class. */ + /** + * Creates an instance of CustomModelJobInput class. + */ public CustomModelJobInput() { } + /** + * Get the jobInputType property: [Required] Specifies the type of job. + * + * @return the jobInputType value. + */ + @Override + public JobInputType jobInputType() { + return this.jobInputType; + } + /** * Get the mode property: Input Asset Delivery Mode. - * + * * @return the mode value. */ public InputDeliveryMode mode() { @@ -42,7 +58,7 @@ public InputDeliveryMode mode() { /** * Set the mode property: Input Asset Delivery Mode. - * + * * @param mode the mode value to set. * @return the CustomModelJobInput object itself. */ @@ -53,7 +69,7 @@ public CustomModelJobInput withMode(InputDeliveryMode mode) { /** * Get the uri property: [Required] Input Asset URI. - * + * * @return the uri value. */ public String uri() { @@ -62,7 +78,7 @@ public String uri() { /** * Set the uri property: [Required] Input Asset URI. - * + * * @param uri the uri value to set. * @return the CustomModelJobInput object itself. */ @@ -71,7 +87,9 @@ public CustomModelJobInput withUri(String uri) { return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public CustomModelJobInput withDescription(String description) { super.withDescription(description); @@ -80,18 +98,63 @@ public CustomModelJobInput withDescription(String description) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (uri() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property uri in model CustomModelJobInput")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property uri in model CustomModelJobInput")); } } private static final ClientLogger LOGGER = new ClientLogger(CustomModelJobInput.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("uri", this.uri); + jsonWriter.writeStringField("jobInputType", this.jobInputType == null ? null : this.jobInputType.toString()); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomModelJobInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomModelJobInput if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CustomModelJobInput. + */ + public static CustomModelJobInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomModelJobInput deserializedCustomModelJobInput = new CustomModelJobInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedCustomModelJobInput.withDescription(reader.getString()); + } else if ("uri".equals(fieldName)) { + deserializedCustomModelJobInput.uri = reader.getString(); + } else if ("jobInputType".equals(fieldName)) { + deserializedCustomModelJobInput.jobInputType = JobInputType.fromString(reader.getString()); + } else if ("mode".equals(fieldName)) { + deserializedCustomModelJobInput.mode = InputDeliveryMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomModelJobInput; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomModelJobOutput.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomModelJobOutput.java index b68ea2621db98..1b5caea24254f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomModelJobOutput.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomModelJobOutput.java @@ -5,34 +5,50 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The CustomModelJobOutput model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobOutputType") -@JsonTypeName("custom_model") +/** + * The CustomModelJobOutput model. + */ @Fluent public final class CustomModelJobOutput extends JobOutput { + /* + * [Required] Specifies the type of job. + */ + private JobOutputType jobOutputType = JobOutputType.CUSTOM_MODEL; + /* * Output Asset Delivery Mode. */ - @JsonProperty(value = "mode") private OutputDeliveryMode mode; /* * Output Asset URI. */ - @JsonProperty(value = "uri") private String uri; - /** Creates an instance of CustomModelJobOutput class. */ + /** + * Creates an instance of CustomModelJobOutput class. + */ public CustomModelJobOutput() { } + /** + * Get the jobOutputType property: [Required] Specifies the type of job. + * + * @return the jobOutputType value. + */ + @Override + public JobOutputType jobOutputType() { + return this.jobOutputType; + } + /** * Get the mode property: Output Asset Delivery Mode. - * + * * @return the mode value. */ public OutputDeliveryMode mode() { @@ -41,7 +57,7 @@ public OutputDeliveryMode mode() { /** * Set the mode property: Output Asset Delivery Mode. - * + * * @param mode the mode value to set. * @return the CustomModelJobOutput object itself. */ @@ -52,7 +68,7 @@ public CustomModelJobOutput withMode(OutputDeliveryMode mode) { /** * Get the uri property: Output Asset URI. - * + * * @return the uri value. */ public String uri() { @@ -61,7 +77,7 @@ public String uri() { /** * Set the uri property: Output Asset URI. - * + * * @param uri the uri value to set. * @return the CustomModelJobOutput object itself. */ @@ -70,7 +86,9 @@ public CustomModelJobOutput withUri(String uri) { return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public CustomModelJobOutput withDescription(String description) { super.withDescription(description); @@ -79,11 +97,56 @@ public CustomModelJobOutput withDescription(String description) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("jobOutputType", this.jobOutputType == null ? null : this.jobOutputType.toString()); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + jsonWriter.writeStringField("uri", this.uri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomModelJobOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomModelJobOutput if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the CustomModelJobOutput. + */ + public static CustomModelJobOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomModelJobOutput deserializedCustomModelJobOutput = new CustomModelJobOutput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedCustomModelJobOutput.withDescription(reader.getString()); + } else if ("jobOutputType".equals(fieldName)) { + deserializedCustomModelJobOutput.jobOutputType = JobOutputType.fromString(reader.getString()); + } else if ("mode".equals(fieldName)) { + deserializedCustomModelJobOutput.mode = OutputDeliveryMode.fromString(reader.getString()); + } else if ("uri".equals(fieldName)) { + deserializedCustomModelJobOutput.uri = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomModelJobOutput; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomMonitoringSignal.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomMonitoringSignal.java new file mode 100644 index 0000000000000..415913944399b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomMonitoringSignal.java @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * The CustomMonitoringSignal model. + */ +@Fluent +public final class CustomMonitoringSignal extends MonitoringSignalBase { + /* + * [Required] Specifies the type of signal to monitor. + */ + private MonitoringSignalType signalType = MonitoringSignalType.CUSTOM; + + /* + * [Required] Reference to the component asset used to calculate the custom metrics. + */ + private String componentId; + + /* + * Monitoring assets to take as input. Key is the component input port name, value is the data asset. + */ + private Map inputAssets; + + /* + * Extra component parameters to take as input. Key is the component literal input port name, value is the parameter + * value. + */ + private Map inputs; + + /* + * [Required] A list of metrics to calculate and their associated thresholds. + */ + private List metricThresholds; + + /** + * Creates an instance of CustomMonitoringSignal class. + */ + public CustomMonitoringSignal() { + } + + /** + * Get the signalType property: [Required] Specifies the type of signal to monitor. + * + * @return the signalType value. + */ + @Override + public MonitoringSignalType signalType() { + return this.signalType; + } + + /** + * Get the componentId property: [Required] Reference to the component asset used to calculate the custom metrics. + * + * @return the componentId value. + */ + public String componentId() { + return this.componentId; + } + + /** + * Set the componentId property: [Required] Reference to the component asset used to calculate the custom metrics. + * + * @param componentId the componentId value to set. + * @return the CustomMonitoringSignal object itself. + */ + public CustomMonitoringSignal withComponentId(String componentId) { + this.componentId = componentId; + return this; + } + + /** + * Get the inputAssets property: Monitoring assets to take as input. Key is the component input port name, value is + * the data asset. + * + * @return the inputAssets value. + */ + public Map inputAssets() { + return this.inputAssets; + } + + /** + * Set the inputAssets property: Monitoring assets to take as input. Key is the component input port name, value is + * the data asset. + * + * @param inputAssets the inputAssets value to set. + * @return the CustomMonitoringSignal object itself. + */ + public CustomMonitoringSignal withInputAssets(Map inputAssets) { + this.inputAssets = inputAssets; + return this; + } + + /** + * Get the inputs property: Extra component parameters to take as input. Key is the component literal input port + * name, value is the parameter value. + * + * @return the inputs value. + */ + public Map inputs() { + return this.inputs; + } + + /** + * Set the inputs property: Extra component parameters to take as input. Key is the component literal input port + * name, value is the parameter value. + * + * @param inputs the inputs value to set. + * @return the CustomMonitoringSignal object itself. + */ + public CustomMonitoringSignal withInputs(Map inputs) { + this.inputs = inputs; + return this; + } + + /** + * Get the metricThresholds property: [Required] A list of metrics to calculate and their associated thresholds. + * + * @return the metricThresholds value. + */ + public List metricThresholds() { + return this.metricThresholds; + } + + /** + * Set the metricThresholds property: [Required] A list of metrics to calculate and their associated thresholds. + * + * @param metricThresholds the metricThresholds value to set. + * @return the CustomMonitoringSignal object itself. + */ + public CustomMonitoringSignal withMetricThresholds(List metricThresholds) { + this.metricThresholds = metricThresholds; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CustomMonitoringSignal withNotificationTypes(List notificationTypes) { + super.withNotificationTypes(notificationTypes); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CustomMonitoringSignal withProperties(Map properties) { + super.withProperties(properties); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (componentId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property componentId in model CustomMonitoringSignal")); + } + if (inputAssets() != null) { + inputAssets().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + if (inputs() != null) { + inputs().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + if (metricThresholds() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property metricThresholds in model CustomMonitoringSignal")); + } else { + metricThresholds().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CustomMonitoringSignal.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("notificationTypes", notificationTypes(), + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("componentId", this.componentId); + jsonWriter.writeArrayField("metricThresholds", this.metricThresholds, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("signalType", this.signalType == null ? null : this.signalType.toString()); + jsonWriter.writeMapField("inputAssets", this.inputAssets, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeMapField("inputs", this.inputs, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomMonitoringSignal from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomMonitoringSignal if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CustomMonitoringSignal. + */ + public static CustomMonitoringSignal fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomMonitoringSignal deserializedCustomMonitoringSignal = new CustomMonitoringSignal(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("notificationTypes".equals(fieldName)) { + List notificationTypes + = reader.readArray(reader1 -> MonitoringNotificationType.fromString(reader1.getString())); + deserializedCustomMonitoringSignal.withNotificationTypes(notificationTypes); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedCustomMonitoringSignal.withProperties(properties); + } else if ("componentId".equals(fieldName)) { + deserializedCustomMonitoringSignal.componentId = reader.getString(); + } else if ("metricThresholds".equals(fieldName)) { + List metricThresholds + = reader.readArray(reader1 -> CustomMetricThreshold.fromJson(reader1)); + deserializedCustomMonitoringSignal.metricThresholds = metricThresholds; + } else if ("signalType".equals(fieldName)) { + deserializedCustomMonitoringSignal.signalType = MonitoringSignalType.fromString(reader.getString()); + } else if ("inputAssets".equals(fieldName)) { + Map inputAssets + = reader.readMap(reader1 -> MonitoringInputDataBase.fromJson(reader1)); + deserializedCustomMonitoringSignal.inputAssets = inputAssets; + } else if ("inputs".equals(fieldName)) { + Map inputs = reader.readMap(reader1 -> JobInput.fromJson(reader1)); + deserializedCustomMonitoringSignal.inputs = inputs; + } else { + reader.skipChildren(); + } + } + + return deserializedCustomMonitoringSignal; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomNCrossValidations.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomNCrossValidations.java index fb61bff1cc77c..000e6185d5e5b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomNCrossValidations.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomNCrossValidations.java @@ -5,28 +5,45 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** N-Cross validations are specified by user. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "mode") -@JsonTypeName("Custom") +/** + * N-Cross validations are specified by user. + */ @Fluent public final class CustomNCrossValidations extends NCrossValidations { + /* + * [Required] Mode for determining N-Cross validations. + */ + private NCrossValidationsMode mode = NCrossValidationsMode.CUSTOM; + /* * [Required] N-Cross validations value. */ - @JsonProperty(value = "value", required = true) private int value; - /** Creates an instance of CustomNCrossValidations class. */ + /** + * Creates an instance of CustomNCrossValidations class. + */ public CustomNCrossValidations() { } + /** + * Get the mode property: [Required] Mode for determining N-Cross validations. + * + * @return the mode value. + */ + @Override + public NCrossValidationsMode mode() { + return this.mode; + } + /** * Get the value property: [Required] N-Cross validations value. - * + * * @return the value value. */ public int value() { @@ -35,7 +52,7 @@ public int value() { /** * Set the value property: [Required] N-Cross validations value. - * + * * @param value the value value to set. * @return the CustomNCrossValidations object itself. */ @@ -46,11 +63,51 @@ public CustomNCrossValidations withValue(int value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("value", this.value); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomNCrossValidations from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomNCrossValidations if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CustomNCrossValidations. + */ + public static CustomNCrossValidations fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomNCrossValidations deserializedCustomNCrossValidations = new CustomNCrossValidations(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedCustomNCrossValidations.value = reader.getInt(); + } else if ("mode".equals(fieldName)) { + deserializedCustomNCrossValidations.mode = NCrossValidationsMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomNCrossValidations; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomSeasonality.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomSeasonality.java index d9b507c43f124..30010953c90b5 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomSeasonality.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomSeasonality.java @@ -5,28 +5,45 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The CustomSeasonality model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "mode") -@JsonTypeName("Custom") +/** + * The CustomSeasonality model. + */ @Fluent public final class CustomSeasonality extends Seasonality { + /* + * [Required] Seasonality mode. + */ + private SeasonalityMode mode = SeasonalityMode.CUSTOM; + /* * [Required] Seasonality value. */ - @JsonProperty(value = "value", required = true) private int value; - /** Creates an instance of CustomSeasonality class. */ + /** + * Creates an instance of CustomSeasonality class. + */ public CustomSeasonality() { } + /** + * Get the mode property: [Required] Seasonality mode. + * + * @return the mode value. + */ + @Override + public SeasonalityMode mode() { + return this.mode; + } + /** * Get the value property: [Required] Seasonality value. - * + * * @return the value value. */ public int value() { @@ -35,7 +52,7 @@ public int value() { /** * Set the value property: [Required] Seasonality value. - * + * * @param value the value value to set. * @return the CustomSeasonality object itself. */ @@ -46,11 +63,51 @@ public CustomSeasonality withValue(int value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("value", this.value); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomSeasonality from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomSeasonality if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CustomSeasonality. + */ + public static CustomSeasonality fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomSeasonality deserializedCustomSeasonality = new CustomSeasonality(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedCustomSeasonality.value = reader.getInt(); + } else if ("mode".equals(fieldName)) { + deserializedCustomSeasonality.mode = SeasonalityMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomSeasonality; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomService.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomService.java new file mode 100644 index 0000000000000..60bc67ca2f9b3 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomService.java @@ -0,0 +1,296 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +/** + * Specifies the custom service configuration. + */ +@Fluent +public final class CustomService implements JsonSerializable { + /* + * Name of the Custom Service + */ + private String name; + + /* + * Describes the Image Specifications + */ + private Image image; + + /* + * Environment Variable for the container + */ + private Map environmentVariables; + + /* + * Describes the docker settings for the image + */ + private Docker docker; + + /* + * Configuring the endpoints for the container + */ + private List endpoints; + + /* + * Configuring the volumes for the container + */ + private List volumes; + + /* + * Specifies the custom service configuration + */ + private Map additionalProperties; + + /** + * Creates an instance of CustomService class. + */ + public CustomService() { + } + + /** + * Get the name property: Name of the Custom Service. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the Custom Service. + * + * @param name the name value to set. + * @return the CustomService object itself. + */ + public CustomService withName(String name) { + this.name = name; + return this; + } + + /** + * Get the image property: Describes the Image Specifications. + * + * @return the image value. + */ + public Image image() { + return this.image; + } + + /** + * Set the image property: Describes the Image Specifications. + * + * @param image the image value to set. + * @return the CustomService object itself. + */ + public CustomService withImage(Image image) { + this.image = image; + return this; + } + + /** + * Get the environmentVariables property: Environment Variable for the container. + * + * @return the environmentVariables value. + */ + public Map environmentVariables() { + return this.environmentVariables; + } + + /** + * Set the environmentVariables property: Environment Variable for the container. + * + * @param environmentVariables the environmentVariables value to set. + * @return the CustomService object itself. + */ + public CustomService withEnvironmentVariables(Map environmentVariables) { + this.environmentVariables = environmentVariables; + return this; + } + + /** + * Get the docker property: Describes the docker settings for the image. + * + * @return the docker value. + */ + public Docker docker() { + return this.docker; + } + + /** + * Set the docker property: Describes the docker settings for the image. + * + * @param docker the docker value to set. + * @return the CustomService object itself. + */ + public CustomService withDocker(Docker docker) { + this.docker = docker; + return this; + } + + /** + * Get the endpoints property: Configuring the endpoints for the container. + * + * @return the endpoints value. + */ + public List endpoints() { + return this.endpoints; + } + + /** + * Set the endpoints property: Configuring the endpoints for the container. + * + * @param endpoints the endpoints value to set. + * @return the CustomService object itself. + */ + public CustomService withEndpoints(List endpoints) { + this.endpoints = endpoints; + return this; + } + + /** + * Get the volumes property: Configuring the volumes for the container. + * + * @return the volumes value. + */ + public List volumes() { + return this.volumes; + } + + /** + * Set the volumes property: Configuring the volumes for the container. + * + * @param volumes the volumes value to set. + * @return the CustomService object itself. + */ + public CustomService withVolumes(List volumes) { + this.volumes = volumes; + return this; + } + + /** + * Get the additionalProperties property: Specifies the custom service configuration. + * + * @return the additionalProperties value. + */ + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: Specifies the custom service configuration. + * + * @param additionalProperties the additionalProperties value to set. + * @return the CustomService object itself. + */ + public CustomService withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (image() != null) { + image().validate(); + } + if (environmentVariables() != null) { + environmentVariables().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + if (docker() != null) { + docker().validate(); + } + if (endpoints() != null) { + endpoints().forEach(e -> e.validate()); + } + if (volumes() != null) { + volumes().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("image", this.image); + jsonWriter.writeMapField("environmentVariables", this.environmentVariables, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("docker", this.docker); + jsonWriter.writeArrayField("endpoints", this.endpoints, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("volumes", this.volumes, (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomService from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomService if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CustomService. + */ + public static CustomService fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomService deserializedCustomService = new CustomService(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedCustomService.name = reader.getString(); + } else if ("image".equals(fieldName)) { + deserializedCustomService.image = Image.fromJson(reader); + } else if ("environmentVariables".equals(fieldName)) { + Map environmentVariables + = reader.readMap(reader1 -> EnvironmentVariable.fromJson(reader1)); + deserializedCustomService.environmentVariables = environmentVariables; + } else if ("docker".equals(fieldName)) { + deserializedCustomService.docker = Docker.fromJson(reader); + } else if ("endpoints".equals(fieldName)) { + List endpoints = reader.readArray(reader1 -> Endpoint.fromJson(reader1)); + deserializedCustomService.endpoints = endpoints; + } else if ("volumes".equals(fieldName)) { + List volumes = reader.readArray(reader1 -> VolumeDefinition.fromJson(reader1)); + deserializedCustomService.volumes = volumes; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedCustomService.additionalProperties = additionalProperties; + + return deserializedCustomService; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomTargetLags.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomTargetLags.java index 1c3a2db01db91..7234e7df11974 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomTargetLags.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomTargetLags.java @@ -6,29 +6,46 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** The CustomTargetLags model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "mode") -@JsonTypeName("Custom") +/** + * The CustomTargetLags model. + */ @Fluent public final class CustomTargetLags extends TargetLags { + /* + * [Required] Set target lags mode - Auto/Custom + */ + private TargetLagsMode mode = TargetLagsMode.CUSTOM; + /* * [Required] Set target lags values. */ - @JsonProperty(value = "values", required = true) private List values; - /** Creates an instance of CustomTargetLags class. */ + /** + * Creates an instance of CustomTargetLags class. + */ public CustomTargetLags() { } + /** + * Get the mode property: [Required] Set target lags mode - Auto/Custom. + * + * @return the mode value. + */ + @Override + public TargetLagsMode mode() { + return this.mode; + } + /** * Get the values property: [Required] Set target lags values. - * + * * @return the values value. */ public List values() { @@ -37,7 +54,7 @@ public List values() { /** * Set the values property: [Required] Set target lags values. - * + * * @param values the values value to set. * @return the CustomTargetLags object itself. */ @@ -48,18 +65,58 @@ public CustomTargetLags withValues(List values) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (values() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property values in model CustomTargetLags")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property values in model CustomTargetLags")); } } private static final ClientLogger LOGGER = new ClientLogger(CustomTargetLags.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("values", this.values, (writer, element) -> writer.writeInt(element)); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomTargetLags from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomTargetLags if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CustomTargetLags. + */ + public static CustomTargetLags fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomTargetLags deserializedCustomTargetLags = new CustomTargetLags(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("values".equals(fieldName)) { + List values = reader.readArray(reader1 -> reader1.getInt()); + deserializedCustomTargetLags.values = values; + } else if ("mode".equals(fieldName)) { + deserializedCustomTargetLags.mode = TargetLagsMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomTargetLags; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomTargetRollingWindowSize.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomTargetRollingWindowSize.java index a6809abe95b3b..4ed9f08339817 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomTargetRollingWindowSize.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/CustomTargetRollingWindowSize.java @@ -5,28 +5,45 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The CustomTargetRollingWindowSize model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "mode") -@JsonTypeName("Custom") +/** + * The CustomTargetRollingWindowSize model. + */ @Fluent public final class CustomTargetRollingWindowSize extends TargetRollingWindowSize { + /* + * [Required] TargetRollingWindowSiz detection mode. + */ + private TargetRollingWindowSizeMode mode = TargetRollingWindowSizeMode.CUSTOM; + /* * [Required] TargetRollingWindowSize value. */ - @JsonProperty(value = "value", required = true) private int value; - /** Creates an instance of CustomTargetRollingWindowSize class. */ + /** + * Creates an instance of CustomTargetRollingWindowSize class. + */ public CustomTargetRollingWindowSize() { } + /** + * Get the mode property: [Required] TargetRollingWindowSiz detection mode. + * + * @return the mode value. + */ + @Override + public TargetRollingWindowSizeMode mode() { + return this.mode; + } + /** * Get the value property: [Required] TargetRollingWindowSize value. - * + * * @return the value value. */ public int value() { @@ -35,7 +52,7 @@ public int value() { /** * Set the value property: [Required] TargetRollingWindowSize value. - * + * * @param value the value value to set. * @return the CustomTargetRollingWindowSize object itself. */ @@ -46,11 +63,53 @@ public CustomTargetRollingWindowSize withValue(int value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("value", this.value); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomTargetRollingWindowSize from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomTargetRollingWindowSize if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CustomTargetRollingWindowSize. + */ + public static CustomTargetRollingWindowSize fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomTargetRollingWindowSize deserializedCustomTargetRollingWindowSize + = new CustomTargetRollingWindowSize(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedCustomTargetRollingWindowSize.value = reader.getInt(); + } else if ("mode".equals(fieldName)) { + deserializedCustomTargetRollingWindowSize.mode + = TargetRollingWindowSizeMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomTargetRollingWindowSize; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataAvailabilityStatus.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataAvailabilityStatus.java new file mode 100644 index 0000000000000..721b6ecae7816 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataAvailabilityStatus.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for DataAvailabilityStatus. + */ +public final class DataAvailabilityStatus extends ExpandableStringEnum { + /** + * Static value None for DataAvailabilityStatus. + */ + public static final DataAvailabilityStatus NONE = fromString("None"); + + /** + * Static value Pending for DataAvailabilityStatus. + */ + public static final DataAvailabilityStatus PENDING = fromString("Pending"); + + /** + * Static value Incomplete for DataAvailabilityStatus. + */ + public static final DataAvailabilityStatus INCOMPLETE = fromString("Incomplete"); + + /** + * Static value Complete for DataAvailabilityStatus. + */ + public static final DataAvailabilityStatus COMPLETE = fromString("Complete"); + + /** + * Creates a new instance of DataAvailabilityStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DataAvailabilityStatus() { + } + + /** + * Creates or finds a DataAvailabilityStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataAvailabilityStatus. + */ + public static DataAvailabilityStatus fromString(String name) { + return fromString(name, DataAvailabilityStatus.class); + } + + /** + * Gets known DataAvailabilityStatus values. + * + * @return known DataAvailabilityStatus values. + */ + public static Collection values() { + return values(DataAvailabilityStatus.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataCollectionMode.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataCollectionMode.java new file mode 100644 index 0000000000000..303b59a49c1f8 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataCollectionMode.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for DataCollectionMode. + */ +public final class DataCollectionMode extends ExpandableStringEnum { + /** + * Static value Enabled for DataCollectionMode. + */ + public static final DataCollectionMode ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for DataCollectionMode. + */ + public static final DataCollectionMode DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of DataCollectionMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DataCollectionMode() { + } + + /** + * Creates or finds a DataCollectionMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataCollectionMode. + */ + public static DataCollectionMode fromString(String name) { + return fromString(name, DataCollectionMode.class); + } + + /** + * Gets known DataCollectionMode values. + * + * @return known DataCollectionMode values. + */ + public static Collection values() { + return values(DataCollectionMode.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataCollector.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataCollector.java new file mode 100644 index 0000000000000..966ebbd6559e7 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataCollector.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The DataCollector model. + */ +@Fluent +public final class DataCollector implements JsonSerializable { + /* + * [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. + */ + private Map collections; + + /* + * The request logging configuration for mdc, it includes advanced logging settings for all collections. It's + * optional. + */ + private 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. + */ + private RollingRateType rollingRate; + + /** + * Creates an instance of DataCollector class. + */ + public DataCollector() { + } + + /** + * Get the collections property: [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. + * + * @return the collections value. + */ + public Map collections() { + return this.collections; + } + + /** + * Set the collections property: [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. + * + * @param collections the collections value to set. + * @return the DataCollector object itself. + */ + public DataCollector withCollections(Map collections) { + this.collections = collections; + return this; + } + + /** + * Get the requestLogging property: The request logging configuration for mdc, it includes advanced logging settings + * for all collections. It's optional. + * + * @return the requestLogging value. + */ + public RequestLogging requestLogging() { + return this.requestLogging; + } + + /** + * Set the requestLogging property: The request logging configuration for mdc, it includes advanced logging settings + * for all collections. It's optional. + * + * @param requestLogging the requestLogging value to set. + * @return the DataCollector object itself. + */ + public DataCollector withRequestLogging(RequestLogging requestLogging) { + this.requestLogging = requestLogging; + return this; + } + + /** + * Get the rollingRate property: 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. + * + * @return the rollingRate value. + */ + public RollingRateType rollingRate() { + return this.rollingRate; + } + + /** + * Set the rollingRate property: 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. + * + * @param rollingRate the rollingRate value to set. + * @return the DataCollector object itself. + */ + public DataCollector withRollingRate(RollingRateType rollingRate) { + this.rollingRate = rollingRate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (collections() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property collections in model DataCollector")); + } else { + collections().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + if (requestLogging() != null) { + requestLogging().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DataCollector.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("collections", this.collections, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("requestLogging", this.requestLogging); + jsonWriter.writeStringField("rollingRate", this.rollingRate == null ? null : this.rollingRate.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataCollector from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataCollector if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataCollector. + */ + public static DataCollector fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataCollector deserializedDataCollector = new DataCollector(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("collections".equals(fieldName)) { + Map collections = reader.readMap(reader1 -> Collection.fromJson(reader1)); + deserializedDataCollector.collections = collections; + } else if ("requestLogging".equals(fieldName)) { + deserializedDataCollector.requestLogging = RequestLogging.fromJson(reader); + } else if ("rollingRate".equals(fieldName)) { + deserializedDataCollector.rollingRate = RollingRateType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDataCollector; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataContainer.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataContainer.java index 59ae115c87e89..930533a3aaa7e 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataContainer.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataContainer.java @@ -8,90 +8,103 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.machinelearning.fluent.models.DataContainerInner; -/** An immutable client-side representation of DataContainer. */ +/** + * An immutable client-side representation of DataContainer. + */ public interface DataContainer { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the properties property: [Required] Additional attributes of the entity. - * + * * @return the properties value. */ DataContainerProperties properties(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.DataContainerInner object. - * + * * @return the inner object. */ DataContainerInner innerModel(); - /** The entirety of the DataContainer definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithParentResource, - DefinitionStages.WithProperties, - DefinitionStages.WithCreate { + /** + * The entirety of the DataContainer definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, DefinitionStages.WithCreate { } - /** The DataContainer definition stages. */ + + /** + * The DataContainer definition stages. + */ interface DefinitionStages { - /** The first stage of the DataContainer definition. */ + /** + * The first stage of the DataContainer definition. + */ interface Blank extends WithParentResource { } - /** The stage of the DataContainer definition allowing to specify parent resource. */ + + /** + * The stage of the DataContainer definition allowing to specify parent resource. + */ interface WithParentResource { /** - * Specifies resourceGroupName, workspaceName. - * + * Specifies resourceGroupName, registryName. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. * @return the next definition stage. */ - WithProperties withExistingWorkspace(String resourceGroupName, String workspaceName); + WithProperties withExistingRegistry(String resourceGroupName, String registryName); } - /** The stage of the DataContainer definition allowing to specify properties. */ + + /** + * The stage of the DataContainer definition allowing to specify properties. + */ interface WithProperties { /** * Specifies the properties property: [Required] Additional attributes of the entity.. - * + * * @param properties [Required] Additional attributes of the entity. * @return the next definition stage. */ WithCreate withProperties(DataContainerProperties properties); } + /** * The stage of the DataContainer definition which contains all the minimum required properties for the resource * to be created, but also allows for any other optional properties to be specified. @@ -99,67 +112,76 @@ interface WithProperties { interface WithCreate { /** * Executes the create request. - * + * * @return the created resource. */ DataContainer create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ DataContainer create(Context context); } } + /** * Begins update for the DataContainer resource. - * + * * @return the stage of resource update. */ DataContainer.Update update(); - /** The template for DataContainer update. */ + /** + * The template for DataContainer update. + */ interface Update extends UpdateStages.WithProperties { /** * Executes the update request. - * + * * @return the updated resource. */ DataContainer apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ DataContainer apply(Context context); } - /** The DataContainer update stages. */ + + /** + * The DataContainer update stages. + */ interface UpdateStages { - /** The stage of the DataContainer update allowing to specify properties. */ + /** + * The stage of the DataContainer update allowing to specify properties. + */ interface WithProperties { /** * Specifies the properties property: [Required] Additional attributes of the entity.. - * + * * @param properties [Required] Additional attributes of the entity. * @return the next definition stage. */ Update withProperties(DataContainerProperties properties); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ DataContainer refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataContainerProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataContainerProperties.java index ef6dbc31be3de..1f644f4e46e5c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataContainerProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataContainerProperties.java @@ -6,25 +6,41 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Container for data asset versions. */ +/** + * Container for data asset versions. + */ @Fluent public final class DataContainerProperties extends AssetContainer { /* * [Required] Specifies the type of data. */ - @JsonProperty(value = "dataType", required = true) private DataType dataType; - /** Creates an instance of DataContainerProperties class. */ + /* + * The latest version inside this container. + */ + private String latestVersion; + + /* + * The next auto incremental version + */ + private String nextVersion; + + /** + * Creates an instance of DataContainerProperties class. + */ public DataContainerProperties() { } /** * Get the dataType property: [Required] Specifies the type of data. - * + * * @return the dataType value. */ public DataType dataType() { @@ -33,7 +49,7 @@ public DataType dataType() { /** * Set the dataType property: [Required] Specifies the type of data. - * + * * @param dataType the dataType value to set. * @return the DataContainerProperties object itself. */ @@ -42,28 +58,56 @@ public DataContainerProperties withDataType(DataType dataType) { return this; } - /** {@inheritDoc} */ + /** + * Get the latestVersion property: The latest version inside this container. + * + * @return the latestVersion value. + */ + @Override + public String latestVersion() { + return this.latestVersion; + } + + /** + * Get the nextVersion property: The next auto incremental version. + * + * @return the nextVersion value. + */ + @Override + public String nextVersion() { + return this.nextVersion; + } + + /** + * {@inheritDoc} + */ @Override public DataContainerProperties withIsArchived(Boolean isArchived) { super.withIsArchived(isArchived); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public DataContainerProperties withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public DataContainerProperties withProperties(Map properties) { super.withProperties(properties); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public DataContainerProperties withTags(Map tags) { super.withTags(tags); @@ -72,19 +116,73 @@ public DataContainerProperties withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (dataType() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property dataType in model DataContainerProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property dataType in model DataContainerProperties")); } } private static final ClientLogger LOGGER = new ClientLogger(DataContainerProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("isArchived", isArchived()); + jsonWriter.writeStringField("dataType", this.dataType == null ? null : this.dataType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataContainerProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataContainerProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataContainerProperties. + */ + public static DataContainerProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataContainerProperties deserializedDataContainerProperties = new DataContainerProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedDataContainerProperties.withDescription(reader.getString()); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedDataContainerProperties.withProperties(properties); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedDataContainerProperties.withTags(tags); + } else if ("isArchived".equals(fieldName)) { + deserializedDataContainerProperties.withIsArchived(reader.getNullable(JsonReader::getBoolean)); + } else if ("latestVersion".equals(fieldName)) { + deserializedDataContainerProperties.latestVersion = reader.getString(); + } else if ("nextVersion".equals(fieldName)) { + deserializedDataContainerProperties.nextVersion = reader.getString(); + } else if ("dataType".equals(fieldName)) { + deserializedDataContainerProperties.dataType = DataType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDataContainerProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataContainerResourceArmPaginatedResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataContainerResourceArmPaginatedResult.java index df54e8cfb2e15..20d232d934922 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataContainerResourceArmPaginatedResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataContainerResourceArmPaginatedResult.java @@ -5,33 +5,40 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.fluent.models.DataContainerInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** A paginated list of DataContainer entities. */ +/** + * A paginated list of DataContainer entities. + */ @Fluent -public final class DataContainerResourceArmPaginatedResult { +public final class DataContainerResourceArmPaginatedResult + implements JsonSerializable { /* * The link to the next page of DataContainer objects. If null, there are no additional pages. */ - @JsonProperty(value = "nextLink") private String nextLink; /* * An array of objects of type DataContainer. */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of DataContainerResourceArmPaginatedResult class. */ + /** + * Creates an instance of DataContainerResourceArmPaginatedResult class. + */ public DataContainerResourceArmPaginatedResult() { } /** * Get the nextLink property: The link to the next page of DataContainer objects. If null, there are no additional * pages. - * + * * @return the nextLink value. */ public String nextLink() { @@ -41,7 +48,7 @@ public String nextLink() { /** * Set the nextLink property: The link to the next page of DataContainer objects. If null, there are no additional * pages. - * + * * @param nextLink the nextLink value to set. * @return the DataContainerResourceArmPaginatedResult object itself. */ @@ -52,7 +59,7 @@ public DataContainerResourceArmPaginatedResult withNextLink(String nextLink) { /** * Get the value property: An array of objects of type DataContainer. - * + * * @return the value value. */ public List value() { @@ -61,7 +68,7 @@ public List value() { /** * Set the value property: An array of objects of type DataContainer. - * + * * @param value the value value to set. * @return the DataContainerResourceArmPaginatedResult object itself. */ @@ -72,7 +79,7 @@ public DataContainerResourceArmPaginatedResult withValue(List e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataContainerResourceArmPaginatedResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataContainerResourceArmPaginatedResult if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DataContainerResourceArmPaginatedResult. + */ + public static DataContainerResourceArmPaginatedResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataContainerResourceArmPaginatedResult deserializedDataContainerResourceArmPaginatedResult + = new DataContainerResourceArmPaginatedResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedDataContainerResourceArmPaginatedResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> DataContainerInner.fromJson(reader1)); + deserializedDataContainerResourceArmPaginatedResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedDataContainerResourceArmPaginatedResult; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataContainers.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataContainers.java index 8962c038ec253..4b43116f29d28 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataContainers.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataContainers.java @@ -7,12 +7,15 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.DataContainerInner; -/** Resource collection API of DataContainers. */ +/** + * Resource collection API of DataContainers. + */ public interface DataContainers { /** * List data containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -24,7 +27,7 @@ public interface DataContainers { /** * List data containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -35,12 +38,12 @@ public interface DataContainers { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of DataContainer entities as paginated response with {@link PagedIterable}. */ - PagedIterable list( - String resourceGroupName, String workspaceName, String skip, ListViewType listViewType, Context context); + PagedIterable list(String resourceGroupName, String workspaceName, String skip, + ListViewType listViewType, Context context); /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -54,7 +57,7 @@ PagedIterable list( /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -66,7 +69,7 @@ PagedIterable list( /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -76,12 +79,12 @@ PagedIterable list( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return container along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String name, Context context); + Response getWithResponse(String resourceGroupName, String workspaceName, String name, + Context context); /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -93,55 +96,32 @@ Response getWithResponse( DataContainer get(String resourceGroupName, String workspaceName, String name); /** - * Get container. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container along with {@link Response}. - */ - DataContainer getById(String id); - - /** - * Get container. - * - * @param id the resource ID. + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param body Container entity to create or update. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container along with {@link Response}. + * @return azure Resource Manager resource envelope along with {@link Response}. */ - Response getByIdWithResponse(String id, Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, String name, + DataContainerInner body, Context context); /** - * Delete container. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Delete container. - * - * @param id the resource ID. - * @param context The context to associate with this operation. + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param body Container entity to create or update. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new DataContainer resource. - * - * @param name resource name. - * @return the first stage of the new DataContainer definition. + * @return azure Resource Manager resource envelope. */ - DataContainer.DefinitionStages.Blank define(String name); + DataContainer createOrUpdate(String resourceGroupName, String workspaceName, String name, DataContainerInner body); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataDriftMetricThresholdBase.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataDriftMetricThresholdBase.java new file mode 100644 index 0000000000000..e3026cd89ddf7 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataDriftMetricThresholdBase.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The DataDriftMetricThresholdBase model. + */ +@Fluent +public class DataDriftMetricThresholdBase implements JsonSerializable { + /* + * [Required] Specifies the data type of the metric threshold. + */ + private MonitoringFeatureDataType dataType = MonitoringFeatureDataType.fromString("DataDriftMetricThresholdBase"); + + /* + * The threshold value. If null, a default value will be set depending on the selected metric. + */ + private MonitoringThreshold threshold; + + /** + * Creates an instance of DataDriftMetricThresholdBase class. + */ + public DataDriftMetricThresholdBase() { + } + + /** + * Get the dataType property: [Required] Specifies the data type of the metric threshold. + * + * @return the dataType value. + */ + public MonitoringFeatureDataType dataType() { + return this.dataType; + } + + /** + * Get the threshold property: The threshold value. If null, a default value will be set depending on the selected + * metric. + * + * @return the threshold value. + */ + public MonitoringThreshold threshold() { + return this.threshold; + } + + /** + * Set the threshold property: The threshold value. If null, a default value will be set depending on the selected + * metric. + * + * @param threshold the threshold value to set. + * @return the DataDriftMetricThresholdBase object itself. + */ + public DataDriftMetricThresholdBase withThreshold(MonitoringThreshold threshold) { + this.threshold = threshold; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (threshold() != null) { + threshold().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("dataType", this.dataType == null ? null : this.dataType.toString()); + jsonWriter.writeJsonField("threshold", this.threshold); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataDriftMetricThresholdBase from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataDriftMetricThresholdBase if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DataDriftMetricThresholdBase. + */ + public static DataDriftMetricThresholdBase fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("dataType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Categorical".equals(discriminatorValue)) { + return CategoricalDataDriftMetricThreshold.fromJson(readerToUse.reset()); + } else if ("Numerical".equals(discriminatorValue)) { + return NumericalDataDriftMetricThreshold.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static DataDriftMetricThresholdBase fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataDriftMetricThresholdBase deserializedDataDriftMetricThresholdBase = new DataDriftMetricThresholdBase(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dataType".equals(fieldName)) { + deserializedDataDriftMetricThresholdBase.dataType + = MonitoringFeatureDataType.fromString(reader.getString()); + } else if ("threshold".equals(fieldName)) { + deserializedDataDriftMetricThresholdBase.threshold = MonitoringThreshold.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDataDriftMetricThresholdBase; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataDriftMonitoringSignal.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataDriftMonitoringSignal.java new file mode 100644 index 0000000000000..4243501e3ba8f --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataDriftMonitoringSignal.java @@ -0,0 +1,323 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * The DataDriftMonitoringSignal model. + */ +@Fluent +public final class DataDriftMonitoringSignal extends MonitoringSignalBase { + /* + * [Required] Specifies the type of signal to monitor. + */ + private MonitoringSignalType signalType = MonitoringSignalType.DATA_DRIFT; + + /* + * A dictionary that maps feature names to their respective data types. + */ + private Map featureDataTypeOverride; + + /* + * The settings for computing feature importance. + */ + private FeatureImportanceSettings featureImportanceSettings; + + /* + * The feature filter which identifies which feature to calculate drift over. + */ + private MonitoringFeatureFilterBase features; + + /* + * [Required] A list of metrics to calculate and their associated thresholds. + */ + private List metricThresholds; + + /* + * [Required] The data which drift will be calculated for. + */ + private MonitoringInputDataBase productionData; + + /* + * [Required] The data to calculate drift against. + */ + private MonitoringInputDataBase referenceData; + + /** + * Creates an instance of DataDriftMonitoringSignal class. + */ + public DataDriftMonitoringSignal() { + } + + /** + * Get the signalType property: [Required] Specifies the type of signal to monitor. + * + * @return the signalType value. + */ + @Override + public MonitoringSignalType signalType() { + return this.signalType; + } + + /** + * Get the featureDataTypeOverride property: A dictionary that maps feature names to their respective data types. + * + * @return the featureDataTypeOverride value. + */ + public Map featureDataTypeOverride() { + return this.featureDataTypeOverride; + } + + /** + * Set the featureDataTypeOverride property: A dictionary that maps feature names to their respective data types. + * + * @param featureDataTypeOverride the featureDataTypeOverride value to set. + * @return the DataDriftMonitoringSignal object itself. + */ + public DataDriftMonitoringSignal + withFeatureDataTypeOverride(Map featureDataTypeOverride) { + this.featureDataTypeOverride = featureDataTypeOverride; + return this; + } + + /** + * Get the featureImportanceSettings property: The settings for computing feature importance. + * + * @return the featureImportanceSettings value. + */ + public FeatureImportanceSettings featureImportanceSettings() { + return this.featureImportanceSettings; + } + + /** + * Set the featureImportanceSettings property: The settings for computing feature importance. + * + * @param featureImportanceSettings the featureImportanceSettings value to set. + * @return the DataDriftMonitoringSignal object itself. + */ + public DataDriftMonitoringSignal + withFeatureImportanceSettings(FeatureImportanceSettings featureImportanceSettings) { + this.featureImportanceSettings = featureImportanceSettings; + return this; + } + + /** + * Get the features property: The feature filter which identifies which feature to calculate drift over. + * + * @return the features value. + */ + public MonitoringFeatureFilterBase features() { + return this.features; + } + + /** + * Set the features property: The feature filter which identifies which feature to calculate drift over. + * + * @param features the features value to set. + * @return the DataDriftMonitoringSignal object itself. + */ + public DataDriftMonitoringSignal withFeatures(MonitoringFeatureFilterBase features) { + this.features = features; + return this; + } + + /** + * Get the metricThresholds property: [Required] A list of metrics to calculate and their associated thresholds. + * + * @return the metricThresholds value. + */ + public List metricThresholds() { + return this.metricThresholds; + } + + /** + * Set the metricThresholds property: [Required] A list of metrics to calculate and their associated thresholds. + * + * @param metricThresholds the metricThresholds value to set. + * @return the DataDriftMonitoringSignal object itself. + */ + public DataDriftMonitoringSignal withMetricThresholds(List metricThresholds) { + this.metricThresholds = metricThresholds; + return this; + } + + /** + * Get the productionData property: [Required] The data which drift will be calculated for. + * + * @return the productionData value. + */ + public MonitoringInputDataBase productionData() { + return this.productionData; + } + + /** + * Set the productionData property: [Required] The data which drift will be calculated for. + * + * @param productionData the productionData value to set. + * @return the DataDriftMonitoringSignal object itself. + */ + public DataDriftMonitoringSignal withProductionData(MonitoringInputDataBase productionData) { + this.productionData = productionData; + return this; + } + + /** + * Get the referenceData property: [Required] The data to calculate drift against. + * + * @return the referenceData value. + */ + public MonitoringInputDataBase referenceData() { + return this.referenceData; + } + + /** + * Set the referenceData property: [Required] The data to calculate drift against. + * + * @param referenceData the referenceData value to set. + * @return the DataDriftMonitoringSignal object itself. + */ + public DataDriftMonitoringSignal withReferenceData(MonitoringInputDataBase referenceData) { + this.referenceData = referenceData; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DataDriftMonitoringSignal withNotificationTypes(List notificationTypes) { + super.withNotificationTypes(notificationTypes); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DataDriftMonitoringSignal withProperties(Map properties) { + super.withProperties(properties); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (featureImportanceSettings() != null) { + featureImportanceSettings().validate(); + } + if (features() != null) { + features().validate(); + } + if (metricThresholds() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property metricThresholds in model DataDriftMonitoringSignal")); + } else { + metricThresholds().forEach(e -> e.validate()); + } + if (productionData() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property productionData in model DataDriftMonitoringSignal")); + } else { + productionData().validate(); + } + if (referenceData() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property referenceData in model DataDriftMonitoringSignal")); + } else { + referenceData().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DataDriftMonitoringSignal.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("notificationTypes", notificationTypes(), + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("metricThresholds", this.metricThresholds, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("productionData", this.productionData); + jsonWriter.writeJsonField("referenceData", this.referenceData); + jsonWriter.writeStringField("signalType", this.signalType == null ? null : this.signalType.toString()); + jsonWriter.writeMapField("featureDataTypeOverride", this.featureDataTypeOverride, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeJsonField("featureImportanceSettings", this.featureImportanceSettings); + jsonWriter.writeJsonField("features", this.features); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataDriftMonitoringSignal from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataDriftMonitoringSignal if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataDriftMonitoringSignal. + */ + public static DataDriftMonitoringSignal fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataDriftMonitoringSignal deserializedDataDriftMonitoringSignal = new DataDriftMonitoringSignal(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("notificationTypes".equals(fieldName)) { + List notificationTypes + = reader.readArray(reader1 -> MonitoringNotificationType.fromString(reader1.getString())); + deserializedDataDriftMonitoringSignal.withNotificationTypes(notificationTypes); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedDataDriftMonitoringSignal.withProperties(properties); + } else if ("metricThresholds".equals(fieldName)) { + List metricThresholds + = reader.readArray(reader1 -> DataDriftMetricThresholdBase.fromJson(reader1)); + deserializedDataDriftMonitoringSignal.metricThresholds = metricThresholds; + } else if ("productionData".equals(fieldName)) { + deserializedDataDriftMonitoringSignal.productionData = MonitoringInputDataBase.fromJson(reader); + } else if ("referenceData".equals(fieldName)) { + deserializedDataDriftMonitoringSignal.referenceData = MonitoringInputDataBase.fromJson(reader); + } else if ("signalType".equals(fieldName)) { + deserializedDataDriftMonitoringSignal.signalType + = MonitoringSignalType.fromString(reader.getString()); + } else if ("featureDataTypeOverride".equals(fieldName)) { + Map featureDataTypeOverride + = reader.readMap(reader1 -> MonitoringFeatureDataType.fromString(reader1.getString())); + deserializedDataDriftMonitoringSignal.featureDataTypeOverride = featureDataTypeOverride; + } else if ("featureImportanceSettings".equals(fieldName)) { + deserializedDataDriftMonitoringSignal.featureImportanceSettings + = FeatureImportanceSettings.fromJson(reader); + } else if ("features".equals(fieldName)) { + deserializedDataDriftMonitoringSignal.features = MonitoringFeatureFilterBase.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDataDriftMonitoringSignal; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataFactory.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataFactory.java index 408de6370a324..1de839ee3698b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataFactory.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataFactory.java @@ -5,40 +5,149 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; -/** A DataFactory compute. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "computeType") -@JsonTypeName("DataFactory") +/** + * A DataFactory compute. + */ @Fluent public final class DataFactory extends Compute { - /** Creates an instance of DataFactory class. */ + /* + * The type of compute + */ + private ComputeType computeType = ComputeType.DATA_FACTORY; + + /* + * The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. + */ + private ProvisioningState provisioningState; + + /* + * The time at which the compute was created. + */ + private OffsetDateTime createdOn; + + /* + * The time at which the compute was last modified. + */ + private OffsetDateTime modifiedOn; + + /* + * Errors during provisioning + */ + private List provisioningErrors; + + /* + * Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning + * service provisioned it if false. + */ + private Boolean isAttachedCompute; + + /** + * Creates an instance of DataFactory class. + */ public DataFactory() { } - /** {@inheritDoc} */ + /** + * Get the computeType property: The type of compute. + * + * @return the computeType value. + */ + @Override + public ComputeType computeType() { + return this.computeType; + } + + /** + * Get the provisioningState property: The provision state of the cluster. Valid values are Unknown, Updating, + * Provisioning, Succeeded, and Failed. + * + * @return the provisioningState value. + */ + @Override + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the createdOn property: The time at which the compute was created. + * + * @return the createdOn value. + */ + @Override + public OffsetDateTime createdOn() { + return this.createdOn; + } + + /** + * Get the modifiedOn property: The time at which the compute was last modified. + * + * @return the modifiedOn value. + */ + @Override + public OffsetDateTime modifiedOn() { + return this.modifiedOn; + } + + /** + * Get the provisioningErrors property: Errors during provisioning. + * + * @return the provisioningErrors value. + */ + @Override + public List provisioningErrors() { + return this.provisioningErrors; + } + + /** + * Get the isAttachedCompute property: Indicating whether the compute was provisioned by user and brought from + * outside if true, or machine learning service provisioned it if false. + * + * @return the isAttachedCompute value. + */ + @Override + public Boolean isAttachedCompute() { + return this.isAttachedCompute; + } + + /** + * {@inheritDoc} + */ @Override public DataFactory withComputeLocation(String computeLocation) { super.withComputeLocation(computeLocation); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public DataFactory withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public DataFactory withResourceId(String resourceId) { super.withResourceId(resourceId); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public DataFactory withDisableLocalAuth(Boolean disableLocalAuth) { super.withDisableLocalAuth(disableLocalAuth); @@ -47,11 +156,73 @@ public DataFactory withDisableLocalAuth(Boolean disableLocalAuth) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("computeLocation", computeLocation()); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("resourceId", resourceId()); + jsonWriter.writeBooleanField("disableLocalAuth", disableLocalAuth()); + jsonWriter.writeStringField("computeType", this.computeType == null ? null : this.computeType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataFactory from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataFactory if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DataFactory. + */ + public static DataFactory fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataFactory deserializedDataFactory = new DataFactory(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("computeLocation".equals(fieldName)) { + deserializedDataFactory.withComputeLocation(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedDataFactory.provisioningState = ProvisioningState.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedDataFactory.withDescription(reader.getString()); + } else if ("createdOn".equals(fieldName)) { + deserializedDataFactory.createdOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("modifiedOn".equals(fieldName)) { + deserializedDataFactory.modifiedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("resourceId".equals(fieldName)) { + deserializedDataFactory.withResourceId(reader.getString()); + } else if ("provisioningErrors".equals(fieldName)) { + List provisioningErrors + = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); + deserializedDataFactory.provisioningErrors = provisioningErrors; + } else if ("isAttachedCompute".equals(fieldName)) { + deserializedDataFactory.isAttachedCompute = reader.getNullable(JsonReader::getBoolean); + } else if ("disableLocalAuth".equals(fieldName)) { + deserializedDataFactory.withDisableLocalAuth(reader.getNullable(JsonReader::getBoolean)); + } else if ("computeType".equals(fieldName)) { + deserializedDataFactory.computeType = ComputeType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDataFactory; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataLakeAnalytics.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataLakeAnalytics.java index 93ab2b848c2d9..0fc59f89cb7bd 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataLakeAnalytics.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataLakeAnalytics.java @@ -5,28 +5,75 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; -/** A DataLakeAnalytics compute. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "computeType") -@JsonTypeName("DataLakeAnalytics") +/** + * A DataLakeAnalytics compute. + */ @Fluent public final class DataLakeAnalytics extends Compute { + /* + * The type of compute + */ + private ComputeType computeType = ComputeType.DATA_LAKE_ANALYTICS; + /* * The properties property. */ - @JsonProperty(value = "properties") private DataLakeAnalyticsSchemaProperties properties; - /** Creates an instance of DataLakeAnalytics class. */ + /* + * The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. + */ + private ProvisioningState provisioningState; + + /* + * The time at which the compute was created. + */ + private OffsetDateTime createdOn; + + /* + * The time at which the compute was last modified. + */ + private OffsetDateTime modifiedOn; + + /* + * Errors during provisioning + */ + private List provisioningErrors; + + /* + * Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning + * service provisioned it if false. + */ + private Boolean isAttachedCompute; + + /** + * Creates an instance of DataLakeAnalytics class. + */ public DataLakeAnalytics() { } + /** + * Get the computeType property: The type of compute. + * + * @return the computeType value. + */ + @Override + public ComputeType computeType() { + return this.computeType; + } + /** * Get the properties property: The properties property. - * + * * @return the properties value. */ public DataLakeAnalyticsSchemaProperties properties() { @@ -35,7 +82,7 @@ public DataLakeAnalyticsSchemaProperties properties() { /** * Set the properties property: The properties property. - * + * * @param properties the properties value to set. * @return the DataLakeAnalytics object itself. */ @@ -44,28 +91,88 @@ public DataLakeAnalytics withProperties(DataLakeAnalyticsSchemaProperties proper return this; } - /** {@inheritDoc} */ + /** + * Get the provisioningState property: The provision state of the cluster. Valid values are Unknown, Updating, + * Provisioning, Succeeded, and Failed. + * + * @return the provisioningState value. + */ + @Override + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the createdOn property: The time at which the compute was created. + * + * @return the createdOn value. + */ + @Override + public OffsetDateTime createdOn() { + return this.createdOn; + } + + /** + * Get the modifiedOn property: The time at which the compute was last modified. + * + * @return the modifiedOn value. + */ + @Override + public OffsetDateTime modifiedOn() { + return this.modifiedOn; + } + + /** + * Get the provisioningErrors property: Errors during provisioning. + * + * @return the provisioningErrors value. + */ + @Override + public List provisioningErrors() { + return this.provisioningErrors; + } + + /** + * Get the isAttachedCompute property: Indicating whether the compute was provisioned by user and brought from + * outside if true, or machine learning service provisioned it if false. + * + * @return the isAttachedCompute value. + */ + @Override + public Boolean isAttachedCompute() { + return this.isAttachedCompute; + } + + /** + * {@inheritDoc} + */ @Override public DataLakeAnalytics withComputeLocation(String computeLocation) { super.withComputeLocation(computeLocation); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public DataLakeAnalytics withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public DataLakeAnalytics withResourceId(String resourceId) { super.withResourceId(resourceId); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public DataLakeAnalytics withDisableLocalAuth(Boolean disableLocalAuth) { super.withDisableLocalAuth(disableLocalAuth); @@ -74,7 +181,7 @@ public DataLakeAnalytics withDisableLocalAuth(Boolean disableLocalAuth) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -84,4 +191,69 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("computeLocation", computeLocation()); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("resourceId", resourceId()); + jsonWriter.writeBooleanField("disableLocalAuth", disableLocalAuth()); + jsonWriter.writeStringField("computeType", this.computeType == null ? null : this.computeType.toString()); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataLakeAnalytics from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataLakeAnalytics if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DataLakeAnalytics. + */ + public static DataLakeAnalytics fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataLakeAnalytics deserializedDataLakeAnalytics = new DataLakeAnalytics(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("computeLocation".equals(fieldName)) { + deserializedDataLakeAnalytics.withComputeLocation(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedDataLakeAnalytics.provisioningState = ProvisioningState.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedDataLakeAnalytics.withDescription(reader.getString()); + } else if ("createdOn".equals(fieldName)) { + deserializedDataLakeAnalytics.createdOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("modifiedOn".equals(fieldName)) { + deserializedDataLakeAnalytics.modifiedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("resourceId".equals(fieldName)) { + deserializedDataLakeAnalytics.withResourceId(reader.getString()); + } else if ("provisioningErrors".equals(fieldName)) { + List provisioningErrors + = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); + deserializedDataLakeAnalytics.provisioningErrors = provisioningErrors; + } else if ("isAttachedCompute".equals(fieldName)) { + deserializedDataLakeAnalytics.isAttachedCompute = reader.getNullable(JsonReader::getBoolean); + } else if ("disableLocalAuth".equals(fieldName)) { + deserializedDataLakeAnalytics.withDisableLocalAuth(reader.getNullable(JsonReader::getBoolean)); + } else if ("computeType".equals(fieldName)) { + deserializedDataLakeAnalytics.computeType = ComputeType.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedDataLakeAnalytics.properties = DataLakeAnalyticsSchemaProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDataLakeAnalytics; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataLakeAnalyticsSchema.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataLakeAnalyticsSchema.java index 8d9dd38b62f8a..fa249102d79e2 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataLakeAnalyticsSchema.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataLakeAnalyticsSchema.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The DataLakeAnalyticsSchema model. */ +/** + * The DataLakeAnalyticsSchema model. + */ @Fluent -public class DataLakeAnalyticsSchema { +public class DataLakeAnalyticsSchema implements JsonSerializable { /* * The properties property. */ - @JsonProperty(value = "properties") private DataLakeAnalyticsSchemaProperties properties; - /** Creates an instance of DataLakeAnalyticsSchema class. */ + /** + * Creates an instance of DataLakeAnalyticsSchema class. + */ public DataLakeAnalyticsSchema() { } /** * Get the properties property: The properties property. - * + * * @return the properties value. */ public DataLakeAnalyticsSchemaProperties properties() { @@ -31,7 +38,7 @@ public DataLakeAnalyticsSchemaProperties properties() { /** * Set the properties property: The properties property. - * + * * @param properties the properties value to set. * @return the DataLakeAnalyticsSchema object itself. */ @@ -42,7 +49,7 @@ public DataLakeAnalyticsSchema withProperties(DataLakeAnalyticsSchemaProperties /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -50,4 +57,40 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataLakeAnalyticsSchema from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataLakeAnalyticsSchema if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DataLakeAnalyticsSchema. + */ + public static DataLakeAnalyticsSchema fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataLakeAnalyticsSchema deserializedDataLakeAnalyticsSchema = new DataLakeAnalyticsSchema(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedDataLakeAnalyticsSchema.properties = DataLakeAnalyticsSchemaProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDataLakeAnalyticsSchema; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataLakeAnalyticsSchemaProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataLakeAnalyticsSchemaProperties.java index 645bc27f9f93e..1a8b16c224853 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataLakeAnalyticsSchemaProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataLakeAnalyticsSchemaProperties.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The DataLakeAnalyticsSchemaProperties model. */ +/** + * The DataLakeAnalyticsSchemaProperties model. + */ @Fluent -public final class DataLakeAnalyticsSchemaProperties { +public final class DataLakeAnalyticsSchemaProperties implements JsonSerializable { /* * DataLake Store Account Name */ - @JsonProperty(value = "dataLakeStoreAccountName") private String dataLakeStoreAccountName; - /** Creates an instance of DataLakeAnalyticsSchemaProperties class. */ + /** + * Creates an instance of DataLakeAnalyticsSchemaProperties class. + */ public DataLakeAnalyticsSchemaProperties() { } /** * Get the dataLakeStoreAccountName property: DataLake Store Account Name. - * + * * @return the dataLakeStoreAccountName value. */ public String dataLakeStoreAccountName() { @@ -31,7 +38,7 @@ public String dataLakeStoreAccountName() { /** * Set the dataLakeStoreAccountName property: DataLake Store Account Name. - * + * * @param dataLakeStoreAccountName the dataLakeStoreAccountName value to set. * @return the DataLakeAnalyticsSchemaProperties object itself. */ @@ -42,9 +49,46 @@ public DataLakeAnalyticsSchemaProperties withDataLakeStoreAccountName(String dat /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("dataLakeStoreAccountName", this.dataLakeStoreAccountName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataLakeAnalyticsSchemaProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataLakeAnalyticsSchemaProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DataLakeAnalyticsSchemaProperties. + */ + public static DataLakeAnalyticsSchemaProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataLakeAnalyticsSchemaProperties deserializedDataLakeAnalyticsSchemaProperties + = new DataLakeAnalyticsSchemaProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dataLakeStoreAccountName".equals(fieldName)) { + deserializedDataLakeAnalyticsSchemaProperties.dataLakeStoreAccountName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDataLakeAnalyticsSchemaProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataPathAssetReference.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataPathAssetReference.java index f9425ac02511a..385fc0125eb62 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataPathAssetReference.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataPathAssetReference.java @@ -5,34 +5,50 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Reference to an asset via its path in a datastore. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "referenceType") -@JsonTypeName("DataPath") +/** + * Reference to an asset via its path in a datastore. + */ @Fluent public final class DataPathAssetReference extends AssetReferenceBase { + /* + * [Required] Specifies the type of asset reference. + */ + private ReferenceType referenceType = ReferenceType.DATA_PATH; + /* * ARM resource ID of the datastore where the asset is located. */ - @JsonProperty(value = "datastoreId") private String datastoreId; /* * The path of the file/directory in the datastore. */ - @JsonProperty(value = "path") private String path; - /** Creates an instance of DataPathAssetReference class. */ + /** + * Creates an instance of DataPathAssetReference class. + */ public DataPathAssetReference() { } + /** + * Get the referenceType property: [Required] Specifies the type of asset reference. + * + * @return the referenceType value. + */ + @Override + public ReferenceType referenceType() { + return this.referenceType; + } + /** * Get the datastoreId property: ARM resource ID of the datastore where the asset is located. - * + * * @return the datastoreId value. */ public String datastoreId() { @@ -41,7 +57,7 @@ public String datastoreId() { /** * Set the datastoreId property: ARM resource ID of the datastore where the asset is located. - * + * * @param datastoreId the datastoreId value to set. * @return the DataPathAssetReference object itself. */ @@ -52,7 +68,7 @@ public DataPathAssetReference withDatastoreId(String datastoreId) { /** * Get the path property: The path of the file/directory in the datastore. - * + * * @return the path value. */ public String path() { @@ -61,7 +77,7 @@ public String path() { /** * Set the path property: The path of the file/directory in the datastore. - * + * * @param path the path value to set. * @return the DataPathAssetReference object itself. */ @@ -72,11 +88,53 @@ public DataPathAssetReference withPath(String path) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("referenceType", this.referenceType == null ? null : this.referenceType.toString()); + jsonWriter.writeStringField("datastoreId", this.datastoreId); + jsonWriter.writeStringField("path", this.path); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataPathAssetReference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataPathAssetReference if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DataPathAssetReference. + */ + public static DataPathAssetReference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataPathAssetReference deserializedDataPathAssetReference = new DataPathAssetReference(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("referenceType".equals(fieldName)) { + deserializedDataPathAssetReference.referenceType = ReferenceType.fromString(reader.getString()); + } else if ("datastoreId".equals(fieldName)) { + deserializedDataPathAssetReference.datastoreId = reader.getString(); + } else if ("path".equals(fieldName)) { + deserializedDataPathAssetReference.path = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDataPathAssetReference; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataQualityMetricThresholdBase.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataQualityMetricThresholdBase.java new file mode 100644 index 0000000000000..8ec4a69739813 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataQualityMetricThresholdBase.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The DataQualityMetricThresholdBase model. + */ +@Fluent +public class DataQualityMetricThresholdBase implements JsonSerializable { + /* + * [Required] Specifies the data type of the metric threshold. + */ + private MonitoringFeatureDataType dataType = MonitoringFeatureDataType.fromString("DataQualityMetricThresholdBase"); + + /* + * The threshold value. If null, a default value will be set depending on the selected metric. + */ + private MonitoringThreshold threshold; + + /** + * Creates an instance of DataQualityMetricThresholdBase class. + */ + public DataQualityMetricThresholdBase() { + } + + /** + * Get the dataType property: [Required] Specifies the data type of the metric threshold. + * + * @return the dataType value. + */ + public MonitoringFeatureDataType dataType() { + return this.dataType; + } + + /** + * Get the threshold property: The threshold value. If null, a default value will be set depending on the selected + * metric. + * + * @return the threshold value. + */ + public MonitoringThreshold threshold() { + return this.threshold; + } + + /** + * Set the threshold property: The threshold value. If null, a default value will be set depending on the selected + * metric. + * + * @param threshold the threshold value to set. + * @return the DataQualityMetricThresholdBase object itself. + */ + public DataQualityMetricThresholdBase withThreshold(MonitoringThreshold threshold) { + this.threshold = threshold; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (threshold() != null) { + threshold().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("dataType", this.dataType == null ? null : this.dataType.toString()); + jsonWriter.writeJsonField("threshold", this.threshold); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataQualityMetricThresholdBase from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataQualityMetricThresholdBase if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DataQualityMetricThresholdBase. + */ + public static DataQualityMetricThresholdBase fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("dataType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Categorical".equals(discriminatorValue)) { + return CategoricalDataQualityMetricThreshold.fromJson(readerToUse.reset()); + } else if ("Numerical".equals(discriminatorValue)) { + return NumericalDataQualityMetricThreshold.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static DataQualityMetricThresholdBase fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataQualityMetricThresholdBase deserializedDataQualityMetricThresholdBase + = new DataQualityMetricThresholdBase(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dataType".equals(fieldName)) { + deserializedDataQualityMetricThresholdBase.dataType + = MonitoringFeatureDataType.fromString(reader.getString()); + } else if ("threshold".equals(fieldName)) { + deserializedDataQualityMetricThresholdBase.threshold = MonitoringThreshold.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDataQualityMetricThresholdBase; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataQualityMonitoringSignal.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataQualityMonitoringSignal.java new file mode 100644 index 0000000000000..a42279395baf2 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataQualityMonitoringSignal.java @@ -0,0 +1,325 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * The DataQualityMonitoringSignal model. + */ +@Fluent +public final class DataQualityMonitoringSignal extends MonitoringSignalBase { + /* + * [Required] Specifies the type of signal to monitor. + */ + private MonitoringSignalType signalType = MonitoringSignalType.DATA_QUALITY; + + /* + * A dictionary that maps feature names to their respective data types. + */ + private Map featureDataTypeOverride; + + /* + * The settings for computing feature importance. + */ + private FeatureImportanceSettings featureImportanceSettings; + + /* + * The features to calculate drift over. + */ + private MonitoringFeatureFilterBase features; + + /* + * [Required] A list of metrics to calculate and their associated thresholds. + */ + private List metricThresholds; + + /* + * [Required] The data produced by the production service which drift will be calculated for. + */ + private MonitoringInputDataBase productionData; + + /* + * [Required] The data to calculate drift against. + */ + private MonitoringInputDataBase referenceData; + + /** + * Creates an instance of DataQualityMonitoringSignal class. + */ + public DataQualityMonitoringSignal() { + } + + /** + * Get the signalType property: [Required] Specifies the type of signal to monitor. + * + * @return the signalType value. + */ + @Override + public MonitoringSignalType signalType() { + return this.signalType; + } + + /** + * Get the featureDataTypeOverride property: A dictionary that maps feature names to their respective data types. + * + * @return the featureDataTypeOverride value. + */ + public Map featureDataTypeOverride() { + return this.featureDataTypeOverride; + } + + /** + * Set the featureDataTypeOverride property: A dictionary that maps feature names to their respective data types. + * + * @param featureDataTypeOverride the featureDataTypeOverride value to set. + * @return the DataQualityMonitoringSignal object itself. + */ + public DataQualityMonitoringSignal + withFeatureDataTypeOverride(Map featureDataTypeOverride) { + this.featureDataTypeOverride = featureDataTypeOverride; + return this; + } + + /** + * Get the featureImportanceSettings property: The settings for computing feature importance. + * + * @return the featureImportanceSettings value. + */ + public FeatureImportanceSettings featureImportanceSettings() { + return this.featureImportanceSettings; + } + + /** + * Set the featureImportanceSettings property: The settings for computing feature importance. + * + * @param featureImportanceSettings the featureImportanceSettings value to set. + * @return the DataQualityMonitoringSignal object itself. + */ + public DataQualityMonitoringSignal + withFeatureImportanceSettings(FeatureImportanceSettings featureImportanceSettings) { + this.featureImportanceSettings = featureImportanceSettings; + return this; + } + + /** + * Get the features property: The features to calculate drift over. + * + * @return the features value. + */ + public MonitoringFeatureFilterBase features() { + return this.features; + } + + /** + * Set the features property: The features to calculate drift over. + * + * @param features the features value to set. + * @return the DataQualityMonitoringSignal object itself. + */ + public DataQualityMonitoringSignal withFeatures(MonitoringFeatureFilterBase features) { + this.features = features; + return this; + } + + /** + * Get the metricThresholds property: [Required] A list of metrics to calculate and their associated thresholds. + * + * @return the metricThresholds value. + */ + public List metricThresholds() { + return this.metricThresholds; + } + + /** + * Set the metricThresholds property: [Required] A list of metrics to calculate and their associated thresholds. + * + * @param metricThresholds the metricThresholds value to set. + * @return the DataQualityMonitoringSignal object itself. + */ + public DataQualityMonitoringSignal withMetricThresholds(List metricThresholds) { + this.metricThresholds = metricThresholds; + return this; + } + + /** + * Get the productionData property: [Required] The data produced by the production service which drift will be + * calculated for. + * + * @return the productionData value. + */ + public MonitoringInputDataBase productionData() { + return this.productionData; + } + + /** + * Set the productionData property: [Required] The data produced by the production service which drift will be + * calculated for. + * + * @param productionData the productionData value to set. + * @return the DataQualityMonitoringSignal object itself. + */ + public DataQualityMonitoringSignal withProductionData(MonitoringInputDataBase productionData) { + this.productionData = productionData; + return this; + } + + /** + * Get the referenceData property: [Required] The data to calculate drift against. + * + * @return the referenceData value. + */ + public MonitoringInputDataBase referenceData() { + return this.referenceData; + } + + /** + * Set the referenceData property: [Required] The data to calculate drift against. + * + * @param referenceData the referenceData value to set. + * @return the DataQualityMonitoringSignal object itself. + */ + public DataQualityMonitoringSignal withReferenceData(MonitoringInputDataBase referenceData) { + this.referenceData = referenceData; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DataQualityMonitoringSignal withNotificationTypes(List notificationTypes) { + super.withNotificationTypes(notificationTypes); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DataQualityMonitoringSignal withProperties(Map properties) { + super.withProperties(properties); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (featureImportanceSettings() != null) { + featureImportanceSettings().validate(); + } + if (features() != null) { + features().validate(); + } + if (metricThresholds() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property metricThresholds in model DataQualityMonitoringSignal")); + } else { + metricThresholds().forEach(e -> e.validate()); + } + if (productionData() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property productionData in model DataQualityMonitoringSignal")); + } else { + productionData().validate(); + } + if (referenceData() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property referenceData in model DataQualityMonitoringSignal")); + } else { + referenceData().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DataQualityMonitoringSignal.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("notificationTypes", notificationTypes(), + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("metricThresholds", this.metricThresholds, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("productionData", this.productionData); + jsonWriter.writeJsonField("referenceData", this.referenceData); + jsonWriter.writeStringField("signalType", this.signalType == null ? null : this.signalType.toString()); + jsonWriter.writeMapField("featureDataTypeOverride", this.featureDataTypeOverride, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeJsonField("featureImportanceSettings", this.featureImportanceSettings); + jsonWriter.writeJsonField("features", this.features); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataQualityMonitoringSignal from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataQualityMonitoringSignal if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataQualityMonitoringSignal. + */ + public static DataQualityMonitoringSignal fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataQualityMonitoringSignal deserializedDataQualityMonitoringSignal = new DataQualityMonitoringSignal(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("notificationTypes".equals(fieldName)) { + List notificationTypes + = reader.readArray(reader1 -> MonitoringNotificationType.fromString(reader1.getString())); + deserializedDataQualityMonitoringSignal.withNotificationTypes(notificationTypes); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedDataQualityMonitoringSignal.withProperties(properties); + } else if ("metricThresholds".equals(fieldName)) { + List metricThresholds + = reader.readArray(reader1 -> DataQualityMetricThresholdBase.fromJson(reader1)); + deserializedDataQualityMonitoringSignal.metricThresholds = metricThresholds; + } else if ("productionData".equals(fieldName)) { + deserializedDataQualityMonitoringSignal.productionData = MonitoringInputDataBase.fromJson(reader); + } else if ("referenceData".equals(fieldName)) { + deserializedDataQualityMonitoringSignal.referenceData = MonitoringInputDataBase.fromJson(reader); + } else if ("signalType".equals(fieldName)) { + deserializedDataQualityMonitoringSignal.signalType + = MonitoringSignalType.fromString(reader.getString()); + } else if ("featureDataTypeOverride".equals(fieldName)) { + Map featureDataTypeOverride + = reader.readMap(reader1 -> MonitoringFeatureDataType.fromString(reader1.getString())); + deserializedDataQualityMonitoringSignal.featureDataTypeOverride = featureDataTypeOverride; + } else if ("featureImportanceSettings".equals(fieldName)) { + deserializedDataQualityMonitoringSignal.featureImportanceSettings + = FeatureImportanceSettings.fromJson(reader); + } else if ("features".equals(fieldName)) { + deserializedDataQualityMonitoringSignal.features = MonitoringFeatureFilterBase.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDataQualityMonitoringSignal; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataReferenceCredential.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataReferenceCredential.java new file mode 100644 index 0000000000000..628cd4ec4a6c4 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataReferenceCredential.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * DataReferenceCredential base class. + */ +@Immutable +public class DataReferenceCredential implements JsonSerializable { + /* + * [Required] Credential type used to authentication with storage. + */ + private DataReferenceCredentialType credentialType + = DataReferenceCredentialType.fromString("DataReferenceCredential"); + + /** + * Creates an instance of DataReferenceCredential class. + */ + public DataReferenceCredential() { + } + + /** + * Get the credentialType property: [Required] Credential type used to authentication with storage. + * + * @return the credentialType value. + */ + public DataReferenceCredentialType credentialType() { + return this.credentialType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("credentialType", + this.credentialType == null ? null : this.credentialType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataReferenceCredential from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataReferenceCredential if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DataReferenceCredential. + */ + public static DataReferenceCredential fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("credentialType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("NoCredentials".equals(discriminatorValue)) { + return AnonymousAccessCredential.fromJson(readerToUse.reset()); + } else if ("DockerCredentials".equals(discriminatorValue)) { + return DockerCredential.fromJson(readerToUse.reset()); + } else if ("ManagedIdentity".equals(discriminatorValue)) { + return ManagedIdentityCredential.fromJson(readerToUse.reset()); + } else if ("SAS".equals(discriminatorValue)) { + return SasCredential.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static DataReferenceCredential fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataReferenceCredential deserializedDataReferenceCredential = new DataReferenceCredential(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("credentialType".equals(fieldName)) { + deserializedDataReferenceCredential.credentialType + = DataReferenceCredentialType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDataReferenceCredential; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataReferenceCredentialType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataReferenceCredentialType.java new file mode 100644 index 0000000000000..c364b7398d33b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataReferenceCredentialType.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum to determine the DataReference credentials type. + */ +public final class DataReferenceCredentialType extends ExpandableStringEnum { + /** + * Static value SAS for DataReferenceCredentialType. + */ + public static final DataReferenceCredentialType SAS = fromString("SAS"); + + /** + * Static value DockerCredentials for DataReferenceCredentialType. + */ + public static final DataReferenceCredentialType DOCKER_CREDENTIALS = fromString("DockerCredentials"); + + /** + * Static value ManagedIdentity for DataReferenceCredentialType. + */ + public static final DataReferenceCredentialType MANAGED_IDENTITY = fromString("ManagedIdentity"); + + /** + * Static value NoCredentials for DataReferenceCredentialType. + */ + public static final DataReferenceCredentialType NO_CREDENTIALS = fromString("NoCredentials"); + + /** + * Creates a new instance of DataReferenceCredentialType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DataReferenceCredentialType() { + } + + /** + * Creates or finds a DataReferenceCredentialType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataReferenceCredentialType. + */ + public static DataReferenceCredentialType fromString(String name) { + return fromString(name, DataReferenceCredentialType.class); + } + + /** + * Gets known DataReferenceCredentialType values. + * + * @return known DataReferenceCredentialType values. + */ + public static Collection values() { + return values(DataReferenceCredentialType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataType.java index 3b8eae0a61d62..f5d4202cbc117 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataType.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Enum to determine the type of data. */ +/** + * Enum to determine the type of data. + */ public final class DataType extends ExpandableStringEnum { - /** Static value uri_file for DataType. */ + /** + * Static value uri_file for DataType. + */ public static final DataType URI_FILE = fromString("uri_file"); - /** Static value uri_folder for DataType. */ + /** + * Static value uri_folder for DataType. + */ public static final DataType URI_FOLDER = fromString("uri_folder"); - /** Static value mltable for DataType. */ + /** + * Static value mltable for DataType. + */ public static final DataType MLTABLE = fromString("mltable"); /** * Creates a new instance of DataType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public DataType() { /** * Creates or finds a DataType from its string representation. - * + * * @param name a name to look for. * @return the corresponding DataType. */ - @JsonCreator public static DataType fromString(String name) { return fromString(name, DataType.class); } /** * Gets known DataType values. - * + * * @return known DataType values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataVersionBase.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataVersionBase.java index ad254ac4664f8..ac80ba0b6f227 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataVersionBase.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataVersionBase.java @@ -4,95 +4,109 @@ package com.azure.resourcemanager.machinelearning.models; +import com.azure.core.http.rest.Response; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.machinelearning.fluent.models.DataVersionBaseInner; -/** An immutable client-side representation of DataVersionBase. */ +/** + * An immutable client-side representation of DataVersionBase. + */ public interface DataVersionBase { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the properties property: [Required] Additional attributes of the entity. - * + * * @return the properties value. */ DataVersionBaseProperties properties(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.DataVersionBaseInner object. - * + * * @return the inner object. */ DataVersionBaseInner innerModel(); - /** The entirety of the DataVersionBase definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithParentResource, - DefinitionStages.WithProperties, - DefinitionStages.WithCreate { + /** + * The entirety of the DataVersionBase definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, DefinitionStages.WithCreate { } - /** The DataVersionBase definition stages. */ + + /** + * The DataVersionBase definition stages. + */ interface DefinitionStages { - /** The first stage of the DataVersionBase definition. */ + /** + * The first stage of the DataVersionBase definition. + */ interface Blank extends WithParentResource { } - /** The stage of the DataVersionBase definition allowing to specify parent resource. */ + + /** + * The stage of the DataVersionBase definition allowing to specify parent resource. + */ interface WithParentResource { /** - * Specifies resourceGroupName, workspaceName, name. - * + * Specifies resourceGroupName, registryName, name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. * @param name Container name. * @return the next definition stage. */ - WithProperties withExistingData(String resourceGroupName, String workspaceName, String name); + WithProperties withExistingData(String resourceGroupName, String registryName, String name); } - /** The stage of the DataVersionBase definition allowing to specify properties. */ + + /** + * The stage of the DataVersionBase definition allowing to specify properties. + */ interface WithProperties { /** * Specifies the properties property: [Required] Additional attributes of the entity.. - * + * * @param properties [Required] Additional attributes of the entity. * @return the next definition stage. */ WithCreate withProperties(DataVersionBaseProperties properties); } + /** * The stage of the DataVersionBase definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. @@ -100,69 +114,102 @@ interface WithProperties { interface WithCreate { /** * Executes the create request. - * + * * @return the created resource. */ DataVersionBase create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ DataVersionBase create(Context context); } } + /** * Begins update for the DataVersionBase resource. - * + * * @return the stage of resource update. */ DataVersionBase.Update update(); - /** The template for DataVersionBase update. */ + /** + * The template for DataVersionBase update. + */ interface Update extends UpdateStages.WithProperties { /** * Executes the update request. - * + * * @return the updated resource. */ DataVersionBase apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ DataVersionBase apply(Context context); } - /** The DataVersionBase update stages. */ + + /** + * The DataVersionBase update stages. + */ interface UpdateStages { - /** The stage of the DataVersionBase update allowing to specify properties. */ + /** + * The stage of the DataVersionBase update allowing to specify properties. + */ interface WithProperties { /** * Specifies the properties property: [Required] Additional attributes of the entity.. - * + * * @param properties [Required] Additional attributes of the entity. * @return the next definition stage. */ Update withProperties(DataVersionBaseProperties properties); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ DataVersionBase refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ DataVersionBase refresh(Context context); + + /** + * Generate a storage location and credential for the client to upload a data asset to. + * + * @param body Pending upload request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + Response createOrGetStartPendingUploadWithResponse(PendingUploadRequestDto body, + Context context); + + /** + * Generate a storage location and credential for the client to upload a data asset to. + * + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + PendingUploadResponseDto createOrGetStartPendingUpload(PendingUploadRequestDto body); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataVersionBaseProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataVersionBaseProperties.java index ad6fb4df7677d..6968f1f20bbe8 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataVersionBaseProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataVersionBaseProperties.java @@ -6,41 +6,45 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Data version base definition. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "dataType", - defaultImpl = DataVersionBaseProperties.class) -@JsonTypeName("DataVersionBaseProperties") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "mltable", value = MLTableData.class), - @JsonSubTypes.Type(name = "uri_file", value = UriFileDataVersion.class), - @JsonSubTypes.Type(name = "uri_folder", value = UriFolderDataVersion.class) -}) +/** + * Data version base definition. + */ @Fluent public class DataVersionBaseProperties extends AssetBase { /* - * [Required] Uri of the data. Usage/meaning depends on - * Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20221001.Assets.DataVersionBase.DataType + * [Required] Specifies the type of data. + */ + private DataType dataType = DataType.fromString("DataVersionBaseProperties"); + + /* + * [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330 */ - @JsonProperty(value = "dataUri", required = true) private String dataUri; - /** Creates an instance of DataVersionBaseProperties class. */ + /** + * Creates an instance of DataVersionBaseProperties class. + */ public DataVersionBaseProperties() { } /** - * Get the dataUri property: [Required] Uri of the data. Usage/meaning depends on - * Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20221001.Assets.DataVersionBase.DataType. - * + * Get the dataType property: [Required] Specifies the type of data. + * + * @return the dataType value. + */ + public DataType dataType() { + return this.dataType; + } + + /** + * Get the dataUri property: [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330. + * * @return the dataUri value. */ public String dataUri() { @@ -48,9 +52,8 @@ public String dataUri() { } /** - * Set the dataUri property: [Required] Uri of the data. Usage/meaning depends on - * Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20221001.Assets.DataVersionBase.DataType. - * + * Set the dataUri property: [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330. + * * @param dataUri the dataUri value to set. * @return the DataVersionBaseProperties object itself. */ @@ -59,35 +62,45 @@ public DataVersionBaseProperties withDataUri(String dataUri) { return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public DataVersionBaseProperties withIsAnonymous(Boolean isAnonymous) { super.withIsAnonymous(isAnonymous); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public DataVersionBaseProperties withIsArchived(Boolean isArchived) { super.withIsArchived(isArchived); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public DataVersionBaseProperties withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public DataVersionBaseProperties withProperties(Map properties) { super.withProperties(properties); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public DataVersionBaseProperties withTags(Map tags) { super.withTags(tags); @@ -96,19 +109,104 @@ public DataVersionBaseProperties withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (dataUri() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property dataUri in model DataVersionBaseProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property dataUri in model DataVersionBaseProperties")); } } private static final ClientLogger LOGGER = new ClientLogger(DataVersionBaseProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("isAnonymous", isAnonymous()); + jsonWriter.writeBooleanField("isArchived", isArchived()); + jsonWriter.writeStringField("dataUri", this.dataUri); + jsonWriter.writeStringField("dataType", this.dataType == null ? null : this.dataType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataVersionBaseProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataVersionBaseProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataVersionBaseProperties. + */ + public static DataVersionBaseProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("dataType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("mltable".equals(discriminatorValue)) { + return MLTableData.fromJson(readerToUse.reset()); + } else if ("uri_file".equals(discriminatorValue)) { + return UriFileDataVersion.fromJson(readerToUse.reset()); + } else if ("uri_folder".equals(discriminatorValue)) { + return UriFolderDataVersion.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static DataVersionBaseProperties fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataVersionBaseProperties deserializedDataVersionBaseProperties = new DataVersionBaseProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedDataVersionBaseProperties.withDescription(reader.getString()); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedDataVersionBaseProperties.withProperties(properties); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedDataVersionBaseProperties.withTags(tags); + } else if ("isAnonymous".equals(fieldName)) { + deserializedDataVersionBaseProperties.withIsAnonymous(reader.getNullable(JsonReader::getBoolean)); + } else if ("isArchived".equals(fieldName)) { + deserializedDataVersionBaseProperties.withIsArchived(reader.getNullable(JsonReader::getBoolean)); + } else if ("dataUri".equals(fieldName)) { + deserializedDataVersionBaseProperties.dataUri = reader.getString(); + } else if ("dataType".equals(fieldName)) { + deserializedDataVersionBaseProperties.dataType = DataType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDataVersionBaseProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataVersionBaseResourceArmPaginatedResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataVersionBaseResourceArmPaginatedResult.java index 6e8048afa408a..412b78d04bb1d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataVersionBaseResourceArmPaginatedResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataVersionBaseResourceArmPaginatedResult.java @@ -5,33 +5,40 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.fluent.models.DataVersionBaseInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** A paginated list of DataVersionBase entities. */ +/** + * A paginated list of DataVersionBase entities. + */ @Fluent -public final class DataVersionBaseResourceArmPaginatedResult { +public final class DataVersionBaseResourceArmPaginatedResult + implements JsonSerializable { /* * The link to the next page of DataVersionBase objects. If null, there are no additional pages. */ - @JsonProperty(value = "nextLink") private String nextLink; /* * An array of objects of type DataVersionBase. */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of DataVersionBaseResourceArmPaginatedResult class. */ + /** + * Creates an instance of DataVersionBaseResourceArmPaginatedResult class. + */ public DataVersionBaseResourceArmPaginatedResult() { } /** * Get the nextLink property: The link to the next page of DataVersionBase objects. If null, there are no additional * pages. - * + * * @return the nextLink value. */ public String nextLink() { @@ -41,7 +48,7 @@ public String nextLink() { /** * Set the nextLink property: The link to the next page of DataVersionBase objects. If null, there are no additional * pages. - * + * * @param nextLink the nextLink value to set. * @return the DataVersionBaseResourceArmPaginatedResult object itself. */ @@ -52,7 +59,7 @@ public DataVersionBaseResourceArmPaginatedResult withNextLink(String nextLink) { /** * Get the value property: An array of objects of type DataVersionBase. - * + * * @return the value value. */ public List value() { @@ -61,7 +68,7 @@ public List value() { /** * Set the value property: An array of objects of type DataVersionBase. - * + * * @param value the value value to set. * @return the DataVersionBaseResourceArmPaginatedResult object itself. */ @@ -72,7 +79,7 @@ public DataVersionBaseResourceArmPaginatedResult withValue(List e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataVersionBaseResourceArmPaginatedResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataVersionBaseResourceArmPaginatedResult if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DataVersionBaseResourceArmPaginatedResult. + */ + public static DataVersionBaseResourceArmPaginatedResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataVersionBaseResourceArmPaginatedResult deserializedDataVersionBaseResourceArmPaginatedResult + = new DataVersionBaseResourceArmPaginatedResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedDataVersionBaseResourceArmPaginatedResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> DataVersionBaseInner.fromJson(reader1)); + deserializedDataVersionBaseResourceArmPaginatedResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedDataVersionBaseResourceArmPaginatedResult; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataVersions.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataVersions.java index e5234415cf8bc..8d544d49b3ba6 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataVersions.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DataVersions.java @@ -7,12 +7,15 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.DataVersionBaseInner; -/** Resource collection API of DataVersions. */ +/** + * Resource collection API of DataVersions. + */ public interface DataVersions { /** * List data versions in the data container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Data container's name. @@ -25,37 +28,29 @@ public interface DataVersions { /** * List data versions in the data container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Data container's name. * @param orderBy Please choose OrderBy value from ['createdtime', 'modifiedtime']. - * @param top 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. + * @param top 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. * @param skip Continuation token for pagination. * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for - * including/excluding (for example) archived entities. + * including/excluding (for example) archived entities. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of DataVersionBase entities as paginated response with {@link PagedIterable}. */ - PagedIterable list( - String resourceGroupName, - String workspaceName, - String name, - String orderBy, - Integer top, - String skip, - String tags, - ListViewType listViewType, - Context context); + PagedIterable list(String resourceGroupName, String workspaceName, String name, String orderBy, + Integer top, String skip, String tags, ListViewType listViewType, Context context); /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -66,12 +61,12 @@ PagedIterable list( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ - Response deleteWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context); + Response deleteWithResponse(String resourceGroupName, String workspaceName, String name, String version, + Context context); /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -84,7 +79,7 @@ Response deleteWithResponse( /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -95,12 +90,12 @@ Response deleteWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return version along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context); + Response getWithResponse(String resourceGroupName, String workspaceName, String name, + String version, Context context); /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. @@ -113,55 +108,65 @@ Response getWithResponse( DataVersionBase get(String resourceGroupName, String workspaceName, String name, String version); /** - * Get version. - * - * @param id the resource ID. + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return version along with {@link Response}. + * @return azure Resource Manager resource envelope along with {@link Response}. */ - DataVersionBase getById(String id); + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, String name, + String version, DataVersionBaseInner body, Context context); /** - * Get version. - * - * @param id the resource ID. - * @param context The context to associate with this operation. + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Version entity to create or update. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return version along with {@link Response}. + * @return azure Resource Manager resource envelope. */ - Response getByIdWithResponse(String id, Context context); + DataVersionBase createOrUpdate(String resourceGroupName, String workspaceName, String name, String version, + DataVersionBaseInner body); /** - * Delete version. - * - * @param id the resource ID. + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void deleteById(String id); + void publish(String resourceGroupName, String workspaceName, String name, String version, DestinationAsset body); /** - * Delete version. - * - * @param id the resource ID. + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new DataVersionBase resource. - * - * @param name resource name. - * @return the first stage of the new DataVersionBase definition. - */ - DataVersionBase.DefinitionStages.Blank define(String name); + void publish(String resourceGroupName, String workspaceName, String name, String version, DestinationAsset body, + Context context); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Databricks.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Databricks.java index a0f94b61afd0e..a4ce92e15f051 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Databricks.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Databricks.java @@ -5,28 +5,75 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; -/** A DataFactory compute. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "computeType") -@JsonTypeName("Databricks") +/** + * A DataFactory compute. + */ @Fluent public final class Databricks extends Compute { + /* + * The type of compute + */ + private ComputeType computeType = ComputeType.DATABRICKS; + /* * Properties of Databricks */ - @JsonProperty(value = "properties") private DatabricksProperties properties; - /** Creates an instance of Databricks class. */ + /* + * The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. + */ + private ProvisioningState provisioningState; + + /* + * The time at which the compute was created. + */ + private OffsetDateTime createdOn; + + /* + * The time at which the compute was last modified. + */ + private OffsetDateTime modifiedOn; + + /* + * Errors during provisioning + */ + private List provisioningErrors; + + /* + * Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning + * service provisioned it if false. + */ + private Boolean isAttachedCompute; + + /** + * Creates an instance of Databricks class. + */ public Databricks() { } + /** + * Get the computeType property: The type of compute. + * + * @return the computeType value. + */ + @Override + public ComputeType computeType() { + return this.computeType; + } + /** * Get the properties property: Properties of Databricks. - * + * * @return the properties value. */ public DatabricksProperties properties() { @@ -35,7 +82,7 @@ public DatabricksProperties properties() { /** * Set the properties property: Properties of Databricks. - * + * * @param properties the properties value to set. * @return the Databricks object itself. */ @@ -44,28 +91,88 @@ public Databricks withProperties(DatabricksProperties properties) { return this; } - /** {@inheritDoc} */ + /** + * Get the provisioningState property: The provision state of the cluster. Valid values are Unknown, Updating, + * Provisioning, Succeeded, and Failed. + * + * @return the provisioningState value. + */ + @Override + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the createdOn property: The time at which the compute was created. + * + * @return the createdOn value. + */ + @Override + public OffsetDateTime createdOn() { + return this.createdOn; + } + + /** + * Get the modifiedOn property: The time at which the compute was last modified. + * + * @return the modifiedOn value. + */ + @Override + public OffsetDateTime modifiedOn() { + return this.modifiedOn; + } + + /** + * Get the provisioningErrors property: Errors during provisioning. + * + * @return the provisioningErrors value. + */ + @Override + public List provisioningErrors() { + return this.provisioningErrors; + } + + /** + * Get the isAttachedCompute property: Indicating whether the compute was provisioned by user and brought from + * outside if true, or machine learning service provisioned it if false. + * + * @return the isAttachedCompute value. + */ + @Override + public Boolean isAttachedCompute() { + return this.isAttachedCompute; + } + + /** + * {@inheritDoc} + */ @Override public Databricks withComputeLocation(String computeLocation) { super.withComputeLocation(computeLocation); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public Databricks withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public Databricks withResourceId(String resourceId) { super.withResourceId(resourceId); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public Databricks withDisableLocalAuth(Boolean disableLocalAuth) { super.withDisableLocalAuth(disableLocalAuth); @@ -74,7 +181,7 @@ public Databricks withDisableLocalAuth(Boolean disableLocalAuth) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -84,4 +191,69 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("computeLocation", computeLocation()); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("resourceId", resourceId()); + jsonWriter.writeBooleanField("disableLocalAuth", disableLocalAuth()); + jsonWriter.writeStringField("computeType", this.computeType == null ? null : this.computeType.toString()); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Databricks from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Databricks if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Databricks. + */ + public static Databricks fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Databricks deserializedDatabricks = new Databricks(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("computeLocation".equals(fieldName)) { + deserializedDatabricks.withComputeLocation(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedDatabricks.provisioningState = ProvisioningState.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedDatabricks.withDescription(reader.getString()); + } else if ("createdOn".equals(fieldName)) { + deserializedDatabricks.createdOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("modifiedOn".equals(fieldName)) { + deserializedDatabricks.modifiedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("resourceId".equals(fieldName)) { + deserializedDatabricks.withResourceId(reader.getString()); + } else if ("provisioningErrors".equals(fieldName)) { + List provisioningErrors + = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); + deserializedDatabricks.provisioningErrors = provisioningErrors; + } else if ("isAttachedCompute".equals(fieldName)) { + deserializedDatabricks.isAttachedCompute = reader.getNullable(JsonReader::getBoolean); + } else if ("disableLocalAuth".equals(fieldName)) { + deserializedDatabricks.withDisableLocalAuth(reader.getNullable(JsonReader::getBoolean)); + } else if ("computeType".equals(fieldName)) { + deserializedDatabricks.computeType = ComputeType.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedDatabricks.properties = DatabricksProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDatabricks; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatabricksComputeSecrets.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatabricksComputeSecrets.java index bd9f0dfb69f7f..846d0988f71ac 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatabricksComputeSecrets.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatabricksComputeSecrets.java @@ -5,29 +5,46 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.fluent.models.ComputeSecretsInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.IOException; -/** Secrets related to a Machine Learning compute based on Databricks. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "computeType") -@JsonTypeName("Databricks") +/** + * Secrets related to a Machine Learning compute based on Databricks. + */ @Fluent public final class DatabricksComputeSecrets extends ComputeSecretsInner { + /* + * The type of compute + */ + private ComputeType computeType = ComputeType.DATABRICKS; + /* * access token for databricks account. */ - @JsonProperty(value = "databricksAccessToken") private String databricksAccessToken; - /** Creates an instance of DatabricksComputeSecrets class. */ + /** + * Creates an instance of DatabricksComputeSecrets class. + */ public DatabricksComputeSecrets() { } + /** + * Get the computeType property: The type of compute. + * + * @return the computeType value. + */ + @Override + public ComputeType computeType() { + return this.computeType; + } + /** * Get the databricksAccessToken property: access token for databricks account. - * + * * @return the databricksAccessToken value. */ public String databricksAccessToken() { @@ -36,7 +53,7 @@ public String databricksAccessToken() { /** * Set the databricksAccessToken property: access token for databricks account. - * + * * @param databricksAccessToken the databricksAccessToken value to set. * @return the DatabricksComputeSecrets object itself. */ @@ -47,11 +64,50 @@ public DatabricksComputeSecrets withDatabricksAccessToken(String databricksAcces /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("computeType", this.computeType == null ? null : this.computeType.toString()); + jsonWriter.writeStringField("databricksAccessToken", this.databricksAccessToken); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DatabricksComputeSecrets from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatabricksComputeSecrets if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DatabricksComputeSecrets. + */ + public static DatabricksComputeSecrets fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DatabricksComputeSecrets deserializedDatabricksComputeSecrets = new DatabricksComputeSecrets(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("computeType".equals(fieldName)) { + deserializedDatabricksComputeSecrets.computeType = ComputeType.fromString(reader.getString()); + } else if ("databricksAccessToken".equals(fieldName)) { + deserializedDatabricksComputeSecrets.databricksAccessToken = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDatabricksComputeSecrets; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatabricksComputeSecretsProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatabricksComputeSecretsProperties.java index 3415468a00779..39459ed8d2820 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatabricksComputeSecretsProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatabricksComputeSecretsProperties.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Properties of Databricks Compute Secrets. */ +/** + * Properties of Databricks Compute Secrets. + */ @Fluent -public class DatabricksComputeSecretsProperties { +public class DatabricksComputeSecretsProperties implements JsonSerializable { /* * access token for databricks account. */ - @JsonProperty(value = "databricksAccessToken") private String databricksAccessToken; - /** Creates an instance of DatabricksComputeSecretsProperties class. */ + /** + * Creates an instance of DatabricksComputeSecretsProperties class. + */ public DatabricksComputeSecretsProperties() { } /** * Get the databricksAccessToken property: access token for databricks account. - * + * * @return the databricksAccessToken value. */ public String databricksAccessToken() { @@ -31,7 +38,7 @@ public String databricksAccessToken() { /** * Set the databricksAccessToken property: access token for databricks account. - * + * * @param databricksAccessToken the databricksAccessToken value to set. * @return the DatabricksComputeSecretsProperties object itself. */ @@ -42,9 +49,46 @@ public DatabricksComputeSecretsProperties withDatabricksAccessToken(String datab /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("databricksAccessToken", this.databricksAccessToken); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DatabricksComputeSecretsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatabricksComputeSecretsProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DatabricksComputeSecretsProperties. + */ + public static DatabricksComputeSecretsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DatabricksComputeSecretsProperties deserializedDatabricksComputeSecretsProperties + = new DatabricksComputeSecretsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("databricksAccessToken".equals(fieldName)) { + deserializedDatabricksComputeSecretsProperties.databricksAccessToken = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDatabricksComputeSecretsProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatabricksProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatabricksProperties.java index 5fff72428cc6f..5f73a76b73c03 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatabricksProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatabricksProperties.java @@ -5,30 +5,36 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Properties of Databricks. */ +/** + * Properties of Databricks. + */ @Fluent -public final class DatabricksProperties { +public final class DatabricksProperties implements JsonSerializable { /* * Databricks access token */ - @JsonProperty(value = "databricksAccessToken") private String databricksAccessToken; /* * Workspace Url */ - @JsonProperty(value = "workspaceUrl") private String workspaceUrl; - /** Creates an instance of DatabricksProperties class. */ + /** + * Creates an instance of DatabricksProperties class. + */ public DatabricksProperties() { } /** * Get the databricksAccessToken property: Databricks access token. - * + * * @return the databricksAccessToken value. */ public String databricksAccessToken() { @@ -37,7 +43,7 @@ public String databricksAccessToken() { /** * Set the databricksAccessToken property: Databricks access token. - * + * * @param databricksAccessToken the databricksAccessToken value to set. * @return the DatabricksProperties object itself. */ @@ -48,7 +54,7 @@ public DatabricksProperties withDatabricksAccessToken(String databricksAccessTok /** * Get the workspaceUrl property: Workspace Url. - * + * * @return the workspaceUrl value. */ public String workspaceUrl() { @@ -57,7 +63,7 @@ public String workspaceUrl() { /** * Set the workspaceUrl property: Workspace Url. - * + * * @param workspaceUrl the workspaceUrl value to set. * @return the DatabricksProperties object itself. */ @@ -68,9 +74,48 @@ public DatabricksProperties withWorkspaceUrl(String workspaceUrl) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("databricksAccessToken", this.databricksAccessToken); + jsonWriter.writeStringField("workspaceUrl", this.workspaceUrl); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DatabricksProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatabricksProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DatabricksProperties. + */ + public static DatabricksProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DatabricksProperties deserializedDatabricksProperties = new DatabricksProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("databricksAccessToken".equals(fieldName)) { + deserializedDatabricksProperties.databricksAccessToken = reader.getString(); + } else if ("workspaceUrl".equals(fieldName)) { + deserializedDatabricksProperties.workspaceUrl = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDatabricksProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatabricksSchema.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatabricksSchema.java index b67e4f9483433..80f84da479f35 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatabricksSchema.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatabricksSchema.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The DatabricksSchema model. */ +/** + * The DatabricksSchema model. + */ @Fluent -public class DatabricksSchema { +public class DatabricksSchema implements JsonSerializable { /* * Properties of Databricks */ - @JsonProperty(value = "properties") private DatabricksProperties properties; - /** Creates an instance of DatabricksSchema class. */ + /** + * Creates an instance of DatabricksSchema class. + */ public DatabricksSchema() { } /** * Get the properties property: Properties of Databricks. - * + * * @return the properties value. */ public DatabricksProperties properties() { @@ -31,7 +38,7 @@ public DatabricksProperties properties() { /** * Set the properties property: Properties of Databricks. - * + * * @param properties the properties value to set. * @return the DatabricksSchema object itself. */ @@ -42,7 +49,7 @@ public DatabricksSchema withProperties(DatabricksProperties properties) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -50,4 +57,40 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DatabricksSchema from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatabricksSchema if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DatabricksSchema. + */ + public static DatabricksSchema fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DatabricksSchema deserializedDatabricksSchema = new DatabricksSchema(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedDatabricksSchema.properties = DatabricksProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDatabricksSchema; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Datastore.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Datastore.java index 7b181093c6e26..6afc7bec6e0ef 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Datastore.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Datastore.java @@ -9,90 +9,103 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.machinelearning.fluent.models.DatastoreInner; -/** An immutable client-side representation of Datastore. */ +/** + * An immutable client-side representation of Datastore. + */ public interface Datastore { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the properties property: [Required] Additional attributes of the entity. - * + * * @return the properties value. */ DatastoreProperties properties(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.DatastoreInner object. - * + * * @return the inner object. */ DatastoreInner innerModel(); - /** The entirety of the Datastore definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithParentResource, - DefinitionStages.WithProperties, - DefinitionStages.WithCreate { + /** + * The entirety of the Datastore definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, DefinitionStages.WithCreate { } - /** The Datastore definition stages. */ + + /** + * The Datastore definition stages. + */ interface DefinitionStages { - /** The first stage of the Datastore definition. */ + /** + * The first stage of the Datastore definition. + */ interface Blank extends WithParentResource { } - /** The stage of the Datastore definition allowing to specify parent resource. */ + + /** + * The stage of the Datastore definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, workspaceName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @return the next definition stage. */ WithProperties withExistingWorkspace(String resourceGroupName, String workspaceName); } - /** The stage of the Datastore definition allowing to specify properties. */ + + /** + * The stage of the Datastore definition allowing to specify properties. + */ interface WithProperties { /** * Specifies the properties property: [Required] Additional attributes of the entity.. - * + * * @param properties [Required] Additional attributes of the entity. * @return the next definition stage. */ WithCreate withProperties(DatastoreProperties properties); } + /** * The stage of the Datastore definition which contains all the minimum required properties for the resource to * be created, but also allows for any other optional properties to be specified. @@ -100,87 +113,102 @@ interface WithProperties { interface WithCreate extends DefinitionStages.WithSkipValidation { /** * Executes the create request. - * + * * @return the created resource. */ Datastore create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ Datastore create(Context context); } - /** The stage of the Datastore definition allowing to specify skipValidation. */ + + /** + * The stage of the Datastore definition allowing to specify skipValidation. + */ interface WithSkipValidation { /** * Specifies the skipValidation property: Flag to skip validation.. - * + * * @param skipValidation Flag to skip validation. * @return the next definition stage. */ WithCreate withSkipValidation(Boolean skipValidation); } } + /** * Begins update for the Datastore resource. - * + * * @return the stage of resource update. */ Datastore.Update update(); - /** The template for Datastore update. */ + /** + * The template for Datastore update. + */ interface Update extends UpdateStages.WithProperties, UpdateStages.WithSkipValidation { /** * Executes the update request. - * + * * @return the updated resource. */ Datastore apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ Datastore apply(Context context); } - /** The Datastore update stages. */ + + /** + * The Datastore update stages. + */ interface UpdateStages { - /** The stage of the Datastore update allowing to specify properties. */ + /** + * The stage of the Datastore update allowing to specify properties. + */ interface WithProperties { /** * Specifies the properties property: [Required] Additional attributes of the entity.. - * + * * @param properties [Required] Additional attributes of the entity. * @return the next definition stage. */ Update withProperties(DatastoreProperties properties); } - /** The stage of the Datastore update allowing to specify skipValidation. */ + + /** + * The stage of the Datastore update allowing to specify skipValidation. + */ interface WithSkipValidation { /** * Specifies the skipValidation property: Flag to skip validation.. - * + * * @param skipValidation Flag to skip validation. * @return the next definition stage. */ Update withSkipValidation(Boolean skipValidation); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ Datastore refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ @@ -188,18 +216,19 @@ interface WithSkipValidation { /** * Get datastore secrets. - * + * + * @param body Secret expiry information. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return datastore secrets along with {@link Response}. */ - Response listSecretsWithResponse(Context context); + Response listSecretsWithResponse(SecretExpiry body, Context context); /** * Get datastore secrets. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return datastore secrets. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatastoreCredentials.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatastoreCredentials.java index abb8e62f1cc3d..8a2822c5920e7 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatastoreCredentials.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatastoreCredentials.java @@ -5,35 +5,112 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Base definition for datastore credentials. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "credentialsType", - defaultImpl = DatastoreCredentials.class) -@JsonTypeName("DatastoreCredentials") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "AccountKey", value = AccountKeyDatastoreCredentials.class), - @JsonSubTypes.Type(name = "Certificate", value = CertificateDatastoreCredentials.class), - @JsonSubTypes.Type(name = "None", value = NoneDatastoreCredentials.class), - @JsonSubTypes.Type(name = "Sas", value = SasDatastoreCredentials.class), - @JsonSubTypes.Type(name = "ServicePrincipal", value = ServicePrincipalDatastoreCredentials.class) -}) +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Base definition for datastore credentials. + */ @Immutable -public class DatastoreCredentials { - /** Creates an instance of DatastoreCredentials class. */ +public class DatastoreCredentials implements JsonSerializable { + /* + * [Required] Credential type used to authentication with storage. + */ + private CredentialsType credentialsType = CredentialsType.fromString("DatastoreCredentials"); + + /** + * Creates an instance of DatastoreCredentials class. + */ public DatastoreCredentials() { } + /** + * Get the credentialsType property: [Required] Credential type used to authentication with storage. + * + * @return the credentialsType value. + */ + public CredentialsType credentialsType() { + return this.credentialsType; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("credentialsType", + this.credentialsType == null ? null : this.credentialsType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DatastoreCredentials from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatastoreCredentials if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DatastoreCredentials. + */ + public static DatastoreCredentials fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("credentialsType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("AccountKey".equals(discriminatorValue)) { + return AccountKeyDatastoreCredentials.fromJson(readerToUse.reset()); + } else if ("Certificate".equals(discriminatorValue)) { + return CertificateDatastoreCredentials.fromJson(readerToUse.reset()); + } else if ("None".equals(discriminatorValue)) { + return NoneDatastoreCredentials.fromJson(readerToUse.reset()); + } else if ("Sas".equals(discriminatorValue)) { + return SasDatastoreCredentials.fromJson(readerToUse.reset()); + } else if ("ServicePrincipal".equals(discriminatorValue)) { + return ServicePrincipalDatastoreCredentials.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static DatastoreCredentials fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DatastoreCredentials deserializedDatastoreCredentials = new DatastoreCredentials(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("credentialsType".equals(fieldName)) { + deserializedDatastoreCredentials.credentialsType = CredentialsType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDatastoreCredentials; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatastoreProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatastoreProperties.java index 053662bb3d116..7c8f1c9629860 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatastoreProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatastoreProperties.java @@ -6,46 +6,50 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Base definition for datastore contents configuration. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "datastoreType", - defaultImpl = DatastoreProperties.class) -@JsonTypeName("DatastoreProperties") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "AzureBlob", value = AzureBlobDatastore.class), - @JsonSubTypes.Type(name = "AzureDataLakeGen1", value = AzureDataLakeGen1Datastore.class), - @JsonSubTypes.Type(name = "AzureDataLakeGen2", value = AzureDataLakeGen2Datastore.class), - @JsonSubTypes.Type(name = "AzureFile", value = AzureFileDatastore.class) -}) +/** + * Base definition for datastore contents configuration. + */ @Fluent public class DatastoreProperties extends ResourceBase { + /* + * [Required] Storage type backing the datastore. + */ + private DatastoreType datastoreType = DatastoreType.fromString("DatastoreProperties"); + /* * [Required] Account credentials. */ - @JsonProperty(value = "credentials", required = true) private DatastoreCredentials credentials; /* * Readonly property to indicate if datastore is the workspace default datastore */ - @JsonProperty(value = "isDefault", access = JsonProperty.Access.WRITE_ONLY) private Boolean isDefault; - /** Creates an instance of DatastoreProperties class. */ + /** + * Creates an instance of DatastoreProperties class. + */ public DatastoreProperties() { } + /** + * Get the datastoreType property: [Required] Storage type backing the datastore. + * + * @return the datastoreType value. + */ + public DatastoreType datastoreType() { + return this.datastoreType; + } + /** * Get the credentials property: [Required] Account credentials. - * + * * @return the credentials value. */ public DatastoreCredentials credentials() { @@ -54,7 +58,7 @@ public DatastoreCredentials credentials() { /** * Set the credentials property: [Required] Account credentials. - * + * * @param credentials the credentials value to set. * @return the DatastoreProperties object itself. */ @@ -65,28 +69,45 @@ public DatastoreProperties withCredentials(DatastoreCredentials credentials) { /** * Get the isDefault property: Readonly property to indicate if datastore is the workspace default datastore. - * + * * @return the isDefault value. */ public Boolean isDefault() { return this.isDefault; } - /** {@inheritDoc} */ + /** + * Set the isDefault property: Readonly property to indicate if datastore is the workspace default datastore. + * + * @param isDefault the isDefault value to set. + * @return the DatastoreProperties object itself. + */ + DatastoreProperties withIsDefault(Boolean isDefault) { + this.isDefault = isDefault; + return this; + } + + /** + * {@inheritDoc} + */ @Override public DatastoreProperties withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public DatastoreProperties withProperties(Map properties) { super.withProperties(properties); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public DatastoreProperties withTags(Map tags) { super.withTags(tags); @@ -95,15 +116,15 @@ public DatastoreProperties withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (credentials() == null) { - throw LOGGER - .logExceptionAsError( + throw LOGGER.atError() + .log( new IllegalArgumentException("Missing required property credentials in model DatastoreProperties")); } else { credentials().validate(); @@ -111,4 +132,90 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(DatastoreProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("credentials", this.credentials); + jsonWriter.writeStringField("datastoreType", this.datastoreType == null ? null : this.datastoreType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DatastoreProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatastoreProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DatastoreProperties. + */ + public static DatastoreProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("datastoreType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("AzureBlob".equals(discriminatorValue)) { + return AzureBlobDatastore.fromJson(readerToUse.reset()); + } else if ("AzureDataLakeGen1".equals(discriminatorValue)) { + return AzureDataLakeGen1Datastore.fromJson(readerToUse.reset()); + } else if ("AzureDataLakeGen2".equals(discriminatorValue)) { + return AzureDataLakeGen2Datastore.fromJson(readerToUse.reset()); + } else if ("AzureFile".equals(discriminatorValue)) { + return AzureFileDatastore.fromJson(readerToUse.reset()); + } else if ("OneLake".equals(discriminatorValue)) { + return OneLakeDatastore.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static DatastoreProperties fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DatastoreProperties deserializedDatastoreProperties = new DatastoreProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedDatastoreProperties.withDescription(reader.getString()); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedDatastoreProperties.withProperties(properties); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedDatastoreProperties.withTags(tags); + } else if ("credentials".equals(fieldName)) { + deserializedDatastoreProperties.credentials = DatastoreCredentials.fromJson(reader); + } else if ("datastoreType".equals(fieldName)) { + deserializedDatastoreProperties.datastoreType = DatastoreType.fromString(reader.getString()); + } else if ("isDefault".equals(fieldName)) { + deserializedDatastoreProperties.isDefault = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedDatastoreProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatastoreResourceArmPaginatedResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatastoreResourceArmPaginatedResult.java index 9acb559cf7ec1..e0af62a8e4f46 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatastoreResourceArmPaginatedResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatastoreResourceArmPaginatedResult.java @@ -5,33 +5,40 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.fluent.models.DatastoreInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** A paginated list of Datastore entities. */ +/** + * A paginated list of Datastore entities. + */ @Fluent -public final class DatastoreResourceArmPaginatedResult { +public final class DatastoreResourceArmPaginatedResult + implements JsonSerializable { /* * The link to the next page of Datastore objects. If null, there are no additional pages. */ - @JsonProperty(value = "nextLink") private String nextLink; /* * An array of objects of type Datastore. */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of DatastoreResourceArmPaginatedResult class. */ + /** + * Creates an instance of DatastoreResourceArmPaginatedResult class. + */ public DatastoreResourceArmPaginatedResult() { } /** * Get the nextLink property: The link to the next page of Datastore objects. If null, there are no additional * pages. - * + * * @return the nextLink value. */ public String nextLink() { @@ -41,7 +48,7 @@ public String nextLink() { /** * Set the nextLink property: The link to the next page of Datastore objects. If null, there are no additional * pages. - * + * * @param nextLink the nextLink value to set. * @return the DatastoreResourceArmPaginatedResult object itself. */ @@ -52,7 +59,7 @@ public DatastoreResourceArmPaginatedResult withNextLink(String nextLink) { /** * Get the value property: An array of objects of type Datastore. - * + * * @return the value value. */ public List value() { @@ -61,7 +68,7 @@ public List value() { /** * Set the value property: An array of objects of type Datastore. - * + * * @param value the value value to set. * @return the DatastoreResourceArmPaginatedResult object itself. */ @@ -72,7 +79,7 @@ public DatastoreResourceArmPaginatedResult withValue(List value) /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -80,4 +87,45 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DatastoreResourceArmPaginatedResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatastoreResourceArmPaginatedResult if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DatastoreResourceArmPaginatedResult. + */ + public static DatastoreResourceArmPaginatedResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DatastoreResourceArmPaginatedResult deserializedDatastoreResourceArmPaginatedResult + = new DatastoreResourceArmPaginatedResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedDatastoreResourceArmPaginatedResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> DatastoreInner.fromJson(reader1)); + deserializedDatastoreResourceArmPaginatedResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedDatastoreResourceArmPaginatedResult; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatastoreSecrets.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatastoreSecrets.java index 67b7f3d7b5483..9e4949c1c8f6b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatastoreSecrets.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatastoreSecrets.java @@ -6,11 +6,20 @@ import com.azure.resourcemanager.machinelearning.fluent.models.DatastoreSecretsInner; -/** An immutable client-side representation of DatastoreSecrets. */ +/** + * An immutable client-side representation of DatastoreSecrets. + */ public interface DatastoreSecrets { + /** + * Gets the secretsType property: [Required] Credential type used to authentication with storage. + * + * @return the secretsType value. + */ + SecretsType secretsType(); + /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.DatastoreSecretsInner object. - * + * * @return the inner object. */ DatastoreSecretsInner innerModel(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatastoreType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatastoreType.java index 0258a7e012f8c..1e3c89c1091d9 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatastoreType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DatastoreType.java @@ -5,26 +5,40 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Enum to determine the datastore contents type. */ +/** + * Enum to determine the datastore contents type. + */ public final class DatastoreType extends ExpandableStringEnum { - /** Static value AzureBlob for DatastoreType. */ + /** + * Static value AzureBlob for DatastoreType. + */ public static final DatastoreType AZURE_BLOB = fromString("AzureBlob"); - /** Static value AzureDataLakeGen1 for DatastoreType. */ + /** + * Static value AzureDataLakeGen1 for DatastoreType. + */ public static final DatastoreType AZURE_DATA_LAKE_GEN1 = fromString("AzureDataLakeGen1"); - /** Static value AzureDataLakeGen2 for DatastoreType. */ + /** + * Static value AzureDataLakeGen2 for DatastoreType. + */ public static final DatastoreType AZURE_DATA_LAKE_GEN2 = fromString("AzureDataLakeGen2"); - /** Static value AzureFile for DatastoreType. */ + /** + * Static value AzureFile for DatastoreType. + */ public static final DatastoreType AZURE_FILE = fromString("AzureFile"); + /** + * Static value OneLake for DatastoreType. + */ + public static final DatastoreType ONE_LAKE = fromString("OneLake"); + /** * Creates a new instance of DatastoreType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,18 +47,17 @@ public DatastoreType() { /** * Creates or finds a DatastoreType from its string representation. - * + * * @param name a name to look for. * @return the corresponding DatastoreType. */ - @JsonCreator public static DatastoreType fromString(String name) { return fromString(name, DatastoreType.class); } /** * Gets known DatastoreType values. - * + * * @return known DatastoreType values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Datastores.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Datastores.java index d3adbfe3d9cd6..7a320530e32ed 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Datastores.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Datastores.java @@ -9,11 +9,13 @@ import com.azure.core.util.Context; import java.util.List; -/** Resource collection API of Datastores. */ +/** + * Resource collection API of Datastores. + */ public interface Datastores { /** * List datastores. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -25,7 +27,7 @@ public interface Datastores { /** * List datastores. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -41,21 +43,12 @@ public interface Datastores { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of Datastore entities as paginated response with {@link PagedIterable}. */ - PagedIterable list( - String resourceGroupName, - String workspaceName, - String skip, - Integer count, - Boolean isDefault, - List names, - String searchText, - String orderBy, - Boolean orderByAsc, - Context context); + PagedIterable list(String resourceGroupName, String workspaceName, String skip, Integer count, + Boolean isDefault, List names, String searchText, String orderBy, Boolean orderByAsc, Context context); /** * Delete datastore. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Datastore name. @@ -69,7 +62,7 @@ PagedIterable list( /** * Delete datastore. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Datastore name. @@ -81,7 +74,7 @@ PagedIterable list( /** * Get datastore. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Datastore name. @@ -95,7 +88,7 @@ PagedIterable list( /** * Get datastore. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Datastore name. @@ -108,22 +101,23 @@ PagedIterable list( /** * Get datastore secrets. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Datastore name. + * @param body Secret expiry information. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return datastore secrets along with {@link Response}. */ - Response listSecretsWithResponse( - String resourceGroupName, String workspaceName, String name, Context context); + Response listSecretsWithResponse(String resourceGroupName, String workspaceName, String name, + SecretExpiry body, Context context); /** * Get datastore secrets. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Datastore name. @@ -136,7 +130,7 @@ Response listSecretsWithResponse( /** * Get datastore. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -147,7 +141,7 @@ Response listSecretsWithResponse( /** * Get datastore. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -159,7 +153,7 @@ Response listSecretsWithResponse( /** * Delete datastore. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -169,7 +163,7 @@ Response listSecretsWithResponse( /** * Delete datastore. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -181,7 +175,7 @@ Response listSecretsWithResponse( /** * Begins definition for a new Datastore resource. - * + * * @param name resource name. * @return the first stage of the new Datastore definition. */ diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DefaultScaleSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DefaultScaleSettings.java index 0dbc03ac65382..cb04bce37c106 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DefaultScaleSettings.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DefaultScaleSettings.java @@ -5,25 +5,80 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The DefaultScaleSettings model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "scaleType") -@JsonTypeName("Default") +/** + * The DefaultScaleSettings model. + */ @Immutable public final class DefaultScaleSettings extends OnlineScaleSettings { - /** Creates an instance of DefaultScaleSettings class. */ + /* + * [Required] Type of deployment scaling algorithm + */ + private ScaleType scaleType = ScaleType.DEFAULT; + + /** + * Creates an instance of DefaultScaleSettings class. + */ public DefaultScaleSettings() { } + /** + * Get the scaleType property: [Required] Type of deployment scaling algorithm. + * + * @return the scaleType value. + */ + @Override + public ScaleType scaleType() { + return this.scaleType; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("scaleType", this.scaleType == null ? null : this.scaleType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DefaultScaleSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DefaultScaleSettings if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DefaultScaleSettings. + */ + public static DefaultScaleSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DefaultScaleSettings deserializedDefaultScaleSettings = new DefaultScaleSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("scaleType".equals(fieldName)) { + deserializedDefaultScaleSettings.scaleType = ScaleType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDefaultScaleSettings; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DeploymentLogs.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DeploymentLogs.java index a16cf2ec0073d..b2144defa3e01 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DeploymentLogs.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DeploymentLogs.java @@ -6,18 +6,20 @@ import com.azure.resourcemanager.machinelearning.fluent.models.DeploymentLogsInner; -/** An immutable client-side representation of DeploymentLogs. */ +/** + * An immutable client-side representation of DeploymentLogs. + */ public interface DeploymentLogs { /** * Gets the content property: The retrieved online deployment logs. - * + * * @return the content value. */ String content(); /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.DeploymentLogsInner object. - * + * * @return the inner object. */ DeploymentLogsInner innerModel(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DeploymentLogsRequest.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DeploymentLogsRequest.java index 12a5f06c5c2e9..755e973638f32 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DeploymentLogsRequest.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DeploymentLogsRequest.java @@ -5,30 +5,36 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The DeploymentLogsRequest model. */ +/** + * The DeploymentLogsRequest model. + */ @Fluent -public final class DeploymentLogsRequest { +public final class DeploymentLogsRequest implements JsonSerializable { /* * The type of container to retrieve logs from. */ - @JsonProperty(value = "containerType") private ContainerType containerType; /* * The maximum number of lines to tail. */ - @JsonProperty(value = "tail") private Integer tail; - /** Creates an instance of DeploymentLogsRequest class. */ + /** + * Creates an instance of DeploymentLogsRequest class. + */ public DeploymentLogsRequest() { } /** * Get the containerType property: The type of container to retrieve logs from. - * + * * @return the containerType value. */ public ContainerType containerType() { @@ -37,7 +43,7 @@ public ContainerType containerType() { /** * Set the containerType property: The type of container to retrieve logs from. - * + * * @param containerType the containerType value to set. * @return the DeploymentLogsRequest object itself. */ @@ -48,7 +54,7 @@ public DeploymentLogsRequest withContainerType(ContainerType containerType) { /** * Get the tail property: The maximum number of lines to tail. - * + * * @return the tail value. */ public Integer tail() { @@ -57,7 +63,7 @@ public Integer tail() { /** * Set the tail property: The maximum number of lines to tail. - * + * * @param tail the tail value to set. * @return the DeploymentLogsRequest object itself. */ @@ -68,9 +74,48 @@ public DeploymentLogsRequest withTail(Integer tail) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("containerType", this.containerType == null ? null : this.containerType.toString()); + jsonWriter.writeNumberField("tail", this.tail); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeploymentLogsRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeploymentLogsRequest if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DeploymentLogsRequest. + */ + public static DeploymentLogsRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeploymentLogsRequest deserializedDeploymentLogsRequest = new DeploymentLogsRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("containerType".equals(fieldName)) { + deserializedDeploymentLogsRequest.containerType = ContainerType.fromString(reader.getString()); + } else if ("tail".equals(fieldName)) { + deserializedDeploymentLogsRequest.tail = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedDeploymentLogsRequest; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DeploymentProvisioningState.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DeploymentProvisioningState.java index 1f8856ab72e00..5f476db23fa0b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DeploymentProvisioningState.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DeploymentProvisioningState.java @@ -5,35 +5,50 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Possible values for DeploymentProvisioningState. */ +/** + * Possible values for DeploymentProvisioningState. + */ public final class DeploymentProvisioningState extends ExpandableStringEnum { - /** Static value Creating for DeploymentProvisioningState. */ + /** + * Static value Creating for DeploymentProvisioningState. + */ public static final DeploymentProvisioningState CREATING = fromString("Creating"); - /** Static value Deleting for DeploymentProvisioningState. */ + /** + * Static value Deleting for DeploymentProvisioningState. + */ public static final DeploymentProvisioningState DELETING = fromString("Deleting"); - /** Static value Scaling for DeploymentProvisioningState. */ + /** + * Static value Scaling for DeploymentProvisioningState. + */ public static final DeploymentProvisioningState SCALING = fromString("Scaling"); - /** Static value Updating for DeploymentProvisioningState. */ + /** + * Static value Updating for DeploymentProvisioningState. + */ public static final DeploymentProvisioningState UPDATING = fromString("Updating"); - /** Static value Succeeded for DeploymentProvisioningState. */ + /** + * Static value Succeeded for DeploymentProvisioningState. + */ public static final DeploymentProvisioningState SUCCEEDED = fromString("Succeeded"); - /** Static value Failed for DeploymentProvisioningState. */ + /** + * Static value Failed for DeploymentProvisioningState. + */ public static final DeploymentProvisioningState FAILED = fromString("Failed"); - /** Static value Canceled for DeploymentProvisioningState. */ + /** + * Static value Canceled for DeploymentProvisioningState. + */ public static final DeploymentProvisioningState CANCELED = fromString("Canceled"); /** * Creates a new instance of DeploymentProvisioningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -42,18 +57,17 @@ public DeploymentProvisioningState() { /** * Creates or finds a DeploymentProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding DeploymentProvisioningState. */ - @JsonCreator public static DeploymentProvisioningState fromString(String name) { return fromString(name, DeploymentProvisioningState.class); } /** * Gets known DeploymentProvisioningState values. - * + * * @return known DeploymentProvisioningState values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DeploymentResourceConfiguration.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DeploymentResourceConfiguration.java index 652e1c26d99eb..9478808332d58 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DeploymentResourceConfiguration.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DeploymentResourceConfiguration.java @@ -5,30 +5,44 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** The DeploymentResourceConfiguration model. */ +/** + * The DeploymentResourceConfiguration model. + */ @Fluent public final class DeploymentResourceConfiguration extends ResourceConfiguration { - /** Creates an instance of DeploymentResourceConfiguration class. */ + /** + * Creates an instance of DeploymentResourceConfiguration class. + */ public DeploymentResourceConfiguration() { } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public DeploymentResourceConfiguration withInstanceCount(Integer instanceCount) { super.withInstanceCount(instanceCount); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public DeploymentResourceConfiguration withInstanceType(String instanceType) { super.withInstanceType(instanceType); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public DeploymentResourceConfiguration withProperties(Map properties) { super.withProperties(properties); @@ -37,11 +51,56 @@ public DeploymentResourceConfiguration withProperties(Map proper /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("instanceCount", instanceCount()); + jsonWriter.writeStringField("instanceType", instanceType()); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeUntyped(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeploymentResourceConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeploymentResourceConfiguration if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DeploymentResourceConfiguration. + */ + public static DeploymentResourceConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeploymentResourceConfiguration deserializedDeploymentResourceConfiguration + = new DeploymentResourceConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("instanceCount".equals(fieldName)) { + deserializedDeploymentResourceConfiguration + .withInstanceCount(reader.getNullable(JsonReader::getInt)); + } else if ("instanceType".equals(fieldName)) { + deserializedDeploymentResourceConfiguration.withInstanceType(reader.getString()); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedDeploymentResourceConfiguration.withProperties(properties); + } else { + reader.skipChildren(); + } + } + + return deserializedDeploymentResourceConfiguration; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DestinationAsset.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DestinationAsset.java new file mode 100644 index 0000000000000..a57b03a489d42 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DestinationAsset.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Publishing destination registry asset information. + */ +@Fluent +public final class DestinationAsset implements JsonSerializable { + /* + * Destination asset name + */ + private String destinationName; + + /* + * Destination asset version + */ + private String destinationVersion; + + /* + * Destination registry name + */ + private String registryName; + + /** + * Creates an instance of DestinationAsset class. + */ + public DestinationAsset() { + } + + /** + * Get the destinationName property: Destination asset name. + * + * @return the destinationName value. + */ + public String destinationName() { + return this.destinationName; + } + + /** + * Set the destinationName property: Destination asset name. + * + * @param destinationName the destinationName value to set. + * @return the DestinationAsset object itself. + */ + public DestinationAsset withDestinationName(String destinationName) { + this.destinationName = destinationName; + return this; + } + + /** + * Get the destinationVersion property: Destination asset version. + * + * @return the destinationVersion value. + */ + public String destinationVersion() { + return this.destinationVersion; + } + + /** + * Set the destinationVersion property: Destination asset version. + * + * @param destinationVersion the destinationVersion value to set. + * @return the DestinationAsset object itself. + */ + public DestinationAsset withDestinationVersion(String destinationVersion) { + this.destinationVersion = destinationVersion; + return this; + } + + /** + * Get the registryName property: Destination registry name. + * + * @return the registryName value. + */ + public String registryName() { + return this.registryName; + } + + /** + * Set the registryName property: Destination registry name. + * + * @param registryName the registryName value to set. + * @return the DestinationAsset object itself. + */ + public DestinationAsset withRegistryName(String registryName) { + this.registryName = registryName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("destinationName", this.destinationName); + jsonWriter.writeStringField("destinationVersion", this.destinationVersion); + jsonWriter.writeStringField("registryName", this.registryName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DestinationAsset from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DestinationAsset if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DestinationAsset. + */ + public static DestinationAsset fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DestinationAsset deserializedDestinationAsset = new DestinationAsset(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("destinationName".equals(fieldName)) { + deserializedDestinationAsset.destinationName = reader.getString(); + } else if ("destinationVersion".equals(fieldName)) { + deserializedDestinationAsset.destinationVersion = reader.getString(); + } else if ("registryName".equals(fieldName)) { + deserializedDestinationAsset.registryName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDestinationAsset; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DiagnoseRequestProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DiagnoseRequestProperties.java index cb9851aa8b82c..d681a1cab2e32 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DiagnoseRequestProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DiagnoseRequestProperties.java @@ -5,83 +5,72 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** The DiagnoseRequestProperties model. */ +/** + * The DiagnoseRequestProperties model. + */ @Fluent -public final class DiagnoseRequestProperties { +public final class DiagnoseRequestProperties implements JsonSerializable { /* * Setting for diagnosing user defined routing */ - @JsonProperty(value = "udr") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map udr; /* * Setting for diagnosing network security group */ - @JsonProperty(value = "nsg") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map nsg; /* * Setting for diagnosing resource lock */ - @JsonProperty(value = "resourceLock") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map resourceLock; /* * Setting for diagnosing dns resolution */ - @JsonProperty(value = "dnsResolution") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map dnsResolution; /* * Setting for diagnosing dependent storage account */ - @JsonProperty(value = "storageAccount") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map storageAccount; /* * Setting for diagnosing dependent key vault */ - @JsonProperty(value = "keyVault") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map keyVault; /* * Setting for diagnosing dependent container registry */ - @JsonProperty(value = "containerRegistry") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map containerRegistry; /* * Setting for diagnosing dependent application insights */ - @JsonProperty(value = "applicationInsights") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map applicationInsights; /* * Setting for diagnosing unclassified category of problems */ - @JsonProperty(value = "others") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map others; - /** Creates an instance of DiagnoseRequestProperties class. */ + /** + * Creates an instance of DiagnoseRequestProperties class. + */ public DiagnoseRequestProperties() { } /** * Get the udr property: Setting for diagnosing user defined routing. - * + * * @return the udr value. */ public Map udr() { @@ -90,7 +79,7 @@ public Map udr() { /** * Set the udr property: Setting for diagnosing user defined routing. - * + * * @param udr the udr value to set. * @return the DiagnoseRequestProperties object itself. */ @@ -101,7 +90,7 @@ public DiagnoseRequestProperties withUdr(Map udr) { /** * Get the nsg property: Setting for diagnosing network security group. - * + * * @return the nsg value. */ public Map nsg() { @@ -110,7 +99,7 @@ public Map nsg() { /** * Set the nsg property: Setting for diagnosing network security group. - * + * * @param nsg the nsg value to set. * @return the DiagnoseRequestProperties object itself. */ @@ -121,7 +110,7 @@ public DiagnoseRequestProperties withNsg(Map nsg) { /** * Get the resourceLock property: Setting for diagnosing resource lock. - * + * * @return the resourceLock value. */ public Map resourceLock() { @@ -130,7 +119,7 @@ public Map resourceLock() { /** * Set the resourceLock property: Setting for diagnosing resource lock. - * + * * @param resourceLock the resourceLock value to set. * @return the DiagnoseRequestProperties object itself. */ @@ -141,7 +130,7 @@ public DiagnoseRequestProperties withResourceLock(Map resourceLo /** * Get the dnsResolution property: Setting for diagnosing dns resolution. - * + * * @return the dnsResolution value. */ public Map dnsResolution() { @@ -150,7 +139,7 @@ public Map dnsResolution() { /** * Set the dnsResolution property: Setting for diagnosing dns resolution. - * + * * @param dnsResolution the dnsResolution value to set. * @return the DiagnoseRequestProperties object itself. */ @@ -161,7 +150,7 @@ public DiagnoseRequestProperties withDnsResolution(Map dnsResolu /** * Get the storageAccount property: Setting for diagnosing dependent storage account. - * + * * @return the storageAccount value. */ public Map storageAccount() { @@ -170,7 +159,7 @@ public Map storageAccount() { /** * Set the storageAccount property: Setting for diagnosing dependent storage account. - * + * * @param storageAccount the storageAccount value to set. * @return the DiagnoseRequestProperties object itself. */ @@ -181,7 +170,7 @@ public DiagnoseRequestProperties withStorageAccount(Map storageA /** * Get the keyVault property: Setting for diagnosing dependent key vault. - * + * * @return the keyVault value. */ public Map keyVault() { @@ -190,7 +179,7 @@ public Map keyVault() { /** * Set the keyVault property: Setting for diagnosing dependent key vault. - * + * * @param keyVault the keyVault value to set. * @return the DiagnoseRequestProperties object itself. */ @@ -201,7 +190,7 @@ public DiagnoseRequestProperties withKeyVault(Map keyVault) { /** * Get the containerRegistry property: Setting for diagnosing dependent container registry. - * + * * @return the containerRegistry value. */ public Map containerRegistry() { @@ -210,7 +199,7 @@ public Map containerRegistry() { /** * Set the containerRegistry property: Setting for diagnosing dependent container registry. - * + * * @param containerRegistry the containerRegistry value to set. * @return the DiagnoseRequestProperties object itself. */ @@ -221,7 +210,7 @@ public DiagnoseRequestProperties withContainerRegistry(Map conta /** * Get the applicationInsights property: Setting for diagnosing dependent application insights. - * + * * @return the applicationInsights value. */ public Map applicationInsights() { @@ -230,7 +219,7 @@ public Map applicationInsights() { /** * Set the applicationInsights property: Setting for diagnosing dependent application insights. - * + * * @param applicationInsights the applicationInsights value to set. * @return the DiagnoseRequestProperties object itself. */ @@ -241,7 +230,7 @@ public DiagnoseRequestProperties withApplicationInsights(Map app /** * Get the others property: Setting for diagnosing unclassified category of problems. - * + * * @return the others value. */ public Map others() { @@ -250,7 +239,7 @@ public Map others() { /** * Set the others property: Setting for diagnosing unclassified category of problems. - * + * * @param others the others value to set. * @return the DiagnoseRequestProperties object itself. */ @@ -261,9 +250,82 @@ public DiagnoseRequestProperties withOthers(Map others) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("udr", this.udr, (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeMapField("nsg", this.nsg, (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeMapField("resourceLock", this.resourceLock, (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeMapField("dnsResolution", this.dnsResolution, + (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeMapField("storageAccount", this.storageAccount, + (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeMapField("keyVault", this.keyVault, (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeMapField("containerRegistry", this.containerRegistry, + (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeMapField("applicationInsights", this.applicationInsights, + (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeMapField("others", this.others, (writer, element) -> writer.writeUntyped(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiagnoseRequestProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiagnoseRequestProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DiagnoseRequestProperties. + */ + public static DiagnoseRequestProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiagnoseRequestProperties deserializedDiagnoseRequestProperties = new DiagnoseRequestProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("udr".equals(fieldName)) { + Map udr = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedDiagnoseRequestProperties.udr = udr; + } else if ("nsg".equals(fieldName)) { + Map nsg = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedDiagnoseRequestProperties.nsg = nsg; + } else if ("resourceLock".equals(fieldName)) { + Map resourceLock = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedDiagnoseRequestProperties.resourceLock = resourceLock; + } else if ("dnsResolution".equals(fieldName)) { + Map dnsResolution = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedDiagnoseRequestProperties.dnsResolution = dnsResolution; + } else if ("storageAccount".equals(fieldName)) { + Map storageAccount = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedDiagnoseRequestProperties.storageAccount = storageAccount; + } else if ("keyVault".equals(fieldName)) { + Map keyVault = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedDiagnoseRequestProperties.keyVault = keyVault; + } else if ("containerRegistry".equals(fieldName)) { + Map containerRegistry = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedDiagnoseRequestProperties.containerRegistry = containerRegistry; + } else if ("applicationInsights".equals(fieldName)) { + Map applicationInsights = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedDiagnoseRequestProperties.applicationInsights = applicationInsights; + } else if ("others".equals(fieldName)) { + Map others = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedDiagnoseRequestProperties.others = others; + } else { + reader.skipChildren(); + } + } + + return deserializedDiagnoseRequestProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DiagnoseResponseResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DiagnoseResponseResult.java index 403b22180639f..6dc007e7d30e0 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DiagnoseResponseResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DiagnoseResponseResult.java @@ -6,18 +6,20 @@ import com.azure.resourcemanager.machinelearning.fluent.models.DiagnoseResponseResultInner; -/** An immutable client-side representation of DiagnoseResponseResult. */ +/** + * An immutable client-side representation of DiagnoseResponseResult. + */ public interface DiagnoseResponseResult { /** * Gets the value property: The value property. - * + * * @return the value value. */ DiagnoseResponseResultValue value(); /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.DiagnoseResponseResultInner object. - * + * * @return the inner object. */ DiagnoseResponseResultInner innerModel(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DiagnoseResponseResultValue.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DiagnoseResponseResultValue.java index 81e242c0c4cae..2eb53c188f799 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DiagnoseResponseResultValue.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DiagnoseResponseResultValue.java @@ -5,73 +5,72 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** The DiagnoseResponseResultValue model. */ +/** + * The DiagnoseResponseResultValue model. + */ @Fluent -public final class DiagnoseResponseResultValue { +public final class DiagnoseResponseResultValue implements JsonSerializable { /* * The userDefinedRouteResults property. */ - @JsonProperty(value = "userDefinedRouteResults") private List userDefinedRouteResults; /* * The networkSecurityRuleResults property. */ - @JsonProperty(value = "networkSecurityRuleResults") private List networkSecurityRuleResults; /* * The resourceLockResults property. */ - @JsonProperty(value = "resourceLockResults") private List resourceLockResults; /* * The dnsResolutionResults property. */ - @JsonProperty(value = "dnsResolutionResults") private List dnsResolutionResults; /* * The storageAccountResults property. */ - @JsonProperty(value = "storageAccountResults") private List storageAccountResults; /* * The keyVaultResults property. */ - @JsonProperty(value = "keyVaultResults") private List keyVaultResults; /* * The containerRegistryResults property. */ - @JsonProperty(value = "containerRegistryResults") private List containerRegistryResults; /* * The applicationInsightsResults property. */ - @JsonProperty(value = "applicationInsightsResults") private List applicationInsightsResults; /* * The otherResults property. */ - @JsonProperty(value = "otherResults") private List otherResults; - /** Creates an instance of DiagnoseResponseResultValue class. */ + /** + * Creates an instance of DiagnoseResponseResultValue class. + */ public DiagnoseResponseResultValue() { } /** * Get the userDefinedRouteResults property: The userDefinedRouteResults property. - * + * * @return the userDefinedRouteResults value. */ public List userDefinedRouteResults() { @@ -80,7 +79,7 @@ public List userDefinedRouteResults() { /** * Set the userDefinedRouteResults property: The userDefinedRouteResults property. - * + * * @param userDefinedRouteResults the userDefinedRouteResults value to set. * @return the DiagnoseResponseResultValue object itself. */ @@ -91,7 +90,7 @@ public DiagnoseResponseResultValue withUserDefinedRouteResults(List networkSecurityRuleResults() { @@ -100,7 +99,7 @@ public List networkSecurityRuleResults() { /** * Set the networkSecurityRuleResults property: The networkSecurityRuleResults property. - * + * * @param networkSecurityRuleResults the networkSecurityRuleResults value to set. * @return the DiagnoseResponseResultValue object itself. */ @@ -111,7 +110,7 @@ public DiagnoseResponseResultValue withNetworkSecurityRuleResults(List resourceLockResults() { @@ -120,7 +119,7 @@ public List resourceLockResults() { /** * Set the resourceLockResults property: The resourceLockResults property. - * + * * @param resourceLockResults the resourceLockResults value to set. * @return the DiagnoseResponseResultValue object itself. */ @@ -131,7 +130,7 @@ public DiagnoseResponseResultValue withResourceLockResults(List /** * Get the dnsResolutionResults property: The dnsResolutionResults property. - * + * * @return the dnsResolutionResults value. */ public List dnsResolutionResults() { @@ -140,7 +139,7 @@ public List dnsResolutionResults() { /** * Set the dnsResolutionResults property: The dnsResolutionResults property. - * + * * @param dnsResolutionResults the dnsResolutionResults value to set. * @return the DiagnoseResponseResultValue object itself. */ @@ -151,7 +150,7 @@ public DiagnoseResponseResultValue withDnsResolutionResults(List /** * Get the storageAccountResults property: The storageAccountResults property. - * + * * @return the storageAccountResults value. */ public List storageAccountResults() { @@ -160,7 +159,7 @@ public List storageAccountResults() { /** * Set the storageAccountResults property: The storageAccountResults property. - * + * * @param storageAccountResults the storageAccountResults value to set. * @return the DiagnoseResponseResultValue object itself. */ @@ -171,7 +170,7 @@ public DiagnoseResponseResultValue withStorageAccountResults(List keyVaultResults() { @@ -180,7 +179,7 @@ public List keyVaultResults() { /** * Set the keyVaultResults property: The keyVaultResults property. - * + * * @param keyVaultResults the keyVaultResults value to set. * @return the DiagnoseResponseResultValue object itself. */ @@ -191,7 +190,7 @@ public DiagnoseResponseResultValue withKeyVaultResults(List keyV /** * Get the containerRegistryResults property: The containerRegistryResults property. - * + * * @return the containerRegistryResults value. */ public List containerRegistryResults() { @@ -200,7 +199,7 @@ public List containerRegistryResults() { /** * Set the containerRegistryResults property: The containerRegistryResults property. - * + * * @param containerRegistryResults the containerRegistryResults value to set. * @return the DiagnoseResponseResultValue object itself. */ @@ -211,7 +210,7 @@ public DiagnoseResponseResultValue withContainerRegistryResults(List applicationInsightsResults() { @@ -220,7 +219,7 @@ public List applicationInsightsResults() { /** * Set the applicationInsightsResults property: The applicationInsightsResults property. - * + * * @param applicationInsightsResults the applicationInsightsResults value to set. * @return the DiagnoseResponseResultValue object itself. */ @@ -231,7 +230,7 @@ public DiagnoseResponseResultValue withApplicationInsightsResults(List otherResults() { @@ -240,7 +239,7 @@ public List otherResults() { /** * Set the otherResults property: The otherResults property. - * + * * @param otherResults the otherResults value to set. * @return the DiagnoseResponseResultValue object itself. */ @@ -251,7 +250,7 @@ public DiagnoseResponseResultValue withOtherResults(List otherRe /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -283,4 +282,89 @@ public void validate() { otherResults().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("userDefinedRouteResults", this.userDefinedRouteResults, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("networkSecurityRuleResults", this.networkSecurityRuleResults, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("resourceLockResults", this.resourceLockResults, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("dnsResolutionResults", this.dnsResolutionResults, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("storageAccountResults", this.storageAccountResults, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("keyVaultResults", this.keyVaultResults, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("containerRegistryResults", this.containerRegistryResults, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("applicationInsightsResults", this.applicationInsightsResults, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("otherResults", this.otherResults, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiagnoseResponseResultValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiagnoseResponseResultValue if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DiagnoseResponseResultValue. + */ + public static DiagnoseResponseResultValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiagnoseResponseResultValue deserializedDiagnoseResponseResultValue = new DiagnoseResponseResultValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("userDefinedRouteResults".equals(fieldName)) { + List userDefinedRouteResults + = reader.readArray(reader1 -> DiagnoseResult.fromJson(reader1)); + deserializedDiagnoseResponseResultValue.userDefinedRouteResults = userDefinedRouteResults; + } else if ("networkSecurityRuleResults".equals(fieldName)) { + List networkSecurityRuleResults + = reader.readArray(reader1 -> DiagnoseResult.fromJson(reader1)); + deserializedDiagnoseResponseResultValue.networkSecurityRuleResults = networkSecurityRuleResults; + } else if ("resourceLockResults".equals(fieldName)) { + List resourceLockResults + = reader.readArray(reader1 -> DiagnoseResult.fromJson(reader1)); + deserializedDiagnoseResponseResultValue.resourceLockResults = resourceLockResults; + } else if ("dnsResolutionResults".equals(fieldName)) { + List dnsResolutionResults + = reader.readArray(reader1 -> DiagnoseResult.fromJson(reader1)); + deserializedDiagnoseResponseResultValue.dnsResolutionResults = dnsResolutionResults; + } else if ("storageAccountResults".equals(fieldName)) { + List storageAccountResults + = reader.readArray(reader1 -> DiagnoseResult.fromJson(reader1)); + deserializedDiagnoseResponseResultValue.storageAccountResults = storageAccountResults; + } else if ("keyVaultResults".equals(fieldName)) { + List keyVaultResults + = reader.readArray(reader1 -> DiagnoseResult.fromJson(reader1)); + deserializedDiagnoseResponseResultValue.keyVaultResults = keyVaultResults; + } else if ("containerRegistryResults".equals(fieldName)) { + List containerRegistryResults + = reader.readArray(reader1 -> DiagnoseResult.fromJson(reader1)); + deserializedDiagnoseResponseResultValue.containerRegistryResults = containerRegistryResults; + } else if ("applicationInsightsResults".equals(fieldName)) { + List applicationInsightsResults + = reader.readArray(reader1 -> DiagnoseResult.fromJson(reader1)); + deserializedDiagnoseResponseResultValue.applicationInsightsResults = applicationInsightsResults; + } else if ("otherResults".equals(fieldName)) { + List otherResults = reader.readArray(reader1 -> DiagnoseResult.fromJson(reader1)); + deserializedDiagnoseResponseResultValue.otherResults = otherResults; + } else { + reader.skipChildren(); + } + } + + return deserializedDiagnoseResponseResultValue; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DiagnoseResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DiagnoseResult.java index f7eb4471ab307..eb24aa66d6288 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DiagnoseResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DiagnoseResult.java @@ -5,36 +5,41 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Result of Diagnose. */ +/** + * Result of Diagnose. + */ @Immutable -public final class DiagnoseResult { +public final class DiagnoseResult implements JsonSerializable { /* * Code for workspace setup error */ - @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) private String code; /* * Level of workspace setup error */ - @JsonProperty(value = "level", access = JsonProperty.Access.WRITE_ONLY) private DiagnoseResultLevel level; /* * Message of workspace setup error */ - @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) private String message; - /** Creates an instance of DiagnoseResult class. */ + /** + * Creates an instance of DiagnoseResult class. + */ public DiagnoseResult() { } /** * Get the code property: Code for workspace setup error. - * + * * @return the code value. */ public String code() { @@ -43,7 +48,7 @@ public String code() { /** * Get the level property: Level of workspace setup error. - * + * * @return the level value. */ public DiagnoseResultLevel level() { @@ -52,7 +57,7 @@ public DiagnoseResultLevel level() { /** * Get the message property: Message of workspace setup error. - * + * * @return the message value. */ public String message() { @@ -61,9 +66,48 @@ public String message() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiagnoseResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiagnoseResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DiagnoseResult. + */ + public static DiagnoseResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiagnoseResult deserializedDiagnoseResult = new DiagnoseResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedDiagnoseResult.code = reader.getString(); + } else if ("level".equals(fieldName)) { + deserializedDiagnoseResult.level = DiagnoseResultLevel.fromString(reader.getString()); + } else if ("message".equals(fieldName)) { + deserializedDiagnoseResult.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDiagnoseResult; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DiagnoseResultLevel.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DiagnoseResultLevel.java index fe22e4e3f9f55..0e892dbb5e7e5 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DiagnoseResultLevel.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DiagnoseResultLevel.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Level of workspace setup error. */ +/** + * Level of workspace setup error. + */ public final class DiagnoseResultLevel extends ExpandableStringEnum { - /** Static value Warning for DiagnoseResultLevel. */ + /** + * Static value Warning for DiagnoseResultLevel. + */ public static final DiagnoseResultLevel WARNING = fromString("Warning"); - /** Static value Error for DiagnoseResultLevel. */ + /** + * Static value Error for DiagnoseResultLevel. + */ public static final DiagnoseResultLevel ERROR = fromString("Error"); - /** Static value Information for DiagnoseResultLevel. */ + /** + * Static value Information for DiagnoseResultLevel. + */ public static final DiagnoseResultLevel INFORMATION = fromString("Information"); /** * Creates a new instance of DiagnoseResultLevel value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public DiagnoseResultLevel() { /** * Creates or finds a DiagnoseResultLevel from its string representation. - * + * * @param name a name to look for. * @return the corresponding DiagnoseResultLevel. */ - @JsonCreator public static DiagnoseResultLevel fromString(String name) { return fromString(name, DiagnoseResultLevel.class); } /** * Gets known DiagnoseResultLevel values. - * + * * @return known DiagnoseResultLevel values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DiagnoseWorkspaceParameters.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DiagnoseWorkspaceParameters.java index f0a37ececc467..338b6300f93d8 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DiagnoseWorkspaceParameters.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DiagnoseWorkspaceParameters.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Parameters to diagnose a workspace. */ +/** + * Parameters to diagnose a workspace. + */ @Fluent -public final class DiagnoseWorkspaceParameters { +public final class DiagnoseWorkspaceParameters implements JsonSerializable { /* * Value of Parameters */ - @JsonProperty(value = "value") private DiagnoseRequestProperties value; - /** Creates an instance of DiagnoseWorkspaceParameters class. */ + /** + * Creates an instance of DiagnoseWorkspaceParameters class. + */ public DiagnoseWorkspaceParameters() { } /** * Get the value property: Value of Parameters. - * + * * @return the value value. */ public DiagnoseRequestProperties value() { @@ -31,7 +38,7 @@ public DiagnoseRequestProperties value() { /** * Set the value property: Value of Parameters. - * + * * @param value the value value to set. * @return the DiagnoseWorkspaceParameters object itself. */ @@ -42,7 +49,7 @@ public DiagnoseWorkspaceParameters withValue(DiagnoseRequestProperties value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -50,4 +57,40 @@ public void validate() { value().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiagnoseWorkspaceParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiagnoseWorkspaceParameters if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DiagnoseWorkspaceParameters. + */ + public static DiagnoseWorkspaceParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiagnoseWorkspaceParameters deserializedDiagnoseWorkspaceParameters = new DiagnoseWorkspaceParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedDiagnoseWorkspaceParameters.value = DiagnoseRequestProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDiagnoseWorkspaceParameters; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DistributionConfiguration.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DistributionConfiguration.java index 059ddfa4210a4..83d8d323b9a44 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DistributionConfiguration.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DistributionConfiguration.java @@ -5,33 +5,109 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Base definition for job distribution configuration. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "distributionType", - defaultImpl = DistributionConfiguration.class) -@JsonTypeName("DistributionConfiguration") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "Mpi", value = Mpi.class), - @JsonSubTypes.Type(name = "PyTorch", value = PyTorch.class), - @JsonSubTypes.Type(name = "TensorFlow", value = TensorFlow.class) -}) +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Base definition for job distribution configuration. + */ @Immutable -public class DistributionConfiguration { - /** Creates an instance of DistributionConfiguration class. */ +public class DistributionConfiguration implements JsonSerializable { + /* + * [Required] Specifies the type of distribution framework. + */ + private DistributionType distributionType = DistributionType.fromString("DistributionConfiguration"); + + /** + * Creates an instance of DistributionConfiguration class. + */ public DistributionConfiguration() { } + /** + * Get the distributionType property: [Required] Specifies the type of distribution framework. + * + * @return the distributionType value. + */ + public DistributionType distributionType() { + return this.distributionType; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("distributionType", + this.distributionType == null ? null : this.distributionType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DistributionConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DistributionConfiguration if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DistributionConfiguration. + */ + public static DistributionConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("distributionType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Mpi".equals(discriminatorValue)) { + return Mpi.fromJson(readerToUse.reset()); + } else if ("PyTorch".equals(discriminatorValue)) { + return PyTorch.fromJson(readerToUse.reset()); + } else if ("TensorFlow".equals(discriminatorValue)) { + return TensorFlow.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static DistributionConfiguration fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DistributionConfiguration deserializedDistributionConfiguration = new DistributionConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("distributionType".equals(fieldName)) { + deserializedDistributionConfiguration.distributionType + = DistributionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDistributionConfiguration; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DistributionType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DistributionType.java index 79c7b8c646ad9..804fcb1fec182 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DistributionType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DistributionType.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Enum to determine the job distribution type. */ +/** + * Enum to determine the job distribution type. + */ public final class DistributionType extends ExpandableStringEnum { - /** Static value PyTorch for DistributionType. */ + /** + * Static value PyTorch for DistributionType. + */ public static final DistributionType PY_TORCH = fromString("PyTorch"); - /** Static value TensorFlow for DistributionType. */ + /** + * Static value TensorFlow for DistributionType. + */ public static final DistributionType TENSOR_FLOW = fromString("TensorFlow"); - /** Static value Mpi for DistributionType. */ + /** + * Static value Mpi for DistributionType. + */ public static final DistributionType MPI = fromString("Mpi"); /** * Creates a new instance of DistributionType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public DistributionType() { /** * Creates or finds a DistributionType from its string representation. - * + * * @param name a name to look for. * @return the corresponding DistributionType. */ - @JsonCreator public static DistributionType fromString(String name) { return fromString(name, DistributionType.class); } /** * Gets known DistributionType values. - * + * * @return known DistributionType values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Docker.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Docker.java new file mode 100644 index 0000000000000..80e7c8df2bba9 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Docker.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * Docker container configuration. + */ +@Fluent +public final class Docker implements JsonSerializable { + /* + * Indicate whether container shall run in privileged or non-privileged mode. + */ + private Boolean privileged; + + /* + * Docker container configuration + */ + private Map additionalProperties; + + /** + * Creates an instance of Docker class. + */ + public Docker() { + } + + /** + * Get the privileged property: Indicate whether container shall run in privileged or non-privileged mode. + * + * @return the privileged value. + */ + public Boolean privileged() { + return this.privileged; + } + + /** + * Set the privileged property: Indicate whether container shall run in privileged or non-privileged mode. + * + * @param privileged the privileged value to set. + * @return the Docker object itself. + */ + public Docker withPrivileged(Boolean privileged) { + this.privileged = privileged; + return this; + } + + /** + * Get the additionalProperties property: Docker container configuration. + * + * @return the additionalProperties value. + */ + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: Docker container configuration. + * + * @param additionalProperties the additionalProperties value to set. + * @return the Docker object itself. + */ + public Docker withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("privileged", this.privileged); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Docker from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Docker if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Docker. + */ + public static Docker fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Docker deserializedDocker = new Docker(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("privileged".equals(fieldName)) { + deserializedDocker.privileged = reader.getNullable(JsonReader::getBoolean); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedDocker.additionalProperties = additionalProperties; + + return deserializedDocker; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DockerCredential.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DockerCredential.java new file mode 100644 index 0000000000000..da8d0be7b4b59 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/DockerCredential.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Credential for docker with username and password. + */ +@Fluent +public final class DockerCredential extends DataReferenceCredential { + /* + * [Required] Credential type used to authentication with storage. + */ + private DataReferenceCredentialType credentialType = DataReferenceCredentialType.DOCKER_CREDENTIALS; + + /* + * DockerCredential user password + */ + private String password; + + /* + * DockerCredential user name + */ + private String username; + + /** + * Creates an instance of DockerCredential class. + */ + public DockerCredential() { + } + + /** + * Get the credentialType property: [Required] Credential type used to authentication with storage. + * + * @return the credentialType value. + */ + @Override + public DataReferenceCredentialType credentialType() { + return this.credentialType; + } + + /** + * Get the password property: DockerCredential user password. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: DockerCredential user password. + * + * @param password the password value to set. + * @return the DockerCredential object itself. + */ + public DockerCredential withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the username property: DockerCredential user name. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: DockerCredential user name. + * + * @param username the username value to set. + * @return the DockerCredential object itself. + */ + public DockerCredential withUsername(String username) { + this.username = username; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("credentialType", + this.credentialType == null ? null : this.credentialType.toString()); + jsonWriter.writeStringField("password", this.password); + jsonWriter.writeStringField("userName", this.username); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DockerCredential from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DockerCredential if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DockerCredential. + */ + public static DockerCredential fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DockerCredential deserializedDockerCredential = new DockerCredential(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("credentialType".equals(fieldName)) { + deserializedDockerCredential.credentialType + = DataReferenceCredentialType.fromString(reader.getString()); + } else if ("password".equals(fieldName)) { + deserializedDockerCredential.password = reader.getString(); + } else if ("userName".equals(fieldName)) { + deserializedDockerCredential.username = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDockerCredential; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EarlyTerminationPolicy.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EarlyTerminationPolicy.java index 2137966297643..48590ea37e40e 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EarlyTerminationPolicy.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EarlyTerminationPolicy.java @@ -5,44 +5,50 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Early termination policies enable canceling poor-performing runs before they complete. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "policyType", - defaultImpl = EarlyTerminationPolicy.class) -@JsonTypeName("EarlyTerminationPolicy") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "Bandit", value = BanditPolicy.class), - @JsonSubTypes.Type(name = "MedianStopping", value = MedianStoppingPolicy.class), - @JsonSubTypes.Type(name = "TruncationSelection", value = TruncationSelectionPolicy.class) -}) +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Early termination policies enable canceling poor-performing runs before they complete. + */ @Fluent -public class EarlyTerminationPolicy { +public class EarlyTerminationPolicy implements JsonSerializable { + /* + * [Required] Name of policy configuration + */ + private EarlyTerminationPolicyType policyType = EarlyTerminationPolicyType.fromString("EarlyTerminationPolicy"); + /* * Number of intervals by which to delay the first evaluation. */ - @JsonProperty(value = "delayEvaluation") private Integer delayEvaluation; /* * Interval (number of runs) between policy evaluations. */ - @JsonProperty(value = "evaluationInterval") private Integer evaluationInterval; - /** Creates an instance of EarlyTerminationPolicy class. */ + /** + * Creates an instance of EarlyTerminationPolicy class. + */ public EarlyTerminationPolicy() { } + /** + * Get the policyType property: [Required] Name of policy configuration. + * + * @return the policyType value. + */ + public EarlyTerminationPolicyType policyType() { + return this.policyType; + } + /** * Get the delayEvaluation property: Number of intervals by which to delay the first evaluation. - * + * * @return the delayEvaluation value. */ public Integer delayEvaluation() { @@ -51,7 +57,7 @@ public Integer delayEvaluation() { /** * Set the delayEvaluation property: Number of intervals by which to delay the first evaluation. - * + * * @param delayEvaluation the delayEvaluation value to set. * @return the EarlyTerminationPolicy object itself. */ @@ -62,7 +68,7 @@ public EarlyTerminationPolicy withDelayEvaluation(Integer delayEvaluation) { /** * Get the evaluationInterval property: Interval (number of runs) between policy evaluations. - * + * * @return the evaluationInterval value. */ public Integer evaluationInterval() { @@ -71,7 +77,7 @@ public Integer evaluationInterval() { /** * Set the evaluationInterval property: Interval (number of runs) between policy evaluations. - * + * * @param evaluationInterval the evaluationInterval value to set. * @return the EarlyTerminationPolicy object itself. */ @@ -82,9 +88,81 @@ public EarlyTerminationPolicy withEvaluationInterval(Integer evaluationInterval) /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("policyType", this.policyType == null ? null : this.policyType.toString()); + jsonWriter.writeNumberField("delayEvaluation", this.delayEvaluation); + jsonWriter.writeNumberField("evaluationInterval", this.evaluationInterval); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EarlyTerminationPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EarlyTerminationPolicy if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the EarlyTerminationPolicy. + */ + public static EarlyTerminationPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("policyType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Bandit".equals(discriminatorValue)) { + return BanditPolicy.fromJson(readerToUse.reset()); + } else if ("MedianStopping".equals(discriminatorValue)) { + return MedianStoppingPolicy.fromJson(readerToUse.reset()); + } else if ("TruncationSelection".equals(discriminatorValue)) { + return TruncationSelectionPolicy.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static EarlyTerminationPolicy fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EarlyTerminationPolicy deserializedEarlyTerminationPolicy = new EarlyTerminationPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("policyType".equals(fieldName)) { + deserializedEarlyTerminationPolicy.policyType + = EarlyTerminationPolicyType.fromString(reader.getString()); + } else if ("delayEvaluation".equals(fieldName)) { + deserializedEarlyTerminationPolicy.delayEvaluation = reader.getNullable(JsonReader::getInt); + } else if ("evaluationInterval".equals(fieldName)) { + deserializedEarlyTerminationPolicy.evaluationInterval = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedEarlyTerminationPolicy; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EarlyTerminationPolicyType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EarlyTerminationPolicyType.java index 1ab6e1510118d..d9b5ea3a9e8cc 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EarlyTerminationPolicyType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EarlyTerminationPolicyType.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for EarlyTerminationPolicyType. */ +/** + * Defines values for EarlyTerminationPolicyType. + */ public final class EarlyTerminationPolicyType extends ExpandableStringEnum { - /** Static value Bandit for EarlyTerminationPolicyType. */ + /** + * Static value Bandit for EarlyTerminationPolicyType. + */ public static final EarlyTerminationPolicyType BANDIT = fromString("Bandit"); - /** Static value MedianStopping for EarlyTerminationPolicyType. */ + /** + * Static value MedianStopping for EarlyTerminationPolicyType. + */ public static final EarlyTerminationPolicyType MEDIAN_STOPPING = fromString("MedianStopping"); - /** Static value TruncationSelection for EarlyTerminationPolicyType. */ + /** + * Static value TruncationSelection for EarlyTerminationPolicyType. + */ public static final EarlyTerminationPolicyType TRUNCATION_SELECTION = fromString("TruncationSelection"); /** * Creates a new instance of EarlyTerminationPolicyType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public EarlyTerminationPolicyType() { /** * Creates or finds a EarlyTerminationPolicyType from its string representation. - * + * * @param name a name to look for. * @return the corresponding EarlyTerminationPolicyType. */ - @JsonCreator public static EarlyTerminationPolicyType fromString(String name) { return fromString(name, EarlyTerminationPolicyType.class); } /** * Gets known EarlyTerminationPolicyType values. - * + * * @return known EarlyTerminationPolicyType values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EgressPublicNetworkAccessType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EgressPublicNetworkAccessType.java index e19a06ff3f63d..3080369f65fce 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EgressPublicNetworkAccessType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EgressPublicNetworkAccessType.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Enum to determine whether PublicNetworkAccess is Enabled or Disabled for egress of a deployment. */ +/** + * Enum to determine whether PublicNetworkAccess is Enabled or Disabled for egress of a deployment. + */ public final class EgressPublicNetworkAccessType extends ExpandableStringEnum { - /** Static value Enabled for EgressPublicNetworkAccessType. */ + /** + * Static value Enabled for EgressPublicNetworkAccessType. + */ public static final EgressPublicNetworkAccessType ENABLED = fromString("Enabled"); - /** Static value Disabled for EgressPublicNetworkAccessType. */ + /** + * Static value Disabled for EgressPublicNetworkAccessType. + */ public static final EgressPublicNetworkAccessType DISABLED = fromString("Disabled"); /** * Creates a new instance of EgressPublicNetworkAccessType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public EgressPublicNetworkAccessType() { /** * Creates or finds a EgressPublicNetworkAccessType from its string representation. - * + * * @param name a name to look for. * @return the corresponding EgressPublicNetworkAccessType. */ - @JsonCreator public static EgressPublicNetworkAccessType fromString(String name) { return fromString(name, EgressPublicNetworkAccessType.class); } /** * Gets known EgressPublicNetworkAccessType values. - * + * * @return known EgressPublicNetworkAccessType values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EmailNotificationEnableType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EmailNotificationEnableType.java new file mode 100644 index 0000000000000..df16415a1807d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EmailNotificationEnableType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum to determine the email notification type. + */ +public final class EmailNotificationEnableType extends ExpandableStringEnum { + /** + * Static value JobCompleted for EmailNotificationEnableType. + */ + public static final EmailNotificationEnableType JOB_COMPLETED = fromString("JobCompleted"); + + /** + * Static value JobFailed for EmailNotificationEnableType. + */ + public static final EmailNotificationEnableType JOB_FAILED = fromString("JobFailed"); + + /** + * Static value JobCancelled for EmailNotificationEnableType. + */ + public static final EmailNotificationEnableType JOB_CANCELLED = fromString("JobCancelled"); + + /** + * Creates a new instance of EmailNotificationEnableType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EmailNotificationEnableType() { + } + + /** + * Creates or finds a EmailNotificationEnableType from its string representation. + * + * @param name a name to look for. + * @return the corresponding EmailNotificationEnableType. + */ + public static EmailNotificationEnableType fromString(String name) { + return fromString(name, EmailNotificationEnableType.class); + } + + /** + * Gets known EmailNotificationEnableType values. + * + * @return known EmailNotificationEnableType values. + */ + public static Collection values() { + return values(EmailNotificationEnableType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EncryptionKeyVaultProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EncryptionKeyVaultProperties.java index b5dece8ac6eee..f43541ede5671 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EncryptionKeyVaultProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EncryptionKeyVaultProperties.java @@ -6,36 +6,41 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The EncryptionKeyVaultProperties model. */ +/** + * The EncryptionKeyVaultProperties model. + */ @Fluent -public final class EncryptionKeyVaultProperties { +public final class EncryptionKeyVaultProperties implements JsonSerializable { /* * The ArmId of the keyVault where the customer owned encryption key is present. */ - @JsonProperty(value = "keyVaultArmId", required = true) private String keyVaultArmId; /* * Key vault uri to access the encryption key. */ - @JsonProperty(value = "keyIdentifier", required = true) private String keyIdentifier; /* * For future use - The client id of the identity which will be used to access key vault. */ - @JsonProperty(value = "identityClientId") private String identityClientId; - /** Creates an instance of EncryptionKeyVaultProperties class. */ + /** + * Creates an instance of EncryptionKeyVaultProperties class. + */ public EncryptionKeyVaultProperties() { } /** * Get the keyVaultArmId property: The ArmId of the keyVault where the customer owned encryption key is present. - * + * * @return the keyVaultArmId value. */ public String keyVaultArmId() { @@ -44,7 +49,7 @@ public String keyVaultArmId() { /** * Set the keyVaultArmId property: The ArmId of the keyVault where the customer owned encryption key is present. - * + * * @param keyVaultArmId the keyVaultArmId value to set. * @return the EncryptionKeyVaultProperties object itself. */ @@ -55,7 +60,7 @@ public EncryptionKeyVaultProperties withKeyVaultArmId(String keyVaultArmId) { /** * Get the keyIdentifier property: Key vault uri to access the encryption key. - * + * * @return the keyIdentifier value. */ public String keyIdentifier() { @@ -64,7 +69,7 @@ public String keyIdentifier() { /** * Set the keyIdentifier property: Key vault uri to access the encryption key. - * + * * @param keyIdentifier the keyIdentifier value to set. * @return the EncryptionKeyVaultProperties object itself. */ @@ -76,7 +81,7 @@ public EncryptionKeyVaultProperties withKeyIdentifier(String keyIdentifier) { /** * Get the identityClientId property: For future use - The client id of the identity which will be used to access * key vault. - * + * * @return the identityClientId value. */ public String identityClientId() { @@ -86,7 +91,7 @@ public String identityClientId() { /** * Set the identityClientId property: For future use - The client id of the identity which will be used to access * key vault. - * + * * @param identityClientId the identityClientId value to set. * @return the EncryptionKeyVaultProperties object itself. */ @@ -97,23 +102,64 @@ public EncryptionKeyVaultProperties withIdentityClientId(String identityClientId /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (keyVaultArmId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property keyVaultArmId in model EncryptionKeyVaultProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property keyVaultArmId in model EncryptionKeyVaultProperties")); } if (keyIdentifier() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property keyIdentifier in model EncryptionKeyVaultProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property keyIdentifier in model EncryptionKeyVaultProperties")); } } private static final ClientLogger LOGGER = new ClientLogger(EncryptionKeyVaultProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("keyVaultArmId", this.keyVaultArmId); + jsonWriter.writeStringField("keyIdentifier", this.keyIdentifier); + jsonWriter.writeStringField("identityClientId", this.identityClientId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EncryptionKeyVaultProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EncryptionKeyVaultProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EncryptionKeyVaultProperties. + */ + public static EncryptionKeyVaultProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EncryptionKeyVaultProperties deserializedEncryptionKeyVaultProperties = new EncryptionKeyVaultProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyVaultArmId".equals(fieldName)) { + deserializedEncryptionKeyVaultProperties.keyVaultArmId = reader.getString(); + } else if ("keyIdentifier".equals(fieldName)) { + deserializedEncryptionKeyVaultProperties.keyIdentifier = reader.getString(); + } else if ("identityClientId".equals(fieldName)) { + deserializedEncryptionKeyVaultProperties.identityClientId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEncryptionKeyVaultProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EncryptionKeyVaultUpdateProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EncryptionKeyVaultUpdateProperties.java new file mode 100644 index 0000000000000..72d9bdc0de9fe --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EncryptionKeyVaultUpdateProperties.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The EncryptionKeyVaultUpdateProperties model. + */ +@Fluent +public final class EncryptionKeyVaultUpdateProperties implements JsonSerializable { + /* + * The keyIdentifier property. + */ + private String keyIdentifier; + + /** + * Creates an instance of EncryptionKeyVaultUpdateProperties class. + */ + public EncryptionKeyVaultUpdateProperties() { + } + + /** + * Get the keyIdentifier property: The keyIdentifier property. + * + * @return the keyIdentifier value. + */ + public String keyIdentifier() { + return this.keyIdentifier; + } + + /** + * Set the keyIdentifier property: The keyIdentifier property. + * + * @param keyIdentifier the keyIdentifier value to set. + * @return the EncryptionKeyVaultUpdateProperties object itself. + */ + public EncryptionKeyVaultUpdateProperties withKeyIdentifier(String keyIdentifier) { + this.keyIdentifier = keyIdentifier; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyIdentifier() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property keyIdentifier in model EncryptionKeyVaultUpdateProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EncryptionKeyVaultUpdateProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("keyIdentifier", this.keyIdentifier); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EncryptionKeyVaultUpdateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EncryptionKeyVaultUpdateProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EncryptionKeyVaultUpdateProperties. + */ + public static EncryptionKeyVaultUpdateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EncryptionKeyVaultUpdateProperties deserializedEncryptionKeyVaultUpdateProperties + = new EncryptionKeyVaultUpdateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyIdentifier".equals(fieldName)) { + deserializedEncryptionKeyVaultUpdateProperties.keyIdentifier = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEncryptionKeyVaultUpdateProperties; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EncryptionProperty.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EncryptionProperty.java index a56f01ee36e6f..4ccbbab3eeb74 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EncryptionProperty.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EncryptionProperty.java @@ -6,36 +6,41 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The EncryptionProperty model. */ +/** + * The EncryptionProperty model. + */ @Fluent -public final class EncryptionProperty { +public final class EncryptionProperty implements JsonSerializable { /* * Indicates whether or not the encryption is enabled for the workspace. */ - @JsonProperty(value = "status", required = true) private EncryptionStatus status; /* * The identity that will be used to access the key vault for encryption at rest. */ - @JsonProperty(value = "identity") private IdentityForCmk identity; /* * Customer Key vault properties. */ - @JsonProperty(value = "keyVaultProperties", required = true) private EncryptionKeyVaultProperties keyVaultProperties; - /** Creates an instance of EncryptionProperty class. */ + /** + * Creates an instance of EncryptionProperty class. + */ public EncryptionProperty() { } /** * Get the status property: Indicates whether or not the encryption is enabled for the workspace. - * + * * @return the status value. */ public EncryptionStatus status() { @@ -44,7 +49,7 @@ public EncryptionStatus status() { /** * Set the status property: Indicates whether or not the encryption is enabled for the workspace. - * + * * @param status the status value to set. * @return the EncryptionProperty object itself. */ @@ -55,7 +60,7 @@ public EncryptionProperty withStatus(EncryptionStatus status) { /** * Get the identity property: The identity that will be used to access the key vault for encryption at rest. - * + * * @return the identity value. */ public IdentityForCmk identity() { @@ -64,7 +69,7 @@ public IdentityForCmk identity() { /** * Set the identity property: The identity that will be used to access the key vault for encryption at rest. - * + * * @param identity the identity value to set. * @return the EncryptionProperty object itself. */ @@ -75,7 +80,7 @@ public EncryptionProperty withIdentity(IdentityForCmk identity) { /** * Get the keyVaultProperties property: Customer Key vault properties. - * + * * @return the keyVaultProperties value. */ public EncryptionKeyVaultProperties keyVaultProperties() { @@ -84,7 +89,7 @@ public EncryptionKeyVaultProperties keyVaultProperties() { /** * Set the keyVaultProperties property: Customer Key vault properties. - * + * * @param keyVaultProperties the keyVaultProperties value to set. * @return the EncryptionProperty object itself. */ @@ -95,27 +100,68 @@ public EncryptionProperty withKeyVaultProperties(EncryptionKeyVaultProperties ke /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (status() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property status in model EncryptionProperty")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property status in model EncryptionProperty")); } if (identity() != null) { identity().validate(); } if (keyVaultProperties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property keyVaultProperties in model EncryptionProperty")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property keyVaultProperties in model EncryptionProperty")); } else { keyVaultProperties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(EncryptionProperty.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeJsonField("keyVaultProperties", this.keyVaultProperties); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EncryptionProperty from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EncryptionProperty if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EncryptionProperty. + */ + public static EncryptionProperty fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EncryptionProperty deserializedEncryptionProperty = new EncryptionProperty(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedEncryptionProperty.status = EncryptionStatus.fromString(reader.getString()); + } else if ("keyVaultProperties".equals(fieldName)) { + deserializedEncryptionProperty.keyVaultProperties = EncryptionKeyVaultProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedEncryptionProperty.identity = IdentityForCmk.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEncryptionProperty; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EncryptionStatus.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EncryptionStatus.java index abfb234a26af6..545f6cafe0e87 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EncryptionStatus.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EncryptionStatus.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Indicates whether or not the encryption is enabled for the workspace. */ +/** + * Indicates whether or not the encryption is enabled for the workspace. + */ public final class EncryptionStatus extends ExpandableStringEnum { - /** Static value Enabled for EncryptionStatus. */ + /** + * Static value Enabled for EncryptionStatus. + */ public static final EncryptionStatus ENABLED = fromString("Enabled"); - /** Static value Disabled for EncryptionStatus. */ + /** + * Static value Disabled for EncryptionStatus. + */ public static final EncryptionStatus DISABLED = fromString("Disabled"); /** * Creates a new instance of EncryptionStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public EncryptionStatus() { /** * Creates or finds a EncryptionStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding EncryptionStatus. */ - @JsonCreator public static EncryptionStatus fromString(String name) { return fromString(name, EncryptionStatus.class); } /** * Gets known EncryptionStatus values. - * + * * @return known EncryptionStatus values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EncryptionUpdateProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EncryptionUpdateProperties.java new file mode 100644 index 0000000000000..851cb862af2d6 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EncryptionUpdateProperties.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The EncryptionUpdateProperties model. + */ +@Fluent +public final class EncryptionUpdateProperties implements JsonSerializable { + /* + * The keyVaultProperties property. + */ + private EncryptionKeyVaultUpdateProperties keyVaultProperties; + + /** + * Creates an instance of EncryptionUpdateProperties class. + */ + public EncryptionUpdateProperties() { + } + + /** + * Get the keyVaultProperties property: The keyVaultProperties property. + * + * @return the keyVaultProperties value. + */ + public EncryptionKeyVaultUpdateProperties keyVaultProperties() { + return this.keyVaultProperties; + } + + /** + * Set the keyVaultProperties property: The keyVaultProperties property. + * + * @param keyVaultProperties the keyVaultProperties value to set. + * @return the EncryptionUpdateProperties object itself. + */ + public EncryptionUpdateProperties withKeyVaultProperties(EncryptionKeyVaultUpdateProperties keyVaultProperties) { + this.keyVaultProperties = keyVaultProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyVaultProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property keyVaultProperties in model EncryptionUpdateProperties")); + } else { + keyVaultProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EncryptionUpdateProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("keyVaultProperties", this.keyVaultProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EncryptionUpdateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EncryptionUpdateProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EncryptionUpdateProperties. + */ + public static EncryptionUpdateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EncryptionUpdateProperties deserializedEncryptionUpdateProperties = new EncryptionUpdateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyVaultProperties".equals(fieldName)) { + deserializedEncryptionUpdateProperties.keyVaultProperties + = EncryptionKeyVaultUpdateProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEncryptionUpdateProperties; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Endpoint.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Endpoint.java new file mode 100644 index 0000000000000..03377af95217a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Endpoint.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes the endpoint configuration for the container. + */ +@Fluent +public final class Endpoint implements JsonSerializable { + /* + * Protocol over which communication will happen over this endpoint + */ + private Protocol protocol; + + /* + * Name of the Endpoint + */ + private String name; + + /* + * Application port inside the container. + */ + private Integer target; + + /* + * Port over which the application is exposed from container. + */ + private Integer published; + + /* + * Host IP over which the application is exposed from the container + */ + private String hostIp; + + /** + * Creates an instance of Endpoint class. + */ + public Endpoint() { + } + + /** + * Get the protocol property: Protocol over which communication will happen over this endpoint. + * + * @return the protocol value. + */ + public Protocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Protocol over which communication will happen over this endpoint. + * + * @param protocol the protocol value to set. + * @return the Endpoint object itself. + */ + public Endpoint withProtocol(Protocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the name property: Name of the Endpoint. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the Endpoint. + * + * @param name the name value to set. + * @return the Endpoint object itself. + */ + public Endpoint withName(String name) { + this.name = name; + return this; + } + + /** + * Get the target property: Application port inside the container. + * + * @return the target value. + */ + public Integer target() { + return this.target; + } + + /** + * Set the target property: Application port inside the container. + * + * @param target the target value to set. + * @return the Endpoint object itself. + */ + public Endpoint withTarget(Integer target) { + this.target = target; + return this; + } + + /** + * Get the published property: Port over which the application is exposed from container. + * + * @return the published value. + */ + public Integer published() { + return this.published; + } + + /** + * Set the published property: Port over which the application is exposed from container. + * + * @param published the published value to set. + * @return the Endpoint object itself. + */ + public Endpoint withPublished(Integer published) { + this.published = published; + return this; + } + + /** + * Get the hostIp property: Host IP over which the application is exposed from the container. + * + * @return the hostIp value. + */ + public String hostIp() { + return this.hostIp; + } + + /** + * Set the hostIp property: Host IP over which the application is exposed from the container. + * + * @param hostIp the hostIp value to set. + * @return the Endpoint object itself. + */ + public Endpoint withHostIp(String hostIp) { + this.hostIp = hostIp; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeNumberField("target", this.target); + jsonWriter.writeNumberField("published", this.published); + jsonWriter.writeStringField("hostIp", this.hostIp); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Endpoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Endpoint if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Endpoint. + */ + public static Endpoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Endpoint deserializedEndpoint = new Endpoint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("protocol".equals(fieldName)) { + deserializedEndpoint.protocol = Protocol.fromString(reader.getString()); + } else if ("name".equals(fieldName)) { + deserializedEndpoint.name = reader.getString(); + } else if ("target".equals(fieldName)) { + deserializedEndpoint.target = reader.getNullable(JsonReader::getInt); + } else if ("published".equals(fieldName)) { + deserializedEndpoint.published = reader.getNullable(JsonReader::getInt); + } else if ("hostIp".equals(fieldName)) { + deserializedEndpoint.hostIp = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEndpoint; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointAuthKeys.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointAuthKeys.java index 0d6b4eba1bf55..91480236604d9 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointAuthKeys.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointAuthKeys.java @@ -6,25 +6,27 @@ import com.azure.resourcemanager.machinelearning.fluent.models.EndpointAuthKeysInner; -/** An immutable client-side representation of EndpointAuthKeys. */ +/** + * An immutable client-side representation of EndpointAuthKeys. + */ public interface EndpointAuthKeys { /** * Gets the primaryKey property: The primary key. - * + * * @return the primaryKey value. */ String primaryKey(); /** * Gets the secondaryKey property: The secondary key. - * + * * @return the secondaryKey value. */ String secondaryKey(); /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.EndpointAuthKeysInner object. - * + * * @return the inner object. */ EndpointAuthKeysInner innerModel(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointAuthMode.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointAuthMode.java index c52e770ee18d8..342a2f2fd94e4 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointAuthMode.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointAuthMode.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Enum to determine endpoint authentication mode. */ +/** + * Enum to determine endpoint authentication mode. + */ public final class EndpointAuthMode extends ExpandableStringEnum { - /** Static value AMLToken for EndpointAuthMode. */ + /** + * Static value AMLToken for EndpointAuthMode. + */ public static final EndpointAuthMode AMLTOKEN = fromString("AMLToken"); - /** Static value Key for EndpointAuthMode. */ + /** + * Static value Key for EndpointAuthMode. + */ public static final EndpointAuthMode KEY = fromString("Key"); - /** Static value AADToken for EndpointAuthMode. */ + /** + * Static value AADToken for EndpointAuthMode. + */ public static final EndpointAuthMode AADTOKEN = fromString("AADToken"); /** * Creates a new instance of EndpointAuthMode value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public EndpointAuthMode() { /** * Creates or finds a EndpointAuthMode from its string representation. - * + * * @param name a name to look for. * @return the corresponding EndpointAuthMode. */ - @JsonCreator public static EndpointAuthMode fromString(String name) { return fromString(name, EndpointAuthMode.class); } /** * Gets known EndpointAuthMode values. - * + * * @return known EndpointAuthMode values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointAuthToken.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointAuthToken.java index 327ea7b62a73a..d5ad66f4e7deb 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointAuthToken.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointAuthToken.java @@ -6,39 +6,41 @@ import com.azure.resourcemanager.machinelearning.fluent.models.EndpointAuthTokenInner; -/** An immutable client-side representation of EndpointAuthToken. */ +/** + * An immutable client-side representation of EndpointAuthToken. + */ public interface EndpointAuthToken { /** * Gets the accessToken property: Access token for endpoint authentication. - * + * * @return the accessToken value. */ String accessToken(); /** * Gets the expiryTimeUtc property: Access token expiry time (UTC). - * + * * @return the expiryTimeUtc value. */ Long expiryTimeUtc(); /** * Gets the refreshAfterTimeUtc property: Refresh access token after time (UTC). - * + * * @return the refreshAfterTimeUtc value. */ Long refreshAfterTimeUtc(); /** * Gets the tokenType property: Access token type. - * + * * @return the tokenType value. */ String tokenType(); /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.EndpointAuthTokenInner object. - * + * * @return the inner object. */ EndpointAuthTokenInner innerModel(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointComputeType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointComputeType.java index e80c9ec955ccd..f92159af135ee 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointComputeType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointComputeType.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Enum to determine endpoint compute type. */ +/** + * Enum to determine endpoint compute type. + */ public final class EndpointComputeType extends ExpandableStringEnum { - /** Static value Managed for EndpointComputeType. */ + /** + * Static value Managed for EndpointComputeType. + */ public static final EndpointComputeType MANAGED = fromString("Managed"); - /** Static value Kubernetes for EndpointComputeType. */ + /** + * Static value Kubernetes for EndpointComputeType. + */ public static final EndpointComputeType KUBERNETES = fromString("Kubernetes"); - /** Static value AzureMLCompute for EndpointComputeType. */ + /** + * Static value AzureMLCompute for EndpointComputeType. + */ public static final EndpointComputeType AZURE_MLCOMPUTE = fromString("AzureMLCompute"); /** * Creates a new instance of EndpointComputeType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public EndpointComputeType() { /** * Creates or finds a EndpointComputeType from its string representation. - * + * * @param name a name to look for. * @return the corresponding EndpointComputeType. */ - @JsonCreator public static EndpointComputeType fromString(String name) { return fromString(name, EndpointComputeType.class); } /** * Gets known EndpointComputeType values. - * + * * @return known EndpointComputeType values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointDeploymentPropertiesBase.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointDeploymentPropertiesBase.java index 9f210ec5de03b..0e2a6ebc70182 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointDeploymentPropertiesBase.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointDeploymentPropertiesBase.java @@ -5,52 +5,52 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Base definition for endpoint deployment. */ +/** + * Base definition for endpoint deployment. + */ @Fluent -public class EndpointDeploymentPropertiesBase { +public class EndpointDeploymentPropertiesBase implements JsonSerializable { /* * Code configuration for the endpoint deployment. */ - @JsonProperty(value = "codeConfiguration") private CodeConfiguration codeConfiguration; /* * Description of the endpoint deployment. */ - @JsonProperty(value = "description") private String description; /* * ARM resource ID or AssetId of the environment specification for the endpoint deployment. */ - @JsonProperty(value = "environmentId") private String environmentId; /* * Environment variables configuration for the deployment. */ - @JsonProperty(value = "environmentVariables") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map environmentVariables; /* * Property dictionary. Properties can be added, but not removed or altered. */ - @JsonProperty(value = "properties") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map properties; - /** Creates an instance of EndpointDeploymentPropertiesBase class. */ + /** + * Creates an instance of EndpointDeploymentPropertiesBase class. + */ public EndpointDeploymentPropertiesBase() { } /** * Get the codeConfiguration property: Code configuration for the endpoint deployment. - * + * * @return the codeConfiguration value. */ public CodeConfiguration codeConfiguration() { @@ -59,7 +59,7 @@ public CodeConfiguration codeConfiguration() { /** * Set the codeConfiguration property: Code configuration for the endpoint deployment. - * + * * @param codeConfiguration the codeConfiguration value to set. * @return the EndpointDeploymentPropertiesBase object itself. */ @@ -70,7 +70,7 @@ public EndpointDeploymentPropertiesBase withCodeConfiguration(CodeConfiguration /** * Get the description property: Description of the endpoint deployment. - * + * * @return the description value. */ public String description() { @@ -79,7 +79,7 @@ public String description() { /** * Set the description property: Description of the endpoint deployment. - * + * * @param description the description value to set. * @return the EndpointDeploymentPropertiesBase object itself. */ @@ -91,7 +91,7 @@ public EndpointDeploymentPropertiesBase withDescription(String description) { /** * Get the environmentId property: ARM resource ID or AssetId of the environment specification for the endpoint * deployment. - * + * * @return the environmentId value. */ public String environmentId() { @@ -101,7 +101,7 @@ public String environmentId() { /** * Set the environmentId property: ARM resource ID or AssetId of the environment specification for the endpoint * deployment. - * + * * @param environmentId the environmentId value to set. * @return the EndpointDeploymentPropertiesBase object itself. */ @@ -112,7 +112,7 @@ public EndpointDeploymentPropertiesBase withEnvironmentId(String environmentId) /** * Get the environmentVariables property: Environment variables configuration for the deployment. - * + * * @return the environmentVariables value. */ public Map environmentVariables() { @@ -121,7 +121,7 @@ public Map environmentVariables() { /** * Set the environmentVariables property: Environment variables configuration for the deployment. - * + * * @param environmentVariables the environmentVariables value to set. * @return the EndpointDeploymentPropertiesBase object itself. */ @@ -132,7 +132,7 @@ public EndpointDeploymentPropertiesBase withEnvironmentVariables(Map properties() { @@ -141,7 +141,7 @@ public Map properties() { /** * Set the properties property: Property dictionary. Properties can be added, but not removed or altered. - * + * * @param properties the properties value to set. * @return the EndpointDeploymentPropertiesBase object itself. */ @@ -152,7 +152,7 @@ public EndpointDeploymentPropertiesBase withProperties(Map prope /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -160,4 +160,56 @@ public void validate() { codeConfiguration().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("codeConfiguration", this.codeConfiguration); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("environmentId", this.environmentId); + jsonWriter.writeMapField("environmentVariables", this.environmentVariables, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("properties", this.properties, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EndpointDeploymentPropertiesBase from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EndpointDeploymentPropertiesBase if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EndpointDeploymentPropertiesBase. + */ + public static EndpointDeploymentPropertiesBase fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EndpointDeploymentPropertiesBase deserializedEndpointDeploymentPropertiesBase + = new EndpointDeploymentPropertiesBase(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("codeConfiguration".equals(fieldName)) { + deserializedEndpointDeploymentPropertiesBase.codeConfiguration = CodeConfiguration.fromJson(reader); + } else if ("description".equals(fieldName)) { + deserializedEndpointDeploymentPropertiesBase.description = reader.getString(); + } else if ("environmentId".equals(fieldName)) { + deserializedEndpointDeploymentPropertiesBase.environmentId = reader.getString(); + } else if ("environmentVariables".equals(fieldName)) { + Map environmentVariables = reader.readMap(reader1 -> reader1.getString()); + deserializedEndpointDeploymentPropertiesBase.environmentVariables = environmentVariables; + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedEndpointDeploymentPropertiesBase.properties = properties; + } else { + reader.skipChildren(); + } + } + + return deserializedEndpointDeploymentPropertiesBase; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointPropertiesBase.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointPropertiesBase.java index 0251403b9fe8e..d3c899248d138 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointPropertiesBase.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointPropertiesBase.java @@ -7,55 +7,57 @@ import com.azure.resourcemanager.machinelearning.fluent.models.EndpointPropertiesBaseInner; import java.util.Map; -/** An immutable client-side representation of EndpointPropertiesBase. */ +/** + * An immutable client-side representation of EndpointPropertiesBase. + */ public interface EndpointPropertiesBase { /** * Gets the authMode property: [Required] Use 'Key' for key based authentication and 'AMLToken' for Azure Machine * Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. - * + * * @return the authMode value. */ EndpointAuthMode authMode(); /** * Gets the description property: Description of the inference endpoint. - * + * * @return the description value. */ String description(); /** - * Gets the keys property: EndpointAuthKeys to set initially on an Endpoint. This property will always be returned - * as null. AuthKey values must be retrieved using the ListKeys API. - * + * Gets the keys property: EndpointAuthKeys to set initially on an Endpoint. + * This property will always be returned as null. AuthKey values must be retrieved using the ListKeys API. + * * @return the keys value. */ EndpointAuthKeys keys(); /** * Gets the properties property: Property dictionary. Properties can be added, but not removed or altered. - * + * * @return the properties value. */ Map properties(); /** * Gets the scoringUri property: Endpoint URI. - * + * * @return the scoringUri value. */ String scoringUri(); /** * Gets the swaggerUri property: Endpoint Swagger URI. - * + * * @return the swaggerUri value. */ String swaggerUri(); /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.EndpointPropertiesBaseInner object. - * + * * @return the inner object. */ EndpointPropertiesBaseInner innerModel(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointProvisioningState.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointProvisioningState.java index 01be8b4cabf38..e3b206d2cca1d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointProvisioningState.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointProvisioningState.java @@ -5,32 +5,45 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** State of endpoint provisioning. */ +/** + * State of endpoint provisioning. + */ public final class EndpointProvisioningState extends ExpandableStringEnum { - /** Static value Creating for EndpointProvisioningState. */ + /** + * Static value Creating for EndpointProvisioningState. + */ public static final EndpointProvisioningState CREATING = fromString("Creating"); - /** Static value Deleting for EndpointProvisioningState. */ + /** + * Static value Deleting for EndpointProvisioningState. + */ public static final EndpointProvisioningState DELETING = fromString("Deleting"); - /** Static value Succeeded for EndpointProvisioningState. */ + /** + * Static value Succeeded for EndpointProvisioningState. + */ public static final EndpointProvisioningState SUCCEEDED = fromString("Succeeded"); - /** Static value Failed for EndpointProvisioningState. */ + /** + * Static value Failed for EndpointProvisioningState. + */ public static final EndpointProvisioningState FAILED = fromString("Failed"); - /** Static value Updating for EndpointProvisioningState. */ + /** + * Static value Updating for EndpointProvisioningState. + */ public static final EndpointProvisioningState UPDATING = fromString("Updating"); - /** Static value Canceled for EndpointProvisioningState. */ + /** + * Static value Canceled for EndpointProvisioningState. + */ public static final EndpointProvisioningState CANCELED = fromString("Canceled"); /** * Creates a new instance of EndpointProvisioningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -39,18 +52,17 @@ public EndpointProvisioningState() { /** * Creates or finds a EndpointProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding EndpointProvisioningState. */ - @JsonCreator public static EndpointProvisioningState fromString(String name) { return fromString(name, EndpointProvisioningState.class); } /** * Gets known EndpointProvisioningState values. - * + * * @return known EndpointProvisioningState values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointScheduleAction.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointScheduleAction.java index 1fc068802e760..719f8fc0f2e94 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointScheduleAction.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointScheduleAction.java @@ -6,30 +6,47 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The EndpointScheduleAction model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "actionType") -@JsonTypeName("InvokeBatchEndpoint") +/** + * The EndpointScheduleAction model. + */ @Fluent public final class EndpointScheduleAction extends ScheduleActionBase { + /* + * [Required] Specifies the action type of the schedule + */ + private ScheduleActionType actionType = ScheduleActionType.INVOKE_BATCH_ENDPOINT; + /* * [Required] Defines Schedule action definition details. * */ - @JsonProperty(value = "endpointInvocationDefinition", required = true) private Object endpointInvocationDefinition; - /** Creates an instance of EndpointScheduleAction class. */ + /** + * Creates an instance of EndpointScheduleAction class. + */ public EndpointScheduleAction() { } /** - * Get the endpointInvocationDefinition property: [Required] Defines Schedule action definition details. <see - * href="TBD" />. - * + * Get the actionType property: [Required] Specifies the action type of the schedule. + * + * @return the actionType value. + */ + @Override + public ScheduleActionType actionType() { + return this.actionType; + } + + /** + * Get the endpointInvocationDefinition property: [Required] Defines Schedule action definition details. + * <see href="TBD" />. + * * @return the endpointInvocationDefinition value. */ public Object endpointInvocationDefinition() { @@ -37,9 +54,9 @@ public Object endpointInvocationDefinition() { } /** - * Set the endpointInvocationDefinition property: [Required] Defines Schedule action definition details. <see - * href="TBD" />. - * + * Set the endpointInvocationDefinition property: [Required] Defines Schedule action definition details. + * <see href="TBD" />. + * * @param endpointInvocationDefinition the endpointInvocationDefinition value to set. * @return the EndpointScheduleAction object itself. */ @@ -50,19 +67,58 @@ public EndpointScheduleAction withEndpointInvocationDefinition(Object endpointIn /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (endpointInvocationDefinition() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property endpointInvocationDefinition in model EndpointScheduleAction")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property endpointInvocationDefinition in model EndpointScheduleAction")); } } private static final ClientLogger LOGGER = new ClientLogger(EndpointScheduleAction.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeUntypedField("endpointInvocationDefinition", this.endpointInvocationDefinition); + jsonWriter.writeStringField("actionType", this.actionType == null ? null : this.actionType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EndpointScheduleAction from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EndpointScheduleAction if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EndpointScheduleAction. + */ + public static EndpointScheduleAction fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EndpointScheduleAction deserializedEndpointScheduleAction = new EndpointScheduleAction(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("endpointInvocationDefinition".equals(fieldName)) { + deserializedEndpointScheduleAction.endpointInvocationDefinition = reader.readUntyped(); + } else if ("actionType".equals(fieldName)) { + deserializedEndpointScheduleAction.actionType = ScheduleActionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEndpointScheduleAction; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointServiceConnectionStatus.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointServiceConnectionStatus.java new file mode 100644 index 0000000000000..fd1926ec9f011 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EndpointServiceConnectionStatus.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Connection status of the service consumer with the service provider. + */ +public final class EndpointServiceConnectionStatus extends ExpandableStringEnum { + /** + * Static value Approved for EndpointServiceConnectionStatus. + */ + public static final EndpointServiceConnectionStatus APPROVED = fromString("Approved"); + + /** + * Static value Pending for EndpointServiceConnectionStatus. + */ + public static final EndpointServiceConnectionStatus PENDING = fromString("Pending"); + + /** + * Static value Rejected for EndpointServiceConnectionStatus. + */ + public static final EndpointServiceConnectionStatus REJECTED = fromString("Rejected"); + + /** + * Static value Disconnected for EndpointServiceConnectionStatus. + */ + public static final EndpointServiceConnectionStatus DISCONNECTED = fromString("Disconnected"); + + /** + * Creates a new instance of EndpointServiceConnectionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EndpointServiceConnectionStatus() { + } + + /** + * Creates or finds a EndpointServiceConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding EndpointServiceConnectionStatus. + */ + public static EndpointServiceConnectionStatus fromString(String name) { + return fromString(name, EndpointServiceConnectionStatus.class); + } + + /** + * Gets known EndpointServiceConnectionStatus values. + * + * @return known EndpointServiceConnectionStatus values. + */ + public static Collection values() { + return values(EndpointServiceConnectionStatus.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentContainer.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentContainer.java index 0256e791b224a..1ccabda295cf5 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentContainer.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentContainer.java @@ -8,90 +8,103 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentContainerInner; -/** An immutable client-side representation of EnvironmentContainer. */ +/** + * An immutable client-side representation of EnvironmentContainer. + */ public interface EnvironmentContainer { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the properties property: [Required] Additional attributes of the entity. - * + * * @return the properties value. */ EnvironmentContainerProperties properties(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentContainerInner object. - * + * * @return the inner object. */ EnvironmentContainerInner innerModel(); - /** The entirety of the EnvironmentContainer definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithParentResource, - DefinitionStages.WithProperties, - DefinitionStages.WithCreate { + /** + * The entirety of the EnvironmentContainer definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, DefinitionStages.WithCreate { } - /** The EnvironmentContainer definition stages. */ + + /** + * The EnvironmentContainer definition stages. + */ interface DefinitionStages { - /** The first stage of the EnvironmentContainer definition. */ + /** + * The first stage of the EnvironmentContainer definition. + */ interface Blank extends WithParentResource { } - /** The stage of the EnvironmentContainer definition allowing to specify parent resource. */ + + /** + * The stage of the EnvironmentContainer definition allowing to specify parent resource. + */ interface WithParentResource { /** - * Specifies resourceGroupName, workspaceName. - * + * Specifies resourceGroupName, registryName. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. * @return the next definition stage. */ - WithProperties withExistingWorkspace(String resourceGroupName, String workspaceName); + WithProperties withExistingRegistry(String resourceGroupName, String registryName); } - /** The stage of the EnvironmentContainer definition allowing to specify properties. */ + + /** + * The stage of the EnvironmentContainer definition allowing to specify properties. + */ interface WithProperties { /** * Specifies the properties property: [Required] Additional attributes of the entity.. - * + * * @param properties [Required] Additional attributes of the entity. * @return the next definition stage. */ WithCreate withProperties(EnvironmentContainerProperties properties); } + /** * The stage of the EnvironmentContainer definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. @@ -99,67 +112,76 @@ interface WithProperties { interface WithCreate { /** * Executes the create request. - * + * * @return the created resource. */ EnvironmentContainer create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ EnvironmentContainer create(Context context); } } + /** * Begins update for the EnvironmentContainer resource. - * + * * @return the stage of resource update. */ EnvironmentContainer.Update update(); - /** The template for EnvironmentContainer update. */ + /** + * The template for EnvironmentContainer update. + */ interface Update extends UpdateStages.WithProperties { /** * Executes the update request. - * + * * @return the updated resource. */ EnvironmentContainer apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ EnvironmentContainer apply(Context context); } - /** The EnvironmentContainer update stages. */ + + /** + * The EnvironmentContainer update stages. + */ interface UpdateStages { - /** The stage of the EnvironmentContainer update allowing to specify properties. */ + /** + * The stage of the EnvironmentContainer update allowing to specify properties. + */ interface WithProperties { /** * Specifies the properties property: [Required] Additional attributes of the entity.. - * + * * @param properties [Required] Additional attributes of the entity. * @return the next definition stage. */ Update withProperties(EnvironmentContainerProperties properties); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ EnvironmentContainer refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentContainerProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentContainerProperties.java index 772621f9cc4fd..73b5205628c05 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentContainerProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentContainerProperties.java @@ -5,37 +5,97 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Container for environment specification versions. */ +/** + * Container for environment specification versions. + */ @Fluent public final class EnvironmentContainerProperties extends AssetContainer { - /** Creates an instance of EnvironmentContainerProperties class. */ + /* + * Provisioning state for the environment container. + */ + private AssetProvisioningState provisioningState; + + /* + * The latest version inside this container. + */ + private String latestVersion; + + /* + * The next auto incremental version + */ + private String nextVersion; + + /** + * Creates an instance of EnvironmentContainerProperties class. + */ public EnvironmentContainerProperties() { } - /** {@inheritDoc} */ + /** + * Get the provisioningState property: Provisioning state for the environment container. + * + * @return the provisioningState value. + */ + public AssetProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the latestVersion property: The latest version inside this container. + * + * @return the latestVersion value. + */ + @Override + public String latestVersion() { + return this.latestVersion; + } + + /** + * Get the nextVersion property: The next auto incremental version. + * + * @return the nextVersion value. + */ + @Override + public String nextVersion() { + return this.nextVersion; + } + + /** + * {@inheritDoc} + */ @Override public EnvironmentContainerProperties withIsArchived(Boolean isArchived) { super.withIsArchived(isArchived); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public EnvironmentContainerProperties withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public EnvironmentContainerProperties withProperties(Map properties) { super.withProperties(properties); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public EnvironmentContainerProperties withTags(Map tags) { super.withTags(tags); @@ -44,11 +104,67 @@ public EnvironmentContainerProperties withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("isArchived", isArchived()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EnvironmentContainerProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EnvironmentContainerProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EnvironmentContainerProperties. + */ + public static EnvironmentContainerProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EnvironmentContainerProperties deserializedEnvironmentContainerProperties + = new EnvironmentContainerProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedEnvironmentContainerProperties.withDescription(reader.getString()); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedEnvironmentContainerProperties.withProperties(properties); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEnvironmentContainerProperties.withTags(tags); + } else if ("isArchived".equals(fieldName)) { + deserializedEnvironmentContainerProperties + .withIsArchived(reader.getNullable(JsonReader::getBoolean)); + } else if ("latestVersion".equals(fieldName)) { + deserializedEnvironmentContainerProperties.latestVersion = reader.getString(); + } else if ("nextVersion".equals(fieldName)) { + deserializedEnvironmentContainerProperties.nextVersion = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedEnvironmentContainerProperties.provisioningState + = AssetProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEnvironmentContainerProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentContainerResourceArmPaginatedResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentContainerResourceArmPaginatedResult.java index 80da987c4f2f1..092db28d1d525 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentContainerResourceArmPaginatedResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentContainerResourceArmPaginatedResult.java @@ -5,33 +5,40 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentContainerInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** A paginated list of EnvironmentContainer entities. */ +/** + * A paginated list of EnvironmentContainer entities. + */ @Fluent -public final class EnvironmentContainerResourceArmPaginatedResult { +public final class EnvironmentContainerResourceArmPaginatedResult + implements JsonSerializable { /* * The link to the next page of EnvironmentContainer objects. If null, there are no additional pages. */ - @JsonProperty(value = "nextLink") private String nextLink; /* * An array of objects of type EnvironmentContainer. */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of EnvironmentContainerResourceArmPaginatedResult class. */ + /** + * Creates an instance of EnvironmentContainerResourceArmPaginatedResult class. + */ public EnvironmentContainerResourceArmPaginatedResult() { } /** * Get the nextLink property: The link to the next page of EnvironmentContainer objects. If null, there are no * additional pages. - * + * * @return the nextLink value. */ public String nextLink() { @@ -41,7 +48,7 @@ public String nextLink() { /** * Set the nextLink property: The link to the next page of EnvironmentContainer objects. If null, there are no * additional pages. - * + * * @param nextLink the nextLink value to set. * @return the EnvironmentContainerResourceArmPaginatedResult object itself. */ @@ -52,7 +59,7 @@ public EnvironmentContainerResourceArmPaginatedResult withNextLink(String nextLi /** * Get the value property: An array of objects of type EnvironmentContainer. - * + * * @return the value value. */ public List value() { @@ -61,7 +68,7 @@ public List value() { /** * Set the value property: An array of objects of type EnvironmentContainer. - * + * * @param value the value value to set. * @return the EnvironmentContainerResourceArmPaginatedResult object itself. */ @@ -72,7 +79,7 @@ public EnvironmentContainerResourceArmPaginatedResult withValue(List e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EnvironmentContainerResourceArmPaginatedResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EnvironmentContainerResourceArmPaginatedResult if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EnvironmentContainerResourceArmPaginatedResult. + */ + public static EnvironmentContainerResourceArmPaginatedResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EnvironmentContainerResourceArmPaginatedResult deserializedEnvironmentContainerResourceArmPaginatedResult + = new EnvironmentContainerResourceArmPaginatedResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedEnvironmentContainerResourceArmPaginatedResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> EnvironmentContainerInner.fromJson(reader1)); + deserializedEnvironmentContainerResourceArmPaginatedResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedEnvironmentContainerResourceArmPaginatedResult; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentContainers.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentContainers.java index a78c04678f4d4..aa9ec8b91af27 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentContainers.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentContainers.java @@ -7,12 +7,15 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentContainerInner; -/** Resource collection API of EnvironmentContainers. */ +/** + * Resource collection API of EnvironmentContainers. + */ public interface EnvironmentContainers { /** * List environment containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -24,7 +27,7 @@ public interface EnvironmentContainers { /** * List environment containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -35,12 +38,12 @@ public interface EnvironmentContainers { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of EnvironmentContainer entities as paginated response with {@link PagedIterable}. */ - PagedIterable list( - String resourceGroupName, String workspaceName, String skip, ListViewType listViewType, Context context); + PagedIterable list(String resourceGroupName, String workspaceName, String skip, + ListViewType listViewType, Context context); /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -54,7 +57,7 @@ PagedIterable list( /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -66,7 +69,7 @@ PagedIterable list( /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -76,12 +79,12 @@ PagedIterable list( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return container along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String name, Context context); + Response getWithResponse(String resourceGroupName, String workspaceName, String name, + Context context); /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -93,55 +96,33 @@ Response getWithResponse( EnvironmentContainer get(String resourceGroupName, String workspaceName, String name); /** - * Get container. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container along with {@link Response}. - */ - EnvironmentContainer getById(String id); - - /** - * Get container. - * - * @param id the resource ID. + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container along with {@link Response}. + * @return azure Resource Manager resource envelope along with {@link Response}. */ - Response getByIdWithResponse(String id, Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String name, EnvironmentContainerInner body, Context context); /** - * Delete container. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Delete container. - * - * @param id the resource ID. - * @param context The context to associate with this operation. + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new EnvironmentContainer resource. - * - * @param name resource name. - * @return the first stage of the new EnvironmentContainer definition. + * @return azure Resource Manager resource envelope. */ - EnvironmentContainer.DefinitionStages.Blank define(String name); + EnvironmentContainer createOrUpdate(String resourceGroupName, String workspaceName, String name, + EnvironmentContainerInner body); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentType.java index f500324ca53a2..efd0efdcc68ee 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentType.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Environment type is either user created or curated by Azure ML service. */ +/** + * Environment type is either user created or curated by Azure ML service. + */ public final class EnvironmentType extends ExpandableStringEnum { - /** Static value Curated for EnvironmentType. */ + /** + * Static value Curated for EnvironmentType. + */ public static final EnvironmentType CURATED = fromString("Curated"); - /** Static value UserCreated for EnvironmentType. */ + /** + * Static value UserCreated for EnvironmentType. + */ public static final EnvironmentType USER_CREATED = fromString("UserCreated"); /** * Creates a new instance of EnvironmentType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public EnvironmentType() { /** * Creates or finds a EnvironmentType from its string representation. - * + * * @param name a name to look for. * @return the corresponding EnvironmentType. */ - @JsonCreator public static EnvironmentType fromString(String name) { return fromString(name, EnvironmentType.class); } /** * Gets known EnvironmentType values. - * + * * @return known EnvironmentType values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVariable.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVariable.java new file mode 100644 index 0000000000000..cae88ac393c32 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVariable.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * Environment Variables for the container. + */ +@Fluent +public final class EnvironmentVariable implements JsonSerializable { + /* + * Type of the Environment Variable. Possible values are: local - For local variable + */ + private EnvironmentVariableType type; + + /* + * Value of the Environment variable + */ + private String value; + + /* + * Environment Variables for the container + */ + private Map additionalProperties; + + /** + * Creates an instance of EnvironmentVariable class. + */ + public EnvironmentVariable() { + } + + /** + * Get the type property: Type of the Environment Variable. Possible values are: local - For local variable. + * + * @return the type value. + */ + public EnvironmentVariableType type() { + return this.type; + } + + /** + * Set the type property: Type of the Environment Variable. Possible values are: local - For local variable. + * + * @param type the type value to set. + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withType(EnvironmentVariableType type) { + this.type = type; + return this; + } + + /** + * Get the value property: Value of the Environment variable. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Value of the Environment variable. + * + * @param value the value value to set. + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the additionalProperties property: Environment Variables for the container. + * + * @return the additionalProperties value. + */ + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: Environment Variables for the container. + * + * @param additionalProperties the additionalProperties value to set. + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("value", this.value); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EnvironmentVariable from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EnvironmentVariable if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the EnvironmentVariable. + */ + public static EnvironmentVariable fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EnvironmentVariable deserializedEnvironmentVariable = new EnvironmentVariable(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedEnvironmentVariable.type = EnvironmentVariableType.fromString(reader.getString()); + } else if ("value".equals(fieldName)) { + deserializedEnvironmentVariable.value = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedEnvironmentVariable.additionalProperties = additionalProperties; + + return deserializedEnvironmentVariable; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVariableType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVariableType.java new file mode 100644 index 0000000000000..011c36d2c2b44 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVariableType.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of Environment Variable + * + * Type of the Environment Variable. Possible values are: local - For local variable. + */ +public final class EnvironmentVariableType extends ExpandableStringEnum { + /** + * Static value local for EnvironmentVariableType. + */ + public static final EnvironmentVariableType LOCAL = fromString("local"); + + /** + * Creates a new instance of EnvironmentVariableType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EnvironmentVariableType() { + } + + /** + * Creates or finds a EnvironmentVariableType from its string representation. + * + * @param name a name to look for. + * @return the corresponding EnvironmentVariableType. + */ + public static EnvironmentVariableType fromString(String name) { + return fromString(name, EnvironmentVariableType.class); + } + + /** + * Gets known EnvironmentVariableType values. + * + * @return known EnvironmentVariableType values. + */ + public static Collection values() { + return values(EnvironmentVariableType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVersion.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVersion.java index 8c72da86c8b0e..d369104be6e6a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVersion.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVersion.java @@ -8,91 +8,105 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentVersionInner; -/** An immutable client-side representation of EnvironmentVersion. */ +/** + * An immutable client-side representation of EnvironmentVersion. + */ public interface EnvironmentVersion { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the properties property: [Required] Additional attributes of the entity. - * + * * @return the properties value. */ EnvironmentVersionProperties properties(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentVersionInner object. - * + * * @return the inner object. */ EnvironmentVersionInner innerModel(); - /** The entirety of the EnvironmentVersion definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithParentResource, - DefinitionStages.WithProperties, - DefinitionStages.WithCreate { + /** + * The entirety of the EnvironmentVersion definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, DefinitionStages.WithCreate { } - /** The EnvironmentVersion definition stages. */ + + /** + * The EnvironmentVersion definition stages. + */ interface DefinitionStages { - /** The first stage of the EnvironmentVersion definition. */ + /** + * The first stage of the EnvironmentVersion definition. + */ interface Blank extends WithParentResource { } - /** The stage of the EnvironmentVersion definition allowing to specify parent resource. */ + + /** + * The stage of the EnvironmentVersion definition allowing to specify parent resource. + */ interface WithParentResource { /** - * Specifies resourceGroupName, workspaceName, name. - * + * Specifies resourceGroupName, registryName, environmentName. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. - * @param name Name of EnvironmentVersion. This is case-sensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. * @return the next definition stage. */ - WithProperties withExistingEnvironment(String resourceGroupName, String workspaceName, String name); + WithProperties withExistingEnvironment(String resourceGroupName, String registryName, + String environmentName); } - /** The stage of the EnvironmentVersion definition allowing to specify properties. */ + + /** + * The stage of the EnvironmentVersion definition allowing to specify properties. + */ interface WithProperties { /** * Specifies the properties property: [Required] Additional attributes of the entity.. - * + * * @param properties [Required] Additional attributes of the entity. * @return the next definition stage. */ WithCreate withProperties(EnvironmentVersionProperties properties); } + /** * The stage of the EnvironmentVersion definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. @@ -100,67 +114,76 @@ interface WithProperties { interface WithCreate { /** * Executes the create request. - * + * * @return the created resource. */ EnvironmentVersion create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ EnvironmentVersion create(Context context); } } + /** * Begins update for the EnvironmentVersion resource. - * + * * @return the stage of resource update. */ EnvironmentVersion.Update update(); - /** The template for EnvironmentVersion update. */ + /** + * The template for EnvironmentVersion update. + */ interface Update extends UpdateStages.WithProperties { /** * Executes the update request. - * + * * @return the updated resource. */ EnvironmentVersion apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ EnvironmentVersion apply(Context context); } - /** The EnvironmentVersion update stages. */ + + /** + * The EnvironmentVersion update stages. + */ interface UpdateStages { - /** The stage of the EnvironmentVersion update allowing to specify properties. */ + /** + * The stage of the EnvironmentVersion update allowing to specify properties. + */ interface WithProperties { /** * Specifies the properties property: [Required] Additional attributes of the entity.. - * + * * @param properties [Required] Additional attributes of the entity. * @return the next definition stage. */ Update withProperties(EnvironmentVersionProperties properties); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ EnvironmentVersion refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVersionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVersionProperties.java index 97f7ff9208937..6a83529232a4e 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVersionProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVersionProperties.java @@ -5,22 +5,25 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Environment version details. */ +/** + * Environment version details. + */ @Fluent public final class EnvironmentVersionProperties extends AssetBase { /* * Defines if image needs to be rebuilt based on base image changes. */ - @JsonProperty(value = "autoRebuild") private AutoRebuildSetting autoRebuild; /* * Configuration settings for Docker build context. */ - @JsonProperty(value = "build") private BuildContext build; /* @@ -30,45 +33,51 @@ public final class EnvironmentVersionProperties extends AssetBase { * href="https://repo2docker.readthedocs.io/en/latest/config_files.html#environment-yml-install-a-conda-environment" * /> */ - @JsonProperty(value = "condaFile") private String condaFile; /* * Environment type is either user managed or curated by the Azure ML service * */ - @JsonProperty(value = "environmentType", access = JsonProperty.Access.WRITE_ONLY) private EnvironmentType environmentType; /* * Name of the image that will be used for the environment. - * */ - @JsonProperty(value = "image") private String image; /* * Defines configuration specific to inference. */ - @JsonProperty(value = "inferenceConfig") private InferenceContainerProperties inferenceConfig; /* * The OS type of the environment. */ - @JsonProperty(value = "osType") private OperatingSystemType osType; - /** Creates an instance of EnvironmentVersionProperties class. */ + /* + * Provisioning state for the environment version. + */ + private AssetProvisioningState provisioningState; + + /* + * Stage in the environment lifecycle assigned to this environment + */ + private String stage; + + /** + * Creates an instance of EnvironmentVersionProperties class. + */ public EnvironmentVersionProperties() { } /** * Get the autoRebuild property: Defines if image needs to be rebuilt based on base image changes. - * + * * @return the autoRebuild value. */ public AutoRebuildSetting autoRebuild() { @@ -77,7 +86,7 @@ public AutoRebuildSetting autoRebuild() { /** * Set the autoRebuild property: Defines if image needs to be rebuilt based on base image changes. - * + * * @param autoRebuild the autoRebuild value to set. * @return the EnvironmentVersionProperties object itself. */ @@ -88,7 +97,7 @@ public EnvironmentVersionProperties withAutoRebuild(AutoRebuildSetting autoRebui /** * Get the build property: Configuration settings for Docker build context. - * + * * @return the build value. */ public BuildContext build() { @@ -97,7 +106,7 @@ public BuildContext build() { /** * Set the build property: Configuration settings for Docker build context. - * + * * @param build the build value to set. * @return the EnvironmentVersionProperties object itself. */ @@ -108,10 +117,11 @@ public EnvironmentVersionProperties withBuild(BuildContext build) { /** * Get the condaFile property: Standard configuration file used by Conda that lets you install any kind of package, - * including Python, R, and C/C++ packages. <see + * including Python, R, and C/C++ packages. + * <see * href="https://repo2docker.readthedocs.io/en/latest/config_files.html#environment-yml-install-a-conda-environment" * />. - * + * * @return the condaFile value. */ public String condaFile() { @@ -120,10 +130,11 @@ public String condaFile() { /** * Set the condaFile property: Standard configuration file used by Conda that lets you install any kind of package, - * including Python, R, and C/C++ packages. <see + * including Python, R, and C/C++ packages. + * <see * href="https://repo2docker.readthedocs.io/en/latest/config_files.html#environment-yml-install-a-conda-environment" * />. - * + * * @param condaFile the condaFile value to set. * @return the EnvironmentVersionProperties object itself. */ @@ -135,7 +146,7 @@ public EnvironmentVersionProperties withCondaFile(String condaFile) { /** * Get the environmentType property: Environment type is either user managed or curated by the Azure ML service * <see href="https://docs.microsoft.com/en-us/azure/machine-learning/resource-curated-environments" />. - * + * * @return the environmentType value. */ public EnvironmentType environmentType() { @@ -143,11 +154,11 @@ public EnvironmentType environmentType() { } /** - * Get the image property: Name of the image that will be used for the environment. <seealso - * href="https://docs.microsoft.com/en-us/azure/machine-learning" - + "/how-to-deploy-custom-docker-image#use-a-custom-base-image" + * Get the image property: Name of the image that will be used for the environment. + * <seealso + * href="https://docs.microsoft.com/en-us/azure/machine-learning/how-to-deploy-custom-docker-image#use-a-custom-base-image" * />. - * + * * @return the image value. */ public String image() { @@ -155,11 +166,11 @@ public String image() { } /** - * Set the image property: Name of the image that will be used for the environment. <seealso - * href="https://docs.microsoft.com/en-us/azure/machine-learning" - + "/how-to-deploy-custom-docker-image#use-a-custom-base-image" + * Set the image property: Name of the image that will be used for the environment. + * <seealso + * href="https://docs.microsoft.com/en-us/azure/machine-learning/how-to-deploy-custom-docker-image#use-a-custom-base-image" * />. - * + * * @param image the image value to set. * @return the EnvironmentVersionProperties object itself. */ @@ -170,7 +181,7 @@ public EnvironmentVersionProperties withImage(String image) { /** * Get the inferenceConfig property: Defines configuration specific to inference. - * + * * @return the inferenceConfig value. */ public InferenceContainerProperties inferenceConfig() { @@ -179,7 +190,7 @@ public InferenceContainerProperties inferenceConfig() { /** * Set the inferenceConfig property: Defines configuration specific to inference. - * + * * @param inferenceConfig the inferenceConfig value to set. * @return the EnvironmentVersionProperties object itself. */ @@ -190,7 +201,7 @@ public EnvironmentVersionProperties withInferenceConfig(InferenceContainerProper /** * Get the osType property: The OS type of the environment. - * + * * @return the osType value. */ public OperatingSystemType osType() { @@ -199,7 +210,7 @@ public OperatingSystemType osType() { /** * Set the osType property: The OS type of the environment. - * + * * @param osType the osType value to set. * @return the EnvironmentVersionProperties object itself. */ @@ -208,35 +219,74 @@ public EnvironmentVersionProperties withOsType(OperatingSystemType osType) { return this; } - /** {@inheritDoc} */ + /** + * Get the provisioningState property: Provisioning state for the environment version. + * + * @return the provisioningState value. + */ + public AssetProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the stage property: Stage in the environment lifecycle assigned to this environment. + * + * @return the stage value. + */ + public String stage() { + return this.stage; + } + + /** + * Set the stage property: Stage in the environment lifecycle assigned to this environment. + * + * @param stage the stage value to set. + * @return the EnvironmentVersionProperties object itself. + */ + public EnvironmentVersionProperties withStage(String stage) { + this.stage = stage; + return this; + } + + /** + * {@inheritDoc} + */ @Override public EnvironmentVersionProperties withIsAnonymous(Boolean isAnonymous) { super.withIsAnonymous(isAnonymous); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public EnvironmentVersionProperties withIsArchived(Boolean isArchived) { super.withIsArchived(isArchived); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public EnvironmentVersionProperties withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public EnvironmentVersionProperties withProperties(Map properties) { super.withProperties(properties); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public EnvironmentVersionProperties withTags(Map tags) { super.withTags(tags); @@ -245,7 +295,7 @@ public EnvironmentVersionProperties withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -258,4 +308,85 @@ public void validate() { inferenceConfig().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("isAnonymous", isAnonymous()); + jsonWriter.writeBooleanField("isArchived", isArchived()); + jsonWriter.writeStringField("autoRebuild", this.autoRebuild == null ? null : this.autoRebuild.toString()); + jsonWriter.writeJsonField("build", this.build); + jsonWriter.writeStringField("condaFile", this.condaFile); + jsonWriter.writeStringField("image", this.image); + jsonWriter.writeJsonField("inferenceConfig", this.inferenceConfig); + jsonWriter.writeStringField("osType", this.osType == null ? null : this.osType.toString()); + jsonWriter.writeStringField("stage", this.stage); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EnvironmentVersionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EnvironmentVersionProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EnvironmentVersionProperties. + */ + public static EnvironmentVersionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EnvironmentVersionProperties deserializedEnvironmentVersionProperties = new EnvironmentVersionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedEnvironmentVersionProperties.withDescription(reader.getString()); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedEnvironmentVersionProperties.withProperties(properties); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEnvironmentVersionProperties.withTags(tags); + } else if ("isAnonymous".equals(fieldName)) { + deserializedEnvironmentVersionProperties + .withIsAnonymous(reader.getNullable(JsonReader::getBoolean)); + } else if ("isArchived".equals(fieldName)) { + deserializedEnvironmentVersionProperties.withIsArchived(reader.getNullable(JsonReader::getBoolean)); + } else if ("autoRebuild".equals(fieldName)) { + deserializedEnvironmentVersionProperties.autoRebuild + = AutoRebuildSetting.fromString(reader.getString()); + } else if ("build".equals(fieldName)) { + deserializedEnvironmentVersionProperties.build = BuildContext.fromJson(reader); + } else if ("condaFile".equals(fieldName)) { + deserializedEnvironmentVersionProperties.condaFile = reader.getString(); + } else if ("environmentType".equals(fieldName)) { + deserializedEnvironmentVersionProperties.environmentType + = EnvironmentType.fromString(reader.getString()); + } else if ("image".equals(fieldName)) { + deserializedEnvironmentVersionProperties.image = reader.getString(); + } else if ("inferenceConfig".equals(fieldName)) { + deserializedEnvironmentVersionProperties.inferenceConfig + = InferenceContainerProperties.fromJson(reader); + } else if ("osType".equals(fieldName)) { + deserializedEnvironmentVersionProperties.osType + = OperatingSystemType.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedEnvironmentVersionProperties.provisioningState + = AssetProvisioningState.fromString(reader.getString()); + } else if ("stage".equals(fieldName)) { + deserializedEnvironmentVersionProperties.stage = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEnvironmentVersionProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVersionResourceArmPaginatedResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVersionResourceArmPaginatedResult.java index a0c6920ca097b..87a270844d237 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVersionResourceArmPaginatedResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVersionResourceArmPaginatedResult.java @@ -5,33 +5,40 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentVersionInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** A paginated list of EnvironmentVersion entities. */ +/** + * A paginated list of EnvironmentVersion entities. + */ @Fluent -public final class EnvironmentVersionResourceArmPaginatedResult { +public final class EnvironmentVersionResourceArmPaginatedResult + implements JsonSerializable { /* * The link to the next page of EnvironmentVersion objects. If null, there are no additional pages. */ - @JsonProperty(value = "nextLink") private String nextLink; /* * An array of objects of type EnvironmentVersion. */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of EnvironmentVersionResourceArmPaginatedResult class. */ + /** + * Creates an instance of EnvironmentVersionResourceArmPaginatedResult class. + */ public EnvironmentVersionResourceArmPaginatedResult() { } /** * Get the nextLink property: The link to the next page of EnvironmentVersion objects. If null, there are no * additional pages. - * + * * @return the nextLink value. */ public String nextLink() { @@ -41,7 +48,7 @@ public String nextLink() { /** * Set the nextLink property: The link to the next page of EnvironmentVersion objects. If null, there are no * additional pages. - * + * * @param nextLink the nextLink value to set. * @return the EnvironmentVersionResourceArmPaginatedResult object itself. */ @@ -52,7 +59,7 @@ public EnvironmentVersionResourceArmPaginatedResult withNextLink(String nextLink /** * Get the value property: An array of objects of type EnvironmentVersion. - * + * * @return the value value. */ public List value() { @@ -61,7 +68,7 @@ public List value() { /** * Set the value property: An array of objects of type EnvironmentVersion. - * + * * @param value the value value to set. * @return the EnvironmentVersionResourceArmPaginatedResult object itself. */ @@ -72,7 +79,7 @@ public EnvironmentVersionResourceArmPaginatedResult withValue(List e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EnvironmentVersionResourceArmPaginatedResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EnvironmentVersionResourceArmPaginatedResult if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EnvironmentVersionResourceArmPaginatedResult. + */ + public static EnvironmentVersionResourceArmPaginatedResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EnvironmentVersionResourceArmPaginatedResult deserializedEnvironmentVersionResourceArmPaginatedResult + = new EnvironmentVersionResourceArmPaginatedResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedEnvironmentVersionResourceArmPaginatedResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> EnvironmentVersionInner.fromJson(reader1)); + deserializedEnvironmentVersionResourceArmPaginatedResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedEnvironmentVersionResourceArmPaginatedResult; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVersions.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVersions.java index 42d2c70958795..893b9e9e26b12 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVersions.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EnvironmentVersions.java @@ -7,12 +7,15 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentVersionInner; -/** Resource collection API of EnvironmentVersions. */ +/** + * Resource collection API of EnvironmentVersions. + */ public interface EnvironmentVersions { /** * List versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -25,7 +28,7 @@ public interface EnvironmentVersions { /** * List versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -39,19 +42,12 @@ public interface EnvironmentVersions { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of EnvironmentVersion entities as paginated response with {@link PagedIterable}. */ - PagedIterable list( - String resourceGroupName, - String workspaceName, - String name, - String orderBy, - Integer top, - String skip, - ListViewType listViewType, - Context context); + PagedIterable list(String resourceGroupName, String workspaceName, String name, String orderBy, + Integer top, String skip, ListViewType listViewType, Context context); /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -62,12 +58,12 @@ PagedIterable list( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ - Response deleteWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context); + Response deleteWithResponse(String resourceGroupName, String workspaceName, String name, String version, + Context context); /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -80,7 +76,7 @@ Response deleteWithResponse( /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -91,12 +87,12 @@ Response deleteWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return version along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context); + Response getWithResponse(String resourceGroupName, String workspaceName, String name, + String version, Context context); /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -109,55 +105,65 @@ Response getWithResponse( EnvironmentVersion get(String resourceGroupName, String workspaceName, String name, String version); /** - * Get version. - * - * @param id the resource ID. + * Creates or updates an EnvironmentVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Name of EnvironmentVersion. This is case-sensitive. + * @param version Version of EnvironmentVersion. + * @param body Definition of EnvironmentVersion. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return version along with {@link Response}. + * @return azure Resource Manager resource envelope along with {@link Response}. */ - EnvironmentVersion getById(String id); + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, String name, + String version, EnvironmentVersionInner body, Context context); /** - * Get version. - * - * @param id the resource ID. - * @param context The context to associate with this operation. + * Creates or updates an EnvironmentVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Name of EnvironmentVersion. This is case-sensitive. + * @param version Version of EnvironmentVersion. + * @param body Definition of EnvironmentVersion. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return version along with {@link Response}. + * @return azure Resource Manager resource envelope. */ - Response getByIdWithResponse(String id, Context context); + EnvironmentVersion createOrUpdate(String resourceGroupName, String workspaceName, String name, String version, + EnvironmentVersionInner body); /** - * Delete version. - * - * @param id the resource ID. + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void deleteById(String id); + void publish(String resourceGroupName, String workspaceName, String name, String version, DestinationAsset body); /** - * Delete version. - * - * @param id the resource ID. + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new EnvironmentVersion resource. - * - * @param name resource name. - * @return the first stage of the new EnvironmentVersion definition. - */ - EnvironmentVersion.DefinitionStages.Blank define(String name); + void publish(String resourceGroupName, String workspaceName, String name, String version, DestinationAsset body, + Context context); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EstimatedVMPrice.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EstimatedVMPrice.java index a4fe18a7395df..b1ff0fbc101a8 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EstimatedVMPrice.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EstimatedVMPrice.java @@ -6,44 +6,41 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The estimated price info for using a VM of a particular OS type, tier, etc. */ +/** + * The estimated price info for using a VM of a particular OS type, tier, etc. + */ @Fluent -public final class EstimatedVMPrice { +public final class EstimatedVMPrice implements JsonSerializable { /* - * Retail price - * * The price charged for using the VM. */ - @JsonProperty(value = "retailPrice", required = true) private double retailPrice; /* - * OS type - * * Operating system type used by the VM. */ - @JsonProperty(value = "osType", required = true) private VMPriceOSType osType; /* - * VM tier - * * The type of the VM. */ - @JsonProperty(value = "vmTier", required = true) private VMTier vmTier; - /** Creates an instance of EstimatedVMPrice class. */ + /** + * Creates an instance of EstimatedVMPrice class. + */ public EstimatedVMPrice() { } /** - * Get the retailPrice property: Retail price - * - *

The price charged for using the VM. - * + * Get the retailPrice property: The price charged for using the VM. + * * @return the retailPrice value. */ public double retailPrice() { @@ -51,10 +48,8 @@ public double retailPrice() { } /** - * Set the retailPrice property: Retail price - * - *

The price charged for using the VM. - * + * Set the retailPrice property: The price charged for using the VM. + * * @param retailPrice the retailPrice value to set. * @return the EstimatedVMPrice object itself. */ @@ -64,10 +59,8 @@ public EstimatedVMPrice withRetailPrice(double retailPrice) { } /** - * Get the osType property: OS type - * - *

Operating system type used by the VM. - * + * Get the osType property: Operating system type used by the VM. + * * @return the osType value. */ public VMPriceOSType osType() { @@ -75,10 +68,8 @@ public VMPriceOSType osType() { } /** - * Set the osType property: OS type - * - *

Operating system type used by the VM. - * + * Set the osType property: Operating system type used by the VM. + * * @param osType the osType value to set. * @return the EstimatedVMPrice object itself. */ @@ -88,10 +79,8 @@ public EstimatedVMPrice withOsType(VMPriceOSType osType) { } /** - * Get the vmTier property: VM tier - * - *

The type of the VM. - * + * Get the vmTier property: The type of the VM. + * * @return the vmTier value. */ public VMTier vmTier() { @@ -99,10 +88,8 @@ public VMTier vmTier() { } /** - * Set the vmTier property: VM tier - * - *

The type of the VM. - * + * Set the vmTier property: The type of the VM. + * * @param vmTier the vmTier value to set. * @return the EstimatedVMPrice object itself. */ @@ -113,21 +100,62 @@ public EstimatedVMPrice withVmTier(VMTier vmTier) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (osType() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property osType in model EstimatedVMPrice")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property osType in model EstimatedVMPrice")); } if (vmTier() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property vmTier in model EstimatedVMPrice")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property vmTier in model EstimatedVMPrice")); } } private static final ClientLogger LOGGER = new ClientLogger(EstimatedVMPrice.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeDoubleField("retailPrice", this.retailPrice); + jsonWriter.writeStringField("osType", this.osType == null ? null : this.osType.toString()); + jsonWriter.writeStringField("vmTier", this.vmTier == null ? null : this.vmTier.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EstimatedVMPrice from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EstimatedVMPrice if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EstimatedVMPrice. + */ + public static EstimatedVMPrice fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EstimatedVMPrice deserializedEstimatedVMPrice = new EstimatedVMPrice(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("retailPrice".equals(fieldName)) { + deserializedEstimatedVMPrice.retailPrice = reader.getDouble(); + } else if ("osType".equals(fieldName)) { + deserializedEstimatedVMPrice.osType = VMPriceOSType.fromString(reader.getString()); + } else if ("vmTier".equals(fieldName)) { + deserializedEstimatedVMPrice.vmTier = VMTier.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEstimatedVMPrice; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EstimatedVMPrices.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EstimatedVMPrices.java index 577bbbb091f91..ed40a8ca13c12 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EstimatedVMPrices.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/EstimatedVMPrices.java @@ -6,45 +6,42 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** The estimated price info for using a VM. */ +/** + * The estimated price info for using a VM. + */ @Fluent -public final class EstimatedVMPrices { +public final class EstimatedVMPrices implements JsonSerializable { /* - * Billing currency - * * Three lettered code specifying the currency of the VM price. Example: USD */ - @JsonProperty(value = "billingCurrency", required = true) private BillingCurrency billingCurrency; /* - * Unit of time measure - * * The unit of time measurement for the specified VM price. Example: OneHour */ - @JsonProperty(value = "unitOfMeasure", required = true) private UnitOfMeasure unitOfMeasure; /* - * List of estimated VM prices. - * * The list of estimated prices for using a VM of a particular OS type, tier, etc. */ - @JsonProperty(value = "values", required = true) private List values; - /** Creates an instance of EstimatedVMPrices class. */ + /** + * Creates an instance of EstimatedVMPrices class. + */ public EstimatedVMPrices() { } /** - * Get the billingCurrency property: Billing currency - * - *

Three lettered code specifying the currency of the VM price. Example: USD. - * + * Get the billingCurrency property: Three lettered code specifying the currency of the VM price. Example: USD. + * * @return the billingCurrency value. */ public BillingCurrency billingCurrency() { @@ -52,10 +49,8 @@ public BillingCurrency billingCurrency() { } /** - * Set the billingCurrency property: Billing currency - * - *

Three lettered code specifying the currency of the VM price. Example: USD. - * + * Set the billingCurrency property: Three lettered code specifying the currency of the VM price. Example: USD. + * * @param billingCurrency the billingCurrency value to set. * @return the EstimatedVMPrices object itself. */ @@ -65,10 +60,8 @@ public EstimatedVMPrices withBillingCurrency(BillingCurrency billingCurrency) { } /** - * Get the unitOfMeasure property: Unit of time measure - * - *

The unit of time measurement for the specified VM price. Example: OneHour. - * + * Get the unitOfMeasure property: The unit of time measurement for the specified VM price. Example: OneHour. + * * @return the unitOfMeasure value. */ public UnitOfMeasure unitOfMeasure() { @@ -76,10 +69,8 @@ public UnitOfMeasure unitOfMeasure() { } /** - * Set the unitOfMeasure property: Unit of time measure - * - *

The unit of time measurement for the specified VM price. Example: OneHour. - * + * Set the unitOfMeasure property: The unit of time measurement for the specified VM price. Example: OneHour. + * * @param unitOfMeasure the unitOfMeasure value to set. * @return the EstimatedVMPrices object itself. */ @@ -89,10 +80,8 @@ public EstimatedVMPrices withUnitOfMeasure(UnitOfMeasure unitOfMeasure) { } /** - * Get the values property: List of estimated VM prices. - * - *

The list of estimated prices for using a VM of a particular OS type, tier, etc. - * + * Get the values property: The list of estimated prices for using a VM of a particular OS type, tier, etc. + * * @return the values value. */ public List values() { @@ -100,10 +89,8 @@ public List values() { } /** - * Set the values property: List of estimated VM prices. - * - *

The list of estimated prices for using a VM of a particular OS type, tier, etc. - * + * Set the values property: The list of estimated prices for using a VM of a particular OS type, tier, etc. + * * @param values the values value to set. * @return the EstimatedVMPrices object itself. */ @@ -114,29 +101,72 @@ public EstimatedVMPrices withValues(List values) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (billingCurrency() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property billingCurrency in model EstimatedVMPrices")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property billingCurrency in model EstimatedVMPrices")); } if (unitOfMeasure() == null) { - throw LOGGER - .logExceptionAsError( + throw LOGGER.atError() + .log( new IllegalArgumentException("Missing required property unitOfMeasure in model EstimatedVMPrices")); } if (values() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property values in model EstimatedVMPrices")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property values in model EstimatedVMPrices")); } else { values().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(EstimatedVMPrices.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("billingCurrency", + this.billingCurrency == null ? null : this.billingCurrency.toString()); + jsonWriter.writeStringField("unitOfMeasure", this.unitOfMeasure == null ? null : this.unitOfMeasure.toString()); + jsonWriter.writeArrayField("values", this.values, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EstimatedVMPrices from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EstimatedVMPrices if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EstimatedVMPrices. + */ + public static EstimatedVMPrices fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EstimatedVMPrices deserializedEstimatedVMPrices = new EstimatedVMPrices(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("billingCurrency".equals(fieldName)) { + deserializedEstimatedVMPrices.billingCurrency = BillingCurrency.fromString(reader.getString()); + } else if ("unitOfMeasure".equals(fieldName)) { + deserializedEstimatedVMPrices.unitOfMeasure = UnitOfMeasure.fromString(reader.getString()); + } else if ("values".equals(fieldName)) { + List values = reader.readArray(reader1 -> EstimatedVMPrice.fromJson(reader1)); + deserializedEstimatedVMPrices.values = values; + } else { + reader.skipChildren(); + } + } + + return deserializedEstimatedVMPrices; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ExternalFqdnResponse.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ExternalFqdnResponse.java index 6483d490175f8..e1b65bc65d340 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ExternalFqdnResponse.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ExternalFqdnResponse.java @@ -7,18 +7,20 @@ import com.azure.resourcemanager.machinelearning.fluent.models.ExternalFqdnResponseInner; import java.util.List; -/** An immutable client-side representation of ExternalFqdnResponse. */ +/** + * An immutable client-side representation of ExternalFqdnResponse. + */ public interface ExternalFqdnResponse { /** * Gets the value property: The value property. - * + * * @return the value value. */ List value(); /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.ExternalFqdnResponseInner object. - * + * * @return the inner object. */ ExternalFqdnResponseInner innerModel(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Feature.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Feature.java new file mode 100644 index 0000000000000..74378e4c955da --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Feature.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.machinelearning.fluent.models.FeatureInner; + +/** + * An immutable client-side representation of Feature. + */ +public interface Feature { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: [Required] Additional attributes of the entity. + * + * @return the properties value. + */ + FeatureProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.FeatureInner object. + * + * @return the inner object. + */ + FeatureInner innerModel(); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureAttributionDriftMonitoringSignal.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureAttributionDriftMonitoringSignal.java new file mode 100644 index 0000000000000..456a8fcb31942 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureAttributionDriftMonitoringSignal.java @@ -0,0 +1,302 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * The FeatureAttributionDriftMonitoringSignal model. + */ +@Fluent +public final class FeatureAttributionDriftMonitoringSignal extends MonitoringSignalBase { + /* + * [Required] Specifies the type of signal to monitor. + */ + private MonitoringSignalType signalType = MonitoringSignalType.FEATURE_ATTRIBUTION_DRIFT; + + /* + * A dictionary that maps feature names to their respective data types. + */ + private Map featureDataTypeOverride; + + /* + * [Required] The settings for computing feature importance. + */ + private FeatureImportanceSettings featureImportanceSettings; + + /* + * [Required] A list of metrics to calculate and their associated thresholds. + */ + private FeatureAttributionMetricThreshold metricThreshold; + + /* + * [Required] The data which drift will be calculated for. + */ + private List productionData; + + /* + * [Required] The data to calculate drift against. + */ + private MonitoringInputDataBase referenceData; + + /** + * Creates an instance of FeatureAttributionDriftMonitoringSignal class. + */ + public FeatureAttributionDriftMonitoringSignal() { + } + + /** + * Get the signalType property: [Required] Specifies the type of signal to monitor. + * + * @return the signalType value. + */ + @Override + public MonitoringSignalType signalType() { + return this.signalType; + } + + /** + * Get the featureDataTypeOverride property: A dictionary that maps feature names to their respective data types. + * + * @return the featureDataTypeOverride value. + */ + public Map featureDataTypeOverride() { + return this.featureDataTypeOverride; + } + + /** + * Set the featureDataTypeOverride property: A dictionary that maps feature names to their respective data types. + * + * @param featureDataTypeOverride the featureDataTypeOverride value to set. + * @return the FeatureAttributionDriftMonitoringSignal object itself. + */ + public FeatureAttributionDriftMonitoringSignal + withFeatureDataTypeOverride(Map featureDataTypeOverride) { + this.featureDataTypeOverride = featureDataTypeOverride; + return this; + } + + /** + * Get the featureImportanceSettings property: [Required] The settings for computing feature importance. + * + * @return the featureImportanceSettings value. + */ + public FeatureImportanceSettings featureImportanceSettings() { + return this.featureImportanceSettings; + } + + /** + * Set the featureImportanceSettings property: [Required] The settings for computing feature importance. + * + * @param featureImportanceSettings the featureImportanceSettings value to set. + * @return the FeatureAttributionDriftMonitoringSignal object itself. + */ + public FeatureAttributionDriftMonitoringSignal + withFeatureImportanceSettings(FeatureImportanceSettings featureImportanceSettings) { + this.featureImportanceSettings = featureImportanceSettings; + return this; + } + + /** + * Get the metricThreshold property: [Required] A list of metrics to calculate and their associated thresholds. + * + * @return the metricThreshold value. + */ + public FeatureAttributionMetricThreshold metricThreshold() { + return this.metricThreshold; + } + + /** + * Set the metricThreshold property: [Required] A list of metrics to calculate and their associated thresholds. + * + * @param metricThreshold the metricThreshold value to set. + * @return the FeatureAttributionDriftMonitoringSignal object itself. + */ + public FeatureAttributionDriftMonitoringSignal + withMetricThreshold(FeatureAttributionMetricThreshold metricThreshold) { + this.metricThreshold = metricThreshold; + return this; + } + + /** + * Get the productionData property: [Required] The data which drift will be calculated for. + * + * @return the productionData value. + */ + public List productionData() { + return this.productionData; + } + + /** + * Set the productionData property: [Required] The data which drift will be calculated for. + * + * @param productionData the productionData value to set. + * @return the FeatureAttributionDriftMonitoringSignal object itself. + */ + public FeatureAttributionDriftMonitoringSignal withProductionData(List productionData) { + this.productionData = productionData; + return this; + } + + /** + * Get the referenceData property: [Required] The data to calculate drift against. + * + * @return the referenceData value. + */ + public MonitoringInputDataBase referenceData() { + return this.referenceData; + } + + /** + * Set the referenceData property: [Required] The data to calculate drift against. + * + * @param referenceData the referenceData value to set. + * @return the FeatureAttributionDriftMonitoringSignal object itself. + */ + public FeatureAttributionDriftMonitoringSignal withReferenceData(MonitoringInputDataBase referenceData) { + this.referenceData = referenceData; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FeatureAttributionDriftMonitoringSignal + withNotificationTypes(List notificationTypes) { + super.withNotificationTypes(notificationTypes); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FeatureAttributionDriftMonitoringSignal withProperties(Map properties) { + super.withProperties(properties); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (featureImportanceSettings() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property featureImportanceSettings in model FeatureAttributionDriftMonitoringSignal")); + } else { + featureImportanceSettings().validate(); + } + if (metricThreshold() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property metricThreshold in model FeatureAttributionDriftMonitoringSignal")); + } else { + metricThreshold().validate(); + } + if (productionData() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property productionData in model FeatureAttributionDriftMonitoringSignal")); + } else { + productionData().forEach(e -> e.validate()); + } + if (referenceData() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property referenceData in model FeatureAttributionDriftMonitoringSignal")); + } else { + referenceData().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FeatureAttributionDriftMonitoringSignal.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("notificationTypes", notificationTypes(), + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("featureImportanceSettings", this.featureImportanceSettings); + jsonWriter.writeJsonField("metricThreshold", this.metricThreshold); + jsonWriter.writeArrayField("productionData", this.productionData, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("referenceData", this.referenceData); + jsonWriter.writeStringField("signalType", this.signalType == null ? null : this.signalType.toString()); + jsonWriter.writeMapField("featureDataTypeOverride", this.featureDataTypeOverride, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FeatureAttributionDriftMonitoringSignal from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FeatureAttributionDriftMonitoringSignal if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FeatureAttributionDriftMonitoringSignal. + */ + public static FeatureAttributionDriftMonitoringSignal fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FeatureAttributionDriftMonitoringSignal deserializedFeatureAttributionDriftMonitoringSignal + = new FeatureAttributionDriftMonitoringSignal(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("notificationTypes".equals(fieldName)) { + List notificationTypes + = reader.readArray(reader1 -> MonitoringNotificationType.fromString(reader1.getString())); + deserializedFeatureAttributionDriftMonitoringSignal.withNotificationTypes(notificationTypes); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedFeatureAttributionDriftMonitoringSignal.withProperties(properties); + } else if ("featureImportanceSettings".equals(fieldName)) { + deserializedFeatureAttributionDriftMonitoringSignal.featureImportanceSettings + = FeatureImportanceSettings.fromJson(reader); + } else if ("metricThreshold".equals(fieldName)) { + deserializedFeatureAttributionDriftMonitoringSignal.metricThreshold + = FeatureAttributionMetricThreshold.fromJson(reader); + } else if ("productionData".equals(fieldName)) { + List productionData + = reader.readArray(reader1 -> MonitoringInputDataBase.fromJson(reader1)); + deserializedFeatureAttributionDriftMonitoringSignal.productionData = productionData; + } else if ("referenceData".equals(fieldName)) { + deserializedFeatureAttributionDriftMonitoringSignal.referenceData + = MonitoringInputDataBase.fromJson(reader); + } else if ("signalType".equals(fieldName)) { + deserializedFeatureAttributionDriftMonitoringSignal.signalType + = MonitoringSignalType.fromString(reader.getString()); + } else if ("featureDataTypeOverride".equals(fieldName)) { + Map featureDataTypeOverride + = reader.readMap(reader1 -> MonitoringFeatureDataType.fromString(reader1.getString())); + deserializedFeatureAttributionDriftMonitoringSignal.featureDataTypeOverride + = featureDataTypeOverride; + } else { + reader.skipChildren(); + } + } + + return deserializedFeatureAttributionDriftMonitoringSignal; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureAttributionMetric.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureAttributionMetric.java new file mode 100644 index 0000000000000..9dd83c77e7558 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureAttributionMetric.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for FeatureAttributionMetric. + */ +public final class FeatureAttributionMetric extends ExpandableStringEnum { + /** + * Static value NormalizedDiscountedCumulativeGain for FeatureAttributionMetric. + */ + public static final FeatureAttributionMetric NORMALIZED_DISCOUNTED_CUMULATIVE_GAIN + = fromString("NormalizedDiscountedCumulativeGain"); + + /** + * Creates a new instance of FeatureAttributionMetric value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FeatureAttributionMetric() { + } + + /** + * Creates or finds a FeatureAttributionMetric from its string representation. + * + * @param name a name to look for. + * @return the corresponding FeatureAttributionMetric. + */ + public static FeatureAttributionMetric fromString(String name) { + return fromString(name, FeatureAttributionMetric.class); + } + + /** + * Gets known FeatureAttributionMetric values. + * + * @return known FeatureAttributionMetric values. + */ + public static Collection values() { + return values(FeatureAttributionMetric.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureAttributionMetricThreshold.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureAttributionMetricThreshold.java new file mode 100644 index 0000000000000..a0ac72fdbc7fe --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureAttributionMetricThreshold.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The FeatureAttributionMetricThreshold model. + */ +@Fluent +public final class FeatureAttributionMetricThreshold implements JsonSerializable { + /* + * [Required] The feature attribution metric to calculate. + */ + private FeatureAttributionMetric metric; + + /* + * The threshold value. If null, a default value will be set depending on the selected metric. + */ + private MonitoringThreshold threshold; + + /** + * Creates an instance of FeatureAttributionMetricThreshold class. + */ + public FeatureAttributionMetricThreshold() { + } + + /** + * Get the metric property: [Required] The feature attribution metric to calculate. + * + * @return the metric value. + */ + public FeatureAttributionMetric metric() { + return this.metric; + } + + /** + * Set the metric property: [Required] The feature attribution metric to calculate. + * + * @param metric the metric value to set. + * @return the FeatureAttributionMetricThreshold object itself. + */ + public FeatureAttributionMetricThreshold withMetric(FeatureAttributionMetric metric) { + this.metric = metric; + return this; + } + + /** + * Get the threshold property: The threshold value. If null, a default value will be set depending on the selected + * metric. + * + * @return the threshold value. + */ + public MonitoringThreshold threshold() { + return this.threshold; + } + + /** + * Set the threshold property: The threshold value. If null, a default value will be set depending on the selected + * metric. + * + * @param threshold the threshold value to set. + * @return the FeatureAttributionMetricThreshold object itself. + */ + public FeatureAttributionMetricThreshold withThreshold(MonitoringThreshold threshold) { + this.threshold = threshold; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metric() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property metric in model FeatureAttributionMetricThreshold")); + } + if (threshold() != null) { + threshold().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FeatureAttributionMetricThreshold.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("metric", this.metric == null ? null : this.metric.toString()); + jsonWriter.writeJsonField("threshold", this.threshold); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FeatureAttributionMetricThreshold from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FeatureAttributionMetricThreshold if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FeatureAttributionMetricThreshold. + */ + public static FeatureAttributionMetricThreshold fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FeatureAttributionMetricThreshold deserializedFeatureAttributionMetricThreshold + = new FeatureAttributionMetricThreshold(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("metric".equals(fieldName)) { + deserializedFeatureAttributionMetricThreshold.metric + = FeatureAttributionMetric.fromString(reader.getString()); + } else if ("threshold".equals(fieldName)) { + deserializedFeatureAttributionMetricThreshold.threshold = MonitoringThreshold.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFeatureAttributionMetricThreshold; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureDataType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureDataType.java new file mode 100644 index 0000000000000..4cc26cd06ce40 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureDataType.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for FeatureDataType. + */ +public final class FeatureDataType extends ExpandableStringEnum { + /** + * Static value String for FeatureDataType. + */ + public static final FeatureDataType STRING = fromString("String"); + + /** + * Static value Integer for FeatureDataType. + */ + public static final FeatureDataType INTEGER = fromString("Integer"); + + /** + * Static value Long for FeatureDataType. + */ + public static final FeatureDataType LONG = fromString("Long"); + + /** + * Static value Float for FeatureDataType. + */ + public static final FeatureDataType FLOAT = fromString("Float"); + + /** + * Static value Double for FeatureDataType. + */ + public static final FeatureDataType DOUBLE = fromString("Double"); + + /** + * Static value Binary for FeatureDataType. + */ + public static final FeatureDataType BINARY = fromString("Binary"); + + /** + * Static value Datetime for FeatureDataType. + */ + public static final FeatureDataType DATETIME = fromString("Datetime"); + + /** + * Static value Boolean for FeatureDataType. + */ + public static final FeatureDataType BOOLEAN = fromString("Boolean"); + + /** + * Creates a new instance of FeatureDataType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FeatureDataType() { + } + + /** + * Creates or finds a FeatureDataType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FeatureDataType. + */ + public static FeatureDataType fromString(String name) { + return fromString(name, FeatureDataType.class); + } + + /** + * Gets known FeatureDataType values. + * + * @return known FeatureDataType values. + */ + public static Collection values() { + return values(FeatureDataType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureImportanceMode.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureImportanceMode.java new file mode 100644 index 0000000000000..59bc744d69e85 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureImportanceMode.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The mode of operation for computing feature importance. + */ +public final class FeatureImportanceMode extends ExpandableStringEnum { + /** + * Static value Disabled for FeatureImportanceMode. + */ + public static final FeatureImportanceMode DISABLED = fromString("Disabled"); + + /** + * Static value Enabled for FeatureImportanceMode. + */ + public static final FeatureImportanceMode ENABLED = fromString("Enabled"); + + /** + * Creates a new instance of FeatureImportanceMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FeatureImportanceMode() { + } + + /** + * Creates or finds a FeatureImportanceMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding FeatureImportanceMode. + */ + public static FeatureImportanceMode fromString(String name) { + return fromString(name, FeatureImportanceMode.class); + } + + /** + * Gets known FeatureImportanceMode values. + * + * @return known FeatureImportanceMode values. + */ + public static Collection values() { + return values(FeatureImportanceMode.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureImportanceSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureImportanceSettings.java new file mode 100644 index 0000000000000..750f7d629b94f --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureImportanceSettings.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The FeatureImportanceSettings model. + */ +@Fluent +public final class FeatureImportanceSettings implements JsonSerializable { + /* + * The mode of operation for computing feature importance. + */ + private FeatureImportanceMode mode; + + /* + * The name of the target column within the input data asset. + */ + private String targetColumn; + + /** + * Creates an instance of FeatureImportanceSettings class. + */ + public FeatureImportanceSettings() { + } + + /** + * Get the mode property: The mode of operation for computing feature importance. + * + * @return the mode value. + */ + public FeatureImportanceMode mode() { + return this.mode; + } + + /** + * Set the mode property: The mode of operation for computing feature importance. + * + * @param mode the mode value to set. + * @return the FeatureImportanceSettings object itself. + */ + public FeatureImportanceSettings withMode(FeatureImportanceMode mode) { + this.mode = mode; + return this; + } + + /** + * Get the targetColumn property: The name of the target column within the input data asset. + * + * @return the targetColumn value. + */ + public String targetColumn() { + return this.targetColumn; + } + + /** + * Set the targetColumn property: The name of the target column within the input data asset. + * + * @param targetColumn the targetColumn value to set. + * @return the FeatureImportanceSettings object itself. + */ + public FeatureImportanceSettings withTargetColumn(String targetColumn) { + this.targetColumn = targetColumn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + jsonWriter.writeStringField("targetColumn", this.targetColumn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FeatureImportanceSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FeatureImportanceSettings if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FeatureImportanceSettings. + */ + public static FeatureImportanceSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FeatureImportanceSettings deserializedFeatureImportanceSettings = new FeatureImportanceSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("mode".equals(fieldName)) { + deserializedFeatureImportanceSettings.mode = FeatureImportanceMode.fromString(reader.getString()); + } else if ("targetColumn".equals(fieldName)) { + deserializedFeatureImportanceSettings.targetColumn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFeatureImportanceSettings; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureLags.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureLags.java index a20e4611f93e3..34cf1b1ee7bf3 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureLags.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureLags.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Flag for generating lags for the numeric features. */ +/** + * Flag for generating lags for the numeric features. + */ public final class FeatureLags extends ExpandableStringEnum { - /** Static value None for FeatureLags. */ + /** + * Static value None for FeatureLags. + */ public static final FeatureLags NONE = fromString("None"); - /** Static value Auto for FeatureLags. */ + /** + * Static value Auto for FeatureLags. + */ public static final FeatureLags AUTO = fromString("Auto"); /** * Creates a new instance of FeatureLags value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public FeatureLags() { /** * Creates or finds a FeatureLags from its string representation. - * + * * @param name a name to look for. * @return the corresponding FeatureLags. */ - @JsonCreator public static FeatureLags fromString(String name) { return fromString(name, FeatureLags.class); } /** * Gets known FeatureLags values. - * + * * @return known FeatureLags values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureProperties.java new file mode 100644 index 0000000000000..133c412ea9ada --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureProperties.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * DTO object representing feature. + */ +@Fluent +public final class FeatureProperties extends ResourceBase { + /* + * Specifies type + */ + private FeatureDataType dataType; + + /* + * Specifies name + */ + private String featureName; + + /** + * Creates an instance of FeatureProperties class. + */ + public FeatureProperties() { + } + + /** + * Get the dataType property: Specifies type. + * + * @return the dataType value. + */ + public FeatureDataType dataType() { + return this.dataType; + } + + /** + * Set the dataType property: Specifies type. + * + * @param dataType the dataType value to set. + * @return the FeatureProperties object itself. + */ + public FeatureProperties withDataType(FeatureDataType dataType) { + this.dataType = dataType; + return this; + } + + /** + * Get the featureName property: Specifies name. + * + * @return the featureName value. + */ + public String featureName() { + return this.featureName; + } + + /** + * Set the featureName property: Specifies name. + * + * @param featureName the featureName value to set. + * @return the FeatureProperties object itself. + */ + public FeatureProperties withFeatureName(String featureName) { + this.featureName = featureName; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FeatureProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FeatureProperties withProperties(Map properties) { + super.withProperties(properties); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FeatureProperties withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("dataType", this.dataType == null ? null : this.dataType.toString()); + jsonWriter.writeStringField("featureName", this.featureName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FeatureProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FeatureProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FeatureProperties. + */ + public static FeatureProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FeatureProperties deserializedFeatureProperties = new FeatureProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedFeatureProperties.withDescription(reader.getString()); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedFeatureProperties.withProperties(properties); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedFeatureProperties.withTags(tags); + } else if ("dataType".equals(fieldName)) { + deserializedFeatureProperties.dataType = FeatureDataType.fromString(reader.getString()); + } else if ("featureName".equals(fieldName)) { + deserializedFeatureProperties.featureName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFeatureProperties; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureResourceArmPaginatedResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureResourceArmPaginatedResult.java new file mode 100644 index 0000000000000..e265ce9c2391b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureResourceArmPaginatedResult.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.machinelearning.fluent.models.FeatureInner; +import java.io.IOException; +import java.util.List; + +/** + * A paginated list of Feature entities. + */ +@Fluent +public final class FeatureResourceArmPaginatedResult implements JsonSerializable { + /* + * The link to the next page of Feature objects. If null, there are no additional pages. + */ + private String nextLink; + + /* + * An array of objects of type Feature. + */ + private List value; + + /** + * Creates an instance of FeatureResourceArmPaginatedResult class. + */ + public FeatureResourceArmPaginatedResult() { + } + + /** + * Get the nextLink property: The link to the next page of Feature objects. If null, there are no additional pages. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of Feature objects. If null, there are no additional pages. + * + * @param nextLink the nextLink value to set. + * @return the FeatureResourceArmPaginatedResult object itself. + */ + public FeatureResourceArmPaginatedResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: An array of objects of type Feature. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of objects of type Feature. + * + * @param value the value value to set. + * @return the FeatureResourceArmPaginatedResult object itself. + */ + public FeatureResourceArmPaginatedResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FeatureResourceArmPaginatedResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FeatureResourceArmPaginatedResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FeatureResourceArmPaginatedResult. + */ + public static FeatureResourceArmPaginatedResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FeatureResourceArmPaginatedResult deserializedFeatureResourceArmPaginatedResult + = new FeatureResourceArmPaginatedResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedFeatureResourceArmPaginatedResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> FeatureInner.fromJson(reader1)); + deserializedFeatureResourceArmPaginatedResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedFeatureResourceArmPaginatedResult; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureStoreSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureStoreSettings.java new file mode 100644 index 0000000000000..4b81301030354 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureStoreSettings.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Settings for feature store type workspace. + */ +@Fluent +public final class FeatureStoreSettings implements JsonSerializable { + /* + * Compute runtime config for feature store type workspace. + */ + private ComputeRuntimeDto computeRuntime; + + /* + * The offlineStoreConnectionName property. + */ + private String offlineStoreConnectionName; + + /* + * The onlineStoreConnectionName property. + */ + private String onlineStoreConnectionName; + + /** + * Creates an instance of FeatureStoreSettings class. + */ + public FeatureStoreSettings() { + } + + /** + * Get the computeRuntime property: Compute runtime config for feature store type workspace. + * + * @return the computeRuntime value. + */ + public ComputeRuntimeDto computeRuntime() { + return this.computeRuntime; + } + + /** + * Set the computeRuntime property: Compute runtime config for feature store type workspace. + * + * @param computeRuntime the computeRuntime value to set. + * @return the FeatureStoreSettings object itself. + */ + public FeatureStoreSettings withComputeRuntime(ComputeRuntimeDto computeRuntime) { + this.computeRuntime = computeRuntime; + return this; + } + + /** + * Get the offlineStoreConnectionName property: The offlineStoreConnectionName property. + * + * @return the offlineStoreConnectionName value. + */ + public String offlineStoreConnectionName() { + return this.offlineStoreConnectionName; + } + + /** + * Set the offlineStoreConnectionName property: The offlineStoreConnectionName property. + * + * @param offlineStoreConnectionName the offlineStoreConnectionName value to set. + * @return the FeatureStoreSettings object itself. + */ + public FeatureStoreSettings withOfflineStoreConnectionName(String offlineStoreConnectionName) { + this.offlineStoreConnectionName = offlineStoreConnectionName; + return this; + } + + /** + * Get the onlineStoreConnectionName property: The onlineStoreConnectionName property. + * + * @return the onlineStoreConnectionName value. + */ + public String onlineStoreConnectionName() { + return this.onlineStoreConnectionName; + } + + /** + * Set the onlineStoreConnectionName property: The onlineStoreConnectionName property. + * + * @param onlineStoreConnectionName the onlineStoreConnectionName value to set. + * @return the FeatureStoreSettings object itself. + */ + public FeatureStoreSettings withOnlineStoreConnectionName(String onlineStoreConnectionName) { + this.onlineStoreConnectionName = onlineStoreConnectionName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (computeRuntime() != null) { + computeRuntime().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("computeRuntime", this.computeRuntime); + jsonWriter.writeStringField("offlineStoreConnectionName", this.offlineStoreConnectionName); + jsonWriter.writeStringField("onlineStoreConnectionName", this.onlineStoreConnectionName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FeatureStoreSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FeatureStoreSettings if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the FeatureStoreSettings. + */ + public static FeatureStoreSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FeatureStoreSettings deserializedFeatureStoreSettings = new FeatureStoreSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("computeRuntime".equals(fieldName)) { + deserializedFeatureStoreSettings.computeRuntime = ComputeRuntimeDto.fromJson(reader); + } else if ("offlineStoreConnectionName".equals(fieldName)) { + deserializedFeatureStoreSettings.offlineStoreConnectionName = reader.getString(); + } else if ("onlineStoreConnectionName".equals(fieldName)) { + deserializedFeatureStoreSettings.onlineStoreConnectionName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFeatureStoreSettings; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureSubset.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureSubset.java new file mode 100644 index 0000000000000..4e6c594b88286 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureSubset.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The FeatureSubset model. + */ +@Fluent +public final class FeatureSubset extends MonitoringFeatureFilterBase { + /* + * [Required] Specifies the feature filter to leverage when selecting features to calculate metrics over. + */ + private MonitoringFeatureFilterType filterType = MonitoringFeatureFilterType.FEATURE_SUBSET; + + /* + * [Required] The list of features to include. + */ + private List features; + + /** + * Creates an instance of FeatureSubset class. + */ + public FeatureSubset() { + } + + /** + * Get the filterType property: [Required] Specifies the feature filter to leverage when selecting features to + * calculate metrics over. + * + * @return the filterType value. + */ + @Override + public MonitoringFeatureFilterType filterType() { + return this.filterType; + } + + /** + * Get the features property: [Required] The list of features to include. + * + * @return the features value. + */ + public List features() { + return this.features; + } + + /** + * Set the features property: [Required] The list of features to include. + * + * @param features the features value to set. + * @return the FeatureSubset object itself. + */ + public FeatureSubset withFeatures(List features) { + this.features = features; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (features() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property features in model FeatureSubset")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FeatureSubset.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("features", this.features, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("filterType", this.filterType == null ? null : this.filterType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FeatureSubset from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FeatureSubset if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FeatureSubset. + */ + public static FeatureSubset fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FeatureSubset deserializedFeatureSubset = new FeatureSubset(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("features".equals(fieldName)) { + List features = reader.readArray(reader1 -> reader1.getString()); + deserializedFeatureSubset.features = features; + } else if ("filterType".equals(fieldName)) { + deserializedFeatureSubset.filterType = MonitoringFeatureFilterType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedFeatureSubset; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureWindow.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureWindow.java new file mode 100644 index 0000000000000..3dc654e096cbc --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeatureWindow.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Specifies the feature window. + */ +@Fluent +public final class FeatureWindow implements JsonSerializable { + /* + * Specifies the feature window end time + */ + private OffsetDateTime featureWindowEnd; + + /* + * Specifies the feature window start time + */ + private OffsetDateTime featureWindowStart; + + /** + * Creates an instance of FeatureWindow class. + */ + public FeatureWindow() { + } + + /** + * Get the featureWindowEnd property: Specifies the feature window end time. + * + * @return the featureWindowEnd value. + */ + public OffsetDateTime featureWindowEnd() { + return this.featureWindowEnd; + } + + /** + * Set the featureWindowEnd property: Specifies the feature window end time. + * + * @param featureWindowEnd the featureWindowEnd value to set. + * @return the FeatureWindow object itself. + */ + public FeatureWindow withFeatureWindowEnd(OffsetDateTime featureWindowEnd) { + this.featureWindowEnd = featureWindowEnd; + return this; + } + + /** + * Get the featureWindowStart property: Specifies the feature window start time. + * + * @return the featureWindowStart value. + */ + public OffsetDateTime featureWindowStart() { + return this.featureWindowStart; + } + + /** + * Set the featureWindowStart property: Specifies the feature window start time. + * + * @param featureWindowStart the featureWindowStart value to set. + * @return the FeatureWindow object itself. + */ + public FeatureWindow withFeatureWindowStart(OffsetDateTime featureWindowStart) { + this.featureWindowStart = featureWindowStart; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("featureWindowEnd", + this.featureWindowEnd == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.featureWindowEnd)); + jsonWriter.writeStringField("featureWindowStart", + this.featureWindowStart == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.featureWindowStart)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FeatureWindow from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FeatureWindow if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FeatureWindow. + */ + public static FeatureWindow fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FeatureWindow deserializedFeatureWindow = new FeatureWindow(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("featureWindowEnd".equals(fieldName)) { + deserializedFeatureWindow.featureWindowEnd = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("featureWindowStart".equals(fieldName)) { + deserializedFeatureWindow.featureWindowStart = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedFeatureWindow; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Features.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Features.java new file mode 100644 index 0000000000000..1269d823bacf9 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Features.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Features. + */ +public interface Features { + /** + * List Features. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Featureset name. This is case-sensitive. + * @param featuresetVersion Featureset Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Feature entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String featuresetName, + String featuresetVersion); + + /** + * List Features. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Featureset name. This is case-sensitive. + * @param featuresetVersion Featureset Version identifier. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param featureName feature name. + * @param description Description of the featureset. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize Page size. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Feature entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String featuresetName, + String featuresetVersion, String skip, String tags, String featureName, String description, + ListViewType listViewType, Integer pageSize, Context context); + + /** + * Get feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Feature set name. This is case-sensitive. + * @param featuresetVersion Feature set version identifier. This is case-sensitive. + * @param featureName Feature Name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return feature along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, String featuresetName, + String featuresetVersion, String featureName, Context context); + + /** + * Get feature. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param featuresetName Feature set name. This is case-sensitive. + * @param featuresetVersion Feature set version identifier. This is case-sensitive. + * @param featureName Feature Name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return feature. + */ + Feature get(String resourceGroupName, String workspaceName, String featuresetName, String featuresetVersion, + String featureName); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetContainer.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetContainer.java new file mode 100644 index 0000000000000..0ca4d3b601f3f --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetContainer.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetContainerInner; + +/** + * An immutable client-side representation of FeaturesetContainer. + */ +public interface FeaturesetContainer { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: [Required] Additional attributes of the entity. + * + * @return the properties value. + */ + FeaturesetContainerProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetContainerInner object. + * + * @return the inner object. + */ + FeaturesetContainerInner innerModel(); + + /** + * The entirety of the FeaturesetContainer definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * The FeaturesetContainer definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the FeaturesetContainer definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the FeaturesetContainer definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, workspaceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @return the next definition stage. + */ + WithProperties withExistingWorkspace(String resourceGroupName, String workspaceName); + } + + /** + * The stage of the FeaturesetContainer definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: [Required] Additional attributes of the entity.. + * + * @param properties [Required] Additional attributes of the entity. + * @return the next definition stage. + */ + WithCreate withProperties(FeaturesetContainerProperties properties); + } + + /** + * The stage of the FeaturesetContainer definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate { + /** + * Executes the create request. + * + * @return the created resource. + */ + FeaturesetContainer create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + FeaturesetContainer create(Context context); + } + } + + /** + * Begins update for the FeaturesetContainer resource. + * + * @return the stage of resource update. + */ + FeaturesetContainer.Update update(); + + /** + * The template for FeaturesetContainer update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + FeaturesetContainer apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + FeaturesetContainer apply(Context context); + } + + /** + * The FeaturesetContainer update stages. + */ + interface UpdateStages { + /** + * The stage of the FeaturesetContainer update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: [Required] Additional attributes of the entity.. + * + * @param properties [Required] Additional attributes of the entity. + * @return the next definition stage. + */ + Update withProperties(FeaturesetContainerProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + FeaturesetContainer refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + FeaturesetContainer refresh(Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetContainerProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetContainerProperties.java new file mode 100644 index 0000000000000..8faa84dcd43e1 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetContainerProperties.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * DTO object representing feature set. + */ +@Fluent +public final class FeaturesetContainerProperties extends AssetContainer { + /* + * Provisioning state for the featureset container. + */ + private AssetProvisioningState provisioningState; + + /* + * The latest version inside this container. + */ + private String latestVersion; + + /* + * The next auto incremental version + */ + private String nextVersion; + + /** + * Creates an instance of FeaturesetContainerProperties class. + */ + public FeaturesetContainerProperties() { + } + + /** + * Get the provisioningState property: Provisioning state for the featureset container. + * + * @return the provisioningState value. + */ + public AssetProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the latestVersion property: The latest version inside this container. + * + * @return the latestVersion value. + */ + @Override + public String latestVersion() { + return this.latestVersion; + } + + /** + * Get the nextVersion property: The next auto incremental version. + * + * @return the nextVersion value. + */ + @Override + public String nextVersion() { + return this.nextVersion; + } + + /** + * {@inheritDoc} + */ + @Override + public FeaturesetContainerProperties withIsArchived(Boolean isArchived) { + super.withIsArchived(isArchived); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FeaturesetContainerProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FeaturesetContainerProperties withProperties(Map properties) { + super.withProperties(properties); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FeaturesetContainerProperties withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("isArchived", isArchived()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FeaturesetContainerProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FeaturesetContainerProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FeaturesetContainerProperties. + */ + public static FeaturesetContainerProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FeaturesetContainerProperties deserializedFeaturesetContainerProperties + = new FeaturesetContainerProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedFeaturesetContainerProperties.withDescription(reader.getString()); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedFeaturesetContainerProperties.withProperties(properties); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedFeaturesetContainerProperties.withTags(tags); + } else if ("isArchived".equals(fieldName)) { + deserializedFeaturesetContainerProperties + .withIsArchived(reader.getNullable(JsonReader::getBoolean)); + } else if ("latestVersion".equals(fieldName)) { + deserializedFeaturesetContainerProperties.latestVersion = reader.getString(); + } else if ("nextVersion".equals(fieldName)) { + deserializedFeaturesetContainerProperties.nextVersion = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedFeaturesetContainerProperties.provisioningState + = AssetProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedFeaturesetContainerProperties; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetContainerResourceArmPaginatedResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetContainerResourceArmPaginatedResult.java new file mode 100644 index 0000000000000..06ca33207969a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetContainerResourceArmPaginatedResult.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetContainerInner; +import java.io.IOException; +import java.util.List; + +/** + * A paginated list of FeaturesetContainer entities. + */ +@Fluent +public final class FeaturesetContainerResourceArmPaginatedResult + implements JsonSerializable { + /* + * The link to the next page of FeaturesetContainer objects. If null, there are no additional pages. + */ + private String nextLink; + + /* + * An array of objects of type FeaturesetContainer. + */ + private List value; + + /** + * Creates an instance of FeaturesetContainerResourceArmPaginatedResult class. + */ + public FeaturesetContainerResourceArmPaginatedResult() { + } + + /** + * Get the nextLink property: The link to the next page of FeaturesetContainer objects. If null, there are no + * additional pages. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of FeaturesetContainer objects. If null, there are no + * additional pages. + * + * @param nextLink the nextLink value to set. + * @return the FeaturesetContainerResourceArmPaginatedResult object itself. + */ + public FeaturesetContainerResourceArmPaginatedResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: An array of objects of type FeaturesetContainer. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of objects of type FeaturesetContainer. + * + * @param value the value value to set. + * @return the FeaturesetContainerResourceArmPaginatedResult object itself. + */ + public FeaturesetContainerResourceArmPaginatedResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FeaturesetContainerResourceArmPaginatedResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FeaturesetContainerResourceArmPaginatedResult if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FeaturesetContainerResourceArmPaginatedResult. + */ + public static FeaturesetContainerResourceArmPaginatedResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FeaturesetContainerResourceArmPaginatedResult deserializedFeaturesetContainerResourceArmPaginatedResult + = new FeaturesetContainerResourceArmPaginatedResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedFeaturesetContainerResourceArmPaginatedResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> FeaturesetContainerInner.fromJson(reader1)); + deserializedFeaturesetContainerResourceArmPaginatedResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedFeaturesetContainerResourceArmPaginatedResult; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetContainers.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetContainers.java new file mode 100644 index 0000000000000..7b22836acf160 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetContainers.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of FeaturesetContainers. + */ +public interface FeaturesetContainers { + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetContainer entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param name name for the featureset. + * @param description description for the feature set. + * @param createdBy createdBy user name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetContainer entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String skip, String tags, + ListViewType listViewType, Integer pageSize, String name, String description, String createdBy, + Context context); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String name); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String name, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + Response getEntityWithResponse(String resourceGroupName, String workspaceName, String name, + Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container. + */ + FeaturesetContainer getEntity(String resourceGroupName, String workspaceName, String name); + + /** + * Get container. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + FeaturesetContainer getEntityById(String id); + + /** + * Get container. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + Response getEntityByIdWithResponse(String id, Context context); + + /** + * Delete container. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete container. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new FeaturesetContainer resource. + * + * @param name resource name. + * @return the first stage of the new FeaturesetContainer definition. + */ + FeaturesetContainer.DefinitionStages.Blank define(String name); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetSpecification.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetSpecification.java new file mode 100644 index 0000000000000..f4d195f4b2d5f --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetSpecification.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * DTO object representing specification. + */ +@Fluent +public final class FeaturesetSpecification implements JsonSerializable { + /* + * Specifies the spec path + */ + private String path; + + /** + * Creates an instance of FeaturesetSpecification class. + */ + public FeaturesetSpecification() { + } + + /** + * Get the path property: Specifies the spec path. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: Specifies the spec path. + * + * @param path the path value to set. + * @return the FeaturesetSpecification object itself. + */ + public FeaturesetSpecification withPath(String path) { + this.path = path; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("path", this.path); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FeaturesetSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FeaturesetSpecification if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the FeaturesetSpecification. + */ + public static FeaturesetSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FeaturesetSpecification deserializedFeaturesetSpecification = new FeaturesetSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("path".equals(fieldName)) { + deserializedFeaturesetSpecification.path = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFeaturesetSpecification; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetVersion.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetVersion.java new file mode 100644 index 0000000000000..5ee17b1b2555b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetVersion.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetVersionInner; + +/** + * An immutable client-side representation of FeaturesetVersion. + */ +public interface FeaturesetVersion { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: [Required] Additional attributes of the entity. + * + * @return the properties value. + */ + FeaturesetVersionProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetVersionInner object. + * + * @return the inner object. + */ + FeaturesetVersionInner innerModel(); + + /** + * The entirety of the FeaturesetVersion definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * The FeaturesetVersion definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the FeaturesetVersion definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the FeaturesetVersion definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, workspaceName, name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @return the next definition stage. + */ + WithProperties withExistingFeatureset(String resourceGroupName, String workspaceName, String name); + } + + /** + * The stage of the FeaturesetVersion definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: [Required] Additional attributes of the entity.. + * + * @param properties [Required] Additional attributes of the entity. + * @return the next definition stage. + */ + WithCreate withProperties(FeaturesetVersionProperties properties); + } + + /** + * The stage of the FeaturesetVersion definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate { + /** + * Executes the create request. + * + * @return the created resource. + */ + FeaturesetVersion create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + FeaturesetVersion create(Context context); + } + } + + /** + * Begins update for the FeaturesetVersion resource. + * + * @return the stage of resource update. + */ + FeaturesetVersion.Update update(); + + /** + * The template for FeaturesetVersion update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + FeaturesetVersion apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + FeaturesetVersion apply(Context context); + } + + /** + * The FeaturesetVersion update stages. + */ + interface UpdateStages { + /** + * The stage of the FeaturesetVersion update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: [Required] Additional attributes of the entity.. + * + * @param properties [Required] Additional attributes of the entity. + * @return the next definition stage. + */ + Update withProperties(FeaturesetVersionProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + FeaturesetVersion refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + FeaturesetVersion refresh(Context context); + + /** + * Backfill. + * + * @param body Feature set version backfill request entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response payload for creating a backfill request for a given feature set version. + */ + FeaturesetVersionBackfillResponse backfill(FeaturesetVersionBackfillRequest body); + + /** + * Backfill. + * + * @param body Feature set version backfill request entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response payload for creating a backfill request for a given feature set version. + */ + FeaturesetVersionBackfillResponse backfill(FeaturesetVersionBackfillRequest body, Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetVersionBackfillRequest.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetVersionBackfillRequest.java new file mode 100644 index 0000000000000..0fab21a65154e --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetVersionBackfillRequest.java @@ -0,0 +1,335 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Request payload for creating a backfill request for a given feature set version. + */ +@Fluent +public final class FeaturesetVersionBackfillRequest implements JsonSerializable { + /* + * Specified the data availability status that you want to backfill + */ + private List dataAvailabilityStatus; + + /* + * Specifies description + */ + private String description; + + /* + * Specifies description + */ + private String displayName; + + /* + * Specifies the backfill feature window to be materialized + */ + private FeatureWindow featureWindow; + + /* + * Specify the jobId to retry the failed materialization + */ + private String jobId; + + /* + * Specifies the properties + */ + private Map properties; + + /* + * Specifies the compute resource settings + */ + private MaterializationComputeResource resource; + + /* + * Specifies the spark compute settings + */ + private Map sparkConfiguration; + + /* + * Specifies the tags + */ + private Map tags; + + /** + * Creates an instance of FeaturesetVersionBackfillRequest class. + */ + public FeaturesetVersionBackfillRequest() { + } + + /** + * Get the dataAvailabilityStatus property: Specified the data availability status that you want to backfill. + * + * @return the dataAvailabilityStatus value. + */ + public List dataAvailabilityStatus() { + return this.dataAvailabilityStatus; + } + + /** + * Set the dataAvailabilityStatus property: Specified the data availability status that you want to backfill. + * + * @param dataAvailabilityStatus the dataAvailabilityStatus value to set. + * @return the FeaturesetVersionBackfillRequest object itself. + */ + public FeaturesetVersionBackfillRequest + withDataAvailabilityStatus(List dataAvailabilityStatus) { + this.dataAvailabilityStatus = dataAvailabilityStatus; + return this; + } + + /** + * Get the description property: Specifies description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Specifies description. + * + * @param description the description value to set. + * @return the FeaturesetVersionBackfillRequest object itself. + */ + public FeaturesetVersionBackfillRequest withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the displayName property: Specifies description. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Specifies description. + * + * @param displayName the displayName value to set. + * @return the FeaturesetVersionBackfillRequest object itself. + */ + public FeaturesetVersionBackfillRequest withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the featureWindow property: Specifies the backfill feature window to be materialized. + * + * @return the featureWindow value. + */ + public FeatureWindow featureWindow() { + return this.featureWindow; + } + + /** + * Set the featureWindow property: Specifies the backfill feature window to be materialized. + * + * @param featureWindow the featureWindow value to set. + * @return the FeaturesetVersionBackfillRequest object itself. + */ + public FeaturesetVersionBackfillRequest withFeatureWindow(FeatureWindow featureWindow) { + this.featureWindow = featureWindow; + return this; + } + + /** + * Get the jobId property: Specify the jobId to retry the failed materialization. + * + * @return the jobId value. + */ + public String jobId() { + return this.jobId; + } + + /** + * Set the jobId property: Specify the jobId to retry the failed materialization. + * + * @param jobId the jobId value to set. + * @return the FeaturesetVersionBackfillRequest object itself. + */ + public FeaturesetVersionBackfillRequest withJobId(String jobId) { + this.jobId = jobId; + return this; + } + + /** + * Get the properties property: Specifies the properties. + * + * @return the properties value. + */ + public Map properties() { + return this.properties; + } + + /** + * Set the properties property: Specifies the properties. + * + * @param properties the properties value to set. + * @return the FeaturesetVersionBackfillRequest object itself. + */ + public FeaturesetVersionBackfillRequest withProperties(Map properties) { + this.properties = properties; + return this; + } + + /** + * Get the resource property: Specifies the compute resource settings. + * + * @return the resource value. + */ + public MaterializationComputeResource resource() { + return this.resource; + } + + /** + * Set the resource property: Specifies the compute resource settings. + * + * @param resource the resource value to set. + * @return the FeaturesetVersionBackfillRequest object itself. + */ + public FeaturesetVersionBackfillRequest withResource(MaterializationComputeResource resource) { + this.resource = resource; + return this; + } + + /** + * Get the sparkConfiguration property: Specifies the spark compute settings. + * + * @return the sparkConfiguration value. + */ + public Map sparkConfiguration() { + return this.sparkConfiguration; + } + + /** + * Set the sparkConfiguration property: Specifies the spark compute settings. + * + * @param sparkConfiguration the sparkConfiguration value to set. + * @return the FeaturesetVersionBackfillRequest object itself. + */ + public FeaturesetVersionBackfillRequest withSparkConfiguration(Map sparkConfiguration) { + this.sparkConfiguration = sparkConfiguration; + return this; + } + + /** + * Get the tags property: Specifies the tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Specifies the tags. + * + * @param tags the tags value to set. + * @return the FeaturesetVersionBackfillRequest object itself. + */ + public FeaturesetVersionBackfillRequest withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (featureWindow() != null) { + featureWindow().validate(); + } + if (resource() != null) { + resource().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("dataAvailabilityStatus", this.dataAvailabilityStatus, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeJsonField("featureWindow", this.featureWindow); + jsonWriter.writeStringField("jobId", this.jobId); + jsonWriter.writeMapField("properties", this.properties, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("resource", this.resource); + jsonWriter.writeMapField("sparkConfiguration", this.sparkConfiguration, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FeaturesetVersionBackfillRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FeaturesetVersionBackfillRequest if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FeaturesetVersionBackfillRequest. + */ + public static FeaturesetVersionBackfillRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FeaturesetVersionBackfillRequest deserializedFeaturesetVersionBackfillRequest + = new FeaturesetVersionBackfillRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dataAvailabilityStatus".equals(fieldName)) { + List dataAvailabilityStatus + = reader.readArray(reader1 -> DataAvailabilityStatus.fromString(reader1.getString())); + deserializedFeaturesetVersionBackfillRequest.dataAvailabilityStatus = dataAvailabilityStatus; + } else if ("description".equals(fieldName)) { + deserializedFeaturesetVersionBackfillRequest.description = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedFeaturesetVersionBackfillRequest.displayName = reader.getString(); + } else if ("featureWindow".equals(fieldName)) { + deserializedFeaturesetVersionBackfillRequest.featureWindow = FeatureWindow.fromJson(reader); + } else if ("jobId".equals(fieldName)) { + deserializedFeaturesetVersionBackfillRequest.jobId = reader.getString(); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedFeaturesetVersionBackfillRequest.properties = properties; + } else if ("resource".equals(fieldName)) { + deserializedFeaturesetVersionBackfillRequest.resource + = MaterializationComputeResource.fromJson(reader); + } else if ("sparkConfiguration".equals(fieldName)) { + Map sparkConfiguration = reader.readMap(reader1 -> reader1.getString()); + deserializedFeaturesetVersionBackfillRequest.sparkConfiguration = sparkConfiguration; + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedFeaturesetVersionBackfillRequest.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedFeaturesetVersionBackfillRequest; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetVersionBackfillResponse.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetVersionBackfillResponse.java new file mode 100644 index 0000000000000..87510c5b97688 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetVersionBackfillResponse.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetVersionBackfillResponseInner; +import java.util.List; + +/** + * An immutable client-side representation of FeaturesetVersionBackfillResponse. + */ +public interface FeaturesetVersionBackfillResponse { + /** + * Gets the jobIds property: List of jobs submitted as part of the backfill request. + * + * @return the jobIds value. + */ + List jobIds(); + + /** + * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetVersionBackfillResponseInner + * object. + * + * @return the inner object. + */ + FeaturesetVersionBackfillResponseInner innerModel(); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetVersionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetVersionProperties.java new file mode 100644 index 0000000000000..49c64d3d24365 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetVersionProperties.java @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * DTO object representing feature set version. + */ +@Fluent +public final class FeaturesetVersionProperties extends AssetBase { + /* + * Specifies list of entities + */ + private List entities; + + /* + * Specifies the materialization settings + */ + private MaterializationSettings materializationSettings; + + /* + * Provisioning state for the featureset version container. + */ + private AssetProvisioningState provisioningState; + + /* + * Specifies the feature spec details + */ + private FeaturesetSpecification specification; + + /* + * Specifies the asset stage + */ + private String stage; + + /** + * Creates an instance of FeaturesetVersionProperties class. + */ + public FeaturesetVersionProperties() { + } + + /** + * Get the entities property: Specifies list of entities. + * + * @return the entities value. + */ + public List entities() { + return this.entities; + } + + /** + * Set the entities property: Specifies list of entities. + * + * @param entities the entities value to set. + * @return the FeaturesetVersionProperties object itself. + */ + public FeaturesetVersionProperties withEntities(List entities) { + this.entities = entities; + return this; + } + + /** + * Get the materializationSettings property: Specifies the materialization settings. + * + * @return the materializationSettings value. + */ + public MaterializationSettings materializationSettings() { + return this.materializationSettings; + } + + /** + * Set the materializationSettings property: Specifies the materialization settings. + * + * @param materializationSettings the materializationSettings value to set. + * @return the FeaturesetVersionProperties object itself. + */ + public FeaturesetVersionProperties withMaterializationSettings(MaterializationSettings materializationSettings) { + this.materializationSettings = materializationSettings; + return this; + } + + /** + * Get the provisioningState property: Provisioning state for the featureset version container. + * + * @return the provisioningState value. + */ + public AssetProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the specification property: Specifies the feature spec details. + * + * @return the specification value. + */ + public FeaturesetSpecification specification() { + return this.specification; + } + + /** + * Set the specification property: Specifies the feature spec details. + * + * @param specification the specification value to set. + * @return the FeaturesetVersionProperties object itself. + */ + public FeaturesetVersionProperties withSpecification(FeaturesetSpecification specification) { + this.specification = specification; + return this; + } + + /** + * Get the stage property: Specifies the asset stage. + * + * @return the stage value. + */ + public String stage() { + return this.stage; + } + + /** + * Set the stage property: Specifies the asset stage. + * + * @param stage the stage value to set. + * @return the FeaturesetVersionProperties object itself. + */ + public FeaturesetVersionProperties withStage(String stage) { + this.stage = stage; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FeaturesetVersionProperties withIsAnonymous(Boolean isAnonymous) { + super.withIsAnonymous(isAnonymous); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FeaturesetVersionProperties withIsArchived(Boolean isArchived) { + super.withIsArchived(isArchived); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FeaturesetVersionProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FeaturesetVersionProperties withProperties(Map properties) { + super.withProperties(properties); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FeaturesetVersionProperties withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (materializationSettings() != null) { + materializationSettings().validate(); + } + if (specification() != null) { + specification().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("isAnonymous", isAnonymous()); + jsonWriter.writeBooleanField("isArchived", isArchived()); + jsonWriter.writeArrayField("entities", this.entities, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("materializationSettings", this.materializationSettings); + jsonWriter.writeJsonField("specification", this.specification); + jsonWriter.writeStringField("stage", this.stage); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FeaturesetVersionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FeaturesetVersionProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FeaturesetVersionProperties. + */ + public static FeaturesetVersionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FeaturesetVersionProperties deserializedFeaturesetVersionProperties = new FeaturesetVersionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedFeaturesetVersionProperties.withDescription(reader.getString()); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedFeaturesetVersionProperties.withProperties(properties); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedFeaturesetVersionProperties.withTags(tags); + } else if ("isAnonymous".equals(fieldName)) { + deserializedFeaturesetVersionProperties.withIsAnonymous(reader.getNullable(JsonReader::getBoolean)); + } else if ("isArchived".equals(fieldName)) { + deserializedFeaturesetVersionProperties.withIsArchived(reader.getNullable(JsonReader::getBoolean)); + } else if ("entities".equals(fieldName)) { + List entities = reader.readArray(reader1 -> reader1.getString()); + deserializedFeaturesetVersionProperties.entities = entities; + } else if ("materializationSettings".equals(fieldName)) { + deserializedFeaturesetVersionProperties.materializationSettings + = MaterializationSettings.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedFeaturesetVersionProperties.provisioningState + = AssetProvisioningState.fromString(reader.getString()); + } else if ("specification".equals(fieldName)) { + deserializedFeaturesetVersionProperties.specification = FeaturesetSpecification.fromJson(reader); + } else if ("stage".equals(fieldName)) { + deserializedFeaturesetVersionProperties.stage = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFeaturesetVersionProperties; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetVersionResourceArmPaginatedResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetVersionResourceArmPaginatedResult.java new file mode 100644 index 0000000000000..7f808b563d413 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetVersionResourceArmPaginatedResult.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturesetVersionInner; +import java.io.IOException; +import java.util.List; + +/** + * A paginated list of FeaturesetVersion entities. + */ +@Fluent +public final class FeaturesetVersionResourceArmPaginatedResult + implements JsonSerializable { + /* + * The link to the next page of FeaturesetVersion objects. If null, there are no additional pages. + */ + private String nextLink; + + /* + * An array of objects of type FeaturesetVersion. + */ + private List value; + + /** + * Creates an instance of FeaturesetVersionResourceArmPaginatedResult class. + */ + public FeaturesetVersionResourceArmPaginatedResult() { + } + + /** + * Get the nextLink property: The link to the next page of FeaturesetVersion objects. If null, there are no + * additional pages. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of FeaturesetVersion objects. If null, there are no + * additional pages. + * + * @param nextLink the nextLink value to set. + * @return the FeaturesetVersionResourceArmPaginatedResult object itself. + */ + public FeaturesetVersionResourceArmPaginatedResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: An array of objects of type FeaturesetVersion. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of objects of type FeaturesetVersion. + * + * @param value the value value to set. + * @return the FeaturesetVersionResourceArmPaginatedResult object itself. + */ + public FeaturesetVersionResourceArmPaginatedResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FeaturesetVersionResourceArmPaginatedResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FeaturesetVersionResourceArmPaginatedResult if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FeaturesetVersionResourceArmPaginatedResult. + */ + public static FeaturesetVersionResourceArmPaginatedResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FeaturesetVersionResourceArmPaginatedResult deserializedFeaturesetVersionResourceArmPaginatedResult + = new FeaturesetVersionResourceArmPaginatedResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedFeaturesetVersionResourceArmPaginatedResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> FeaturesetVersionInner.fromJson(reader1)); + deserializedFeaturesetVersionResourceArmPaginatedResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedFeaturesetVersionResourceArmPaginatedResult; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetVersions.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetVersions.java new file mode 100644 index 0000000000000..6cd4b95f7a0c3 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturesetVersions.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of FeaturesetVersions. + */ +public interface FeaturesetVersions { + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Featureset name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetVersion entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String name); + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Featureset name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param versionName name for the featureset version. + * @param version featureset version. + * @param description description for the feature set version. + * @param createdBy createdBy user name. + * @param stage Specifies the featurestore stage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturesetVersion entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String name, String skip, + String tags, ListViewType listViewType, Integer pageSize, String versionName, String version, + String description, String createdBy, String stage, Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String name, String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String name, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, String name, + String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + FeaturesetVersion get(String resourceGroupName, String workspaceName, String name, String version); + + /** + * Backfill. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Feature set version backfill request entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response payload for creating a backfill request for a given feature set version. + */ + FeaturesetVersionBackfillResponse backfill(String resourceGroupName, String workspaceName, String name, + String version, FeaturesetVersionBackfillRequest body); + + /** + * Backfill. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Feature set version backfill request entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response payload for creating a backfill request for a given feature set version. + */ + FeaturesetVersionBackfillResponse backfill(String resourceGroupName, String workspaceName, String name, + String version, FeaturesetVersionBackfillRequest body, Context context); + + /** + * Get version. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + FeaturesetVersion getById(String id); + + /** + * Get version. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete version. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete version. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new FeaturesetVersion resource. + * + * @param name resource name. + * @return the first stage of the new FeaturesetVersion definition. + */ + FeaturesetVersion.DefinitionStages.Blank define(String name); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityContainer.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityContainer.java new file mode 100644 index 0000000000000..4dfbe2c9ee578 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityContainer.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturestoreEntityContainerInner; + +/** + * An immutable client-side representation of FeaturestoreEntityContainer. + */ +public interface FeaturestoreEntityContainer { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: [Required] Additional attributes of the entity. + * + * @return the properties value. + */ + FeaturestoreEntityContainerProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.FeaturestoreEntityContainerInner object. + * + * @return the inner object. + */ + FeaturestoreEntityContainerInner innerModel(); + + /** + * The entirety of the FeaturestoreEntityContainer definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * The FeaturestoreEntityContainer definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the FeaturestoreEntityContainer definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the FeaturestoreEntityContainer definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, workspaceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @return the next definition stage. + */ + WithProperties withExistingWorkspace(String resourceGroupName, String workspaceName); + } + + /** + * The stage of the FeaturestoreEntityContainer definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: [Required] Additional attributes of the entity.. + * + * @param properties [Required] Additional attributes of the entity. + * @return the next definition stage. + */ + WithCreate withProperties(FeaturestoreEntityContainerProperties properties); + } + + /** + * The stage of the FeaturestoreEntityContainer definition which contains all the minimum required properties + * for the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate { + /** + * Executes the create request. + * + * @return the created resource. + */ + FeaturestoreEntityContainer create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + FeaturestoreEntityContainer create(Context context); + } + } + + /** + * Begins update for the FeaturestoreEntityContainer resource. + * + * @return the stage of resource update. + */ + FeaturestoreEntityContainer.Update update(); + + /** + * The template for FeaturestoreEntityContainer update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + FeaturestoreEntityContainer apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + FeaturestoreEntityContainer apply(Context context); + } + + /** + * The FeaturestoreEntityContainer update stages. + */ + interface UpdateStages { + /** + * The stage of the FeaturestoreEntityContainer update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: [Required] Additional attributes of the entity.. + * + * @param properties [Required] Additional attributes of the entity. + * @return the next definition stage. + */ + Update withProperties(FeaturestoreEntityContainerProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + FeaturestoreEntityContainer refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + FeaturestoreEntityContainer refresh(Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityContainerProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityContainerProperties.java new file mode 100644 index 0000000000000..87cd24856ee27 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityContainerProperties.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * DTO object representing feature entity. + */ +@Fluent +public final class FeaturestoreEntityContainerProperties extends AssetContainer { + /* + * Provisioning state for the featurestore entity container. + */ + private AssetProvisioningState provisioningState; + + /* + * The latest version inside this container. + */ + private String latestVersion; + + /* + * The next auto incremental version + */ + private String nextVersion; + + /** + * Creates an instance of FeaturestoreEntityContainerProperties class. + */ + public FeaturestoreEntityContainerProperties() { + } + + /** + * Get the provisioningState property: Provisioning state for the featurestore entity container. + * + * @return the provisioningState value. + */ + public AssetProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the latestVersion property: The latest version inside this container. + * + * @return the latestVersion value. + */ + @Override + public String latestVersion() { + return this.latestVersion; + } + + /** + * Get the nextVersion property: The next auto incremental version. + * + * @return the nextVersion value. + */ + @Override + public String nextVersion() { + return this.nextVersion; + } + + /** + * {@inheritDoc} + */ + @Override + public FeaturestoreEntityContainerProperties withIsArchived(Boolean isArchived) { + super.withIsArchived(isArchived); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FeaturestoreEntityContainerProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FeaturestoreEntityContainerProperties withProperties(Map properties) { + super.withProperties(properties); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FeaturestoreEntityContainerProperties withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("isArchived", isArchived()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FeaturestoreEntityContainerProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FeaturestoreEntityContainerProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FeaturestoreEntityContainerProperties. + */ + public static FeaturestoreEntityContainerProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FeaturestoreEntityContainerProperties deserializedFeaturestoreEntityContainerProperties + = new FeaturestoreEntityContainerProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedFeaturestoreEntityContainerProperties.withDescription(reader.getString()); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedFeaturestoreEntityContainerProperties.withProperties(properties); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedFeaturestoreEntityContainerProperties.withTags(tags); + } else if ("isArchived".equals(fieldName)) { + deserializedFeaturestoreEntityContainerProperties + .withIsArchived(reader.getNullable(JsonReader::getBoolean)); + } else if ("latestVersion".equals(fieldName)) { + deserializedFeaturestoreEntityContainerProperties.latestVersion = reader.getString(); + } else if ("nextVersion".equals(fieldName)) { + deserializedFeaturestoreEntityContainerProperties.nextVersion = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedFeaturestoreEntityContainerProperties.provisioningState + = AssetProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedFeaturestoreEntityContainerProperties; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityContainerResourceArmPaginatedResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityContainerResourceArmPaginatedResult.java new file mode 100644 index 0000000000000..b5c4f068fbef6 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityContainerResourceArmPaginatedResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturestoreEntityContainerInner; +import java.io.IOException; +import java.util.List; + +/** + * A paginated list of FeaturestoreEntityContainer entities. + */ +@Fluent +public final class FeaturestoreEntityContainerResourceArmPaginatedResult + implements JsonSerializable { + /* + * The link to the next page of FeaturestoreEntityContainer objects. If null, there are no additional pages. + */ + private String nextLink; + + /* + * An array of objects of type FeaturestoreEntityContainer. + */ + private List value; + + /** + * Creates an instance of FeaturestoreEntityContainerResourceArmPaginatedResult class. + */ + public FeaturestoreEntityContainerResourceArmPaginatedResult() { + } + + /** + * Get the nextLink property: The link to the next page of FeaturestoreEntityContainer objects. If null, there are + * no additional pages. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of FeaturestoreEntityContainer objects. If null, there are + * no additional pages. + * + * @param nextLink the nextLink value to set. + * @return the FeaturestoreEntityContainerResourceArmPaginatedResult object itself. + */ + public FeaturestoreEntityContainerResourceArmPaginatedResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: An array of objects of type FeaturestoreEntityContainer. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of objects of type FeaturestoreEntityContainer. + * + * @param value the value value to set. + * @return the FeaturestoreEntityContainerResourceArmPaginatedResult object itself. + */ + public FeaturestoreEntityContainerResourceArmPaginatedResult + withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FeaturestoreEntityContainerResourceArmPaginatedResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FeaturestoreEntityContainerResourceArmPaginatedResult if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FeaturestoreEntityContainerResourceArmPaginatedResult. + */ + public static FeaturestoreEntityContainerResourceArmPaginatedResult fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + FeaturestoreEntityContainerResourceArmPaginatedResult deserializedFeaturestoreEntityContainerResourceArmPaginatedResult + = new FeaturestoreEntityContainerResourceArmPaginatedResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedFeaturestoreEntityContainerResourceArmPaginatedResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> FeaturestoreEntityContainerInner.fromJson(reader1)); + deserializedFeaturestoreEntityContainerResourceArmPaginatedResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedFeaturestoreEntityContainerResourceArmPaginatedResult; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityContainers.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityContainers.java new file mode 100644 index 0000000000000..a25dc10b4434c --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityContainers.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of FeaturestoreEntityContainers. + */ +public interface FeaturestoreEntityContainers { + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityContainer entities as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * List featurestore entity containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param name name for the featurestore entity. + * @param description description for the featurestore entity. + * @param createdBy createdBy user name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityContainer entities as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String skip, + String tags, ListViewType listViewType, Integer pageSize, String name, String description, String createdBy, + Context context); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String name); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String name, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + Response getEntityWithResponse(String resourceGroupName, String workspaceName, + String name, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container. + */ + FeaturestoreEntityContainer getEntity(String resourceGroupName, String workspaceName, String name); + + /** + * Get container. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + FeaturestoreEntityContainer getEntityById(String id); + + /** + * Get container. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + Response getEntityByIdWithResponse(String id, Context context); + + /** + * Delete container. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete container. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new FeaturestoreEntityContainer resource. + * + * @param name resource name. + * @return the first stage of the new FeaturestoreEntityContainer definition. + */ + FeaturestoreEntityContainer.DefinitionStages.Blank define(String name); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityVersion.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityVersion.java new file mode 100644 index 0000000000000..43e8e959e830c --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityVersion.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturestoreEntityVersionInner; + +/** + * An immutable client-side representation of FeaturestoreEntityVersion. + */ +public interface FeaturestoreEntityVersion { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: [Required] Additional attributes of the entity. + * + * @return the properties value. + */ + FeaturestoreEntityVersionProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.FeaturestoreEntityVersionInner object. + * + * @return the inner object. + */ + FeaturestoreEntityVersionInner innerModel(); + + /** + * The entirety of the FeaturestoreEntityVersion definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * The FeaturestoreEntityVersion definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the FeaturestoreEntityVersion definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the FeaturestoreEntityVersion definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, workspaceName, name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @return the next definition stage. + */ + WithProperties withExistingFeaturestoreEntity(String resourceGroupName, String workspaceName, String name); + } + + /** + * The stage of the FeaturestoreEntityVersion definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: [Required] Additional attributes of the entity.. + * + * @param properties [Required] Additional attributes of the entity. + * @return the next definition stage. + */ + WithCreate withProperties(FeaturestoreEntityVersionProperties properties); + } + + /** + * The stage of the FeaturestoreEntityVersion definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate { + /** + * Executes the create request. + * + * @return the created resource. + */ + FeaturestoreEntityVersion create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + FeaturestoreEntityVersion create(Context context); + } + } + + /** + * Begins update for the FeaturestoreEntityVersion resource. + * + * @return the stage of resource update. + */ + FeaturestoreEntityVersion.Update update(); + + /** + * The template for FeaturestoreEntityVersion update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + FeaturestoreEntityVersion apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + FeaturestoreEntityVersion apply(Context context); + } + + /** + * The FeaturestoreEntityVersion update stages. + */ + interface UpdateStages { + /** + * The stage of the FeaturestoreEntityVersion update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: [Required] Additional attributes of the entity.. + * + * @param properties [Required] Additional attributes of the entity. + * @return the next definition stage. + */ + Update withProperties(FeaturestoreEntityVersionProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + FeaturestoreEntityVersion refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + FeaturestoreEntityVersion refresh(Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityVersionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityVersionProperties.java new file mode 100644 index 0000000000000..88684c9e1f454 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityVersionProperties.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * DTO object representing feature entity version. + */ +@Fluent +public final class FeaturestoreEntityVersionProperties extends AssetBase { + /* + * Specifies index columns + */ + private List indexColumns; + + /* + * Provisioning state for the featurestore entity version. + */ + private AssetProvisioningState provisioningState; + + /* + * Specifies the asset stage + */ + private String stage; + + /** + * Creates an instance of FeaturestoreEntityVersionProperties class. + */ + public FeaturestoreEntityVersionProperties() { + } + + /** + * Get the indexColumns property: Specifies index columns. + * + * @return the indexColumns value. + */ + public List indexColumns() { + return this.indexColumns; + } + + /** + * Set the indexColumns property: Specifies index columns. + * + * @param indexColumns the indexColumns value to set. + * @return the FeaturestoreEntityVersionProperties object itself. + */ + public FeaturestoreEntityVersionProperties withIndexColumns(List indexColumns) { + this.indexColumns = indexColumns; + return this; + } + + /** + * Get the provisioningState property: Provisioning state for the featurestore entity version. + * + * @return the provisioningState value. + */ + public AssetProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the stage property: Specifies the asset stage. + * + * @return the stage value. + */ + public String stage() { + return this.stage; + } + + /** + * Set the stage property: Specifies the asset stage. + * + * @param stage the stage value to set. + * @return the FeaturestoreEntityVersionProperties object itself. + */ + public FeaturestoreEntityVersionProperties withStage(String stage) { + this.stage = stage; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FeaturestoreEntityVersionProperties withIsAnonymous(Boolean isAnonymous) { + super.withIsAnonymous(isAnonymous); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FeaturestoreEntityVersionProperties withIsArchived(Boolean isArchived) { + super.withIsArchived(isArchived); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FeaturestoreEntityVersionProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FeaturestoreEntityVersionProperties withProperties(Map properties) { + super.withProperties(properties); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FeaturestoreEntityVersionProperties withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (indexColumns() != null) { + indexColumns().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("isAnonymous", isAnonymous()); + jsonWriter.writeBooleanField("isArchived", isArchived()); + jsonWriter.writeArrayField("indexColumns", this.indexColumns, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("stage", this.stage); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FeaturestoreEntityVersionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FeaturestoreEntityVersionProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FeaturestoreEntityVersionProperties. + */ + public static FeaturestoreEntityVersionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FeaturestoreEntityVersionProperties deserializedFeaturestoreEntityVersionProperties + = new FeaturestoreEntityVersionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedFeaturestoreEntityVersionProperties.withDescription(reader.getString()); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedFeaturestoreEntityVersionProperties.withProperties(properties); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedFeaturestoreEntityVersionProperties.withTags(tags); + } else if ("isAnonymous".equals(fieldName)) { + deserializedFeaturestoreEntityVersionProperties + .withIsAnonymous(reader.getNullable(JsonReader::getBoolean)); + } else if ("isArchived".equals(fieldName)) { + deserializedFeaturestoreEntityVersionProperties + .withIsArchived(reader.getNullable(JsonReader::getBoolean)); + } else if ("indexColumns".equals(fieldName)) { + List indexColumns = reader.readArray(reader1 -> IndexColumn.fromJson(reader1)); + deserializedFeaturestoreEntityVersionProperties.indexColumns = indexColumns; + } else if ("provisioningState".equals(fieldName)) { + deserializedFeaturestoreEntityVersionProperties.provisioningState + = AssetProvisioningState.fromString(reader.getString()); + } else if ("stage".equals(fieldName)) { + deserializedFeaturestoreEntityVersionProperties.stage = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFeaturestoreEntityVersionProperties; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityVersionResourceArmPaginatedResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityVersionResourceArmPaginatedResult.java new file mode 100644 index 0000000000000..1346ed89fc27d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityVersionResourceArmPaginatedResult.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.machinelearning.fluent.models.FeaturestoreEntityVersionInner; +import java.io.IOException; +import java.util.List; + +/** + * A paginated list of FeaturestoreEntityVersion entities. + */ +@Fluent +public final class FeaturestoreEntityVersionResourceArmPaginatedResult + implements JsonSerializable { + /* + * The link to the next page of FeaturestoreEntityVersion objects. If null, there are no additional pages. + */ + private String nextLink; + + /* + * An array of objects of type FeaturestoreEntityVersion. + */ + private List value; + + /** + * Creates an instance of FeaturestoreEntityVersionResourceArmPaginatedResult class. + */ + public FeaturestoreEntityVersionResourceArmPaginatedResult() { + } + + /** + * Get the nextLink property: The link to the next page of FeaturestoreEntityVersion objects. If null, there are no + * additional pages. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of FeaturestoreEntityVersion objects. If null, there are no + * additional pages. + * + * @param nextLink the nextLink value to set. + * @return the FeaturestoreEntityVersionResourceArmPaginatedResult object itself. + */ + public FeaturestoreEntityVersionResourceArmPaginatedResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: An array of objects of type FeaturestoreEntityVersion. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of objects of type FeaturestoreEntityVersion. + * + * @param value the value value to set. + * @return the FeaturestoreEntityVersionResourceArmPaginatedResult object itself. + */ + public FeaturestoreEntityVersionResourceArmPaginatedResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FeaturestoreEntityVersionResourceArmPaginatedResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FeaturestoreEntityVersionResourceArmPaginatedResult if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FeaturestoreEntityVersionResourceArmPaginatedResult. + */ + public static FeaturestoreEntityVersionResourceArmPaginatedResult fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + FeaturestoreEntityVersionResourceArmPaginatedResult deserializedFeaturestoreEntityVersionResourceArmPaginatedResult + = new FeaturestoreEntityVersionResourceArmPaginatedResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedFeaturestoreEntityVersionResourceArmPaginatedResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> FeaturestoreEntityVersionInner.fromJson(reader1)); + deserializedFeaturestoreEntityVersionResourceArmPaginatedResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedFeaturestoreEntityVersionResourceArmPaginatedResult; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityVersions.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityVersions.java new file mode 100644 index 0000000000000..66b3383d2c865 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturestoreEntityVersions.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of FeaturestoreEntityVersions. + */ +public interface FeaturestoreEntityVersions { + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Feature entity name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityVersion entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String name); + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Feature entity name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param pageSize page size. + * @param versionName name for the featurestore entity version. + * @param version featurestore entity version. + * @param description description for the feature entity version. + * @param createdBy createdBy user name. + * @param stage Specifies the featurestore stage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of FeaturestoreEntityVersion entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String name, + String skip, String tags, ListViewType listViewType, Integer pageSize, String versionName, String version, + String description, String createdBy, String stage, Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String name, String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String name, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, String name, + String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + FeaturestoreEntityVersion get(String resourceGroupName, String workspaceName, String name, String version); + + /** + * Get version. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + FeaturestoreEntityVersion getById(String id); + + /** + * Get version. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete version. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete version. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new FeaturestoreEntityVersion resource. + * + * @param name resource name. + * @return the first stage of the new FeaturestoreEntityVersion definition. + */ + FeaturestoreEntityVersion.DefinitionStages.Blank define(String name); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturizationMode.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturizationMode.java index 8ca6e116bb449..d5638921fc097 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturizationMode.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturizationMode.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Featurization mode - determines data featurization mode. */ +/** + * Featurization mode - determines data featurization mode. + */ public final class FeaturizationMode extends ExpandableStringEnum { - /** Static value Auto for FeaturizationMode. */ + /** + * Static value Auto for FeaturizationMode. + */ public static final FeaturizationMode AUTO = fromString("Auto"); - /** Static value Custom for FeaturizationMode. */ + /** + * Static value Custom for FeaturizationMode. + */ public static final FeaturizationMode CUSTOM = fromString("Custom"); - /** Static value Off for FeaturizationMode. */ + /** + * Static value Off for FeaturizationMode. + */ public static final FeaturizationMode OFF = fromString("Off"); /** * Creates a new instance of FeaturizationMode value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public FeaturizationMode() { /** * Creates or finds a FeaturizationMode from its string representation. - * + * * @param name a name to look for. * @return the corresponding FeaturizationMode. */ - @JsonCreator public static FeaturizationMode fromString(String name) { return fromString(name, FeaturizationMode.class); } /** * Gets known FeaturizationMode values. - * + * * @return known FeaturizationMode values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturizationSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturizationSettings.java index 49b68df8ae441..9e561ceaaf188 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturizationSettings.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FeaturizationSettings.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Featurization Configuration. */ +/** + * Featurization Configuration. + */ @Fluent -public class FeaturizationSettings { +public class FeaturizationSettings implements JsonSerializable { /* * Dataset language, useful for the text data. */ - @JsonProperty(value = "datasetLanguage") private String datasetLanguage; - /** Creates an instance of FeaturizationSettings class. */ + /** + * Creates an instance of FeaturizationSettings class. + */ public FeaturizationSettings() { } /** * Get the datasetLanguage property: Dataset language, useful for the text data. - * + * * @return the datasetLanguage value. */ public String datasetLanguage() { @@ -31,7 +38,7 @@ public String datasetLanguage() { /** * Set the datasetLanguage property: Dataset language, useful for the text data. - * + * * @param datasetLanguage the datasetLanguage value to set. * @return the FeaturizationSettings object itself. */ @@ -42,9 +49,45 @@ public FeaturizationSettings withDatasetLanguage(String datasetLanguage) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("datasetLanguage", this.datasetLanguage); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FeaturizationSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FeaturizationSettings if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the FeaturizationSettings. + */ + public static FeaturizationSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FeaturizationSettings deserializedFeaturizationSettings = new FeaturizationSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("datasetLanguage".equals(fieldName)) { + deserializedFeaturizationSettings.datasetLanguage = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFeaturizationSettings; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FineTuningJob.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FineTuningJob.java new file mode 100644 index 0000000000000..5260dc51352df --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FineTuningJob.java @@ -0,0 +1,377 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * FineTuning Job definition. + */ +@Fluent +public final class FineTuningJob extends JobBaseProperties { + /* + * [Required] Specifies the type of job. + */ + private JobType jobType = JobType.FINE_TUNING; + + /* + * [Required] + */ + private FineTuningVertical fineTuningDetails; + + /* + * Instance types and other resources for the job + */ + private JobResources resources; + + /* + * Queue settings for the job + */ + private QueueSettings queueSettings; + + /* + * [Required] + */ + private Map outputs; + + /* + * Status of the job. + */ + private JobStatus status; + + /** + * Creates an instance of FineTuningJob class. + */ + public FineTuningJob() { + } + + /** + * Get the jobType property: [Required] Specifies the type of job. + * + * @return the jobType value. + */ + @Override + public JobType jobType() { + return this.jobType; + } + + /** + * Get the fineTuningDetails property: [Required]. + * + * @return the fineTuningDetails value. + */ + public FineTuningVertical fineTuningDetails() { + return this.fineTuningDetails; + } + + /** + * Set the fineTuningDetails property: [Required]. + * + * @param fineTuningDetails the fineTuningDetails value to set. + * @return the FineTuningJob object itself. + */ + public FineTuningJob withFineTuningDetails(FineTuningVertical fineTuningDetails) { + this.fineTuningDetails = fineTuningDetails; + return this; + } + + /** + * Get the resources property: Instance types and other resources for the job. + * + * @return the resources value. + */ + public JobResources resources() { + return this.resources; + } + + /** + * Set the resources property: Instance types and other resources for the job. + * + * @param resources the resources value to set. + * @return the FineTuningJob object itself. + */ + public FineTuningJob withResources(JobResources resources) { + this.resources = resources; + return this; + } + + /** + * Get the queueSettings property: Queue settings for the job. + * + * @return the queueSettings value. + */ + public QueueSettings queueSettings() { + return this.queueSettings; + } + + /** + * Set the queueSettings property: Queue settings for the job. + * + * @param queueSettings the queueSettings value to set. + * @return the FineTuningJob object itself. + */ + public FineTuningJob withQueueSettings(QueueSettings queueSettings) { + this.queueSettings = queueSettings; + return this; + } + + /** + * Get the outputs property: [Required]. + * + * @return the outputs value. + */ + public Map outputs() { + return this.outputs; + } + + /** + * Set the outputs property: [Required]. + * + * @param outputs the outputs value to set. + * @return the FineTuningJob object itself. + */ + public FineTuningJob withOutputs(Map outputs) { + this.outputs = outputs; + return this; + } + + /** + * Get the status property: Status of the job. + * + * @return the status value. + */ + @Override + public JobStatus status() { + return this.status; + } + + /** + * {@inheritDoc} + */ + @Override + public FineTuningJob withComponentId(String componentId) { + super.withComponentId(componentId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FineTuningJob withComputeId(String computeId) { + super.withComputeId(computeId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FineTuningJob withDisplayName(String displayName) { + super.withDisplayName(displayName); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FineTuningJob withExperimentName(String experimentName) { + super.withExperimentName(experimentName); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FineTuningJob withIdentity(IdentityConfiguration identity) { + super.withIdentity(identity); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FineTuningJob withIsArchived(Boolean isArchived) { + super.withIsArchived(isArchived); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FineTuningJob withNotificationSetting(NotificationSetting notificationSetting) { + super.withNotificationSetting(notificationSetting); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FineTuningJob withServices(Map services) { + super.withServices(services); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FineTuningJob withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FineTuningJob withProperties(Map properties) { + super.withProperties(properties); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FineTuningJob withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (fineTuningDetails() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property fineTuningDetails in model FineTuningJob")); + } else { + fineTuningDetails().validate(); + } + if (resources() != null) { + resources().validate(); + } + if (queueSettings() != null) { + queueSettings().validate(); + } + if (outputs() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property outputs in model FineTuningJob")); + } else { + outputs().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FineTuningJob.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("componentId", componentId()); + jsonWriter.writeStringField("computeId", computeId()); + jsonWriter.writeStringField("displayName", displayName()); + jsonWriter.writeStringField("experimentName", experimentName()); + jsonWriter.writeJsonField("identity", identity()); + jsonWriter.writeBooleanField("isArchived", isArchived()); + jsonWriter.writeJsonField("notificationSetting", notificationSetting()); + jsonWriter.writeMapField("services", services(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("fineTuningDetails", this.fineTuningDetails); + jsonWriter.writeMapField("outputs", this.outputs, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("jobType", this.jobType == null ? null : this.jobType.toString()); + jsonWriter.writeJsonField("resources", this.resources); + jsonWriter.writeJsonField("queueSettings", this.queueSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FineTuningJob from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FineTuningJob if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FineTuningJob. + */ + public static FineTuningJob fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FineTuningJob deserializedFineTuningJob = new FineTuningJob(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedFineTuningJob.withDescription(reader.getString()); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedFineTuningJob.withProperties(properties); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedFineTuningJob.withTags(tags); + } else if ("componentId".equals(fieldName)) { + deserializedFineTuningJob.withComponentId(reader.getString()); + } else if ("computeId".equals(fieldName)) { + deserializedFineTuningJob.withComputeId(reader.getString()); + } else if ("displayName".equals(fieldName)) { + deserializedFineTuningJob.withDisplayName(reader.getString()); + } else if ("experimentName".equals(fieldName)) { + deserializedFineTuningJob.withExperimentName(reader.getString()); + } else if ("identity".equals(fieldName)) { + deserializedFineTuningJob.withIdentity(IdentityConfiguration.fromJson(reader)); + } else if ("isArchived".equals(fieldName)) { + deserializedFineTuningJob.withIsArchived(reader.getNullable(JsonReader::getBoolean)); + } else if ("notificationSetting".equals(fieldName)) { + deserializedFineTuningJob.withNotificationSetting(NotificationSetting.fromJson(reader)); + } else if ("services".equals(fieldName)) { + Map services = reader.readMap(reader1 -> JobService.fromJson(reader1)); + deserializedFineTuningJob.withServices(services); + } else if ("status".equals(fieldName)) { + deserializedFineTuningJob.status = JobStatus.fromString(reader.getString()); + } else if ("fineTuningDetails".equals(fieldName)) { + deserializedFineTuningJob.fineTuningDetails = FineTuningVertical.fromJson(reader); + } else if ("outputs".equals(fieldName)) { + Map outputs = reader.readMap(reader1 -> JobOutput.fromJson(reader1)); + deserializedFineTuningJob.outputs = outputs; + } else if ("jobType".equals(fieldName)) { + deserializedFineTuningJob.jobType = JobType.fromString(reader.getString()); + } else if ("resources".equals(fieldName)) { + deserializedFineTuningJob.resources = JobResources.fromJson(reader); + } else if ("queueSettings".equals(fieldName)) { + deserializedFineTuningJob.queueSettings = QueueSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFineTuningJob; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FineTuningTaskType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FineTuningTaskType.java new file mode 100644 index 0000000000000..f85ce1cdd1030 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FineTuningTaskType.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for FineTuningTaskType. + */ +public final class FineTuningTaskType extends ExpandableStringEnum { + /** + * Static value ChatCompletion for FineTuningTaskType. + */ + public static final FineTuningTaskType CHAT_COMPLETION = fromString("ChatCompletion"); + + /** + * Static value TextCompletion for FineTuningTaskType. + */ + public static final FineTuningTaskType TEXT_COMPLETION = fromString("TextCompletion"); + + /** + * Static value TextClassification for FineTuningTaskType. + */ + public static final FineTuningTaskType TEXT_CLASSIFICATION = fromString("TextClassification"); + + /** + * Static value QuestionAnswering for FineTuningTaskType. + */ + public static final FineTuningTaskType QUESTION_ANSWERING = fromString("QuestionAnswering"); + + /** + * Static value TextSummarization for FineTuningTaskType. + */ + public static final FineTuningTaskType TEXT_SUMMARIZATION = fromString("TextSummarization"); + + /** + * Static value TokenClassification for FineTuningTaskType. + */ + public static final FineTuningTaskType TOKEN_CLASSIFICATION = fromString("TokenClassification"); + + /** + * Static value TextTranslation for FineTuningTaskType. + */ + public static final FineTuningTaskType TEXT_TRANSLATION = fromString("TextTranslation"); + + /** + * Static value ImageClassification for FineTuningTaskType. + */ + public static final FineTuningTaskType IMAGE_CLASSIFICATION = fromString("ImageClassification"); + + /** + * Static value ImageInstanceSegmentation for FineTuningTaskType. + */ + public static final FineTuningTaskType IMAGE_INSTANCE_SEGMENTATION = fromString("ImageInstanceSegmentation"); + + /** + * Static value ImageObjectDetection for FineTuningTaskType. + */ + public static final FineTuningTaskType IMAGE_OBJECT_DETECTION = fromString("ImageObjectDetection"); + + /** + * Static value VideoMultiObjectTracking for FineTuningTaskType. + */ + public static final FineTuningTaskType VIDEO_MULTI_OBJECT_TRACKING = fromString("VideoMultiObjectTracking"); + + /** + * Creates a new instance of FineTuningTaskType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FineTuningTaskType() { + } + + /** + * Creates or finds a FineTuningTaskType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FineTuningTaskType. + */ + public static FineTuningTaskType fromString(String name) { + return fromString(name, FineTuningTaskType.class); + } + + /** + * Gets known FineTuningTaskType values. + * + * @return known FineTuningTaskType values. + */ + public static Collection values() { + return values(FineTuningTaskType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FineTuningVertical.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FineTuningVertical.java new file mode 100644 index 0000000000000..36974fab893d6 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FineTuningVertical.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The FineTuningVertical model. + */ +@Fluent +public class FineTuningVertical implements JsonSerializable { + /* + * [Required] Enum to determine the type of fine tuning. + */ + private ModelProvider modelProvider = ModelProvider.fromString("FineTuningVertical"); + + /* + * [Required] Fine tuning task type. + */ + private FineTuningTaskType taskType; + + /* + * [Required] Training data for fine tuning. + */ + private JobInput trainingData; + + /* + * Validation data for fine tuning. + */ + private JobInput validationData; + + /* + * [Required] Input model for fine tuning. + */ + private MLFlowModelJobInput model; + + /** + * Creates an instance of FineTuningVertical class. + */ + public FineTuningVertical() { + } + + /** + * Get the modelProvider property: [Required] Enum to determine the type of fine tuning. + * + * @return the modelProvider value. + */ + public ModelProvider modelProvider() { + return this.modelProvider; + } + + /** + * Get the taskType property: [Required] Fine tuning task type. + * + * @return the taskType value. + */ + public FineTuningTaskType taskType() { + return this.taskType; + } + + /** + * Set the taskType property: [Required] Fine tuning task type. + * + * @param taskType the taskType value to set. + * @return the FineTuningVertical object itself. + */ + public FineTuningVertical withTaskType(FineTuningTaskType taskType) { + this.taskType = taskType; + return this; + } + + /** + * Get the trainingData property: [Required] Training data for fine tuning. + * + * @return the trainingData value. + */ + public JobInput trainingData() { + return this.trainingData; + } + + /** + * Set the trainingData property: [Required] Training data for fine tuning. + * + * @param trainingData the trainingData value to set. + * @return the FineTuningVertical object itself. + */ + public FineTuningVertical withTrainingData(JobInput trainingData) { + this.trainingData = trainingData; + return this; + } + + /** + * Get the validationData property: Validation data for fine tuning. + * + * @return the validationData value. + */ + public JobInput validationData() { + return this.validationData; + } + + /** + * Set the validationData property: Validation data for fine tuning. + * + * @param validationData the validationData value to set. + * @return the FineTuningVertical object itself. + */ + public FineTuningVertical withValidationData(JobInput validationData) { + this.validationData = validationData; + return this; + } + + /** + * Get the model property: [Required] Input model for fine tuning. + * + * @return the model value. + */ + public MLFlowModelJobInput model() { + return this.model; + } + + /** + * Set the model property: [Required] Input model for fine tuning. + * + * @param model the model value to set. + * @return the FineTuningVertical object itself. + */ + public FineTuningVertical withModel(MLFlowModelJobInput model) { + this.model = model; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (taskType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property taskType in model FineTuningVertical")); + } + if (trainingData() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property trainingData in model FineTuningVertical")); + } else { + trainingData().validate(); + } + if (validationData() != null) { + validationData().validate(); + } + if (model() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property model in model FineTuningVertical")); + } else { + model().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FineTuningVertical.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); + jsonWriter.writeJsonField("trainingData", this.trainingData); + jsonWriter.writeJsonField("model", this.model); + jsonWriter.writeStringField("modelProvider", this.modelProvider == null ? null : this.modelProvider.toString()); + jsonWriter.writeJsonField("validationData", this.validationData); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FineTuningVertical from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FineTuningVertical if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FineTuningVertical. + */ + public static FineTuningVertical fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("modelProvider".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("AzureOpenAI".equals(discriminatorValue)) { + return AzureOpenAiFineTuning.fromJson(readerToUse.reset()); + } else if ("Custom".equals(discriminatorValue)) { + return CustomModelFineTuning.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static FineTuningVertical fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FineTuningVertical deserializedFineTuningVertical = new FineTuningVertical(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("taskType".equals(fieldName)) { + deserializedFineTuningVertical.taskType = FineTuningTaskType.fromString(reader.getString()); + } else if ("trainingData".equals(fieldName)) { + deserializedFineTuningVertical.trainingData = JobInput.fromJson(reader); + } else if ("model".equals(fieldName)) { + deserializedFineTuningVertical.model = MLFlowModelJobInput.fromJson(reader); + } else if ("modelProvider".equals(fieldName)) { + deserializedFineTuningVertical.modelProvider = ModelProvider.fromString(reader.getString()); + } else if ("validationData".equals(fieldName)) { + deserializedFineTuningVertical.validationData = JobInput.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFineTuningVertical; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FixedInputData.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FixedInputData.java new file mode 100644 index 0000000000000..3330c8541a6bc --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FixedInputData.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Fixed input data definition. + */ +@Fluent +public final class FixedInputData extends MonitoringInputDataBase { + /* + * [Required] Specifies the type of signal to monitor. + */ + private MonitoringInputDataType inputDataType = MonitoringInputDataType.FIXED; + + /** + * Creates an instance of FixedInputData class. + */ + public FixedInputData() { + } + + /** + * Get the inputDataType property: [Required] Specifies the type of signal to monitor. + * + * @return the inputDataType value. + */ + @Override + public MonitoringInputDataType inputDataType() { + return this.inputDataType; + } + + /** + * {@inheritDoc} + */ + @Override + public FixedInputData withColumns(Map columns) { + super.withColumns(columns); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FixedInputData withDataContext(String dataContext) { + super.withDataContext(dataContext); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FixedInputData withJobInputType(JobInputType jobInputType) { + super.withJobInputType(jobInputType); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FixedInputData withUri(String uri) { + super.withUri(uri); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("jobInputType", jobInputType() == null ? null : jobInputType().toString()); + jsonWriter.writeStringField("uri", uri()); + jsonWriter.writeMapField("columns", columns(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("dataContext", dataContext()); + jsonWriter.writeStringField("inputDataType", this.inputDataType == null ? null : this.inputDataType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FixedInputData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FixedInputData if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FixedInputData. + */ + public static FixedInputData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FixedInputData deserializedFixedInputData = new FixedInputData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("jobInputType".equals(fieldName)) { + deserializedFixedInputData.withJobInputType(JobInputType.fromString(reader.getString())); + } else if ("uri".equals(fieldName)) { + deserializedFixedInputData.withUri(reader.getString()); + } else if ("columns".equals(fieldName)) { + Map columns = reader.readMap(reader1 -> reader1.getString()); + deserializedFixedInputData.withColumns(columns); + } else if ("dataContext".equals(fieldName)) { + deserializedFixedInputData.withDataContext(reader.getString()); + } else if ("inputDataType".equals(fieldName)) { + deserializedFixedInputData.inputDataType = MonitoringInputDataType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedFixedInputData; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FlavorData.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FlavorData.java index 24c41610e5530..1da887f6d2536 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FlavorData.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FlavorData.java @@ -5,27 +5,32 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** The FlavorData model. */ +/** + * The FlavorData model. + */ @Fluent -public final class FlavorData { +public final class FlavorData implements JsonSerializable { /* * Model flavor-specific data. */ - @JsonProperty(value = "data") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map data; - /** Creates an instance of FlavorData class. */ + /** + * Creates an instance of FlavorData class. + */ public FlavorData() { } /** * Get the data property: Model flavor-specific data. - * + * * @return the data value. */ public Map data() { @@ -34,7 +39,7 @@ public Map data() { /** * Set the data property: Model flavor-specific data. - * + * * @param data the data value to set. * @return the FlavorData object itself. */ @@ -45,9 +50,46 @@ public FlavorData withData(Map data) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("data", this.data, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FlavorData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FlavorData if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the FlavorData. + */ + public static FlavorData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FlavorData deserializedFlavorData = new FlavorData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("data".equals(fieldName)) { + Map data = reader.readMap(reader1 -> reader1.getString()); + deserializedFlavorData.data = data; + } else { + reader.skipChildren(); + } + } + + return deserializedFlavorData; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ForecastHorizon.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ForecastHorizon.java index 6bb995553e44d..d648c8be3c2e9 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ForecastHorizon.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ForecastHorizon.java @@ -5,32 +5,105 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The desired maximum forecast horizon in units of time-series frequency. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "mode", - defaultImpl = ForecastHorizon.class) -@JsonTypeName("ForecastHorizon") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "Auto", value = AutoForecastHorizon.class), - @JsonSubTypes.Type(name = "Custom", value = CustomForecastHorizon.class) -}) +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The desired maximum forecast horizon in units of time-series frequency. + */ @Immutable -public class ForecastHorizon { - /** Creates an instance of ForecastHorizon class. */ +public class ForecastHorizon implements JsonSerializable { + /* + * [Required] Set forecast horizon value selection mode. + */ + private ForecastHorizonMode mode = ForecastHorizonMode.fromString("ForecastHorizon"); + + /** + * Creates an instance of ForecastHorizon class. + */ public ForecastHorizon() { } + /** + * Get the mode property: [Required] Set forecast horizon value selection mode. + * + * @return the mode value. + */ + public ForecastHorizonMode mode() { + return this.mode; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ForecastHorizon from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ForecastHorizon if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ForecastHorizon. + */ + public static ForecastHorizon fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("mode".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Auto".equals(discriminatorValue)) { + return AutoForecastHorizon.fromJson(readerToUse.reset()); + } else if ("Custom".equals(discriminatorValue)) { + return CustomForecastHorizon.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static ForecastHorizon fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ForecastHorizon deserializedForecastHorizon = new ForecastHorizon(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("mode".equals(fieldName)) { + deserializedForecastHorizon.mode = ForecastHorizonMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedForecastHorizon; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ForecastHorizonMode.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ForecastHorizonMode.java index f1a66b8d5fb61..593850044112c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ForecastHorizonMode.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ForecastHorizonMode.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Enum to determine forecast horizon selection mode. */ +/** + * Enum to determine forecast horizon selection mode. + */ public final class ForecastHorizonMode extends ExpandableStringEnum { - /** Static value Auto for ForecastHorizonMode. */ + /** + * Static value Auto for ForecastHorizonMode. + */ public static final ForecastHorizonMode AUTO = fromString("Auto"); - /** Static value Custom for ForecastHorizonMode. */ + /** + * Static value Custom for ForecastHorizonMode. + */ public static final ForecastHorizonMode CUSTOM = fromString("Custom"); /** * Creates a new instance of ForecastHorizonMode value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public ForecastHorizonMode() { /** * Creates or finds a ForecastHorizonMode from its string representation. - * + * * @param name a name to look for. * @return the corresponding ForecastHorizonMode. */ - @JsonCreator public static ForecastHorizonMode fromString(String name) { return fromString(name, ForecastHorizonMode.class); } /** * Gets known ForecastHorizonMode values. - * + * * @return known ForecastHorizonMode values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Forecasting.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Forecasting.java index 0f9bf8e05d7ed..7aa1ef79910e4 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Forecasting.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Forecasting.java @@ -5,63 +5,61 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** Forecasting task in AutoML Table vertical. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") -@JsonTypeName("Forecasting") +/** + * Forecasting task in AutoML Table vertical. + */ @Fluent public final class Forecasting extends AutoMLVertical { + /* + * [Required] Task type for AutoMLJob. + */ + private TaskType taskType = TaskType.FORECASTING; + /* * Forecasting task specific inputs. */ - @JsonProperty(value = "forecastingSettings") private ForecastingSettings forecastingSettings; /* * Primary metric for forecasting task. */ - @JsonProperty(value = "primaryMetric") private ForecastingPrimaryMetrics primaryMetric; /* * Inputs for training phase for an AutoML Job. */ - @JsonProperty(value = "trainingSettings") private ForecastingTrainingSettings trainingSettings; /* * Columns to use for CVSplit data. */ - @JsonProperty(value = "cvSplitColumnNames") private List cvSplitColumnNames; /* * Featurization inputs needed for AutoML job. */ - @JsonProperty(value = "featurizationSettings") private TableVerticalFeaturizationSettings featurizationSettings; /* * Execution constraints for AutoMLJob. */ - @JsonProperty(value = "limitSettings") private TableVerticalLimitSettings limitSettings; /* * Number of cross validation folds to be applied on training dataset * when validation dataset is not provided. */ - @JsonProperty(value = "nCrossValidations") private NCrossValidations nCrossValidations; /* * Test data input. */ - @JsonProperty(value = "testData") private MLTableJobInput testData; /* @@ -69,13 +67,11 @@ public final class Forecasting extends AutoMLVertical { * Values between (0.0 , 1.0) * Applied when validation dataset is not provided. */ - @JsonProperty(value = "testDataSize") private Double testDataSize; /* * Validation data inputs. */ - @JsonProperty(value = "validationData") private MLTableJobInput validationData; /* @@ -83,23 +79,33 @@ public final class Forecasting extends AutoMLVertical { * Values between (0.0 , 1.0) * Applied when validation dataset is not provided. */ - @JsonProperty(value = "validationDataSize") private Double validationDataSize; /* * 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. */ - @JsonProperty(value = "weightColumnName") private String weightColumnName; - /** Creates an instance of Forecasting class. */ + /** + * Creates an instance of Forecasting class. + */ public Forecasting() { } + /** + * Get the taskType property: [Required] Task type for AutoMLJob. + * + * @return the taskType value. + */ + @Override + public TaskType taskType() { + return this.taskType; + } + /** * Get the forecastingSettings property: Forecasting task specific inputs. - * + * * @return the forecastingSettings value. */ public ForecastingSettings forecastingSettings() { @@ -108,7 +114,7 @@ public ForecastingSettings forecastingSettings() { /** * Set the forecastingSettings property: Forecasting task specific inputs. - * + * * @param forecastingSettings the forecastingSettings value to set. * @return the Forecasting object itself. */ @@ -119,7 +125,7 @@ public Forecasting withForecastingSettings(ForecastingSettings forecastingSettin /** * Get the primaryMetric property: Primary metric for forecasting task. - * + * * @return the primaryMetric value. */ public ForecastingPrimaryMetrics primaryMetric() { @@ -128,7 +134,7 @@ public ForecastingPrimaryMetrics primaryMetric() { /** * Set the primaryMetric property: Primary metric for forecasting task. - * + * * @param primaryMetric the primaryMetric value to set. * @return the Forecasting object itself. */ @@ -139,7 +145,7 @@ public Forecasting withPrimaryMetric(ForecastingPrimaryMetrics primaryMetric) { /** * Get the trainingSettings property: Inputs for training phase for an AutoML Job. - * + * * @return the trainingSettings value. */ public ForecastingTrainingSettings trainingSettings() { @@ -148,7 +154,7 @@ public ForecastingTrainingSettings trainingSettings() { /** * Set the trainingSettings property: Inputs for training phase for an AutoML Job. - * + * * @param trainingSettings the trainingSettings value to set. * @return the Forecasting object itself. */ @@ -159,7 +165,7 @@ public Forecasting withTrainingSettings(ForecastingTrainingSettings trainingSett /** * Get the cvSplitColumnNames property: Columns to use for CVSplit data. - * + * * @return the cvSplitColumnNames value. */ public List cvSplitColumnNames() { @@ -168,7 +174,7 @@ public List cvSplitColumnNames() { /** * Set the cvSplitColumnNames property: Columns to use for CVSplit data. - * + * * @param cvSplitColumnNames the cvSplitColumnNames value to set. * @return the Forecasting object itself. */ @@ -179,7 +185,7 @@ public Forecasting withCvSplitColumnNames(List cvSplitColumnNames) { /** * Get the featurizationSettings property: Featurization inputs needed for AutoML job. - * + * * @return the featurizationSettings value. */ public TableVerticalFeaturizationSettings featurizationSettings() { @@ -188,7 +194,7 @@ public TableVerticalFeaturizationSettings featurizationSettings() { /** * Set the featurizationSettings property: Featurization inputs needed for AutoML job. - * + * * @param featurizationSettings the featurizationSettings value to set. * @return the Forecasting object itself. */ @@ -199,7 +205,7 @@ public Forecasting withFeaturizationSettings(TableVerticalFeaturizationSettings /** * Get the limitSettings property: Execution constraints for AutoMLJob. - * + * * @return the limitSettings value. */ public TableVerticalLimitSettings limitSettings() { @@ -208,7 +214,7 @@ public TableVerticalLimitSettings limitSettings() { /** * Set the limitSettings property: Execution constraints for AutoMLJob. - * + * * @param limitSettings the limitSettings value to set. * @return the Forecasting object itself. */ @@ -218,9 +224,9 @@ public Forecasting withLimitSettings(TableVerticalLimitSettings limitSettings) { } /** - * Get the nCrossValidations property: Number of cross validation folds to be applied on training dataset when - * validation dataset is not provided. - * + * Get the nCrossValidations property: Number of cross validation folds to be applied on training dataset + * when validation dataset is not provided. + * * @return the nCrossValidations value. */ public NCrossValidations nCrossValidations() { @@ -228,9 +234,9 @@ public NCrossValidations nCrossValidations() { } /** - * Set the nCrossValidations property: Number of cross validation folds to be applied on training dataset when - * validation dataset is not provided. - * + * Set the nCrossValidations property: Number of cross validation folds to be applied on training dataset + * when validation dataset is not provided. + * * @param nCrossValidations the nCrossValidations value to set. * @return the Forecasting object itself. */ @@ -241,7 +247,7 @@ public Forecasting withNCrossValidations(NCrossValidations nCrossValidations) { /** * Get the testData property: Test data input. - * + * * @return the testData value. */ public MLTableJobInput testData() { @@ -250,7 +256,7 @@ public MLTableJobInput testData() { /** * Set the testData property: Test data input. - * + * * @param testData the testData value to set. * @return the Forecasting object itself. */ @@ -261,8 +267,9 @@ public Forecasting withTestData(MLTableJobInput testData) { /** * Get the testDataSize property: 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. - * + * Values between (0.0 , 1.0) + * Applied when validation dataset is not provided. + * * @return the testDataSize value. */ public Double testDataSize() { @@ -271,8 +278,9 @@ public Double testDataSize() { /** * Set the testDataSize property: 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. - * + * Values between (0.0 , 1.0) + * Applied when validation dataset is not provided. + * * @param testDataSize the testDataSize value to set. * @return the Forecasting object itself. */ @@ -283,7 +291,7 @@ public Forecasting withTestDataSize(Double testDataSize) { /** * Get the validationData property: Validation data inputs. - * + * * @return the validationData value. */ public MLTableJobInput validationData() { @@ -292,7 +300,7 @@ public MLTableJobInput validationData() { /** * Set the validationData property: Validation data inputs. - * + * * @param validationData the validationData value to set. * @return the Forecasting object itself. */ @@ -303,8 +311,10 @@ public Forecasting withValidationData(MLTableJobInput validationData) { /** * Get the validationDataSize property: 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. - * + * purpose. + * Values between (0.0 , 1.0) + * Applied when validation dataset is not provided. + * * @return the validationDataSize value. */ public Double validationDataSize() { @@ -313,8 +323,10 @@ public Double validationDataSize() { /** * Set the validationDataSize property: 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. - * + * purpose. + * Values between (0.0 , 1.0) + * Applied when validation dataset is not provided. + * * @param validationDataSize the validationDataSize value to set. * @return the Forecasting object itself. */ @@ -326,7 +338,7 @@ public Forecasting withValidationDataSize(Double validationDataSize) { /** * Get the weightColumnName property: 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. - * + * * @return the weightColumnName value. */ public String weightColumnName() { @@ -336,7 +348,7 @@ public String weightColumnName() { /** * Set the weightColumnName property: 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. - * + * * @param weightColumnName the weightColumnName value to set. * @return the Forecasting object itself. */ @@ -345,21 +357,27 @@ public Forecasting withWeightColumnName(String weightColumnName) { return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public Forecasting withLogVerbosity(LogVerbosity logVerbosity) { super.withLogVerbosity(logVerbosity); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public Forecasting withTargetColumnName(String targetColumnName) { super.withTargetColumnName(targetColumnName); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public Forecasting withTrainingData(MLTableJobInput trainingData) { super.withTrainingData(trainingData); @@ -368,7 +386,7 @@ public Forecasting withTrainingData(MLTableJobInput trainingData) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -396,4 +414,88 @@ public void validate() { validationData().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("trainingData", trainingData()); + jsonWriter.writeStringField("logVerbosity", logVerbosity() == null ? null : logVerbosity().toString()); + jsonWriter.writeStringField("targetColumnName", targetColumnName()); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); + jsonWriter.writeJsonField("forecastingSettings", this.forecastingSettings); + jsonWriter.writeStringField("primaryMetric", this.primaryMetric == null ? null : this.primaryMetric.toString()); + jsonWriter.writeJsonField("trainingSettings", this.trainingSettings); + jsonWriter.writeArrayField("cvSplitColumnNames", this.cvSplitColumnNames, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("featurizationSettings", this.featurizationSettings); + jsonWriter.writeJsonField("limitSettings", this.limitSettings); + jsonWriter.writeJsonField("nCrossValidations", this.nCrossValidations); + jsonWriter.writeJsonField("testData", this.testData); + jsonWriter.writeNumberField("testDataSize", this.testDataSize); + jsonWriter.writeJsonField("validationData", this.validationData); + jsonWriter.writeNumberField("validationDataSize", this.validationDataSize); + jsonWriter.writeStringField("weightColumnName", this.weightColumnName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Forecasting from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Forecasting if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Forecasting. + */ + public static Forecasting fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Forecasting deserializedForecasting = new Forecasting(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("trainingData".equals(fieldName)) { + deserializedForecasting.withTrainingData(MLTableJobInput.fromJson(reader)); + } else if ("logVerbosity".equals(fieldName)) { + deserializedForecasting.withLogVerbosity(LogVerbosity.fromString(reader.getString())); + } else if ("targetColumnName".equals(fieldName)) { + deserializedForecasting.withTargetColumnName(reader.getString()); + } else if ("taskType".equals(fieldName)) { + deserializedForecasting.taskType = TaskType.fromString(reader.getString()); + } else if ("forecastingSettings".equals(fieldName)) { + deserializedForecasting.forecastingSettings = ForecastingSettings.fromJson(reader); + } else if ("primaryMetric".equals(fieldName)) { + deserializedForecasting.primaryMetric = ForecastingPrimaryMetrics.fromString(reader.getString()); + } else if ("trainingSettings".equals(fieldName)) { + deserializedForecasting.trainingSettings = ForecastingTrainingSettings.fromJson(reader); + } else if ("cvSplitColumnNames".equals(fieldName)) { + List cvSplitColumnNames = reader.readArray(reader1 -> reader1.getString()); + deserializedForecasting.cvSplitColumnNames = cvSplitColumnNames; + } else if ("featurizationSettings".equals(fieldName)) { + deserializedForecasting.featurizationSettings = TableVerticalFeaturizationSettings.fromJson(reader); + } else if ("limitSettings".equals(fieldName)) { + deserializedForecasting.limitSettings = TableVerticalLimitSettings.fromJson(reader); + } else if ("nCrossValidations".equals(fieldName)) { + deserializedForecasting.nCrossValidations = NCrossValidations.fromJson(reader); + } else if ("testData".equals(fieldName)) { + deserializedForecasting.testData = MLTableJobInput.fromJson(reader); + } else if ("testDataSize".equals(fieldName)) { + deserializedForecasting.testDataSize = reader.getNullable(JsonReader::getDouble); + } else if ("validationData".equals(fieldName)) { + deserializedForecasting.validationData = MLTableJobInput.fromJson(reader); + } else if ("validationDataSize".equals(fieldName)) { + deserializedForecasting.validationDataSize = reader.getNullable(JsonReader::getDouble); + } else if ("weightColumnName".equals(fieldName)) { + deserializedForecasting.weightColumnName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedForecasting; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ForecastingModels.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ForecastingModels.java index d75b3fdec7a46..35d93cbc2f82f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ForecastingModels.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ForecastingModels.java @@ -5,71 +5,110 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Enum for all forecasting models supported by AutoML. */ +/** + * Enum for all forecasting models supported by AutoML. + */ public final class ForecastingModels extends ExpandableStringEnum { - /** Static value AutoArima for ForecastingModels. */ + /** + * Static value AutoArima for ForecastingModels. + */ public static final ForecastingModels AUTO_ARIMA = fromString("AutoArima"); - /** Static value Prophet for ForecastingModels. */ + /** + * Static value Prophet for ForecastingModels. + */ public static final ForecastingModels PROPHET = fromString("Prophet"); - /** Static value Naive for ForecastingModels. */ + /** + * Static value Naive for ForecastingModels. + */ public static final ForecastingModels NAIVE = fromString("Naive"); - /** Static value SeasonalNaive for ForecastingModels. */ + /** + * Static value SeasonalNaive for ForecastingModels. + */ public static final ForecastingModels SEASONAL_NAIVE = fromString("SeasonalNaive"); - /** Static value Average for ForecastingModels. */ + /** + * Static value Average for ForecastingModels. + */ public static final ForecastingModels AVERAGE = fromString("Average"); - /** Static value SeasonalAverage for ForecastingModels. */ + /** + * Static value SeasonalAverage for ForecastingModels. + */ public static final ForecastingModels SEASONAL_AVERAGE = fromString("SeasonalAverage"); - /** Static value ExponentialSmoothing for ForecastingModels. */ + /** + * Static value ExponentialSmoothing for ForecastingModels. + */ public static final ForecastingModels EXPONENTIAL_SMOOTHING = fromString("ExponentialSmoothing"); - /** Static value Arimax for ForecastingModels. */ + /** + * Static value Arimax for ForecastingModels. + */ public static final ForecastingModels ARIMAX = fromString("Arimax"); - /** Static value TCNForecaster for ForecastingModels. */ + /** + * Static value TCNForecaster for ForecastingModels. + */ public static final ForecastingModels TCNFORECASTER = fromString("TCNForecaster"); - /** Static value ElasticNet for ForecastingModels. */ + /** + * Static value ElasticNet for ForecastingModels. + */ public static final ForecastingModels ELASTIC_NET = fromString("ElasticNet"); - /** Static value GradientBoosting for ForecastingModels. */ + /** + * Static value GradientBoosting for ForecastingModels. + */ public static final ForecastingModels GRADIENT_BOOSTING = fromString("GradientBoosting"); - /** Static value DecisionTree for ForecastingModels. */ + /** + * Static value DecisionTree for ForecastingModels. + */ public static final ForecastingModels DECISION_TREE = fromString("DecisionTree"); - /** Static value KNN for ForecastingModels. */ + /** + * Static value KNN for ForecastingModels. + */ public static final ForecastingModels KNN = fromString("KNN"); - /** Static value LassoLars for ForecastingModels. */ + /** + * Static value LassoLars for ForecastingModels. + */ public static final ForecastingModels LASSO_LARS = fromString("LassoLars"); - /** Static value SGD for ForecastingModels. */ + /** + * Static value SGD for ForecastingModels. + */ public static final ForecastingModels SGD = fromString("SGD"); - /** Static value RandomForest for ForecastingModels. */ + /** + * Static value RandomForest for ForecastingModels. + */ public static final ForecastingModels RANDOM_FOREST = fromString("RandomForest"); - /** Static value ExtremeRandomTrees for ForecastingModels. */ + /** + * Static value ExtremeRandomTrees for ForecastingModels. + */ public static final ForecastingModels EXTREME_RANDOM_TREES = fromString("ExtremeRandomTrees"); - /** Static value LightGBM for ForecastingModels. */ + /** + * Static value LightGBM for ForecastingModels. + */ public static final ForecastingModels LIGHT_GBM = fromString("LightGBM"); - /** Static value XGBoostRegressor for ForecastingModels. */ + /** + * Static value XGBoostRegressor for ForecastingModels. + */ public static final ForecastingModels XGBOOST_REGRESSOR = fromString("XGBoostRegressor"); /** * Creates a new instance of ForecastingModels value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -78,18 +117,17 @@ public ForecastingModels() { /** * Creates or finds a ForecastingModels from its string representation. - * + * * @param name a name to look for. * @return the corresponding ForecastingModels. */ - @JsonCreator public static ForecastingModels fromString(String name) { return fromString(name, ForecastingModels.class); } /** * Gets known ForecastingModels values. - * + * * @return known ForecastingModels values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ForecastingPrimaryMetrics.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ForecastingPrimaryMetrics.java index 79f633ca4d448..97883cd1a5619 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ForecastingPrimaryMetrics.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ForecastingPrimaryMetrics.java @@ -5,28 +5,37 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Primary metrics for Forecasting task. */ +/** + * Primary metrics for Forecasting task. + */ public final class ForecastingPrimaryMetrics extends ExpandableStringEnum { - /** Static value SpearmanCorrelation for ForecastingPrimaryMetrics. */ + /** + * Static value SpearmanCorrelation for ForecastingPrimaryMetrics. + */ public static final ForecastingPrimaryMetrics SPEARMAN_CORRELATION = fromString("SpearmanCorrelation"); - /** Static value NormalizedRootMeanSquaredError for ForecastingPrimaryMetrics. */ - public static final ForecastingPrimaryMetrics NORMALIZED_ROOT_MEAN_SQUARED_ERROR = - fromString("NormalizedRootMeanSquaredError"); + /** + * Static value NormalizedRootMeanSquaredError for ForecastingPrimaryMetrics. + */ + public static final ForecastingPrimaryMetrics NORMALIZED_ROOT_MEAN_SQUARED_ERROR + = fromString("NormalizedRootMeanSquaredError"); - /** Static value R2Score for ForecastingPrimaryMetrics. */ + /** + * Static value R2Score for ForecastingPrimaryMetrics. + */ public static final ForecastingPrimaryMetrics R2SCORE = fromString("R2Score"); - /** Static value NormalizedMeanAbsoluteError for ForecastingPrimaryMetrics. */ - public static final ForecastingPrimaryMetrics NORMALIZED_MEAN_ABSOLUTE_ERROR = - fromString("NormalizedMeanAbsoluteError"); + /** + * Static value NormalizedMeanAbsoluteError for ForecastingPrimaryMetrics. + */ + public static final ForecastingPrimaryMetrics NORMALIZED_MEAN_ABSOLUTE_ERROR + = fromString("NormalizedMeanAbsoluteError"); /** * Creates a new instance of ForecastingPrimaryMetrics value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -35,18 +44,17 @@ public ForecastingPrimaryMetrics() { /** * Creates or finds a ForecastingPrimaryMetrics from its string representation. - * + * * @param name a name to look for. * @return the corresponding ForecastingPrimaryMetrics. */ - @JsonCreator public static ForecastingPrimaryMetrics fromString(String name) { return fromString(name, ForecastingPrimaryMetrics.class); } /** * Gets known ForecastingPrimaryMetrics values. - * + * * @return known ForecastingPrimaryMetrics values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ForecastingSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ForecastingSettings.java index b611d6da822aa..78d19ef2521f1 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ForecastingSettings.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ForecastingSettings.java @@ -5,17 +5,22 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** Forecasting specific parameters. */ +/** + * Forecasting specific parameters. + */ @Fluent -public final class ForecastingSettings { +public final class ForecastingSettings implements JsonSerializable { /* * Country or region for holidays for forecasting tasks. * These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. */ - @JsonProperty(value = "countryOrRegionForHolidays") private String countryOrRegionForHolidays; /* @@ -23,39 +28,33 @@ public final class ForecastingSettings { * example, if `CVStepSize` = 3 for daily data, the origin time for each fold will be * three days apart. */ - @JsonProperty(value = "cvStepSize") private Integer cvStepSize; /* * Flag for generating lags for the numeric features with 'auto' or null. */ - @JsonProperty(value = "featureLags") private FeatureLags featureLags; /* * The desired maximum forecast horizon in units of time-series frequency. */ - @JsonProperty(value = "forecastHorizon") private ForecastHorizon forecastHorizon; /* * 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. */ - @JsonProperty(value = "frequency") private String frequency; /* * Set time series seasonality as an integer multiple of the series frequency. * If seasonality is set to 'auto', it will be inferred. */ - @JsonProperty(value = "seasonality") private Seasonality seasonality; /* * The parameter defining how if AutoML should handle short time series. */ - @JsonProperty(value = "shortSeriesHandlingConfig") private ShortSeriesHandlingConfiguration shortSeriesHandlingConfig; /* @@ -63,26 +62,22 @@ public final class ForecastingSettings { * If the TargetAggregateFunction is set i.e. not 'None', but the freq parameter is not set, the error is raised. * The possible target aggregation functions are: "sum", "max", "min" and "mean". */ - @JsonProperty(value = "targetAggregateFunction") private TargetAggregationFunction targetAggregateFunction; /* * The number of past periods to lag from the target column. */ - @JsonProperty(value = "targetLags") private TargetLags targetLags; /* * The number of past periods used to create a rolling window average of the target column. */ - @JsonProperty(value = "targetRollingWindowSize") private TargetRollingWindowSize targetRollingWindowSize; /* * The name of the time column. This parameter is required when forecasting to specify the datetime column in the * input data used for building the time series and inferring its frequency. */ - @JsonProperty(value = "timeColumnName") private String timeColumnName; /* @@ -90,23 +85,23 @@ public final class ForecastingSettings { * If grain is not defined, the data set is assumed to be one time-series. This parameter is used with task type * forecasting. */ - @JsonProperty(value = "timeSeriesIdColumnNames") private List timeSeriesIdColumnNames; /* * Configure STL Decomposition of the time-series target column. */ - @JsonProperty(value = "useStl") private UseStl useStl; - /** Creates an instance of ForecastingSettings class. */ + /** + * Creates an instance of ForecastingSettings class. + */ public ForecastingSettings() { } /** - * Get the countryOrRegionForHolidays property: Country or region for holidays for forecasting tasks. These should - * be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. - * + * Get the countryOrRegionForHolidays property: Country or region for holidays for forecasting tasks. + * These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. + * * @return the countryOrRegionForHolidays value. */ public String countryOrRegionForHolidays() { @@ -114,9 +109,9 @@ public String countryOrRegionForHolidays() { } /** - * Set the countryOrRegionForHolidays property: Country or region for holidays for forecasting tasks. These should - * be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. - * + * Set the countryOrRegionForHolidays property: Country or region for holidays for forecasting tasks. + * These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. + * * @param countryOrRegionForHolidays the countryOrRegionForHolidays value to set. * @return the ForecastingSettings object itself. */ @@ -127,8 +122,9 @@ public ForecastingSettings withCountryOrRegionForHolidays(String countryOrRegion /** * Get the cvStepSize property: 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. - * + * example, if `CVStepSize` = 3 for daily data, the origin time for each fold will be + * three days apart. + * * @return the cvStepSize value. */ public Integer cvStepSize() { @@ -137,8 +133,9 @@ public Integer cvStepSize() { /** * Set the cvStepSize property: 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. - * + * example, if `CVStepSize` = 3 for daily data, the origin time for each fold will be + * three days apart. + * * @param cvStepSize the cvStepSize value to set. * @return the ForecastingSettings object itself. */ @@ -149,7 +146,7 @@ public ForecastingSettings withCvStepSize(Integer cvStepSize) { /** * Get the featureLags property: Flag for generating lags for the numeric features with 'auto' or null. - * + * * @return the featureLags value. */ public FeatureLags featureLags() { @@ -158,7 +155,7 @@ public FeatureLags featureLags() { /** * Set the featureLags property: Flag for generating lags for the numeric features with 'auto' or null. - * + * * @param featureLags the featureLags value to set. * @return the ForecastingSettings object itself. */ @@ -169,7 +166,7 @@ public ForecastingSettings withFeatureLags(FeatureLags featureLags) { /** * Get the forecastHorizon property: The desired maximum forecast horizon in units of time-series frequency. - * + * * @return the forecastHorizon value. */ public ForecastHorizon forecastHorizon() { @@ -178,7 +175,7 @@ public ForecastHorizon forecastHorizon() { /** * Set the forecastHorizon property: The desired maximum forecast horizon in units of time-series frequency. - * + * * @param forecastHorizon the forecastHorizon value to set. * @return the ForecastingSettings object itself. */ @@ -190,7 +187,7 @@ public ForecastingSettings withForecastHorizon(ForecastHorizon forecastHorizon) /** * Get the frequency property: 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. - * + * * @return the frequency value. */ public String frequency() { @@ -200,7 +197,7 @@ public String frequency() { /** * Set the frequency property: 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. - * + * * @param frequency the frequency value to set. * @return the ForecastingSettings object itself. */ @@ -210,9 +207,9 @@ public ForecastingSettings withFrequency(String frequency) { } /** - * Get the seasonality property: Set time series seasonality as an integer multiple of the series frequency. If - * seasonality is set to 'auto', it will be inferred. - * + * Get the seasonality property: Set time series seasonality as an integer multiple of the series frequency. + * If seasonality is set to 'auto', it will be inferred. + * * @return the seasonality value. */ public Seasonality seasonality() { @@ -220,9 +217,9 @@ public Seasonality seasonality() { } /** - * Set the seasonality property: Set time series seasonality as an integer multiple of the series frequency. If - * seasonality is set to 'auto', it will be inferred. - * + * Set the seasonality property: Set time series seasonality as an integer multiple of the series frequency. + * If seasonality is set to 'auto', it will be inferred. + * * @param seasonality the seasonality value to set. * @return the ForecastingSettings object itself. */ @@ -233,7 +230,7 @@ public ForecastingSettings withSeasonality(Seasonality seasonality) { /** * Get the shortSeriesHandlingConfig property: The parameter defining how if AutoML should handle short time series. - * + * * @return the shortSeriesHandlingConfig value. */ public ShortSeriesHandlingConfiguration shortSeriesHandlingConfig() { @@ -242,22 +239,22 @@ public ShortSeriesHandlingConfiguration shortSeriesHandlingConfig() { /** * Set the shortSeriesHandlingConfig property: The parameter defining how if AutoML should handle short time series. - * + * * @param shortSeriesHandlingConfig the shortSeriesHandlingConfig value to set. * @return the ForecastingSettings object itself. */ - public ForecastingSettings withShortSeriesHandlingConfig( - ShortSeriesHandlingConfiguration shortSeriesHandlingConfig) { + public ForecastingSettings + withShortSeriesHandlingConfig(ShortSeriesHandlingConfiguration shortSeriesHandlingConfig) { this.shortSeriesHandlingConfig = shortSeriesHandlingConfig; return this; } /** * Get the targetAggregateFunction property: 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, the error is raised. The possible target aggregation functions are: "sum", "max", "min" and - * "mean". - * + * conform to a user specified frequency. + * If the TargetAggregateFunction is set i.e. not 'None', but the freq parameter is not set, the error is raised. + * The possible target aggregation functions are: "sum", "max", "min" and "mean". + * * @return the targetAggregateFunction value. */ public TargetAggregationFunction targetAggregateFunction() { @@ -266,10 +263,10 @@ public TargetAggregationFunction targetAggregateFunction() { /** * Set the targetAggregateFunction property: 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, the error is raised. The possible target aggregation functions are: "sum", "max", "min" and - * "mean". - * + * conform to a user specified frequency. + * If the TargetAggregateFunction is set i.e. not 'None', but the freq parameter is not set, the error is raised. + * The possible target aggregation functions are: "sum", "max", "min" and "mean". + * * @param targetAggregateFunction the targetAggregateFunction value to set. * @return the ForecastingSettings object itself. */ @@ -280,7 +277,7 @@ public ForecastingSettings withTargetAggregateFunction(TargetAggregationFunction /** * Get the targetLags property: The number of past periods to lag from the target column. - * + * * @return the targetLags value. */ public TargetLags targetLags() { @@ -289,7 +286,7 @@ public TargetLags targetLags() { /** * Set the targetLags property: The number of past periods to lag from the target column. - * + * * @param targetLags the targetLags value to set. * @return the ForecastingSettings object itself. */ @@ -301,7 +298,7 @@ public ForecastingSettings withTargetLags(TargetLags targetLags) { /** * Get the targetRollingWindowSize property: The number of past periods used to create a rolling window average of * the target column. - * + * * @return the targetRollingWindowSize value. */ public TargetRollingWindowSize targetRollingWindowSize() { @@ -311,7 +308,7 @@ public TargetRollingWindowSize targetRollingWindowSize() { /** * Set the targetRollingWindowSize property: The number of past periods used to create a rolling window average of * the target column. - * + * * @param targetRollingWindowSize the targetRollingWindowSize value to set. * @return the ForecastingSettings object itself. */ @@ -323,7 +320,7 @@ public ForecastingSettings withTargetRollingWindowSize(TargetRollingWindowSize t /** * Get the timeColumnName property: The name of the time column. This parameter is required when forecasting to * specify the datetime column in the input data used for building the time series and inferring its frequency. - * + * * @return the timeColumnName value. */ public String timeColumnName() { @@ -333,7 +330,7 @@ public String timeColumnName() { /** * Set the timeColumnName property: The name of the time column. This parameter is required when forecasting to * specify the datetime column in the input data used for building the time series and inferring its frequency. - * + * * @param timeColumnName the timeColumnName value to set. * @return the ForecastingSettings object itself. */ @@ -344,9 +341,10 @@ public ForecastingSettings withTimeColumnName(String timeColumnName) { /** * Get the timeSeriesIdColumnNames property: The names of columns used to group a timeseries. It can be used to - * create multiple series. If grain is not defined, the data set is assumed to be one time-series. This parameter is - * used with task type forecasting. - * + * create multiple series. + * If grain is not defined, the data set is assumed to be one time-series. This parameter is used with task type + * forecasting. + * * @return the timeSeriesIdColumnNames value. */ public List timeSeriesIdColumnNames() { @@ -355,9 +353,10 @@ public List timeSeriesIdColumnNames() { /** * Set the timeSeriesIdColumnNames property: The names of columns used to group a timeseries. It can be used to - * create multiple series. If grain is not defined, the data set is assumed to be one time-series. This parameter is - * used with task type forecasting. - * + * create multiple series. + * If grain is not defined, the data set is assumed to be one time-series. This parameter is used with task type + * forecasting. + * * @param timeSeriesIdColumnNames the timeSeriesIdColumnNames value to set. * @return the ForecastingSettings object itself. */ @@ -368,7 +367,7 @@ public ForecastingSettings withTimeSeriesIdColumnNames(List timeSeriesId /** * Get the useStl property: Configure STL Decomposition of the time-series target column. - * + * * @return the useStl value. */ public UseStl useStl() { @@ -377,7 +376,7 @@ public UseStl useStl() { /** * Set the useStl property: Configure STL Decomposition of the time-series target column. - * + * * @param useStl the useStl value to set. * @return the ForecastingSettings object itself. */ @@ -388,7 +387,7 @@ public ForecastingSettings withUseStl(UseStl useStl) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -405,4 +404,82 @@ public void validate() { targetRollingWindowSize().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("countryOrRegionForHolidays", this.countryOrRegionForHolidays); + jsonWriter.writeNumberField("cvStepSize", this.cvStepSize); + jsonWriter.writeStringField("featureLags", this.featureLags == null ? null : this.featureLags.toString()); + jsonWriter.writeJsonField("forecastHorizon", this.forecastHorizon); + jsonWriter.writeStringField("frequency", this.frequency); + jsonWriter.writeJsonField("seasonality", this.seasonality); + jsonWriter.writeStringField("shortSeriesHandlingConfig", + this.shortSeriesHandlingConfig == null ? null : this.shortSeriesHandlingConfig.toString()); + jsonWriter.writeStringField("targetAggregateFunction", + this.targetAggregateFunction == null ? null : this.targetAggregateFunction.toString()); + jsonWriter.writeJsonField("targetLags", this.targetLags); + jsonWriter.writeJsonField("targetRollingWindowSize", this.targetRollingWindowSize); + jsonWriter.writeStringField("timeColumnName", this.timeColumnName); + jsonWriter.writeArrayField("timeSeriesIdColumnNames", this.timeSeriesIdColumnNames, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("useStl", this.useStl == null ? null : this.useStl.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ForecastingSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ForecastingSettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ForecastingSettings. + */ + public static ForecastingSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ForecastingSettings deserializedForecastingSettings = new ForecastingSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("countryOrRegionForHolidays".equals(fieldName)) { + deserializedForecastingSettings.countryOrRegionForHolidays = reader.getString(); + } else if ("cvStepSize".equals(fieldName)) { + deserializedForecastingSettings.cvStepSize = reader.getNullable(JsonReader::getInt); + } else if ("featureLags".equals(fieldName)) { + deserializedForecastingSettings.featureLags = FeatureLags.fromString(reader.getString()); + } else if ("forecastHorizon".equals(fieldName)) { + deserializedForecastingSettings.forecastHorizon = ForecastHorizon.fromJson(reader); + } else if ("frequency".equals(fieldName)) { + deserializedForecastingSettings.frequency = reader.getString(); + } else if ("seasonality".equals(fieldName)) { + deserializedForecastingSettings.seasonality = Seasonality.fromJson(reader); + } else if ("shortSeriesHandlingConfig".equals(fieldName)) { + deserializedForecastingSettings.shortSeriesHandlingConfig + = ShortSeriesHandlingConfiguration.fromString(reader.getString()); + } else if ("targetAggregateFunction".equals(fieldName)) { + deserializedForecastingSettings.targetAggregateFunction + = TargetAggregationFunction.fromString(reader.getString()); + } else if ("targetLags".equals(fieldName)) { + deserializedForecastingSettings.targetLags = TargetLags.fromJson(reader); + } else if ("targetRollingWindowSize".equals(fieldName)) { + deserializedForecastingSettings.targetRollingWindowSize = TargetRollingWindowSize.fromJson(reader); + } else if ("timeColumnName".equals(fieldName)) { + deserializedForecastingSettings.timeColumnName = reader.getString(); + } else if ("timeSeriesIdColumnNames".equals(fieldName)) { + List timeSeriesIdColumnNames = reader.readArray(reader1 -> reader1.getString()); + deserializedForecastingSettings.timeSeriesIdColumnNames = timeSeriesIdColumnNames; + } else if ("useStl".equals(fieldName)) { + deserializedForecastingSettings.useStl = UseStl.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedForecastingSettings; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ForecastingTrainingSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ForecastingTrainingSettings.java index baf43d0f6fbfe..51b25c6e82122 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ForecastingTrainingSettings.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ForecastingTrainingSettings.java @@ -5,32 +5,38 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.Duration; import java.util.List; -/** Forecasting Training related configuration. */ +/** + * Forecasting Training related configuration. + */ @Fluent public final class ForecastingTrainingSettings extends TrainingSettings { /* * Allowed models for forecasting task. */ - @JsonProperty(value = "allowedTrainingAlgorithms") private List allowedTrainingAlgorithms; /* * Blocked models for forecasting task. */ - @JsonProperty(value = "blockedTrainingAlgorithms") private List blockedTrainingAlgorithms; - /** Creates an instance of ForecastingTrainingSettings class. */ + /** + * Creates an instance of ForecastingTrainingSettings class. + */ public ForecastingTrainingSettings() { } /** * Get the allowedTrainingAlgorithms property: Allowed models for forecasting task. - * + * * @return the allowedTrainingAlgorithms value. */ public List allowedTrainingAlgorithms() { @@ -39,19 +45,19 @@ public List allowedTrainingAlgorithms() { /** * Set the allowedTrainingAlgorithms property: Allowed models for forecasting task. - * + * * @param allowedTrainingAlgorithms the allowedTrainingAlgorithms value to set. * @return the ForecastingTrainingSettings object itself. */ - public ForecastingTrainingSettings withAllowedTrainingAlgorithms( - List allowedTrainingAlgorithms) { + public ForecastingTrainingSettings + withAllowedTrainingAlgorithms(List allowedTrainingAlgorithms) { this.allowedTrainingAlgorithms = allowedTrainingAlgorithms; return this; } /** * Get the blockedTrainingAlgorithms property: Blocked models for forecasting task. - * + * * @return the blockedTrainingAlgorithms value. */ public List blockedTrainingAlgorithms() { @@ -60,59 +66,73 @@ public List blockedTrainingAlgorithms() { /** * Set the blockedTrainingAlgorithms property: Blocked models for forecasting task. - * + * * @param blockedTrainingAlgorithms the blockedTrainingAlgorithms value to set. * @return the ForecastingTrainingSettings object itself. */ - public ForecastingTrainingSettings withBlockedTrainingAlgorithms( - List blockedTrainingAlgorithms) { + public ForecastingTrainingSettings + withBlockedTrainingAlgorithms(List blockedTrainingAlgorithms) { this.blockedTrainingAlgorithms = blockedTrainingAlgorithms; return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ForecastingTrainingSettings withEnableDnnTraining(Boolean enableDnnTraining) { super.withEnableDnnTraining(enableDnnTraining); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ForecastingTrainingSettings withEnableModelExplainability(Boolean enableModelExplainability) { super.withEnableModelExplainability(enableModelExplainability); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ForecastingTrainingSettings withEnableOnnxCompatibleModels(Boolean enableOnnxCompatibleModels) { super.withEnableOnnxCompatibleModels(enableOnnxCompatibleModels); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ForecastingTrainingSettings withEnableStackEnsemble(Boolean enableStackEnsemble) { super.withEnableStackEnsemble(enableStackEnsemble); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ForecastingTrainingSettings withEnableVoteEnsemble(Boolean enableVoteEnsemble) { super.withEnableVoteEnsemble(enableVoteEnsemble); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ForecastingTrainingSettings withEnsembleModelDownloadTimeout(Duration ensembleModelDownloadTimeout) { super.withEnsembleModelDownloadTimeout(ensembleModelDownloadTimeout); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ForecastingTrainingSettings withStackEnsembleSettings(StackEnsembleSettings stackEnsembleSettings) { super.withStackEnsembleSettings(stackEnsembleSettings); @@ -121,11 +141,85 @@ public ForecastingTrainingSettings withStackEnsembleSettings(StackEnsembleSettin /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enableDnnTraining", enableDnnTraining()); + jsonWriter.writeBooleanField("enableModelExplainability", enableModelExplainability()); + jsonWriter.writeBooleanField("enableOnnxCompatibleModels", enableOnnxCompatibleModels()); + jsonWriter.writeBooleanField("enableStackEnsemble", enableStackEnsemble()); + jsonWriter.writeBooleanField("enableVoteEnsemble", enableVoteEnsemble()); + jsonWriter.writeStringField("ensembleModelDownloadTimeout", + CoreUtils.durationToStringWithDays(ensembleModelDownloadTimeout())); + jsonWriter.writeJsonField("stackEnsembleSettings", stackEnsembleSettings()); + jsonWriter.writeArrayField("allowedTrainingAlgorithms", this.allowedTrainingAlgorithms, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("blockedTrainingAlgorithms", this.blockedTrainingAlgorithms, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ForecastingTrainingSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ForecastingTrainingSettings if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ForecastingTrainingSettings. + */ + public static ForecastingTrainingSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ForecastingTrainingSettings deserializedForecastingTrainingSettings = new ForecastingTrainingSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enableDnnTraining".equals(fieldName)) { + deserializedForecastingTrainingSettings + .withEnableDnnTraining(reader.getNullable(JsonReader::getBoolean)); + } else if ("enableModelExplainability".equals(fieldName)) { + deserializedForecastingTrainingSettings + .withEnableModelExplainability(reader.getNullable(JsonReader::getBoolean)); + } else if ("enableOnnxCompatibleModels".equals(fieldName)) { + deserializedForecastingTrainingSettings + .withEnableOnnxCompatibleModels(reader.getNullable(JsonReader::getBoolean)); + } else if ("enableStackEnsemble".equals(fieldName)) { + deserializedForecastingTrainingSettings + .withEnableStackEnsemble(reader.getNullable(JsonReader::getBoolean)); + } else if ("enableVoteEnsemble".equals(fieldName)) { + deserializedForecastingTrainingSettings + .withEnableVoteEnsemble(reader.getNullable(JsonReader::getBoolean)); + } else if ("ensembleModelDownloadTimeout".equals(fieldName)) { + deserializedForecastingTrainingSettings.withEnsembleModelDownloadTimeout( + reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString()))); + } else if ("stackEnsembleSettings".equals(fieldName)) { + deserializedForecastingTrainingSettings + .withStackEnsembleSettings(StackEnsembleSettings.fromJson(reader)); + } else if ("allowedTrainingAlgorithms".equals(fieldName)) { + List allowedTrainingAlgorithms + = reader.readArray(reader1 -> ForecastingModels.fromString(reader1.getString())); + deserializedForecastingTrainingSettings.allowedTrainingAlgorithms = allowedTrainingAlgorithms; + } else if ("blockedTrainingAlgorithms".equals(fieldName)) { + List blockedTrainingAlgorithms + = reader.readArray(reader1 -> ForecastingModels.fromString(reader1.getString())); + deserializedForecastingTrainingSettings.blockedTrainingAlgorithms = blockedTrainingAlgorithms; + } else { + reader.skipChildren(); + } + } + + return deserializedForecastingTrainingSettings; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FqdnEndpoint.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FqdnEndpoint.java index f5da7736f78c0..3173818218420 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FqdnEndpoint.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FqdnEndpoint.java @@ -5,31 +5,37 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** The FqdnEndpoint model. */ +/** + * The FqdnEndpoint model. + */ @Fluent -public final class FqdnEndpoint { +public final class FqdnEndpoint implements JsonSerializable { /* * The domainName property. */ - @JsonProperty(value = "domainName") private String domainName; /* * The endpointDetails property. */ - @JsonProperty(value = "endpointDetails") private List endpointDetails; - /** Creates an instance of FqdnEndpoint class. */ + /** + * Creates an instance of FqdnEndpoint class. + */ public FqdnEndpoint() { } /** * Get the domainName property: The domainName property. - * + * * @return the domainName value. */ public String domainName() { @@ -38,7 +44,7 @@ public String domainName() { /** * Set the domainName property: The domainName property. - * + * * @param domainName the domainName value to set. * @return the FqdnEndpoint object itself. */ @@ -49,7 +55,7 @@ public FqdnEndpoint withDomainName(String domainName) { /** * Get the endpointDetails property: The endpointDetails property. - * + * * @return the endpointDetails value. */ public List endpointDetails() { @@ -58,7 +64,7 @@ public List endpointDetails() { /** * Set the endpointDetails property: The endpointDetails property. - * + * * @param endpointDetails the endpointDetails value to set. * @return the FqdnEndpoint object itself. */ @@ -69,7 +75,7 @@ public FqdnEndpoint withEndpointDetails(List endpointDetails /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -77,4 +83,46 @@ public void validate() { endpointDetails().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("domainName", this.domainName); + jsonWriter.writeArrayField("endpointDetails", this.endpointDetails, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FqdnEndpoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FqdnEndpoint if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FqdnEndpoint. + */ + public static FqdnEndpoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FqdnEndpoint deserializedFqdnEndpoint = new FqdnEndpoint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("domainName".equals(fieldName)) { + deserializedFqdnEndpoint.domainName = reader.getString(); + } else if ("endpointDetails".equals(fieldName)) { + List endpointDetails + = reader.readArray(reader1 -> FqdnEndpointDetail.fromJson(reader1)); + deserializedFqdnEndpoint.endpointDetails = endpointDetails; + } else { + reader.skipChildren(); + } + } + + return deserializedFqdnEndpoint; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FqdnEndpointDetail.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FqdnEndpointDetail.java index e2b5c5930b28b..34a7e4e60ee76 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FqdnEndpointDetail.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FqdnEndpointDetail.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The FqdnEndpointDetail model. */ +/** + * The FqdnEndpointDetail model. + */ @Fluent -public final class FqdnEndpointDetail { +public final class FqdnEndpointDetail implements JsonSerializable { /* * The port property. */ - @JsonProperty(value = "port") private Integer port; - /** Creates an instance of FqdnEndpointDetail class. */ + /** + * Creates an instance of FqdnEndpointDetail class. + */ public FqdnEndpointDetail() { } /** * Get the port property: The port property. - * + * * @return the port value. */ public Integer port() { @@ -31,7 +38,7 @@ public Integer port() { /** * Set the port property: The port property. - * + * * @param port the port value to set. * @return the FqdnEndpointDetail object itself. */ @@ -42,9 +49,45 @@ public FqdnEndpointDetail withPort(Integer port) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("port", this.port); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FqdnEndpointDetail from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FqdnEndpointDetail if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FqdnEndpointDetail. + */ + public static FqdnEndpointDetail fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FqdnEndpointDetail deserializedFqdnEndpointDetail = new FqdnEndpointDetail(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("port".equals(fieldName)) { + deserializedFqdnEndpointDetail.port = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedFqdnEndpointDetail; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FqdnEndpoints.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FqdnEndpoints.java index e858af2ff0011..a7fb5758a764c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FqdnEndpoints.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FqdnEndpoints.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The FqdnEndpoints model. */ +/** + * The FqdnEndpoints model. + */ @Fluent -public final class FqdnEndpoints { +public final class FqdnEndpoints implements JsonSerializable { /* * The properties property. */ - @JsonProperty(value = "properties") private FqdnEndpointsProperties properties; - /** Creates an instance of FqdnEndpoints class. */ + /** + * Creates an instance of FqdnEndpoints class. + */ public FqdnEndpoints() { } /** * Get the properties property: The properties property. - * + * * @return the properties value. */ public FqdnEndpointsProperties properties() { @@ -31,7 +38,7 @@ public FqdnEndpointsProperties properties() { /** * Set the properties property: The properties property. - * + * * @param properties the properties value to set. * @return the FqdnEndpoints object itself. */ @@ -42,7 +49,7 @@ public FqdnEndpoints withProperties(FqdnEndpointsProperties properties) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -50,4 +57,40 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FqdnEndpoints from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FqdnEndpoints if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FqdnEndpoints. + */ + public static FqdnEndpoints fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FqdnEndpoints deserializedFqdnEndpoints = new FqdnEndpoints(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedFqdnEndpoints.properties = FqdnEndpointsProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFqdnEndpoints; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FqdnEndpointsProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FqdnEndpointsProperties.java index 6cf5fe68fb945..481775542a4c4 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FqdnEndpointsProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FqdnEndpointsProperties.java @@ -5,31 +5,37 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** The FqdnEndpointsProperties model. */ +/** + * The FqdnEndpointsProperties model. + */ @Fluent -public final class FqdnEndpointsProperties { +public final class FqdnEndpointsProperties implements JsonSerializable { /* * The category property. */ - @JsonProperty(value = "category") private String category; /* * The endpoints property. */ - @JsonProperty(value = "endpoints") private List endpoints; - /** Creates an instance of FqdnEndpointsProperties class. */ + /** + * Creates an instance of FqdnEndpointsProperties class. + */ public FqdnEndpointsProperties() { } /** * Get the category property: The category property. - * + * * @return the category value. */ public String category() { @@ -38,7 +44,7 @@ public String category() { /** * Set the category property: The category property. - * + * * @param category the category value to set. * @return the FqdnEndpointsProperties object itself. */ @@ -49,7 +55,7 @@ public FqdnEndpointsProperties withCategory(String category) { /** * Get the endpoints property: The endpoints property. - * + * * @return the endpoints value. */ public List endpoints() { @@ -58,7 +64,7 @@ public List endpoints() { /** * Set the endpoints property: The endpoints property. - * + * * @param endpoints the endpoints value to set. * @return the FqdnEndpointsProperties object itself. */ @@ -69,7 +75,7 @@ public FqdnEndpointsProperties withEndpoints(List endpoints) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -77,4 +83,44 @@ public void validate() { endpoints().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", this.category); + jsonWriter.writeArrayField("endpoints", this.endpoints, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FqdnEndpointsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FqdnEndpointsProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the FqdnEndpointsProperties. + */ + public static FqdnEndpointsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FqdnEndpointsProperties deserializedFqdnEndpointsProperties = new FqdnEndpointsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedFqdnEndpointsProperties.category = reader.getString(); + } else if ("endpoints".equals(fieldName)) { + List endpoints = reader.readArray(reader1 -> FqdnEndpoint.fromJson(reader1)); + deserializedFqdnEndpointsProperties.endpoints = endpoints; + } else { + reader.skipChildren(); + } + } + + return deserializedFqdnEndpointsProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FqdnOutboundRule.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FqdnOutboundRule.java new file mode 100644 index 0000000000000..ab1445fcb8dcc --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/FqdnOutboundRule.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * FQDN Outbound Rule for the managed network of a machine learning workspace. + */ +@Fluent +public final class FqdnOutboundRule extends OutboundRule { + /* + * Type of a managed network Outbound Rule of a machine learning workspace. + */ + private RuleType type = RuleType.FQDN; + + /* + * The destination property. + */ + private String destination; + + /** + * Creates an instance of FqdnOutboundRule class. + */ + public FqdnOutboundRule() { + } + + /** + * Get the type property: Type of a managed network Outbound Rule of a machine learning workspace. + * + * @return the type value. + */ + @Override + public RuleType type() { + return this.type; + } + + /** + * Get the destination property: The destination property. + * + * @return the destination value. + */ + public String destination() { + return this.destination; + } + + /** + * Set the destination property: The destination property. + * + * @param destination the destination value to set. + * @return the FqdnOutboundRule object itself. + */ + public FqdnOutboundRule withDestination(String destination) { + this.destination = destination; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FqdnOutboundRule withCategory(RuleCategory category) { + super.withCategory(category); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FqdnOutboundRule withStatus(RuleStatus status) { + super.withStatus(status); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", category() == null ? null : category().toString()); + jsonWriter.writeStringField("status", status() == null ? null : status().toString()); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("destination", this.destination); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FqdnOutboundRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FqdnOutboundRule if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FqdnOutboundRule. + */ + public static FqdnOutboundRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FqdnOutboundRule deserializedFqdnOutboundRule = new FqdnOutboundRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedFqdnOutboundRule.withCategory(RuleCategory.fromString(reader.getString())); + } else if ("status".equals(fieldName)) { + deserializedFqdnOutboundRule.withStatus(RuleStatus.fromString(reader.getString())); + } else if ("type".equals(fieldName)) { + deserializedFqdnOutboundRule.type = RuleType.fromString(reader.getString()); + } else if ("destination".equals(fieldName)) { + deserializedFqdnOutboundRule.destination = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFqdnOutboundRule; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/GetBlobReferenceForConsumptionDto.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/GetBlobReferenceForConsumptionDto.java new file mode 100644 index 0000000000000..81793801b6665 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/GetBlobReferenceForConsumptionDto.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The GetBlobReferenceForConsumptionDto model. + */ +@Fluent +public final class GetBlobReferenceForConsumptionDto implements JsonSerializable { + /* + * Blob uri, example: https://blob.windows.core.net/Container/Path + */ + private String blobUri; + + /* + * Credential info to access storage account + */ + private DataReferenceCredential credential; + + /* + * The ARM id of the storage account + */ + private String storageAccountArmId; + + /** + * Creates an instance of GetBlobReferenceForConsumptionDto class. + */ + public GetBlobReferenceForConsumptionDto() { + } + + /** + * Get the blobUri property: Blob uri, example: https://blob.windows.core.net/Container/Path. + * + * @return the blobUri value. + */ + public String blobUri() { + return this.blobUri; + } + + /** + * Set the blobUri property: Blob uri, example: https://blob.windows.core.net/Container/Path. + * + * @param blobUri the blobUri value to set. + * @return the GetBlobReferenceForConsumptionDto object itself. + */ + public GetBlobReferenceForConsumptionDto withBlobUri(String blobUri) { + this.blobUri = blobUri; + return this; + } + + /** + * Get the credential property: Credential info to access storage account. + * + * @return the credential value. + */ + public DataReferenceCredential credential() { + return this.credential; + } + + /** + * Set the credential property: Credential info to access storage account. + * + * @param credential the credential value to set. + * @return the GetBlobReferenceForConsumptionDto object itself. + */ + public GetBlobReferenceForConsumptionDto withCredential(DataReferenceCredential credential) { + this.credential = credential; + return this; + } + + /** + * Get the storageAccountArmId property: The ARM id of the storage account. + * + * @return the storageAccountArmId value. + */ + public String storageAccountArmId() { + return this.storageAccountArmId; + } + + /** + * Set the storageAccountArmId property: The ARM id of the storage account. + * + * @param storageAccountArmId the storageAccountArmId value to set. + * @return the GetBlobReferenceForConsumptionDto object itself. + */ + public GetBlobReferenceForConsumptionDto withStorageAccountArmId(String storageAccountArmId) { + this.storageAccountArmId = storageAccountArmId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (credential() != null) { + credential().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("blobUri", this.blobUri); + jsonWriter.writeJsonField("credential", this.credential); + jsonWriter.writeStringField("storageAccountArmId", this.storageAccountArmId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GetBlobReferenceForConsumptionDto from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GetBlobReferenceForConsumptionDto if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GetBlobReferenceForConsumptionDto. + */ + public static GetBlobReferenceForConsumptionDto fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GetBlobReferenceForConsumptionDto deserializedGetBlobReferenceForConsumptionDto + = new GetBlobReferenceForConsumptionDto(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("blobUri".equals(fieldName)) { + deserializedGetBlobReferenceForConsumptionDto.blobUri = reader.getString(); + } else if ("credential".equals(fieldName)) { + deserializedGetBlobReferenceForConsumptionDto.credential = DataReferenceCredential.fromJson(reader); + } else if ("storageAccountArmId".equals(fieldName)) { + deserializedGetBlobReferenceForConsumptionDto.storageAccountArmId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGetBlobReferenceForConsumptionDto; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/GetBlobReferenceSasRequestDto.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/GetBlobReferenceSasRequestDto.java new file mode 100644 index 0000000000000..7733de40102a2 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/GetBlobReferenceSasRequestDto.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * BlobReferenceSASRequest for getBlobReferenceSAS API. + */ +@Fluent +public final class GetBlobReferenceSasRequestDto implements JsonSerializable { + /* + * Id of the asset to be accessed + */ + private String assetId; + + /* + * Blob uri of the asset to be accessed + */ + private String blobUri; + + /** + * Creates an instance of GetBlobReferenceSasRequestDto class. + */ + public GetBlobReferenceSasRequestDto() { + } + + /** + * Get the assetId property: Id of the asset to be accessed. + * + * @return the assetId value. + */ + public String assetId() { + return this.assetId; + } + + /** + * Set the assetId property: Id of the asset to be accessed. + * + * @param assetId the assetId value to set. + * @return the GetBlobReferenceSasRequestDto object itself. + */ + public GetBlobReferenceSasRequestDto withAssetId(String assetId) { + this.assetId = assetId; + return this; + } + + /** + * Get the blobUri property: Blob uri of the asset to be accessed. + * + * @return the blobUri value. + */ + public String blobUri() { + return this.blobUri; + } + + /** + * Set the blobUri property: Blob uri of the asset to be accessed. + * + * @param blobUri the blobUri value to set. + * @return the GetBlobReferenceSasRequestDto object itself. + */ + public GetBlobReferenceSasRequestDto withBlobUri(String blobUri) { + this.blobUri = blobUri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("assetId", this.assetId); + jsonWriter.writeStringField("blobUri", this.blobUri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GetBlobReferenceSasRequestDto from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GetBlobReferenceSasRequestDto if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GetBlobReferenceSasRequestDto. + */ + public static GetBlobReferenceSasRequestDto fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GetBlobReferenceSasRequestDto deserializedGetBlobReferenceSasRequestDto + = new GetBlobReferenceSasRequestDto(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("assetId".equals(fieldName)) { + deserializedGetBlobReferenceSasRequestDto.assetId = reader.getString(); + } else if ("blobUri".equals(fieldName)) { + deserializedGetBlobReferenceSasRequestDto.blobUri = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGetBlobReferenceSasRequestDto; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/GetBlobReferenceSasResponseDto.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/GetBlobReferenceSasResponseDto.java new file mode 100644 index 0000000000000..5f490f3cec94d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/GetBlobReferenceSasResponseDto.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.resourcemanager.machinelearning.fluent.models.GetBlobReferenceSasResponseDtoInner; + +/** + * An immutable client-side representation of GetBlobReferenceSasResponseDto. + */ +public interface GetBlobReferenceSasResponseDto { + /** + * Gets the blobReferenceForConsumption property: Blob reference for consumption details. + * + * @return the blobReferenceForConsumption value. + */ + GetBlobReferenceForConsumptionDto blobReferenceForConsumption(); + + /** + * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.GetBlobReferenceSasResponseDtoInner + * object. + * + * @return the inner object. + */ + GetBlobReferenceSasResponseDtoInner innerModel(); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Goal.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Goal.java index 7137524220105..91b2ac925a4e3 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Goal.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Goal.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines supported metric goals for hyperparameter tuning. */ +/** + * Defines supported metric goals for hyperparameter tuning. + */ public final class Goal extends ExpandableStringEnum { - /** Static value Minimize for Goal. */ + /** + * Static value Minimize for Goal. + */ public static final Goal MINIMIZE = fromString("Minimize"); - /** Static value Maximize for Goal. */ + /** + * Static value Maximize for Goal. + */ public static final Goal MAXIMIZE = fromString("Maximize"); /** * Creates a new instance of Goal value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public Goal() { /** * Creates or finds a Goal from its string representation. - * + * * @param name a name to look for. * @return the corresponding Goal. */ - @JsonCreator public static Goal fromString(String name) { return fromString(name, Goal.class); } /** * Gets known Goal values. - * + * * @return known Goal values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/GridSamplingAlgorithm.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/GridSamplingAlgorithm.java index 1e60d81c65f4b..16f0f5beaf4cd 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/GridSamplingAlgorithm.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/GridSamplingAlgorithm.java @@ -5,25 +5,83 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Defines a Sampling Algorithm that exhaustively generates every value combination in the space. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "samplingAlgorithmType") -@JsonTypeName("Grid") +/** + * Defines a Sampling Algorithm that exhaustively generates every value combination in the space. + */ @Immutable public final class GridSamplingAlgorithm extends SamplingAlgorithm { - /** Creates an instance of GridSamplingAlgorithm class. */ + /* + * [Required] The algorithm used for generating hyperparameter values, along with configuration properties + */ + private SamplingAlgorithmType samplingAlgorithmType = SamplingAlgorithmType.GRID; + + /** + * Creates an instance of GridSamplingAlgorithm class. + */ public GridSamplingAlgorithm() { } + /** + * Get the samplingAlgorithmType property: [Required] The algorithm used for generating hyperparameter values, along + * with configuration properties. + * + * @return the samplingAlgorithmType value. + */ + @Override + public SamplingAlgorithmType samplingAlgorithmType() { + return this.samplingAlgorithmType; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("samplingAlgorithmType", + this.samplingAlgorithmType == null ? null : this.samplingAlgorithmType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GridSamplingAlgorithm from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GridSamplingAlgorithm if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the GridSamplingAlgorithm. + */ + public static GridSamplingAlgorithm fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GridSamplingAlgorithm deserializedGridSamplingAlgorithm = new GridSamplingAlgorithm(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("samplingAlgorithmType".equals(fieldName)) { + deserializedGridSamplingAlgorithm.samplingAlgorithmType + = SamplingAlgorithmType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedGridSamplingAlgorithm; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/HDInsight.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/HDInsight.java index c5e63988ce745..e757fd131a478 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/HDInsight.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/HDInsight.java @@ -5,28 +5,75 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; -/** A HDInsight compute. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "computeType") -@JsonTypeName("HDInsight") +/** + * A HDInsight compute. + */ @Fluent public final class HDInsight extends Compute { + /* + * The type of compute + */ + private ComputeType computeType = ComputeType.HDINSIGHT; + /* * HDInsight compute properties */ - @JsonProperty(value = "properties") private HDInsightProperties properties; - /** Creates an instance of HDInsight class. */ + /* + * The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. + */ + private ProvisioningState provisioningState; + + /* + * The time at which the compute was created. + */ + private OffsetDateTime createdOn; + + /* + * The time at which the compute was last modified. + */ + private OffsetDateTime modifiedOn; + + /* + * Errors during provisioning + */ + private List provisioningErrors; + + /* + * Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning + * service provisioned it if false. + */ + private Boolean isAttachedCompute; + + /** + * Creates an instance of HDInsight class. + */ public HDInsight() { } + /** + * Get the computeType property: The type of compute. + * + * @return the computeType value. + */ + @Override + public ComputeType computeType() { + return this.computeType; + } + /** * Get the properties property: HDInsight compute properties. - * + * * @return the properties value. */ public HDInsightProperties properties() { @@ -35,7 +82,7 @@ public HDInsightProperties properties() { /** * Set the properties property: HDInsight compute properties. - * + * * @param properties the properties value to set. * @return the HDInsight object itself. */ @@ -44,28 +91,88 @@ public HDInsight withProperties(HDInsightProperties properties) { return this; } - /** {@inheritDoc} */ + /** + * Get the provisioningState property: The provision state of the cluster. Valid values are Unknown, Updating, + * Provisioning, Succeeded, and Failed. + * + * @return the provisioningState value. + */ + @Override + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the createdOn property: The time at which the compute was created. + * + * @return the createdOn value. + */ + @Override + public OffsetDateTime createdOn() { + return this.createdOn; + } + + /** + * Get the modifiedOn property: The time at which the compute was last modified. + * + * @return the modifiedOn value. + */ + @Override + public OffsetDateTime modifiedOn() { + return this.modifiedOn; + } + + /** + * Get the provisioningErrors property: Errors during provisioning. + * + * @return the provisioningErrors value. + */ + @Override + public List provisioningErrors() { + return this.provisioningErrors; + } + + /** + * Get the isAttachedCompute property: Indicating whether the compute was provisioned by user and brought from + * outside if true, or machine learning service provisioned it if false. + * + * @return the isAttachedCompute value. + */ + @Override + public Boolean isAttachedCompute() { + return this.isAttachedCompute; + } + + /** + * {@inheritDoc} + */ @Override public HDInsight withComputeLocation(String computeLocation) { super.withComputeLocation(computeLocation); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public HDInsight withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public HDInsight withResourceId(String resourceId) { super.withResourceId(resourceId); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public HDInsight withDisableLocalAuth(Boolean disableLocalAuth) { super.withDisableLocalAuth(disableLocalAuth); @@ -74,7 +181,7 @@ public HDInsight withDisableLocalAuth(Boolean disableLocalAuth) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -84,4 +191,69 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("computeLocation", computeLocation()); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("resourceId", resourceId()); + jsonWriter.writeBooleanField("disableLocalAuth", disableLocalAuth()); + jsonWriter.writeStringField("computeType", this.computeType == null ? null : this.computeType.toString()); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HDInsight from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HDInsight if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the HDInsight. + */ + public static HDInsight fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HDInsight deserializedHDInsight = new HDInsight(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("computeLocation".equals(fieldName)) { + deserializedHDInsight.withComputeLocation(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedHDInsight.provisioningState = ProvisioningState.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedHDInsight.withDescription(reader.getString()); + } else if ("createdOn".equals(fieldName)) { + deserializedHDInsight.createdOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("modifiedOn".equals(fieldName)) { + deserializedHDInsight.modifiedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("resourceId".equals(fieldName)) { + deserializedHDInsight.withResourceId(reader.getString()); + } else if ("provisioningErrors".equals(fieldName)) { + List provisioningErrors + = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); + deserializedHDInsight.provisioningErrors = provisioningErrors; + } else if ("isAttachedCompute".equals(fieldName)) { + deserializedHDInsight.isAttachedCompute = reader.getNullable(JsonReader::getBoolean); + } else if ("disableLocalAuth".equals(fieldName)) { + deserializedHDInsight.withDisableLocalAuth(reader.getNullable(JsonReader::getBoolean)); + } else if ("computeType".equals(fieldName)) { + deserializedHDInsight.computeType = ComputeType.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedHDInsight.properties = HDInsightProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedHDInsight; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/HDInsightProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/HDInsightProperties.java index bc6f0165cefe7..be00bc1a95ebb 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/HDInsightProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/HDInsightProperties.java @@ -5,36 +5,41 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** HDInsight compute properties. */ +/** + * HDInsight compute properties. + */ @Fluent -public final class HDInsightProperties { +public final class HDInsightProperties implements JsonSerializable { /* * Port open for ssh connections on the master node of the cluster. */ - @JsonProperty(value = "sshPort") private Integer sshPort; /* * Public IP address of the master node of the cluster. */ - @JsonProperty(value = "address") private String address; /* * Admin credentials for master node of the cluster */ - @JsonProperty(value = "administratorAccount") private VirtualMachineSshCredentials administratorAccount; - /** Creates an instance of HDInsightProperties class. */ + /** + * Creates an instance of HDInsightProperties class. + */ public HDInsightProperties() { } /** * Get the sshPort property: Port open for ssh connections on the master node of the cluster. - * + * * @return the sshPort value. */ public Integer sshPort() { @@ -43,7 +48,7 @@ public Integer sshPort() { /** * Set the sshPort property: Port open for ssh connections on the master node of the cluster. - * + * * @param sshPort the sshPort value to set. * @return the HDInsightProperties object itself. */ @@ -54,7 +59,7 @@ public HDInsightProperties withSshPort(Integer sshPort) { /** * Get the address property: Public IP address of the master node of the cluster. - * + * * @return the address value. */ public String address() { @@ -63,7 +68,7 @@ public String address() { /** * Set the address property: Public IP address of the master node of the cluster. - * + * * @param address the address value to set. * @return the HDInsightProperties object itself. */ @@ -74,7 +79,7 @@ public HDInsightProperties withAddress(String address) { /** * Get the administratorAccount property: Admin credentials for master node of the cluster. - * + * * @return the administratorAccount value. */ public VirtualMachineSshCredentials administratorAccount() { @@ -83,7 +88,7 @@ public VirtualMachineSshCredentials administratorAccount() { /** * Set the administratorAccount property: Admin credentials for master node of the cluster. - * + * * @param administratorAccount the administratorAccount value to set. * @return the HDInsightProperties object itself. */ @@ -94,7 +99,7 @@ public HDInsightProperties withAdministratorAccount(VirtualMachineSshCredentials /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -102,4 +107,47 @@ public void validate() { administratorAccount().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("sshPort", this.sshPort); + jsonWriter.writeStringField("address", this.address); + jsonWriter.writeJsonField("administratorAccount", this.administratorAccount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HDInsightProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HDInsightProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the HDInsightProperties. + */ + public static HDInsightProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HDInsightProperties deserializedHDInsightProperties = new HDInsightProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sshPort".equals(fieldName)) { + deserializedHDInsightProperties.sshPort = reader.getNullable(JsonReader::getInt); + } else if ("address".equals(fieldName)) { + deserializedHDInsightProperties.address = reader.getString(); + } else if ("administratorAccount".equals(fieldName)) { + deserializedHDInsightProperties.administratorAccount + = VirtualMachineSshCredentials.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedHDInsightProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/HDInsightSchema.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/HDInsightSchema.java index cd4faac3dfc62..08811ff2412ac 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/HDInsightSchema.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/HDInsightSchema.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The HDInsightSchema model. */ +/** + * The HDInsightSchema model. + */ @Fluent -public class HDInsightSchema { +public class HDInsightSchema implements JsonSerializable { /* * HDInsight compute properties */ - @JsonProperty(value = "properties") private HDInsightProperties properties; - /** Creates an instance of HDInsightSchema class. */ + /** + * Creates an instance of HDInsightSchema class. + */ public HDInsightSchema() { } /** * Get the properties property: HDInsight compute properties. - * + * * @return the properties value. */ public HDInsightProperties properties() { @@ -31,7 +38,7 @@ public HDInsightProperties properties() { /** * Set the properties property: HDInsight compute properties. - * + * * @param properties the properties value to set. * @return the HDInsightSchema object itself. */ @@ -42,7 +49,7 @@ public HDInsightSchema withProperties(HDInsightProperties properties) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -50,4 +57,40 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HDInsightSchema from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HDInsightSchema if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the HDInsightSchema. + */ + public static HDInsightSchema fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HDInsightSchema deserializedHDInsightSchema = new HDInsightSchema(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedHDInsightSchema.properties = HDInsightProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedHDInsightSchema; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IdAssetReference.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IdAssetReference.java index 2ed4fa9fd76ca..2e462d48e5284 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IdAssetReference.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IdAssetReference.java @@ -6,28 +6,45 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Reference to an asset via its ARM resource ID. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "referenceType") -@JsonTypeName("Id") +/** + * Reference to an asset via its ARM resource ID. + */ @Fluent public final class IdAssetReference extends AssetReferenceBase { + /* + * [Required] Specifies the type of asset reference. + */ + private ReferenceType referenceType = ReferenceType.ID; + /* * [Required] ARM resource ID of the asset. */ - @JsonProperty(value = "assetId", required = true) private String assetId; - /** Creates an instance of IdAssetReference class. */ + /** + * Creates an instance of IdAssetReference class. + */ public IdAssetReference() { } + /** + * Get the referenceType property: [Required] Specifies the type of asset reference. + * + * @return the referenceType value. + */ + @Override + public ReferenceType referenceType() { + return this.referenceType; + } + /** * Get the assetId property: [Required] ARM resource ID of the asset. - * + * * @return the assetId value. */ public String assetId() { @@ -36,7 +53,7 @@ public String assetId() { /** * Set the assetId property: [Required] ARM resource ID of the asset. - * + * * @param assetId the assetId value to set. * @return the IdAssetReference object itself. */ @@ -47,18 +64,57 @@ public IdAssetReference withAssetId(String assetId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (assetId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property assetId in model IdAssetReference")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property assetId in model IdAssetReference")); } } private static final ClientLogger LOGGER = new ClientLogger(IdAssetReference.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("assetId", this.assetId); + jsonWriter.writeStringField("referenceType", this.referenceType == null ? null : this.referenceType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IdAssetReference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IdAssetReference if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IdAssetReference. + */ + public static IdAssetReference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IdAssetReference deserializedIdAssetReference = new IdAssetReference(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("assetId".equals(fieldName)) { + deserializedIdAssetReference.assetId = reader.getString(); + } else if ("referenceType".equals(fieldName)) { + deserializedIdAssetReference.referenceType = ReferenceType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedIdAssetReference; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IdentityConfiguration.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IdentityConfiguration.java index c0a1ddcffc398..213450120e9a3 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IdentityConfiguration.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IdentityConfiguration.java @@ -5,33 +5,108 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Base definition for identity configuration. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "identityType", - defaultImpl = IdentityConfiguration.class) -@JsonTypeName("IdentityConfiguration") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "AMLToken", value = AmlToken.class), - @JsonSubTypes.Type(name = "Managed", value = ManagedIdentity.class), - @JsonSubTypes.Type(name = "UserIdentity", value = UserIdentity.class) -}) +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Base definition for identity configuration. + */ @Immutable -public class IdentityConfiguration { - /** Creates an instance of IdentityConfiguration class. */ +public class IdentityConfiguration implements JsonSerializable { + /* + * [Required] Specifies the type of identity framework. + */ + private IdentityConfigurationType identityType = IdentityConfigurationType.fromString("IdentityConfiguration"); + + /** + * Creates an instance of IdentityConfiguration class. + */ public IdentityConfiguration() { } + /** + * Get the identityType property: [Required] Specifies the type of identity framework. + * + * @return the identityType value. + */ + public IdentityConfigurationType identityType() { + return this.identityType; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("identityType", this.identityType == null ? null : this.identityType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IdentityConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IdentityConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the IdentityConfiguration. + */ + public static IdentityConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("identityType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("AMLToken".equals(discriminatorValue)) { + return AmlToken.fromJson(readerToUse.reset()); + } else if ("Managed".equals(discriminatorValue)) { + return ManagedIdentity.fromJson(readerToUse.reset()); + } else if ("UserIdentity".equals(discriminatorValue)) { + return UserIdentity.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static IdentityConfiguration fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IdentityConfiguration deserializedIdentityConfiguration = new IdentityConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("identityType".equals(fieldName)) { + deserializedIdentityConfiguration.identityType + = IdentityConfigurationType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedIdentityConfiguration; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IdentityConfigurationType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IdentityConfigurationType.java index 34e2015582110..c30c98880e0a6 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IdentityConfigurationType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IdentityConfigurationType.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Enum to determine identity framework. */ +/** + * Enum to determine identity framework. + */ public final class IdentityConfigurationType extends ExpandableStringEnum { - /** Static value Managed for IdentityConfigurationType. */ + /** + * Static value Managed for IdentityConfigurationType. + */ public static final IdentityConfigurationType MANAGED = fromString("Managed"); - /** Static value AMLToken for IdentityConfigurationType. */ + /** + * Static value AMLToken for IdentityConfigurationType. + */ public static final IdentityConfigurationType AMLTOKEN = fromString("AMLToken"); - /** Static value UserIdentity for IdentityConfigurationType. */ + /** + * Static value UserIdentity for IdentityConfigurationType. + */ public static final IdentityConfigurationType USER_IDENTITY = fromString("UserIdentity"); /** * Creates a new instance of IdentityConfigurationType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public IdentityConfigurationType() { /** * Creates or finds a IdentityConfigurationType from its string representation. - * + * * @param name a name to look for. * @return the corresponding IdentityConfigurationType. */ - @JsonCreator public static IdentityConfigurationType fromString(String name) { return fromString(name, IdentityConfigurationType.class); } /** * Gets known IdentityConfigurationType values. - * + * * @return known IdentityConfigurationType values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IdentityForCmk.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IdentityForCmk.java index 9e86918bfd7af..005ee944ae134 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IdentityForCmk.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IdentityForCmk.java @@ -5,25 +5,32 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Identity that will be used to access key vault for encryption at rest. */ +/** + * Identity that will be used to access key vault for encryption at rest. + */ @Fluent -public final class IdentityForCmk { +public final class IdentityForCmk implements JsonSerializable { /* * The ArmId of the user assigned identity that will be used to access the customer managed key vault */ - @JsonProperty(value = "userAssignedIdentity") private String userAssignedIdentity; - /** Creates an instance of IdentityForCmk class. */ + /** + * Creates an instance of IdentityForCmk class. + */ public IdentityForCmk() { } /** * Get the userAssignedIdentity property: The ArmId of the user assigned identity that will be used to access the * customer managed key vault. - * + * * @return the userAssignedIdentity value. */ public String userAssignedIdentity() { @@ -33,7 +40,7 @@ public String userAssignedIdentity() { /** * Set the userAssignedIdentity property: The ArmId of the user assigned identity that will be used to access the * customer managed key vault. - * + * * @param userAssignedIdentity the userAssignedIdentity value to set. * @return the IdentityForCmk object itself. */ @@ -44,9 +51,45 @@ public IdentityForCmk withUserAssignedIdentity(String userAssignedIdentity) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("userAssignedIdentity", this.userAssignedIdentity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IdentityForCmk from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IdentityForCmk if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the IdentityForCmk. + */ + public static IdentityForCmk fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IdentityForCmk deserializedIdentityForCmk = new IdentityForCmk(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("userAssignedIdentity".equals(fieldName)) { + deserializedIdentityForCmk.userAssignedIdentity = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIdentityForCmk; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Image.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Image.java new file mode 100644 index 0000000000000..f47808eb59747 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Image.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * Describes the Image Specifications. + */ +@Fluent +public final class Image implements JsonSerializable { + /* + * Type of the image. Possible values are: docker - For docker images. azureml - For AzureML images + */ + private ImageType type; + + /* + * Image reference + */ + private String reference; + + /* + * Describes the Image Specifications + */ + private Map additionalProperties; + + /** + * Creates an instance of Image class. + */ + public Image() { + } + + /** + * Get the type property: Type of the image. Possible values are: docker - For docker images. azureml - For AzureML + * images. + * + * @return the type value. + */ + public ImageType type() { + return this.type; + } + + /** + * Set the type property: Type of the image. Possible values are: docker - For docker images. azureml - For AzureML + * images. + * + * @param type the type value to set. + * @return the Image object itself. + */ + public Image withType(ImageType type) { + this.type = type; + return this; + } + + /** + * Get the reference property: Image reference. + * + * @return the reference value. + */ + public String reference() { + return this.reference; + } + + /** + * Set the reference property: Image reference. + * + * @param reference the reference value to set. + * @return the Image object itself. + */ + public Image withReference(String reference) { + this.reference = reference; + return this; + } + + /** + * Get the additionalProperties property: Describes the Image Specifications. + * + * @return the additionalProperties value. + */ + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: Describes the Image Specifications. + * + * @param additionalProperties the additionalProperties value to set. + * @return the Image object itself. + */ + public Image withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("reference", this.reference); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Image from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Image if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Image. + */ + public static Image fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Image deserializedImage = new Image(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedImage.type = ImageType.fromString(reader.getString()); + } else if ("reference".equals(fieldName)) { + deserializedImage.reference = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedImage.additionalProperties = additionalProperties; + + return deserializedImage; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageClassification.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageClassification.java index 96f4c3e36fb1c..ef14317d105cd 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageClassification.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageClassification.java @@ -6,53 +6,51 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * 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'. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") -@JsonTypeName("ImageClassification") @Fluent public final class ImageClassification extends AutoMLVertical { + /* + * [Required] Task type for AutoMLJob. + */ + private TaskType taskType = TaskType.IMAGE_CLASSIFICATION; + /* * Primary metric to optimize for this task. */ - @JsonProperty(value = "primaryMetric") private ClassificationPrimaryMetrics primaryMetric; /* * Settings used for training the model. */ - @JsonProperty(value = "modelSettings") private ImageModelSettingsClassification modelSettings; /* * Search space for sampling different combinations of models and their hyperparameters. */ - @JsonProperty(value = "searchSpace") private List searchSpace; /* * [Required] Limit settings for the AutoML job. */ - @JsonProperty(value = "limitSettings", required = true) private ImageLimitSettings limitSettings; /* * Model sweeping and hyperparameter sweeping related settings. */ - @JsonProperty(value = "sweepSettings") private ImageSweepSettings sweepSettings; /* * Validation data inputs. */ - @JsonProperty(value = "validationData") private MLTableJobInput validationData; /* @@ -60,16 +58,27 @@ public final class ImageClassification extends AutoMLVertical { * Values between (0.0 , 1.0) * Applied when validation dataset is not provided. */ - @JsonProperty(value = "validationDataSize") private Double validationDataSize; - /** Creates an instance of ImageClassification class. */ + /** + * Creates an instance of ImageClassification class. + */ public ImageClassification() { } + /** + * Get the taskType property: [Required] Task type for AutoMLJob. + * + * @return the taskType value. + */ + @Override + public TaskType taskType() { + return this.taskType; + } + /** * Get the primaryMetric property: Primary metric to optimize for this task. - * + * * @return the primaryMetric value. */ public ClassificationPrimaryMetrics primaryMetric() { @@ -78,7 +87,7 @@ public ClassificationPrimaryMetrics primaryMetric() { /** * Set the primaryMetric property: Primary metric to optimize for this task. - * + * * @param primaryMetric the primaryMetric value to set. * @return the ImageClassification object itself. */ @@ -89,7 +98,7 @@ public ImageClassification withPrimaryMetric(ClassificationPrimaryMetrics primar /** * Get the modelSettings property: Settings used for training the model. - * + * * @return the modelSettings value. */ public ImageModelSettingsClassification modelSettings() { @@ -98,7 +107,7 @@ public ImageModelSettingsClassification modelSettings() { /** * Set the modelSettings property: Settings used for training the model. - * + * * @param modelSettings the modelSettings value to set. * @return the ImageClassification object itself. */ @@ -110,7 +119,7 @@ public ImageClassification withModelSettings(ImageModelSettingsClassification mo /** * Get the searchSpace property: Search space for sampling different combinations of models and their * hyperparameters. - * + * * @return the searchSpace value. */ public List searchSpace() { @@ -120,7 +129,7 @@ public List searchSpace() { /** * Set the searchSpace property: Search space for sampling different combinations of models and their * hyperparameters. - * + * * @param searchSpace the searchSpace value to set. * @return the ImageClassification object itself. */ @@ -131,7 +140,7 @@ public ImageClassification withSearchSpace(List e.validate()); } if (limitSettings() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property limitSettings in model ImageClassification")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property limitSettings in model ImageClassification")); } else { limitSettings().validate(); } @@ -263,4 +281,74 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(ImageClassification.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("trainingData", trainingData()); + jsonWriter.writeStringField("logVerbosity", logVerbosity() == null ? null : logVerbosity().toString()); + jsonWriter.writeStringField("targetColumnName", targetColumnName()); + jsonWriter.writeJsonField("limitSettings", this.limitSettings); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); + jsonWriter.writeStringField("primaryMetric", this.primaryMetric == null ? null : this.primaryMetric.toString()); + jsonWriter.writeJsonField("modelSettings", this.modelSettings); + jsonWriter.writeArrayField("searchSpace", this.searchSpace, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("sweepSettings", this.sweepSettings); + jsonWriter.writeJsonField("validationData", this.validationData); + jsonWriter.writeNumberField("validationDataSize", this.validationDataSize); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageClassification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageClassification if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ImageClassification. + */ + public static ImageClassification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageClassification deserializedImageClassification = new ImageClassification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("trainingData".equals(fieldName)) { + deserializedImageClassification.withTrainingData(MLTableJobInput.fromJson(reader)); + } else if ("logVerbosity".equals(fieldName)) { + deserializedImageClassification.withLogVerbosity(LogVerbosity.fromString(reader.getString())); + } else if ("targetColumnName".equals(fieldName)) { + deserializedImageClassification.withTargetColumnName(reader.getString()); + } else if ("limitSettings".equals(fieldName)) { + deserializedImageClassification.limitSettings = ImageLimitSettings.fromJson(reader); + } else if ("taskType".equals(fieldName)) { + deserializedImageClassification.taskType = TaskType.fromString(reader.getString()); + } else if ("primaryMetric".equals(fieldName)) { + deserializedImageClassification.primaryMetric + = ClassificationPrimaryMetrics.fromString(reader.getString()); + } else if ("modelSettings".equals(fieldName)) { + deserializedImageClassification.modelSettings = ImageModelSettingsClassification.fromJson(reader); + } else if ("searchSpace".equals(fieldName)) { + List searchSpace + = reader.readArray(reader1 -> ImageModelDistributionSettingsClassification.fromJson(reader1)); + deserializedImageClassification.searchSpace = searchSpace; + } else if ("sweepSettings".equals(fieldName)) { + deserializedImageClassification.sweepSettings = ImageSweepSettings.fromJson(reader); + } else if ("validationData".equals(fieldName)) { + deserializedImageClassification.validationData = MLTableJobInput.fromJson(reader); + } else if ("validationDataSize".equals(fieldName)) { + deserializedImageClassification.validationDataSize = reader.getNullable(JsonReader::getDouble); + } else { + reader.skipChildren(); + } + } + + return deserializedImageClassification; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageClassificationBase.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageClassificationBase.java index b0042428c4cce..84339846a46fb 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageClassificationBase.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageClassificationBase.java @@ -5,31 +5,36 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** The ImageClassificationBase model. */ +/** + * The ImageClassificationBase model. + */ @Fluent public class ImageClassificationBase extends ImageVertical { /* * Settings used for training the model. */ - @JsonProperty(value = "modelSettings") private ImageModelSettingsClassification modelSettings; /* * Search space for sampling different combinations of models and their hyperparameters. */ - @JsonProperty(value = "searchSpace") private List searchSpace; - /** Creates an instance of ImageClassificationBase class. */ + /** + * Creates an instance of ImageClassificationBase class. + */ public ImageClassificationBase() { } /** * Get the modelSettings property: Settings used for training the model. - * + * * @return the modelSettings value. */ public ImageModelSettingsClassification modelSettings() { @@ -38,7 +43,7 @@ public ImageModelSettingsClassification modelSettings() { /** * Set the modelSettings property: Settings used for training the model. - * + * * @param modelSettings the modelSettings value to set. * @return the ImageClassificationBase object itself. */ @@ -50,7 +55,7 @@ public ImageClassificationBase withModelSettings(ImageModelSettingsClassificatio /** * Get the searchSpace property: Search space for sampling different combinations of models and their * hyperparameters. - * + * * @return the searchSpace value. */ public List searchSpace() { @@ -60,7 +65,7 @@ public List searchSpace() { /** * Set the searchSpace property: Search space for sampling different combinations of models and their * hyperparameters. - * + * * @param searchSpace the searchSpace value to set. * @return the ImageClassificationBase object itself. */ @@ -69,28 +74,36 @@ public ImageClassificationBase withSearchSpace(List e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("limitSettings", limitSettings()); + jsonWriter.writeJsonField("sweepSettings", sweepSettings()); + jsonWriter.writeJsonField("validationData", validationData()); + jsonWriter.writeNumberField("validationDataSize", validationDataSize()); + jsonWriter.writeJsonField("modelSettings", this.modelSettings); + jsonWriter.writeArrayField("searchSpace", this.searchSpace, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageClassificationBase from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageClassificationBase if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ImageClassificationBase. + */ + public static ImageClassificationBase fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageClassificationBase deserializedImageClassificationBase = new ImageClassificationBase(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("limitSettings".equals(fieldName)) { + deserializedImageClassificationBase.withLimitSettings(ImageLimitSettings.fromJson(reader)); + } else if ("sweepSettings".equals(fieldName)) { + deserializedImageClassificationBase.withSweepSettings(ImageSweepSettings.fromJson(reader)); + } else if ("validationData".equals(fieldName)) { + deserializedImageClassificationBase.withValidationData(MLTableJobInput.fromJson(reader)); + } else if ("validationDataSize".equals(fieldName)) { + deserializedImageClassificationBase + .withValidationDataSize(reader.getNullable(JsonReader::getDouble)); + } else if ("modelSettings".equals(fieldName)) { + deserializedImageClassificationBase.modelSettings + = ImageModelSettingsClassification.fromJson(reader); + } else if ("searchSpace".equals(fieldName)) { + List searchSpace + = reader.readArray(reader1 -> ImageModelDistributionSettingsClassification.fromJson(reader1)); + deserializedImageClassificationBase.searchSpace = searchSpace; + } else { + reader.skipChildren(); + } + } + + return deserializedImageClassificationBase; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageClassificationMultilabel.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageClassificationMultilabel.java index a53c34a35f6f8..4c711e134c3e0 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageClassificationMultilabel.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageClassificationMultilabel.java @@ -6,53 +6,51 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Image Classification Multilabel. Multi-label image classification is used when an image could have one or more labels * from a set of labels - e.g. an image could be labeled with both 'cat' and 'dog'. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") -@JsonTypeName("ImageClassificationMultilabel") @Fluent public final class ImageClassificationMultilabel extends AutoMLVertical { + /* + * [Required] Task type for AutoMLJob. + */ + private TaskType taskType = TaskType.IMAGE_CLASSIFICATION_MULTILABEL; + /* * Primary metric to optimize for this task. */ - @JsonProperty(value = "primaryMetric") private ClassificationMultilabelPrimaryMetrics primaryMetric; /* * Settings used for training the model. */ - @JsonProperty(value = "modelSettings") private ImageModelSettingsClassification modelSettings; /* * Search space for sampling different combinations of models and their hyperparameters. */ - @JsonProperty(value = "searchSpace") private List searchSpace; /* * [Required] Limit settings for the AutoML job. */ - @JsonProperty(value = "limitSettings", required = true) private ImageLimitSettings limitSettings; /* * Model sweeping and hyperparameter sweeping related settings. */ - @JsonProperty(value = "sweepSettings") private ImageSweepSettings sweepSettings; /* * Validation data inputs. */ - @JsonProperty(value = "validationData") private MLTableJobInput validationData; /* @@ -60,16 +58,27 @@ public final class ImageClassificationMultilabel extends AutoMLVertical { * Values between (0.0 , 1.0) * Applied when validation dataset is not provided. */ - @JsonProperty(value = "validationDataSize") private Double validationDataSize; - /** Creates an instance of ImageClassificationMultilabel class. */ + /** + * Creates an instance of ImageClassificationMultilabel class. + */ public ImageClassificationMultilabel() { } + /** + * Get the taskType property: [Required] Task type for AutoMLJob. + * + * @return the taskType value. + */ + @Override + public TaskType taskType() { + return this.taskType; + } + /** * Get the primaryMetric property: Primary metric to optimize for this task. - * + * * @return the primaryMetric value. */ public ClassificationMultilabelPrimaryMetrics primaryMetric() { @@ -78,7 +87,7 @@ public ClassificationMultilabelPrimaryMetrics primaryMetric() { /** * Set the primaryMetric property: Primary metric to optimize for this task. - * + * * @param primaryMetric the primaryMetric value to set. * @return the ImageClassificationMultilabel object itself. */ @@ -89,7 +98,7 @@ public ImageClassificationMultilabel withPrimaryMetric(ClassificationMultilabelP /** * Get the modelSettings property: Settings used for training the model. - * + * * @return the modelSettings value. */ public ImageModelSettingsClassification modelSettings() { @@ -98,7 +107,7 @@ public ImageModelSettingsClassification modelSettings() { /** * Set the modelSettings property: Settings used for training the model. - * + * * @param modelSettings the modelSettings value to set. * @return the ImageClassificationMultilabel object itself. */ @@ -110,7 +119,7 @@ public ImageClassificationMultilabel withModelSettings(ImageModelSettingsClassif /** * Get the searchSpace property: Search space for sampling different combinations of models and their * hyperparameters. - * + * * @return the searchSpace value. */ public List searchSpace() { @@ -120,19 +129,19 @@ public List searchSpace() { /** * Set the searchSpace property: Search space for sampling different combinations of models and their * hyperparameters. - * + * * @param searchSpace the searchSpace value to set. * @return the ImageClassificationMultilabel object itself. */ - public ImageClassificationMultilabel withSearchSpace( - List searchSpace) { + public ImageClassificationMultilabel + withSearchSpace(List searchSpace) { this.searchSpace = searchSpace; return this; } /** * Get the limitSettings property: [Required] Limit settings for the AutoML job. - * + * * @return the limitSettings value. */ public ImageLimitSettings limitSettings() { @@ -141,7 +150,7 @@ public ImageLimitSettings limitSettings() { /** * Set the limitSettings property: [Required] Limit settings for the AutoML job. - * + * * @param limitSettings the limitSettings value to set. * @return the ImageClassificationMultilabel object itself. */ @@ -152,7 +161,7 @@ public ImageClassificationMultilabel withLimitSettings(ImageLimitSettings limitS /** * Get the sweepSettings property: Model sweeping and hyperparameter sweeping related settings. - * + * * @return the sweepSettings value. */ public ImageSweepSettings sweepSettings() { @@ -161,7 +170,7 @@ public ImageSweepSettings sweepSettings() { /** * Set the sweepSettings property: Model sweeping and hyperparameter sweeping related settings. - * + * * @param sweepSettings the sweepSettings value to set. * @return the ImageClassificationMultilabel object itself. */ @@ -172,7 +181,7 @@ public ImageClassificationMultilabel withSweepSettings(ImageSweepSettings sweepS /** * Get the validationData property: Validation data inputs. - * + * * @return the validationData value. */ public MLTableJobInput validationData() { @@ -181,7 +190,7 @@ public MLTableJobInput validationData() { /** * Set the validationData property: Validation data inputs. - * + * * @param validationData the validationData value to set. * @return the ImageClassificationMultilabel object itself. */ @@ -192,8 +201,10 @@ public ImageClassificationMultilabel withValidationData(MLTableJobInput validati /** * Get the validationDataSize property: 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. - * + * purpose. + * Values between (0.0 , 1.0) + * Applied when validation dataset is not provided. + * * @return the validationDataSize value. */ public Double validationDataSize() { @@ -202,8 +213,10 @@ public Double validationDataSize() { /** * Set the validationDataSize property: 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. - * + * purpose. + * Values between (0.0 , 1.0) + * Applied when validation dataset is not provided. + * * @param validationDataSize the validationDataSize value to set. * @return the ImageClassificationMultilabel object itself. */ @@ -212,21 +225,27 @@ public ImageClassificationMultilabel withValidationDataSize(Double validationDat return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageClassificationMultilabel withLogVerbosity(LogVerbosity logVerbosity) { super.withLogVerbosity(logVerbosity); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageClassificationMultilabel withTargetColumnName(String targetColumnName) { super.withTargetColumnName(targetColumnName); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageClassificationMultilabel withTrainingData(MLTableJobInput trainingData) { super.withTrainingData(trainingData); @@ -235,7 +254,7 @@ public ImageClassificationMultilabel withTrainingData(MLTableJobInput trainingDa /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -248,10 +267,9 @@ public void validate() { searchSpace().forEach(e -> e.validate()); } if (limitSettings() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property limitSettings in model ImageClassificationMultilabel")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property limitSettings in model ImageClassificationMultilabel")); } else { limitSettings().validate(); } @@ -264,4 +282,78 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(ImageClassificationMultilabel.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("trainingData", trainingData()); + jsonWriter.writeStringField("logVerbosity", logVerbosity() == null ? null : logVerbosity().toString()); + jsonWriter.writeStringField("targetColumnName", targetColumnName()); + jsonWriter.writeJsonField("limitSettings", this.limitSettings); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); + jsonWriter.writeStringField("primaryMetric", this.primaryMetric == null ? null : this.primaryMetric.toString()); + jsonWriter.writeJsonField("modelSettings", this.modelSettings); + jsonWriter.writeArrayField("searchSpace", this.searchSpace, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("sweepSettings", this.sweepSettings); + jsonWriter.writeJsonField("validationData", this.validationData); + jsonWriter.writeNumberField("validationDataSize", this.validationDataSize); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageClassificationMultilabel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageClassificationMultilabel if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ImageClassificationMultilabel. + */ + public static ImageClassificationMultilabel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageClassificationMultilabel deserializedImageClassificationMultilabel + = new ImageClassificationMultilabel(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("trainingData".equals(fieldName)) { + deserializedImageClassificationMultilabel.withTrainingData(MLTableJobInput.fromJson(reader)); + } else if ("logVerbosity".equals(fieldName)) { + deserializedImageClassificationMultilabel + .withLogVerbosity(LogVerbosity.fromString(reader.getString())); + } else if ("targetColumnName".equals(fieldName)) { + deserializedImageClassificationMultilabel.withTargetColumnName(reader.getString()); + } else if ("limitSettings".equals(fieldName)) { + deserializedImageClassificationMultilabel.limitSettings = ImageLimitSettings.fromJson(reader); + } else if ("taskType".equals(fieldName)) { + deserializedImageClassificationMultilabel.taskType = TaskType.fromString(reader.getString()); + } else if ("primaryMetric".equals(fieldName)) { + deserializedImageClassificationMultilabel.primaryMetric + = ClassificationMultilabelPrimaryMetrics.fromString(reader.getString()); + } else if ("modelSettings".equals(fieldName)) { + deserializedImageClassificationMultilabel.modelSettings + = ImageModelSettingsClassification.fromJson(reader); + } else if ("searchSpace".equals(fieldName)) { + List searchSpace + = reader.readArray(reader1 -> ImageModelDistributionSettingsClassification.fromJson(reader1)); + deserializedImageClassificationMultilabel.searchSpace = searchSpace; + } else if ("sweepSettings".equals(fieldName)) { + deserializedImageClassificationMultilabel.sweepSettings = ImageSweepSettings.fromJson(reader); + } else if ("validationData".equals(fieldName)) { + deserializedImageClassificationMultilabel.validationData = MLTableJobInput.fromJson(reader); + } else if ("validationDataSize".equals(fieldName)) { + deserializedImageClassificationMultilabel.validationDataSize + = reader.getNullable(JsonReader::getDouble); + } else { + reader.skipChildren(); + } + } + + return deserializedImageClassificationMultilabel; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageInstanceSegmentation.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageInstanceSegmentation.java index 83c6fb3614ba3..ffe3c8d31401d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageInstanceSegmentation.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageInstanceSegmentation.java @@ -6,53 +6,51 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Image Instance Segmentation. Instance segmentation is used to identify objects in an image at the pixel level, * drawing a polygon around each object in the image. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") -@JsonTypeName("ImageInstanceSegmentation") @Fluent public final class ImageInstanceSegmentation extends AutoMLVertical { + /* + * [Required] Task type for AutoMLJob. + */ + private TaskType taskType = TaskType.IMAGE_INSTANCE_SEGMENTATION; + /* * Primary metric to optimize for this task. */ - @JsonProperty(value = "primaryMetric") private InstanceSegmentationPrimaryMetrics primaryMetric; /* * Settings used for training the model. */ - @JsonProperty(value = "modelSettings") private ImageModelSettingsObjectDetection modelSettings; /* * Search space for sampling different combinations of models and their hyperparameters. */ - @JsonProperty(value = "searchSpace") private List searchSpace; /* * [Required] Limit settings for the AutoML job. */ - @JsonProperty(value = "limitSettings", required = true) private ImageLimitSettings limitSettings; /* * Model sweeping and hyperparameter sweeping related settings. */ - @JsonProperty(value = "sweepSettings") private ImageSweepSettings sweepSettings; /* * Validation data inputs. */ - @JsonProperty(value = "validationData") private MLTableJobInput validationData; /* @@ -60,16 +58,27 @@ public final class ImageInstanceSegmentation extends AutoMLVertical { * Values between (0.0 , 1.0) * Applied when validation dataset is not provided. */ - @JsonProperty(value = "validationDataSize") private Double validationDataSize; - /** Creates an instance of ImageInstanceSegmentation class. */ + /** + * Creates an instance of ImageInstanceSegmentation class. + */ public ImageInstanceSegmentation() { } + /** + * Get the taskType property: [Required] Task type for AutoMLJob. + * + * @return the taskType value. + */ + @Override + public TaskType taskType() { + return this.taskType; + } + /** * Get the primaryMetric property: Primary metric to optimize for this task. - * + * * @return the primaryMetric value. */ public InstanceSegmentationPrimaryMetrics primaryMetric() { @@ -78,7 +87,7 @@ public InstanceSegmentationPrimaryMetrics primaryMetric() { /** * Set the primaryMetric property: Primary metric to optimize for this task. - * + * * @param primaryMetric the primaryMetric value to set. * @return the ImageInstanceSegmentation object itself. */ @@ -89,7 +98,7 @@ public ImageInstanceSegmentation withPrimaryMetric(InstanceSegmentationPrimaryMe /** * Get the modelSettings property: Settings used for training the model. - * + * * @return the modelSettings value. */ public ImageModelSettingsObjectDetection modelSettings() { @@ -98,7 +107,7 @@ public ImageModelSettingsObjectDetection modelSettings() { /** * Set the modelSettings property: Settings used for training the model. - * + * * @param modelSettings the modelSettings value to set. * @return the ImageInstanceSegmentation object itself. */ @@ -110,7 +119,7 @@ public ImageInstanceSegmentation withModelSettings(ImageModelSettingsObjectDetec /** * Get the searchSpace property: Search space for sampling different combinations of models and their * hyperparameters. - * + * * @return the searchSpace value. */ public List searchSpace() { @@ -120,7 +129,7 @@ public List searchSpace() { /** * Set the searchSpace property: Search space for sampling different combinations of models and their * hyperparameters. - * + * * @param searchSpace the searchSpace value to set. * @return the ImageInstanceSegmentation object itself. */ @@ -131,7 +140,7 @@ public ImageInstanceSegmentation withSearchSpace(List e.validate()); } if (limitSettings() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property limitSettings in model ImageInstanceSegmentation")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property limitSettings in model ImageInstanceSegmentation")); } else { limitSettings().validate(); } @@ -263,4 +281,76 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(ImageInstanceSegmentation.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("trainingData", trainingData()); + jsonWriter.writeStringField("logVerbosity", logVerbosity() == null ? null : logVerbosity().toString()); + jsonWriter.writeStringField("targetColumnName", targetColumnName()); + jsonWriter.writeJsonField("limitSettings", this.limitSettings); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); + jsonWriter.writeStringField("primaryMetric", this.primaryMetric == null ? null : this.primaryMetric.toString()); + jsonWriter.writeJsonField("modelSettings", this.modelSettings); + jsonWriter.writeArrayField("searchSpace", this.searchSpace, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("sweepSettings", this.sweepSettings); + jsonWriter.writeJsonField("validationData", this.validationData); + jsonWriter.writeNumberField("validationDataSize", this.validationDataSize); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageInstanceSegmentation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageInstanceSegmentation if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ImageInstanceSegmentation. + */ + public static ImageInstanceSegmentation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageInstanceSegmentation deserializedImageInstanceSegmentation = new ImageInstanceSegmentation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("trainingData".equals(fieldName)) { + deserializedImageInstanceSegmentation.withTrainingData(MLTableJobInput.fromJson(reader)); + } else if ("logVerbosity".equals(fieldName)) { + deserializedImageInstanceSegmentation.withLogVerbosity(LogVerbosity.fromString(reader.getString())); + } else if ("targetColumnName".equals(fieldName)) { + deserializedImageInstanceSegmentation.withTargetColumnName(reader.getString()); + } else if ("limitSettings".equals(fieldName)) { + deserializedImageInstanceSegmentation.limitSettings = ImageLimitSettings.fromJson(reader); + } else if ("taskType".equals(fieldName)) { + deserializedImageInstanceSegmentation.taskType = TaskType.fromString(reader.getString()); + } else if ("primaryMetric".equals(fieldName)) { + deserializedImageInstanceSegmentation.primaryMetric + = InstanceSegmentationPrimaryMetrics.fromString(reader.getString()); + } else if ("modelSettings".equals(fieldName)) { + deserializedImageInstanceSegmentation.modelSettings + = ImageModelSettingsObjectDetection.fromJson(reader); + } else if ("searchSpace".equals(fieldName)) { + List searchSpace + = reader.readArray(reader1 -> ImageModelDistributionSettingsObjectDetection.fromJson(reader1)); + deserializedImageInstanceSegmentation.searchSpace = searchSpace; + } else if ("sweepSettings".equals(fieldName)) { + deserializedImageInstanceSegmentation.sweepSettings = ImageSweepSettings.fromJson(reader); + } else if ("validationData".equals(fieldName)) { + deserializedImageInstanceSegmentation.validationData = MLTableJobInput.fromJson(reader); + } else if ("validationDataSize".equals(fieldName)) { + deserializedImageInstanceSegmentation.validationDataSize + = reader.getNullable(JsonReader::getDouble); + } else { + reader.skipChildren(); + } + } + + return deserializedImageInstanceSegmentation; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageLimitSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageLimitSettings.java index 3bacfabcce467..6b77c84bd1d67 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageLimitSettings.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageLimitSettings.java @@ -5,37 +5,43 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.Duration; -/** Limit settings for the AutoML job. */ +/** + * Limit settings for the AutoML job. + */ @Fluent -public final class ImageLimitSettings { +public final class ImageLimitSettings implements JsonSerializable { /* * Maximum number of concurrent AutoML iterations. */ - @JsonProperty(value = "maxConcurrentTrials") private Integer maxConcurrentTrials; /* * Maximum number of AutoML iterations. */ - @JsonProperty(value = "maxTrials") private Integer maxTrials; /* * AutoML job timeout. */ - @JsonProperty(value = "timeout") private Duration timeout; - /** Creates an instance of ImageLimitSettings class. */ + /** + * Creates an instance of ImageLimitSettings class. + */ public ImageLimitSettings() { } /** * Get the maxConcurrentTrials property: Maximum number of concurrent AutoML iterations. - * + * * @return the maxConcurrentTrials value. */ public Integer maxConcurrentTrials() { @@ -44,7 +50,7 @@ public Integer maxConcurrentTrials() { /** * Set the maxConcurrentTrials property: Maximum number of concurrent AutoML iterations. - * + * * @param maxConcurrentTrials the maxConcurrentTrials value to set. * @return the ImageLimitSettings object itself. */ @@ -55,7 +61,7 @@ public ImageLimitSettings withMaxConcurrentTrials(Integer maxConcurrentTrials) { /** * Get the maxTrials property: Maximum number of AutoML iterations. - * + * * @return the maxTrials value. */ public Integer maxTrials() { @@ -64,7 +70,7 @@ public Integer maxTrials() { /** * Set the maxTrials property: Maximum number of AutoML iterations. - * + * * @param maxTrials the maxTrials value to set. * @return the ImageLimitSettings object itself. */ @@ -75,7 +81,7 @@ public ImageLimitSettings withMaxTrials(Integer maxTrials) { /** * Get the timeout property: AutoML job timeout. - * + * * @return the timeout value. */ public Duration timeout() { @@ -84,7 +90,7 @@ public Duration timeout() { /** * Set the timeout property: AutoML job timeout. - * + * * @param timeout the timeout value to set. * @return the ImageLimitSettings object itself. */ @@ -95,9 +101,52 @@ public ImageLimitSettings withTimeout(Duration timeout) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("maxConcurrentTrials", this.maxConcurrentTrials); + jsonWriter.writeNumberField("maxTrials", this.maxTrials); + jsonWriter.writeStringField("timeout", CoreUtils.durationToStringWithDays(this.timeout)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageLimitSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageLimitSettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ImageLimitSettings. + */ + public static ImageLimitSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageLimitSettings deserializedImageLimitSettings = new ImageLimitSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("maxConcurrentTrials".equals(fieldName)) { + deserializedImageLimitSettings.maxConcurrentTrials = reader.getNullable(JsonReader::getInt); + } else if ("maxTrials".equals(fieldName)) { + deserializedImageLimitSettings.maxTrials = reader.getNullable(JsonReader::getInt); + } else if ("timeout".equals(fieldName)) { + deserializedImageLimitSettings.timeout + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedImageLimitSettings; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageMetadata.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageMetadata.java new file mode 100644 index 0000000000000..751e4968480d4 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageMetadata.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Returns metadata about the operating system image for this compute instance. + */ +@Fluent +public final class ImageMetadata implements JsonSerializable { + /* + * Specifies the current operating system image version this compute instance is running on. + */ + private String currentImageVersion; + + /* + * Specifies the latest available operating system image version. + */ + private String latestImageVersion; + + /* + * Specifies whether this compute instance is running on the latest operating system image. + */ + private Boolean isLatestOsImageVersion; + + /** + * Creates an instance of ImageMetadata class. + */ + public ImageMetadata() { + } + + /** + * Get the currentImageVersion property: Specifies the current operating system image version this compute instance + * is running on. + * + * @return the currentImageVersion value. + */ + public String currentImageVersion() { + return this.currentImageVersion; + } + + /** + * Set the currentImageVersion property: Specifies the current operating system image version this compute instance + * is running on. + * + * @param currentImageVersion the currentImageVersion value to set. + * @return the ImageMetadata object itself. + */ + public ImageMetadata withCurrentImageVersion(String currentImageVersion) { + this.currentImageVersion = currentImageVersion; + return this; + } + + /** + * Get the latestImageVersion property: Specifies the latest available operating system image version. + * + * @return the latestImageVersion value. + */ + public String latestImageVersion() { + return this.latestImageVersion; + } + + /** + * Set the latestImageVersion property: Specifies the latest available operating system image version. + * + * @param latestImageVersion the latestImageVersion value to set. + * @return the ImageMetadata object itself. + */ + public ImageMetadata withLatestImageVersion(String latestImageVersion) { + this.latestImageVersion = latestImageVersion; + return this; + } + + /** + * Get the isLatestOsImageVersion property: Specifies whether this compute instance is running on the latest + * operating system image. + * + * @return the isLatestOsImageVersion value. + */ + public Boolean isLatestOsImageVersion() { + return this.isLatestOsImageVersion; + } + + /** + * Set the isLatestOsImageVersion property: Specifies whether this compute instance is running on the latest + * operating system image. + * + * @param isLatestOsImageVersion the isLatestOsImageVersion value to set. + * @return the ImageMetadata object itself. + */ + public ImageMetadata withIsLatestOsImageVersion(Boolean isLatestOsImageVersion) { + this.isLatestOsImageVersion = isLatestOsImageVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("currentImageVersion", this.currentImageVersion); + jsonWriter.writeStringField("latestImageVersion", this.latestImageVersion); + jsonWriter.writeBooleanField("isLatestOsImageVersion", this.isLatestOsImageVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageMetadata from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageMetadata if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ImageMetadata. + */ + public static ImageMetadata fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageMetadata deserializedImageMetadata = new ImageMetadata(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("currentImageVersion".equals(fieldName)) { + deserializedImageMetadata.currentImageVersion = reader.getString(); + } else if ("latestImageVersion".equals(fieldName)) { + deserializedImageMetadata.latestImageVersion = reader.getString(); + } else if ("isLatestOsImageVersion".equals(fieldName)) { + deserializedImageMetadata.isLatestOsImageVersion = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedImageMetadata; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelDistributionSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelDistributionSettings.java index 968ea07751a86..260a57e548af9 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelDistributionSettings.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelDistributionSettings.java @@ -5,88 +5,87 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** - * Distribution expressions to sweep over values of model settings. <example> Some examples are: <code> - * ModelName = "choice('seresnext', 'resnest50')"; LearningRate = "uniform(0.001, 0.01)"; LayersToFreeze = "choice(0, - * 2)"; </code></example> 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: + * Distribution expressions to sweep over values of model settings. + * <example> + * Some examples are: + * ``` + * ModelName = "choice('seresnext', 'resnest50')"; + * LearningRate = "uniform(0.001, 0.01)"; + * LayersToFreeze = "choice(0, 2)"; + * ```</example> + * 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. */ @Fluent -public class ImageModelDistributionSettings { +public class ImageModelDistributionSettings implements JsonSerializable { /* * Enable AMSGrad when optimizer is 'adam' or 'adamw'. */ - @JsonProperty(value = "amsGradient") private String amsGradient; /* * Settings for using Augmentations. */ - @JsonProperty(value = "augmentations") private String augmentations; /* * Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range [0, 1]. */ - @JsonProperty(value = "beta1") private String beta1; /* * Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range [0, 1]. */ - @JsonProperty(value = "beta2") private String beta2; /* * Whether to use distributer training. */ - @JsonProperty(value = "distributed") private String distributed; /* * Enable early stopping logic during training. */ - @JsonProperty(value = "earlyStopping") private String earlyStopping; /* * Minimum number of epochs or validation evaluations to wait before primary metric improvement * is tracked for early stopping. Must be a positive integer. */ - @JsonProperty(value = "earlyStoppingDelay") private String earlyStoppingDelay; /* * Minimum number of epochs or validation evaluations with no primary metric improvement before * the run is stopped. Must be a positive integer. */ - @JsonProperty(value = "earlyStoppingPatience") private String earlyStoppingPatience; /* * Enable normalization when exporting ONNX model. */ - @JsonProperty(value = "enableOnnxNormalization") private String enableOnnxNormalization; /* * Frequency to evaluate validation dataset to get metric scores. Must be a positive integer. */ - @JsonProperty(value = "evaluationFrequency") private String evaluationFrequency; /* - * Gradient accumulation means running a configured number of "GradAccumulationStep"\ steps without + * Gradient accumulation means running a configured number of "GradAccumulationStep" steps without * updating the model weights while accumulating the gradients of those steps, and then using * the accumulated gradients to compute the weight updates. Must be a positive integer. */ - @JsonProperty(value = "gradientAccumulationStep") private String gradientAccumulationStep; /* @@ -95,19 +94,16 @@ public class ImageModelDistributionSettings { * freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please * see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. */ - @JsonProperty(value = "layersToFreeze") private String layersToFreeze; /* * Initial learning rate. Must be a float in the range [0, 1]. */ - @JsonProperty(value = "learningRate") private String learningRate; /* * Type of learning rate scheduler. Must be 'warmup_cosine' or 'step'. */ - @JsonProperty(value = "learningRateScheduler") private String learningRateScheduler; /* @@ -115,94 +111,82 @@ public class ImageModelDistributionSettings { * For more information on the available models please visit the official documentation: * https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. */ - @JsonProperty(value = "modelName") private String modelName; /* * Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. */ - @JsonProperty(value = "momentum") private String momentum; /* * Enable nesterov when optimizer is 'sgd'. */ - @JsonProperty(value = "nesterov") private String nesterov; /* * Number of training epochs. Must be a positive integer. */ - @JsonProperty(value = "numberOfEpochs") private String numberOfEpochs; /* * Number of data loader workers. Must be a non-negative integer. */ - @JsonProperty(value = "numberOfWorkers") private String numberOfWorkers; /* * Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. */ - @JsonProperty(value = "optimizer") private String optimizer; /* * Random seed to be used when using deterministic training. */ - @JsonProperty(value = "randomSeed") private String randomSeed; /* * Value of gamma when learning rate scheduler is 'step'. Must be a float in the range [0, 1]. */ - @JsonProperty(value = "stepLRGamma") private String stepLRGamma; /* * Value of step size when learning rate scheduler is 'step'. Must be a positive integer. */ - @JsonProperty(value = "stepLRStepSize") private String stepLRStepSize; /* * Training batch size. Must be a positive integer. */ - @JsonProperty(value = "trainingBatchSize") private String trainingBatchSize; /* * Validation batch size. Must be a positive integer. */ - @JsonProperty(value = "validationBatchSize") private String validationBatchSize; /* * Value of cosine cycle when learning rate scheduler is 'warmup_cosine'. Must be a float in the range [0, 1]. */ - @JsonProperty(value = "warmupCosineLRCycles") private String warmupCosineLRCycles; /* * Value of warmup epochs when learning rate scheduler is 'warmup_cosine'. Must be a positive integer. */ - @JsonProperty(value = "warmupCosineLRWarmupEpochs") private String warmupCosineLRWarmupEpochs; /* * Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be a float in the range[0, 1]. */ - @JsonProperty(value = "weightDecay") private String weightDecay; - /** Creates an instance of ImageModelDistributionSettings class. */ + /** + * Creates an instance of ImageModelDistributionSettings class. + */ public ImageModelDistributionSettings() { } /** * Get the amsGradient property: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - * + * * @return the amsGradient value. */ public String amsGradient() { @@ -211,7 +195,7 @@ public String amsGradient() { /** * Set the amsGradient property: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - * + * * @param amsGradient the amsGradient value to set. * @return the ImageModelDistributionSettings object itself. */ @@ -222,7 +206,7 @@ public ImageModelDistributionSettings withAmsGradient(String amsGradient) { /** * Get the augmentations property: Settings for using Augmentations. - * + * * @return the augmentations value. */ public String augmentations() { @@ -231,7 +215,7 @@ public String augmentations() { /** * Set the augmentations property: Settings for using Augmentations. - * + * * @param augmentations the augmentations value to set. * @return the ImageModelDistributionSettings object itself. */ @@ -243,7 +227,7 @@ public ImageModelDistributionSettings withAugmentations(String augmentations) { /** * Get the beta1 property: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range [0, * 1]. - * + * * @return the beta1 value. */ public String beta1() { @@ -253,7 +237,7 @@ public String beta1() { /** * Set the beta1 property: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range [0, * 1]. - * + * * @param beta1 the beta1 value to set. * @return the ImageModelDistributionSettings object itself. */ @@ -265,7 +249,7 @@ public ImageModelDistributionSettings withBeta1(String beta1) { /** * Get the beta2 property: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range [0, * 1]. - * + * * @return the beta2 value. */ public String beta2() { @@ -275,7 +259,7 @@ public String beta2() { /** * Set the beta2 property: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range [0, * 1]. - * + * * @param beta2 the beta2 value to set. * @return the ImageModelDistributionSettings object itself. */ @@ -286,7 +270,7 @@ public ImageModelDistributionSettings withBeta2(String beta2) { /** * Get the distributed property: Whether to use distributer training. - * + * * @return the distributed value. */ public String distributed() { @@ -295,7 +279,7 @@ public String distributed() { /** * Set the distributed property: Whether to use distributer training. - * + * * @param distributed the distributed value to set. * @return the ImageModelDistributionSettings object itself. */ @@ -306,7 +290,7 @@ public ImageModelDistributionSettings withDistributed(String distributed) { /** * Get the earlyStopping property: Enable early stopping logic during training. - * + * * @return the earlyStopping value. */ public String earlyStopping() { @@ -315,7 +299,7 @@ public String earlyStopping() { /** * Set the earlyStopping property: Enable early stopping logic during training. - * + * * @param earlyStopping the earlyStopping value to set. * @return the ImageModelDistributionSettings object itself. */ @@ -326,8 +310,9 @@ public ImageModelDistributionSettings withEarlyStopping(String earlyStopping) { /** * Get the earlyStoppingDelay property: Minimum number of epochs or validation evaluations to wait before primary - * metric improvement is tracked for early stopping. Must be a positive integer. - * + * metric improvement + * is tracked for early stopping. Must be a positive integer. + * * @return the earlyStoppingDelay value. */ public String earlyStoppingDelay() { @@ -336,8 +321,9 @@ public String earlyStoppingDelay() { /** * Set the earlyStoppingDelay property: Minimum number of epochs or validation evaluations to wait before primary - * metric improvement is tracked for early stopping. Must be a positive integer. - * + * metric improvement + * is tracked for early stopping. Must be a positive integer. + * * @param earlyStoppingDelay the earlyStoppingDelay value to set. * @return the ImageModelDistributionSettings object itself. */ @@ -348,8 +334,9 @@ public ImageModelDistributionSettings withEarlyStoppingDelay(String earlyStoppin /** * Get the earlyStoppingPatience property: Minimum number of epochs or validation evaluations with no primary metric - * improvement before the run is stopped. Must be a positive integer. - * + * improvement before + * the run is stopped. Must be a positive integer. + * * @return the earlyStoppingPatience value. */ public String earlyStoppingPatience() { @@ -358,8 +345,9 @@ public String earlyStoppingPatience() { /** * Set the earlyStoppingPatience property: Minimum number of epochs or validation evaluations with no primary metric - * improvement before the run is stopped. Must be a positive integer. - * + * improvement before + * the run is stopped. Must be a positive integer. + * * @param earlyStoppingPatience the earlyStoppingPatience value to set. * @return the ImageModelDistributionSettings object itself. */ @@ -370,7 +358,7 @@ public ImageModelDistributionSettings withEarlyStoppingPatience(String earlyStop /** * Get the enableOnnxNormalization property: Enable normalization when exporting ONNX model. - * + * * @return the enableOnnxNormalization value. */ public String enableOnnxNormalization() { @@ -379,7 +367,7 @@ public String enableOnnxNormalization() { /** * Set the enableOnnxNormalization property: Enable normalization when exporting ONNX model. - * + * * @param enableOnnxNormalization the enableOnnxNormalization value to set. * @return the ImageModelDistributionSettings object itself. */ @@ -391,7 +379,7 @@ public ImageModelDistributionSettings withEnableOnnxNormalization(String enableO /** * Get the evaluationFrequency property: Frequency to evaluate validation dataset to get metric scores. Must be a * positive integer. - * + * * @return the evaluationFrequency value. */ public String evaluationFrequency() { @@ -401,7 +389,7 @@ public String evaluationFrequency() { /** * Set the evaluationFrequency property: Frequency to evaluate validation dataset to get metric scores. Must be a * positive integer. - * + * * @param evaluationFrequency the evaluationFrequency value to set. * @return the ImageModelDistributionSettings object itself. */ @@ -412,9 +400,10 @@ public ImageModelDistributionSettings withEvaluationFrequency(String evaluationF /** * Get the gradientAccumulationStep property: Gradient accumulation means running a configured number of - * "GradAccumulationStep"\ steps without updating the model weights while accumulating the gradients of those steps, - * and then using the accumulated gradients to compute the weight updates. Must be a positive integer. - * + * "GradAccumulationStep" steps without + * updating the model weights while accumulating the gradients of those steps, and then using + * the accumulated gradients to compute the weight updates. Must be a positive integer. + * * @return the gradientAccumulationStep value. */ public String gradientAccumulationStep() { @@ -423,9 +412,10 @@ public String gradientAccumulationStep() { /** * Set the gradientAccumulationStep property: Gradient accumulation means running a configured number of - * "GradAccumulationStep"\ steps without updating the model weights while accumulating the gradients of those steps, - * and then using the accumulated gradients to compute the weight updates. Must be a positive integer. - * + * "GradAccumulationStep" steps without + * updating the model weights while accumulating the gradients of those steps, and then using + * the accumulated gradients to compute the weight updates. Must be a positive integer. + * * @param gradientAccumulationStep the gradientAccumulationStep value to set. * @return the ImageModelDistributionSettings object itself. */ @@ -435,11 +425,11 @@ public ImageModelDistributionSettings withGradientAccumulationStep(String gradie } /** - * Get the layersToFreeze property: Number of layers to freeze for the model. Must be a positive integer. For - * instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models - * supported and details on layer freeze, please see: - * https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - * + * Get the layersToFreeze property: Number of layers to freeze for the model. Must be a positive integer. + * For instance, passing 2 as value for 'seresnext' means + * freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please + * see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + * * @return the layersToFreeze value. */ public String layersToFreeze() { @@ -447,11 +437,11 @@ public String layersToFreeze() { } /** - * Set the layersToFreeze property: Number of layers to freeze for the model. Must be a positive integer. For - * instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models - * supported and details on layer freeze, please see: - * https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - * + * Set the layersToFreeze property: Number of layers to freeze for the model. Must be a positive integer. + * For instance, passing 2 as value for 'seresnext' means + * freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please + * see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + * * @param layersToFreeze the layersToFreeze value to set. * @return the ImageModelDistributionSettings object itself. */ @@ -462,7 +452,7 @@ public ImageModelDistributionSettings withLayersToFreeze(String layersToFreeze) /** * Get the learningRate property: Initial learning rate. Must be a float in the range [0, 1]. - * + * * @return the learningRate value. */ public String learningRate() { @@ -471,7 +461,7 @@ public String learningRate() { /** * Set the learningRate property: Initial learning rate. Must be a float in the range [0, 1]. - * + * * @param learningRate the learningRate value to set. * @return the ImageModelDistributionSettings object itself. */ @@ -482,7 +472,7 @@ public ImageModelDistributionSettings withLearningRate(String learningRate) { /** * Get the learningRateScheduler property: Type of learning rate scheduler. Must be 'warmup_cosine' or 'step'. - * + * * @return the learningRateScheduler value. */ public String learningRateScheduler() { @@ -491,7 +481,7 @@ public String learningRateScheduler() { /** * Set the learningRateScheduler property: Type of learning rate scheduler. Must be 'warmup_cosine' or 'step'. - * + * * @param learningRateScheduler the learningRateScheduler value to set. * @return the ImageModelDistributionSettings object itself. */ @@ -501,10 +491,10 @@ public ImageModelDistributionSettings withLearningRateScheduler(String learningR } /** - * Get the modelName property: Name of the model to use for training. For more information on the available models - * please visit the official documentation: + * Get the modelName property: Name of the model to use for training. + * For more information on the available models please visit the official documentation: * https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - * + * * @return the modelName value. */ public String modelName() { @@ -512,10 +502,10 @@ public String modelName() { } /** - * Set the modelName property: Name of the model to use for training. For more information on the available models - * please visit the official documentation: + * Set the modelName property: Name of the model to use for training. + * For more information on the available models please visit the official documentation: * https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - * + * * @param modelName the modelName value to set. * @return the ImageModelDistributionSettings object itself. */ @@ -526,7 +516,7 @@ public ImageModelDistributionSettings withModelName(String modelName) { /** * Get the momentum property: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - * + * * @return the momentum value. */ public String momentum() { @@ -535,7 +525,7 @@ public String momentum() { /** * Set the momentum property: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - * + * * @param momentum the momentum value to set. * @return the ImageModelDistributionSettings object itself. */ @@ -546,7 +536,7 @@ public ImageModelDistributionSettings withMomentum(String momentum) { /** * Get the nesterov property: Enable nesterov when optimizer is 'sgd'. - * + * * @return the nesterov value. */ public String nesterov() { @@ -555,7 +545,7 @@ public String nesterov() { /** * Set the nesterov property: Enable nesterov when optimizer is 'sgd'. - * + * * @param nesterov the nesterov value to set. * @return the ImageModelDistributionSettings object itself. */ @@ -566,7 +556,7 @@ public ImageModelDistributionSettings withNesterov(String nesterov) { /** * Get the numberOfEpochs property: Number of training epochs. Must be a positive integer. - * + * * @return the numberOfEpochs value. */ public String numberOfEpochs() { @@ -575,7 +565,7 @@ public String numberOfEpochs() { /** * Set the numberOfEpochs property: Number of training epochs. Must be a positive integer. - * + * * @param numberOfEpochs the numberOfEpochs value to set. * @return the ImageModelDistributionSettings object itself. */ @@ -586,7 +576,7 @@ public ImageModelDistributionSettings withNumberOfEpochs(String numberOfEpochs) /** * Get the numberOfWorkers property: Number of data loader workers. Must be a non-negative integer. - * + * * @return the numberOfWorkers value. */ public String numberOfWorkers() { @@ -595,7 +585,7 @@ public String numberOfWorkers() { /** * Set the numberOfWorkers property: Number of data loader workers. Must be a non-negative integer. - * + * * @param numberOfWorkers the numberOfWorkers value to set. * @return the ImageModelDistributionSettings object itself. */ @@ -606,7 +596,7 @@ public ImageModelDistributionSettings withNumberOfWorkers(String numberOfWorkers /** * Get the optimizer property: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - * + * * @return the optimizer value. */ public String optimizer() { @@ -615,7 +605,7 @@ public String optimizer() { /** * Set the optimizer property: Type of optimizer. Must be either 'sgd', 'adam', or 'adamw'. - * + * * @param optimizer the optimizer value to set. * @return the ImageModelDistributionSettings object itself. */ @@ -626,7 +616,7 @@ public ImageModelDistributionSettings withOptimizer(String optimizer) { /** * Get the randomSeed property: Random seed to be used when using deterministic training. - * + * * @return the randomSeed value. */ public String randomSeed() { @@ -635,7 +625,7 @@ public String randomSeed() { /** * Set the randomSeed property: Random seed to be used when using deterministic training. - * + * * @param randomSeed the randomSeed value to set. * @return the ImageModelDistributionSettings object itself. */ @@ -647,7 +637,7 @@ public ImageModelDistributionSettings withRandomSeed(String randomSeed) { /** * Get the stepLRGamma property: Value of gamma when learning rate scheduler is 'step'. Must be a float in the range * [0, 1]. - * + * * @return the stepLRGamma value. */ public String stepLRGamma() { @@ -657,7 +647,7 @@ public String stepLRGamma() { /** * Set the stepLRGamma property: Value of gamma when learning rate scheduler is 'step'. Must be a float in the range * [0, 1]. - * + * * @param stepLRGamma the stepLRGamma value to set. * @return the ImageModelDistributionSettings object itself. */ @@ -669,7 +659,7 @@ public ImageModelDistributionSettings withStepLRGamma(String stepLRGamma) { /** * Get the stepLRStepSize property: Value of step size when learning rate scheduler is 'step'. Must be a positive * integer. - * + * * @return the stepLRStepSize value. */ public String stepLRStepSize() { @@ -679,7 +669,7 @@ public String stepLRStepSize() { /** * Set the stepLRStepSize property: Value of step size when learning rate scheduler is 'step'. Must be a positive * integer. - * + * * @param stepLRStepSize the stepLRStepSize value to set. * @return the ImageModelDistributionSettings object itself. */ @@ -690,7 +680,7 @@ public ImageModelDistributionSettings withStepLRStepSize(String stepLRStepSize) /** * Get the trainingBatchSize property: Training batch size. Must be a positive integer. - * + * * @return the trainingBatchSize value. */ public String trainingBatchSize() { @@ -699,7 +689,7 @@ public String trainingBatchSize() { /** * Set the trainingBatchSize property: Training batch size. Must be a positive integer. - * + * * @param trainingBatchSize the trainingBatchSize value to set. * @return the ImageModelDistributionSettings object itself. */ @@ -710,7 +700,7 @@ public ImageModelDistributionSettings withTrainingBatchSize(String trainingBatch /** * Get the validationBatchSize property: Validation batch size. Must be a positive integer. - * + * * @return the validationBatchSize value. */ public String validationBatchSize() { @@ -719,7 +709,7 @@ public String validationBatchSize() { /** * Set the validationBatchSize property: Validation batch size. Must be a positive integer. - * + * * @param validationBatchSize the validationBatchSize value to set. * @return the ImageModelDistributionSettings object itself. */ @@ -731,7 +721,7 @@ public ImageModelDistributionSettings withValidationBatchSize(String validationB /** * Get the warmupCosineLRCycles property: Value of cosine cycle when learning rate scheduler is 'warmup_cosine'. * Must be a float in the range [0, 1]. - * + * * @return the warmupCosineLRCycles value. */ public String warmupCosineLRCycles() { @@ -741,7 +731,7 @@ public String warmupCosineLRCycles() { /** * Set the warmupCosineLRCycles property: Value of cosine cycle when learning rate scheduler is 'warmup_cosine'. * Must be a float in the range [0, 1]. - * + * * @param warmupCosineLRCycles the warmupCosineLRCycles value to set. * @return the ImageModelDistributionSettings object itself. */ @@ -753,7 +743,7 @@ public ImageModelDistributionSettings withWarmupCosineLRCycles(String warmupCosi /** * Get the warmupCosineLRWarmupEpochs property: Value of warmup epochs when learning rate scheduler is * 'warmup_cosine'. Must be a positive integer. - * + * * @return the warmupCosineLRWarmupEpochs value. */ public String warmupCosineLRWarmupEpochs() { @@ -763,7 +753,7 @@ public String warmupCosineLRWarmupEpochs() { /** * Set the warmupCosineLRWarmupEpochs property: Value of warmup epochs when learning rate scheduler is * 'warmup_cosine'. Must be a positive integer. - * + * * @param warmupCosineLRWarmupEpochs the warmupCosineLRWarmupEpochs value to set. * @return the ImageModelDistributionSettings object itself. */ @@ -775,7 +765,7 @@ public ImageModelDistributionSettings withWarmupCosineLRWarmupEpochs(String warm /** * Get the weightDecay property: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be a float * in the range[0, 1]. - * + * * @return the weightDecay value. */ public String weightDecay() { @@ -785,7 +775,7 @@ public String weightDecay() { /** * Set the weightDecay property: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be a float * in the range[0, 1]. - * + * * @param weightDecay the weightDecay value to set. * @return the ImageModelDistributionSettings object itself. */ @@ -796,9 +786,127 @@ public ImageModelDistributionSettings withWeightDecay(String weightDecay) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("amsGradient", this.amsGradient); + jsonWriter.writeStringField("augmentations", this.augmentations); + jsonWriter.writeStringField("beta1", this.beta1); + jsonWriter.writeStringField("beta2", this.beta2); + jsonWriter.writeStringField("distributed", this.distributed); + jsonWriter.writeStringField("earlyStopping", this.earlyStopping); + jsonWriter.writeStringField("earlyStoppingDelay", this.earlyStoppingDelay); + jsonWriter.writeStringField("earlyStoppingPatience", this.earlyStoppingPatience); + jsonWriter.writeStringField("enableOnnxNormalization", this.enableOnnxNormalization); + jsonWriter.writeStringField("evaluationFrequency", this.evaluationFrequency); + jsonWriter.writeStringField("gradientAccumulationStep", this.gradientAccumulationStep); + jsonWriter.writeStringField("layersToFreeze", this.layersToFreeze); + jsonWriter.writeStringField("learningRate", this.learningRate); + jsonWriter.writeStringField("learningRateScheduler", this.learningRateScheduler); + jsonWriter.writeStringField("modelName", this.modelName); + jsonWriter.writeStringField("momentum", this.momentum); + jsonWriter.writeStringField("nesterov", this.nesterov); + jsonWriter.writeStringField("numberOfEpochs", this.numberOfEpochs); + jsonWriter.writeStringField("numberOfWorkers", this.numberOfWorkers); + jsonWriter.writeStringField("optimizer", this.optimizer); + jsonWriter.writeStringField("randomSeed", this.randomSeed); + jsonWriter.writeStringField("stepLRGamma", this.stepLRGamma); + jsonWriter.writeStringField("stepLRStepSize", this.stepLRStepSize); + jsonWriter.writeStringField("trainingBatchSize", this.trainingBatchSize); + jsonWriter.writeStringField("validationBatchSize", this.validationBatchSize); + jsonWriter.writeStringField("warmupCosineLRCycles", this.warmupCosineLRCycles); + jsonWriter.writeStringField("warmupCosineLRWarmupEpochs", this.warmupCosineLRWarmupEpochs); + jsonWriter.writeStringField("weightDecay", this.weightDecay); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageModelDistributionSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageModelDistributionSettings if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ImageModelDistributionSettings. + */ + public static ImageModelDistributionSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageModelDistributionSettings deserializedImageModelDistributionSettings + = new ImageModelDistributionSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("amsGradient".equals(fieldName)) { + deserializedImageModelDistributionSettings.amsGradient = reader.getString(); + } else if ("augmentations".equals(fieldName)) { + deserializedImageModelDistributionSettings.augmentations = reader.getString(); + } else if ("beta1".equals(fieldName)) { + deserializedImageModelDistributionSettings.beta1 = reader.getString(); + } else if ("beta2".equals(fieldName)) { + deserializedImageModelDistributionSettings.beta2 = reader.getString(); + } else if ("distributed".equals(fieldName)) { + deserializedImageModelDistributionSettings.distributed = reader.getString(); + } else if ("earlyStopping".equals(fieldName)) { + deserializedImageModelDistributionSettings.earlyStopping = reader.getString(); + } else if ("earlyStoppingDelay".equals(fieldName)) { + deserializedImageModelDistributionSettings.earlyStoppingDelay = reader.getString(); + } else if ("earlyStoppingPatience".equals(fieldName)) { + deserializedImageModelDistributionSettings.earlyStoppingPatience = reader.getString(); + } else if ("enableOnnxNormalization".equals(fieldName)) { + deserializedImageModelDistributionSettings.enableOnnxNormalization = reader.getString(); + } else if ("evaluationFrequency".equals(fieldName)) { + deserializedImageModelDistributionSettings.evaluationFrequency = reader.getString(); + } else if ("gradientAccumulationStep".equals(fieldName)) { + deserializedImageModelDistributionSettings.gradientAccumulationStep = reader.getString(); + } else if ("layersToFreeze".equals(fieldName)) { + deserializedImageModelDistributionSettings.layersToFreeze = reader.getString(); + } else if ("learningRate".equals(fieldName)) { + deserializedImageModelDistributionSettings.learningRate = reader.getString(); + } else if ("learningRateScheduler".equals(fieldName)) { + deserializedImageModelDistributionSettings.learningRateScheduler = reader.getString(); + } else if ("modelName".equals(fieldName)) { + deserializedImageModelDistributionSettings.modelName = reader.getString(); + } else if ("momentum".equals(fieldName)) { + deserializedImageModelDistributionSettings.momentum = reader.getString(); + } else if ("nesterov".equals(fieldName)) { + deserializedImageModelDistributionSettings.nesterov = reader.getString(); + } else if ("numberOfEpochs".equals(fieldName)) { + deserializedImageModelDistributionSettings.numberOfEpochs = reader.getString(); + } else if ("numberOfWorkers".equals(fieldName)) { + deserializedImageModelDistributionSettings.numberOfWorkers = reader.getString(); + } else if ("optimizer".equals(fieldName)) { + deserializedImageModelDistributionSettings.optimizer = reader.getString(); + } else if ("randomSeed".equals(fieldName)) { + deserializedImageModelDistributionSettings.randomSeed = reader.getString(); + } else if ("stepLRGamma".equals(fieldName)) { + deserializedImageModelDistributionSettings.stepLRGamma = reader.getString(); + } else if ("stepLRStepSize".equals(fieldName)) { + deserializedImageModelDistributionSettings.stepLRStepSize = reader.getString(); + } else if ("trainingBatchSize".equals(fieldName)) { + deserializedImageModelDistributionSettings.trainingBatchSize = reader.getString(); + } else if ("validationBatchSize".equals(fieldName)) { + deserializedImageModelDistributionSettings.validationBatchSize = reader.getString(); + } else if ("warmupCosineLRCycles".equals(fieldName)) { + deserializedImageModelDistributionSettings.warmupCosineLRCycles = reader.getString(); + } else if ("warmupCosineLRWarmupEpochs".equals(fieldName)) { + deserializedImageModelDistributionSettings.warmupCosineLRWarmupEpochs = reader.getString(); + } else if ("weightDecay".equals(fieldName)) { + deserializedImageModelDistributionSettings.weightDecay = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedImageModelDistributionSettings; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelDistributionSettingsClassification.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelDistributionSettingsClassification.java index 5615072d44375..a57ae2d031afa 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelDistributionSettingsClassification.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelDistributionSettingsClassification.java @@ -5,14 +5,23 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** - * Distribution expressions to sweep over values of model settings. <example> Some examples are: <code> - * ModelName = "choice('seresnext', 'resnest50')"; LearningRate = "uniform(0.001, 0.01)"; LayersToFreeze = "choice(0, - * 2)"; </code></example> 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: + * Distribution expressions to sweep over values of model settings. + * <example> + * Some examples are: + * ``` + * ModelName = "choice('seresnext', 'resnest50')"; + * LearningRate = "uniform(0.001, 0.01)"; + * LayersToFreeze = "choice(0, 2)"; + * ```</example> + * 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. */ @Fluent @@ -20,36 +29,34 @@ public final class ImageModelDistributionSettingsClassification extends ImageMod /* * Image crop size that is input to the neural network for the training dataset. Must be a positive integer. */ - @JsonProperty(value = "trainingCropSize") private String trainingCropSize; /* * Image crop size that is input to the neural network for the validation dataset. Must be a positive integer. */ - @JsonProperty(value = "validationCropSize") private String validationCropSize; /* * Image size to which to resize before cropping for validation dataset. Must be a positive integer. */ - @JsonProperty(value = "validationResizeSize") private String validationResizeSize; /* * Weighted loss. The accepted values are 0 for no weighted loss. * 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be 0 or 1 or 2. */ - @JsonProperty(value = "weightedLoss") private String weightedLoss; - /** Creates an instance of ImageModelDistributionSettingsClassification class. */ + /** + * Creates an instance of ImageModelDistributionSettingsClassification class. + */ public ImageModelDistributionSettingsClassification() { } /** * Get the trainingCropSize property: Image crop size that is input to the neural network for the training dataset. * Must be a positive integer. - * + * * @return the trainingCropSize value. */ public String trainingCropSize() { @@ -59,7 +66,7 @@ public String trainingCropSize() { /** * Set the trainingCropSize property: Image crop size that is input to the neural network for the training dataset. * Must be a positive integer. - * + * * @param trainingCropSize the trainingCropSize value to set. * @return the ImageModelDistributionSettingsClassification object itself. */ @@ -71,7 +78,7 @@ public ImageModelDistributionSettingsClassification withTrainingCropSize(String /** * Get the validationCropSize property: Image crop size that is input to the neural network for the validation * dataset. Must be a positive integer. - * + * * @return the validationCropSize value. */ public String validationCropSize() { @@ -81,7 +88,7 @@ public String validationCropSize() { /** * Set the validationCropSize property: Image crop size that is input to the neural network for the validation * dataset. Must be a positive integer. - * + * * @param validationCropSize the validationCropSize value to set. * @return the ImageModelDistributionSettingsClassification object itself. */ @@ -93,7 +100,7 @@ public ImageModelDistributionSettingsClassification withValidationCropSize(Strin /** * Get the validationResizeSize property: Image size to which to resize before cropping for validation dataset. Must * be a positive integer. - * + * * @return the validationResizeSize value. */ public String validationResizeSize() { @@ -103,7 +110,7 @@ public String validationResizeSize() { /** * Set the validationResizeSize property: Image size to which to resize before cropping for validation dataset. Must * be a positive integer. - * + * * @param validationResizeSize the validationResizeSize value to set. * @return the ImageModelDistributionSettingsClassification object itself. */ @@ -113,9 +120,9 @@ public ImageModelDistributionSettingsClassification withValidationResizeSize(Str } /** - * Get the weightedLoss property: Weighted loss. The accepted values are 0 for no weighted loss. 1 for weighted loss - * with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be 0 or 1 or 2. - * + * Get the weightedLoss property: Weighted loss. The accepted values are 0 for no weighted loss. + * 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be 0 or 1 or 2. + * * @return the weightedLoss value. */ public String weightedLoss() { @@ -123,9 +130,9 @@ public String weightedLoss() { } /** - * Set the weightedLoss property: Weighted loss. The accepted values are 0 for no weighted loss. 1 for weighted loss - * with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be 0 or 1 or 2. - * + * Set the weightedLoss property: Weighted loss. The accepted values are 0 for no weighted loss. + * 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be 0 or 1 or 2. + * * @param weightedLoss the weightedLoss value to set. * @return the ImageModelDistributionSettingsClassification object itself. */ @@ -134,197 +141,253 @@ public ImageModelDistributionSettingsClassification withWeightedLoss(String weig return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsClassification withAmsGradient(String amsGradient) { super.withAmsGradient(amsGradient); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsClassification withAugmentations(String augmentations) { super.withAugmentations(augmentations); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsClassification withBeta1(String beta1) { super.withBeta1(beta1); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsClassification withBeta2(String beta2) { super.withBeta2(beta2); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsClassification withDistributed(String distributed) { super.withDistributed(distributed); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsClassification withEarlyStopping(String earlyStopping) { super.withEarlyStopping(earlyStopping); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsClassification withEarlyStoppingDelay(String earlyStoppingDelay) { super.withEarlyStoppingDelay(earlyStoppingDelay); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsClassification withEarlyStoppingPatience(String earlyStoppingPatience) { super.withEarlyStoppingPatience(earlyStoppingPatience); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsClassification withEnableOnnxNormalization(String enableOnnxNormalization) { super.withEnableOnnxNormalization(enableOnnxNormalization); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsClassification withEvaluationFrequency(String evaluationFrequency) { super.withEvaluationFrequency(evaluationFrequency); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsClassification withGradientAccumulationStep(String gradientAccumulationStep) { super.withGradientAccumulationStep(gradientAccumulationStep); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsClassification withLayersToFreeze(String layersToFreeze) { super.withLayersToFreeze(layersToFreeze); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsClassification withLearningRate(String learningRate) { super.withLearningRate(learningRate); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsClassification withLearningRateScheduler(String learningRateScheduler) { super.withLearningRateScheduler(learningRateScheduler); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsClassification withModelName(String modelName) { super.withModelName(modelName); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsClassification withMomentum(String momentum) { super.withMomentum(momentum); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsClassification withNesterov(String nesterov) { super.withNesterov(nesterov); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsClassification withNumberOfEpochs(String numberOfEpochs) { super.withNumberOfEpochs(numberOfEpochs); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsClassification withNumberOfWorkers(String numberOfWorkers) { super.withNumberOfWorkers(numberOfWorkers); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsClassification withOptimizer(String optimizer) { super.withOptimizer(optimizer); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsClassification withRandomSeed(String randomSeed) { super.withRandomSeed(randomSeed); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsClassification withStepLRGamma(String stepLRGamma) { super.withStepLRGamma(stepLRGamma); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsClassification withStepLRStepSize(String stepLRStepSize) { super.withStepLRStepSize(stepLRStepSize); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsClassification withTrainingBatchSize(String trainingBatchSize) { super.withTrainingBatchSize(trainingBatchSize); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsClassification withValidationBatchSize(String validationBatchSize) { super.withValidationBatchSize(validationBatchSize); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsClassification withWarmupCosineLRCycles(String warmupCosineLRCycles) { super.withWarmupCosineLRCycles(warmupCosineLRCycles); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override - public ImageModelDistributionSettingsClassification withWarmupCosineLRWarmupEpochs( - String warmupCosineLRWarmupEpochs) { + public ImageModelDistributionSettingsClassification + withWarmupCosineLRWarmupEpochs(String warmupCosineLRWarmupEpochs) { super.withWarmupCosineLRWarmupEpochs(warmupCosineLRWarmupEpochs); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsClassification withWeightDecay(String weightDecay) { super.withWeightDecay(weightDecay); @@ -333,11 +396,149 @@ public ImageModelDistributionSettingsClassification withWeightDecay(String weigh /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("amsGradient", amsGradient()); + jsonWriter.writeStringField("augmentations", augmentations()); + jsonWriter.writeStringField("beta1", beta1()); + jsonWriter.writeStringField("beta2", beta2()); + jsonWriter.writeStringField("distributed", distributed()); + jsonWriter.writeStringField("earlyStopping", earlyStopping()); + jsonWriter.writeStringField("earlyStoppingDelay", earlyStoppingDelay()); + jsonWriter.writeStringField("earlyStoppingPatience", earlyStoppingPatience()); + jsonWriter.writeStringField("enableOnnxNormalization", enableOnnxNormalization()); + jsonWriter.writeStringField("evaluationFrequency", evaluationFrequency()); + jsonWriter.writeStringField("gradientAccumulationStep", gradientAccumulationStep()); + jsonWriter.writeStringField("layersToFreeze", layersToFreeze()); + jsonWriter.writeStringField("learningRate", learningRate()); + jsonWriter.writeStringField("learningRateScheduler", learningRateScheduler()); + jsonWriter.writeStringField("modelName", modelName()); + jsonWriter.writeStringField("momentum", momentum()); + jsonWriter.writeStringField("nesterov", nesterov()); + jsonWriter.writeStringField("numberOfEpochs", numberOfEpochs()); + jsonWriter.writeStringField("numberOfWorkers", numberOfWorkers()); + jsonWriter.writeStringField("optimizer", optimizer()); + jsonWriter.writeStringField("randomSeed", randomSeed()); + jsonWriter.writeStringField("stepLRGamma", stepLRGamma()); + jsonWriter.writeStringField("stepLRStepSize", stepLRStepSize()); + jsonWriter.writeStringField("trainingBatchSize", trainingBatchSize()); + jsonWriter.writeStringField("validationBatchSize", validationBatchSize()); + jsonWriter.writeStringField("warmupCosineLRCycles", warmupCosineLRCycles()); + jsonWriter.writeStringField("warmupCosineLRWarmupEpochs", warmupCosineLRWarmupEpochs()); + jsonWriter.writeStringField("weightDecay", weightDecay()); + jsonWriter.writeStringField("trainingCropSize", this.trainingCropSize); + jsonWriter.writeStringField("validationCropSize", this.validationCropSize); + jsonWriter.writeStringField("validationResizeSize", this.validationResizeSize); + jsonWriter.writeStringField("weightedLoss", this.weightedLoss); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageModelDistributionSettingsClassification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageModelDistributionSettingsClassification if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ImageModelDistributionSettingsClassification. + */ + public static ImageModelDistributionSettingsClassification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageModelDistributionSettingsClassification deserializedImageModelDistributionSettingsClassification + = new ImageModelDistributionSettingsClassification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("amsGradient".equals(fieldName)) { + deserializedImageModelDistributionSettingsClassification.withAmsGradient(reader.getString()); + } else if ("augmentations".equals(fieldName)) { + deserializedImageModelDistributionSettingsClassification.withAugmentations(reader.getString()); + } else if ("beta1".equals(fieldName)) { + deserializedImageModelDistributionSettingsClassification.withBeta1(reader.getString()); + } else if ("beta2".equals(fieldName)) { + deserializedImageModelDistributionSettingsClassification.withBeta2(reader.getString()); + } else if ("distributed".equals(fieldName)) { + deserializedImageModelDistributionSettingsClassification.withDistributed(reader.getString()); + } else if ("earlyStopping".equals(fieldName)) { + deserializedImageModelDistributionSettingsClassification.withEarlyStopping(reader.getString()); + } else if ("earlyStoppingDelay".equals(fieldName)) { + deserializedImageModelDistributionSettingsClassification.withEarlyStoppingDelay(reader.getString()); + } else if ("earlyStoppingPatience".equals(fieldName)) { + deserializedImageModelDistributionSettingsClassification + .withEarlyStoppingPatience(reader.getString()); + } else if ("enableOnnxNormalization".equals(fieldName)) { + deserializedImageModelDistributionSettingsClassification + .withEnableOnnxNormalization(reader.getString()); + } else if ("evaluationFrequency".equals(fieldName)) { + deserializedImageModelDistributionSettingsClassification + .withEvaluationFrequency(reader.getString()); + } else if ("gradientAccumulationStep".equals(fieldName)) { + deserializedImageModelDistributionSettingsClassification + .withGradientAccumulationStep(reader.getString()); + } else if ("layersToFreeze".equals(fieldName)) { + deserializedImageModelDistributionSettingsClassification.withLayersToFreeze(reader.getString()); + } else if ("learningRate".equals(fieldName)) { + deserializedImageModelDistributionSettingsClassification.withLearningRate(reader.getString()); + } else if ("learningRateScheduler".equals(fieldName)) { + deserializedImageModelDistributionSettingsClassification + .withLearningRateScheduler(reader.getString()); + } else if ("modelName".equals(fieldName)) { + deserializedImageModelDistributionSettingsClassification.withModelName(reader.getString()); + } else if ("momentum".equals(fieldName)) { + deserializedImageModelDistributionSettingsClassification.withMomentum(reader.getString()); + } else if ("nesterov".equals(fieldName)) { + deserializedImageModelDistributionSettingsClassification.withNesterov(reader.getString()); + } else if ("numberOfEpochs".equals(fieldName)) { + deserializedImageModelDistributionSettingsClassification.withNumberOfEpochs(reader.getString()); + } else if ("numberOfWorkers".equals(fieldName)) { + deserializedImageModelDistributionSettingsClassification.withNumberOfWorkers(reader.getString()); + } else if ("optimizer".equals(fieldName)) { + deserializedImageModelDistributionSettingsClassification.withOptimizer(reader.getString()); + } else if ("randomSeed".equals(fieldName)) { + deserializedImageModelDistributionSettingsClassification.withRandomSeed(reader.getString()); + } else if ("stepLRGamma".equals(fieldName)) { + deserializedImageModelDistributionSettingsClassification.withStepLRGamma(reader.getString()); + } else if ("stepLRStepSize".equals(fieldName)) { + deserializedImageModelDistributionSettingsClassification.withStepLRStepSize(reader.getString()); + } else if ("trainingBatchSize".equals(fieldName)) { + deserializedImageModelDistributionSettingsClassification.withTrainingBatchSize(reader.getString()); + } else if ("validationBatchSize".equals(fieldName)) { + deserializedImageModelDistributionSettingsClassification + .withValidationBatchSize(reader.getString()); + } else if ("warmupCosineLRCycles".equals(fieldName)) { + deserializedImageModelDistributionSettingsClassification + .withWarmupCosineLRCycles(reader.getString()); + } else if ("warmupCosineLRWarmupEpochs".equals(fieldName)) { + deserializedImageModelDistributionSettingsClassification + .withWarmupCosineLRWarmupEpochs(reader.getString()); + } else if ("weightDecay".equals(fieldName)) { + deserializedImageModelDistributionSettingsClassification.withWeightDecay(reader.getString()); + } else if ("trainingCropSize".equals(fieldName)) { + deserializedImageModelDistributionSettingsClassification.trainingCropSize = reader.getString(); + } else if ("validationCropSize".equals(fieldName)) { + deserializedImageModelDistributionSettingsClassification.validationCropSize = reader.getString(); + } else if ("validationResizeSize".equals(fieldName)) { + deserializedImageModelDistributionSettingsClassification.validationResizeSize = reader.getString(); + } else if ("weightedLoss".equals(fieldName)) { + deserializedImageModelDistributionSettingsClassification.weightedLoss = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedImageModelDistributionSettingsClassification; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelDistributionSettingsObjectDetection.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelDistributionSettingsObjectDetection.java index 20c36d838c766..7f3e382a9bdbb 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelDistributionSettingsObjectDetection.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelDistributionSettingsObjectDetection.java @@ -5,14 +5,23 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** - * Distribution expressions to sweep over values of model settings. <example> Some examples are: <code> - * ModelName = "choice('seresnext', 'resnest50')"; LearningRate = "uniform(0.001, 0.01)"; LayersToFreeze = "choice(0, - * 2)"; </code></example> 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: + * Distribution expressions to sweep over values of model settings. + * <example> + * Some examples are: + * ``` + * ModelName = "choice('seresnext', 'resnest50')"; + * LearningRate = "uniform(0.001, 0.01)"; + * LayersToFreeze = "choice(0, 2)"; + * ```</example> + * 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. */ @Fluent @@ -21,14 +30,12 @@ public final class ImageModelDistributionSettingsObjectDetection extends ImageMo * Maximum number of detections per image, for all classes. Must be a positive integer. * Note: This settings is not supported for the 'yolov5' algorithm. */ - @JsonProperty(value = "boxDetectionsPerImage") private String boxDetectionsPerImage; /* * During inference, only return proposals with a classification score greater than * BoxScoreThreshold. Must be a float in the range[0, 1]. */ - @JsonProperty(value = "boxScoreThreshold") private String boxScoreThreshold; /* @@ -36,7 +43,6 @@ public final class ImageModelDistributionSettingsObjectDetection extends ImageMo * Note: The training run may get into CUDA OOM if the size is too big. * Note: This settings is only supported for the 'yolov5' algorithm. */ - @JsonProperty(value = "imageSize") private String imageSize; /* @@ -44,7 +50,6 @@ public final class ImageModelDistributionSettingsObjectDetection extends ImageMo * Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. * Note: This settings is not supported for the 'yolov5' algorithm. */ - @JsonProperty(value = "maxSize") private String maxSize; /* @@ -52,7 +57,6 @@ public final class ImageModelDistributionSettingsObjectDetection extends ImageMo * Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. * Note: This settings is not supported for the 'yolov5' algorithm. */ - @JsonProperty(value = "minSize") private String minSize; /* @@ -60,7 +64,6 @@ public final class ImageModelDistributionSettingsObjectDetection extends ImageMo * Note: training run may get into CUDA OOM if the model size is too big. * Note: This settings is only supported for the 'yolov5' algorithm. */ - @JsonProperty(value = "modelSize") private String modelSize; /* @@ -68,13 +71,11 @@ public final class ImageModelDistributionSettingsObjectDetection extends ImageMo * Note: training run may get into CUDA OOM if no sufficient GPU memory. * Note: This settings is only supported for the 'yolov5' algorithm. */ - @JsonProperty(value = "multiScale") private String multiScale; /* * IOU threshold used during inference in NMS post processing. Must be float in the range [0, 1]. */ - @JsonProperty(value = "nmsIouThreshold") private String nmsIouThreshold; /* @@ -82,14 +83,12 @@ public final class ImageModelDistributionSettingsObjectDetection extends ImageMo * None to enable small object detection logic. A string containing two integers in mxn format. * Note: This settings is not supported for the 'yolov5' algorithm. */ - @JsonProperty(value = "tileGridSize") private String tileGridSize; /* * Overlap ratio between adjacent tiles in each dimension. Must be float in the range [0, 1). * Note: This settings is not supported for the 'yolov5' algorithm. */ - @JsonProperty(value = "tileOverlapRatio") private String tileOverlapRatio; /* @@ -98,29 +97,29 @@ public final class ImageModelDistributionSettingsObjectDetection extends ImageMo * Note: This settings is not supported for the 'yolov5' algorithm. * NMS: Non-maximum suppression */ - @JsonProperty(value = "tilePredictionsNmsThreshold") private String tilePredictionsNmsThreshold; /* * IOU threshold to use when computing validation metric. Must be float in the range [0, 1]. */ - @JsonProperty(value = "validationIouThreshold") private String validationIouThreshold; /* * Metric computation method to use for validation metrics. Must be 'none', 'coco', 'voc', or 'coco_voc'. */ - @JsonProperty(value = "validationMetricType") private String validationMetricType; - /** Creates an instance of ImageModelDistributionSettingsObjectDetection class. */ + /** + * Creates an instance of ImageModelDistributionSettingsObjectDetection class. + */ public ImageModelDistributionSettingsObjectDetection() { } /** * Get the boxDetectionsPerImage property: Maximum number of detections per image, for all classes. Must be a - * positive integer. Note: This settings is not supported for the 'yolov5' algorithm. - * + * positive integer. + * Note: This settings is not supported for the 'yolov5' algorithm. + * * @return the boxDetectionsPerImage value. */ public String boxDetectionsPerImage() { @@ -129,8 +128,9 @@ public String boxDetectionsPerImage() { /** * Set the boxDetectionsPerImage property: Maximum number of detections per image, for all classes. Must be a - * positive integer. Note: This settings is not supported for the 'yolov5' algorithm. - * + * positive integer. + * Note: This settings is not supported for the 'yolov5' algorithm. + * * @param boxDetectionsPerImage the boxDetectionsPerImage value to set. * @return the ImageModelDistributionSettingsObjectDetection object itself. */ @@ -141,8 +141,9 @@ public ImageModelDistributionSettingsObjectDetection withBoxDetectionsPerImage(S /** * Get the boxScoreThreshold property: During inference, only return proposals with a classification score greater - * than BoxScoreThreshold. Must be a float in the range[0, 1]. - * + * than + * BoxScoreThreshold. Must be a float in the range[0, 1]. + * * @return the boxScoreThreshold value. */ public String boxScoreThreshold() { @@ -151,8 +152,9 @@ public String boxScoreThreshold() { /** * Set the boxScoreThreshold property: During inference, only return proposals with a classification score greater - * than BoxScoreThreshold. Must be a float in the range[0, 1]. - * + * than + * BoxScoreThreshold. Must be a float in the range[0, 1]. + * * @param boxScoreThreshold the boxScoreThreshold value to set. * @return the ImageModelDistributionSettingsObjectDetection object itself. */ @@ -162,10 +164,10 @@ public ImageModelDistributionSettingsObjectDetection withBoxScoreThreshold(Strin } /** - * Get the imageSize property: Image size for train and validation. Must be a positive integer. Note: The training - * run may get into CUDA OOM if the size is too big. Note: This settings is only supported for the 'yolov5' - * algorithm. - * + * Get the imageSize property: Image size for train and validation. Must be a positive integer. + * Note: The training run may get into CUDA OOM if the size is too big. + * Note: This settings is only supported for the 'yolov5' algorithm. + * * @return the imageSize value. */ public String imageSize() { @@ -173,10 +175,10 @@ public String imageSize() { } /** - * Set the imageSize property: Image size for train and validation. Must be a positive integer. Note: The training - * run may get into CUDA OOM if the size is too big. Note: This settings is only supported for the 'yolov5' - * algorithm. - * + * Set the imageSize property: Image size for train and validation. Must be a positive integer. + * Note: The training run may get into CUDA OOM if the size is too big. + * Note: This settings is only supported for the 'yolov5' algorithm. + * * @param imageSize the imageSize value to set. * @return the ImageModelDistributionSettingsObjectDetection object itself. */ @@ -186,10 +188,10 @@ public ImageModelDistributionSettingsObjectDetection withImageSize(String imageS } /** - * Get the maxSize property: Maximum size of the image to be rescaled before feeding it to the backbone. Must be a - * positive integer. Note: training run may get into CUDA OOM if the size is too big. Note: This settings is not - * supported for the 'yolov5' algorithm. - * + * Get the maxSize property: Maximum size of the image to be rescaled before feeding it to the backbone. + * Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + * Note: This settings is not supported for the 'yolov5' algorithm. + * * @return the maxSize value. */ public String maxSize() { @@ -197,10 +199,10 @@ public String maxSize() { } /** - * Set the maxSize property: Maximum size of the image to be rescaled before feeding it to the backbone. Must be a - * positive integer. Note: training run may get into CUDA OOM if the size is too big. Note: This settings is not - * supported for the 'yolov5' algorithm. - * + * Set the maxSize property: Maximum size of the image to be rescaled before feeding it to the backbone. + * Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + * Note: This settings is not supported for the 'yolov5' algorithm. + * * @param maxSize the maxSize value to set. * @return the ImageModelDistributionSettingsObjectDetection object itself. */ @@ -210,10 +212,10 @@ public ImageModelDistributionSettingsObjectDetection withMaxSize(String maxSize) } /** - * Get the minSize property: Minimum size of the image to be rescaled before feeding it to the backbone. Must be a - * positive integer. Note: training run may get into CUDA OOM if the size is too big. Note: This settings is not - * supported for the 'yolov5' algorithm. - * + * Get the minSize property: Minimum size of the image to be rescaled before feeding it to the backbone. + * Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + * Note: This settings is not supported for the 'yolov5' algorithm. + * * @return the minSize value. */ public String minSize() { @@ -221,10 +223,10 @@ public String minSize() { } /** - * Set the minSize property: Minimum size of the image to be rescaled before feeding it to the backbone. Must be a - * positive integer. Note: training run may get into CUDA OOM if the size is too big. Note: This settings is not - * supported for the 'yolov5' algorithm. - * + * Set the minSize property: Minimum size of the image to be rescaled before feeding it to the backbone. + * Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + * Note: This settings is not supported for the 'yolov5' algorithm. + * * @param minSize the minSize value to set. * @return the ImageModelDistributionSettingsObjectDetection object itself. */ @@ -234,9 +236,10 @@ public ImageModelDistributionSettingsObjectDetection withMinSize(String minSize) } /** - * Get the modelSize property: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. Note: training run may - * get into CUDA OOM if the model size is too big. Note: This settings is only supported for the 'yolov5' algorithm. - * + * Get the modelSize property: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. + * Note: training run may get into CUDA OOM if the model size is too big. + * Note: This settings is only supported for the 'yolov5' algorithm. + * * @return the modelSize value. */ public String modelSize() { @@ -244,9 +247,10 @@ public String modelSize() { } /** - * Set the modelSize property: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. Note: training run may - * get into CUDA OOM if the model size is too big. Note: This settings is only supported for the 'yolov5' algorithm. - * + * Set the modelSize property: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. + * Note: training run may get into CUDA OOM if the model size is too big. + * Note: This settings is only supported for the 'yolov5' algorithm. + * * @param modelSize the modelSize value to set. * @return the ImageModelDistributionSettingsObjectDetection object itself. */ @@ -256,9 +260,10 @@ public ImageModelDistributionSettingsObjectDetection withModelSize(String modelS } /** - * Get the multiScale property: Enable multi-scale image by varying image size by +/- 50%. Note: training run may - * get into CUDA OOM if no sufficient GPU memory. Note: This settings is only supported for the 'yolov5' algorithm. - * + * Get the multiScale property: Enable multi-scale image by varying image size by +/- 50%. + * Note: training run may get into CUDA OOM if no sufficient GPU memory. + * Note: This settings is only supported for the 'yolov5' algorithm. + * * @return the multiScale value. */ public String multiScale() { @@ -266,9 +271,10 @@ public String multiScale() { } /** - * Set the multiScale property: Enable multi-scale image by varying image size by +/- 50%. Note: training run may - * get into CUDA OOM if no sufficient GPU memory. Note: This settings is only supported for the 'yolov5' algorithm. - * + * Set the multiScale property: Enable multi-scale image by varying image size by +/- 50%. + * Note: training run may get into CUDA OOM if no sufficient GPU memory. + * Note: This settings is only supported for the 'yolov5' algorithm. + * * @param multiScale the multiScale value to set. * @return the ImageModelDistributionSettingsObjectDetection object itself. */ @@ -280,7 +286,7 @@ public ImageModelDistributionSettingsObjectDetection withMultiScale(String multi /** * Get the nmsIouThreshold property: IOU threshold used during inference in NMS post processing. Must be float in * the range [0, 1]. - * + * * @return the nmsIouThreshold value. */ public String nmsIouThreshold() { @@ -290,7 +296,7 @@ public String nmsIouThreshold() { /** * Set the nmsIouThreshold property: IOU threshold used during inference in NMS post processing. Must be float in * the range [0, 1]. - * + * * @param nmsIouThreshold the nmsIouThreshold value to set. * @return the ImageModelDistributionSettingsObjectDetection object itself. */ @@ -300,10 +306,10 @@ public ImageModelDistributionSettingsObjectDetection withNmsIouThreshold(String } /** - * Get the tileGridSize property: The grid size to use for tiling each image. Note: TileGridSize must not be None to - * enable small object detection logic. A string containing two integers in mxn format. Note: This settings is not - * supported for the 'yolov5' algorithm. - * + * Get the tileGridSize property: The grid size to use for tiling each image. Note: TileGridSize must not be + * None to enable small object detection logic. A string containing two integers in mxn format. + * Note: This settings is not supported for the 'yolov5' algorithm. + * * @return the tileGridSize value. */ public String tileGridSize() { @@ -311,10 +317,10 @@ public String tileGridSize() { } /** - * Set the tileGridSize property: The grid size to use for tiling each image. Note: TileGridSize must not be None to - * enable small object detection logic. A string containing two integers in mxn format. Note: This settings is not - * supported for the 'yolov5' algorithm. - * + * Set the tileGridSize property: The grid size to use for tiling each image. Note: TileGridSize must not be + * None to enable small object detection logic. A string containing two integers in mxn format. + * Note: This settings is not supported for the 'yolov5' algorithm. + * * @param tileGridSize the tileGridSize value to set. * @return the ImageModelDistributionSettingsObjectDetection object itself. */ @@ -325,8 +331,9 @@ public ImageModelDistributionSettingsObjectDetection withTileGridSize(String til /** * Get the tileOverlapRatio property: Overlap ratio between adjacent tiles in each dimension. Must be float in the - * range [0, 1). Note: This settings is not supported for the 'yolov5' algorithm. - * + * range [0, 1). + * Note: This settings is not supported for the 'yolov5' algorithm. + * * @return the tileOverlapRatio value. */ public String tileOverlapRatio() { @@ -335,8 +342,9 @@ public String tileOverlapRatio() { /** * Set the tileOverlapRatio property: Overlap ratio between adjacent tiles in each dimension. Must be float in the - * range [0, 1). Note: This settings is not supported for the 'yolov5' algorithm. - * + * range [0, 1). + * Note: This settings is not supported for the 'yolov5' algorithm. + * * @param tileOverlapRatio the tileOverlapRatio value to set. * @return the ImageModelDistributionSettingsObjectDetection object itself. */ @@ -347,9 +355,11 @@ public ImageModelDistributionSettingsObjectDetection withTileOverlapRatio(String /** * Get the tilePredictionsNmsThreshold property: The IOU threshold to use to perform NMS while merging predictions - * from tiles and image. Used in validation/ inference. Must be float in the range [0, 1]. Note: This settings is - * not supported for the 'yolov5' algorithm. NMS: Non-maximum suppression. - * + * from tiles and image. + * Used in validation/ inference. Must be float in the range [0, 1]. + * Note: This settings is not supported for the 'yolov5' algorithm. + * NMS: Non-maximum suppression. + * * @return the tilePredictionsNmsThreshold value. */ public String tilePredictionsNmsThreshold() { @@ -358,14 +368,16 @@ public String tilePredictionsNmsThreshold() { /** * Set the tilePredictionsNmsThreshold property: The IOU threshold to use to perform NMS while merging predictions - * from tiles and image. Used in validation/ inference. Must be float in the range [0, 1]. Note: This settings is - * not supported for the 'yolov5' algorithm. NMS: Non-maximum suppression. - * + * from tiles and image. + * Used in validation/ inference. Must be float in the range [0, 1]. + * Note: This settings is not supported for the 'yolov5' algorithm. + * NMS: Non-maximum suppression. + * * @param tilePredictionsNmsThreshold the tilePredictionsNmsThreshold value to set. * @return the ImageModelDistributionSettingsObjectDetection object itself. */ - public ImageModelDistributionSettingsObjectDetection withTilePredictionsNmsThreshold( - String tilePredictionsNmsThreshold) { + public ImageModelDistributionSettingsObjectDetection + withTilePredictionsNmsThreshold(String tilePredictionsNmsThreshold) { this.tilePredictionsNmsThreshold = tilePredictionsNmsThreshold; return this; } @@ -373,7 +385,7 @@ public ImageModelDistributionSettingsObjectDetection withTilePredictionsNmsThres /** * Get the validationIouThreshold property: IOU threshold to use when computing validation metric. Must be float in * the range [0, 1]. - * + * * @return the validationIouThreshold value. */ public String validationIouThreshold() { @@ -383,7 +395,7 @@ public String validationIouThreshold() { /** * Set the validationIouThreshold property: IOU threshold to use when computing validation metric. Must be float in * the range [0, 1]. - * + * * @param validationIouThreshold the validationIouThreshold value to set. * @return the ImageModelDistributionSettingsObjectDetection object itself. */ @@ -395,7 +407,7 @@ public ImageModelDistributionSettingsObjectDetection withValidationIouThreshold( /** * Get the validationMetricType property: Metric computation method to use for validation metrics. Must be 'none', * 'coco', 'voc', or 'coco_voc'. - * + * * @return the validationMetricType value. */ public String validationMetricType() { @@ -405,7 +417,7 @@ public String validationMetricType() { /** * Set the validationMetricType property: Metric computation method to use for validation metrics. Must be 'none', * 'coco', 'voc', or 'coco_voc'. - * + * * @param validationMetricType the validationMetricType value to set. * @return the ImageModelDistributionSettingsObjectDetection object itself. */ @@ -414,197 +426,253 @@ public ImageModelDistributionSettingsObjectDetection withValidationMetricType(St return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsObjectDetection withAmsGradient(String amsGradient) { super.withAmsGradient(amsGradient); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsObjectDetection withAugmentations(String augmentations) { super.withAugmentations(augmentations); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsObjectDetection withBeta1(String beta1) { super.withBeta1(beta1); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsObjectDetection withBeta2(String beta2) { super.withBeta2(beta2); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsObjectDetection withDistributed(String distributed) { super.withDistributed(distributed); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsObjectDetection withEarlyStopping(String earlyStopping) { super.withEarlyStopping(earlyStopping); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsObjectDetection withEarlyStoppingDelay(String earlyStoppingDelay) { super.withEarlyStoppingDelay(earlyStoppingDelay); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsObjectDetection withEarlyStoppingPatience(String earlyStoppingPatience) { super.withEarlyStoppingPatience(earlyStoppingPatience); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsObjectDetection withEnableOnnxNormalization(String enableOnnxNormalization) { super.withEnableOnnxNormalization(enableOnnxNormalization); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsObjectDetection withEvaluationFrequency(String evaluationFrequency) { super.withEvaluationFrequency(evaluationFrequency); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsObjectDetection withGradientAccumulationStep(String gradientAccumulationStep) { super.withGradientAccumulationStep(gradientAccumulationStep); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsObjectDetection withLayersToFreeze(String layersToFreeze) { super.withLayersToFreeze(layersToFreeze); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsObjectDetection withLearningRate(String learningRate) { super.withLearningRate(learningRate); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsObjectDetection withLearningRateScheduler(String learningRateScheduler) { super.withLearningRateScheduler(learningRateScheduler); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsObjectDetection withModelName(String modelName) { super.withModelName(modelName); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsObjectDetection withMomentum(String momentum) { super.withMomentum(momentum); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsObjectDetection withNesterov(String nesterov) { super.withNesterov(nesterov); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsObjectDetection withNumberOfEpochs(String numberOfEpochs) { super.withNumberOfEpochs(numberOfEpochs); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsObjectDetection withNumberOfWorkers(String numberOfWorkers) { super.withNumberOfWorkers(numberOfWorkers); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsObjectDetection withOptimizer(String optimizer) { super.withOptimizer(optimizer); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsObjectDetection withRandomSeed(String randomSeed) { super.withRandomSeed(randomSeed); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsObjectDetection withStepLRGamma(String stepLRGamma) { super.withStepLRGamma(stepLRGamma); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsObjectDetection withStepLRStepSize(String stepLRStepSize) { super.withStepLRStepSize(stepLRStepSize); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsObjectDetection withTrainingBatchSize(String trainingBatchSize) { super.withTrainingBatchSize(trainingBatchSize); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsObjectDetection withValidationBatchSize(String validationBatchSize) { super.withValidationBatchSize(validationBatchSize); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsObjectDetection withWarmupCosineLRCycles(String warmupCosineLRCycles) { super.withWarmupCosineLRCycles(warmupCosineLRCycles); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override - public ImageModelDistributionSettingsObjectDetection withWarmupCosineLRWarmupEpochs( - String warmupCosineLRWarmupEpochs) { + public ImageModelDistributionSettingsObjectDetection + withWarmupCosineLRWarmupEpochs(String warmupCosineLRWarmupEpochs) { super.withWarmupCosineLRWarmupEpochs(warmupCosineLRWarmupEpochs); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelDistributionSettingsObjectDetection withWeightDecay(String weightDecay) { super.withWeightDecay(weightDecay); @@ -613,11 +681,180 @@ public ImageModelDistributionSettingsObjectDetection withWeightDecay(String weig /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("amsGradient", amsGradient()); + jsonWriter.writeStringField("augmentations", augmentations()); + jsonWriter.writeStringField("beta1", beta1()); + jsonWriter.writeStringField("beta2", beta2()); + jsonWriter.writeStringField("distributed", distributed()); + jsonWriter.writeStringField("earlyStopping", earlyStopping()); + jsonWriter.writeStringField("earlyStoppingDelay", earlyStoppingDelay()); + jsonWriter.writeStringField("earlyStoppingPatience", earlyStoppingPatience()); + jsonWriter.writeStringField("enableOnnxNormalization", enableOnnxNormalization()); + jsonWriter.writeStringField("evaluationFrequency", evaluationFrequency()); + jsonWriter.writeStringField("gradientAccumulationStep", gradientAccumulationStep()); + jsonWriter.writeStringField("layersToFreeze", layersToFreeze()); + jsonWriter.writeStringField("learningRate", learningRate()); + jsonWriter.writeStringField("learningRateScheduler", learningRateScheduler()); + jsonWriter.writeStringField("modelName", modelName()); + jsonWriter.writeStringField("momentum", momentum()); + jsonWriter.writeStringField("nesterov", nesterov()); + jsonWriter.writeStringField("numberOfEpochs", numberOfEpochs()); + jsonWriter.writeStringField("numberOfWorkers", numberOfWorkers()); + jsonWriter.writeStringField("optimizer", optimizer()); + jsonWriter.writeStringField("randomSeed", randomSeed()); + jsonWriter.writeStringField("stepLRGamma", stepLRGamma()); + jsonWriter.writeStringField("stepLRStepSize", stepLRStepSize()); + jsonWriter.writeStringField("trainingBatchSize", trainingBatchSize()); + jsonWriter.writeStringField("validationBatchSize", validationBatchSize()); + jsonWriter.writeStringField("warmupCosineLRCycles", warmupCosineLRCycles()); + jsonWriter.writeStringField("warmupCosineLRWarmupEpochs", warmupCosineLRWarmupEpochs()); + jsonWriter.writeStringField("weightDecay", weightDecay()); + jsonWriter.writeStringField("boxDetectionsPerImage", this.boxDetectionsPerImage); + jsonWriter.writeStringField("boxScoreThreshold", this.boxScoreThreshold); + jsonWriter.writeStringField("imageSize", this.imageSize); + jsonWriter.writeStringField("maxSize", this.maxSize); + jsonWriter.writeStringField("minSize", this.minSize); + jsonWriter.writeStringField("modelSize", this.modelSize); + jsonWriter.writeStringField("multiScale", this.multiScale); + jsonWriter.writeStringField("nmsIouThreshold", this.nmsIouThreshold); + jsonWriter.writeStringField("tileGridSize", this.tileGridSize); + jsonWriter.writeStringField("tileOverlapRatio", this.tileOverlapRatio); + jsonWriter.writeStringField("tilePredictionsNmsThreshold", this.tilePredictionsNmsThreshold); + jsonWriter.writeStringField("validationIouThreshold", this.validationIouThreshold); + jsonWriter.writeStringField("validationMetricType", this.validationMetricType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageModelDistributionSettingsObjectDetection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageModelDistributionSettingsObjectDetection if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ImageModelDistributionSettingsObjectDetection. + */ + public static ImageModelDistributionSettingsObjectDetection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageModelDistributionSettingsObjectDetection deserializedImageModelDistributionSettingsObjectDetection + = new ImageModelDistributionSettingsObjectDetection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("amsGradient".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection.withAmsGradient(reader.getString()); + } else if ("augmentations".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection.withAugmentations(reader.getString()); + } else if ("beta1".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection.withBeta1(reader.getString()); + } else if ("beta2".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection.withBeta2(reader.getString()); + } else if ("distributed".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection.withDistributed(reader.getString()); + } else if ("earlyStopping".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection.withEarlyStopping(reader.getString()); + } else if ("earlyStoppingDelay".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection + .withEarlyStoppingDelay(reader.getString()); + } else if ("earlyStoppingPatience".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection + .withEarlyStoppingPatience(reader.getString()); + } else if ("enableOnnxNormalization".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection + .withEnableOnnxNormalization(reader.getString()); + } else if ("evaluationFrequency".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection + .withEvaluationFrequency(reader.getString()); + } else if ("gradientAccumulationStep".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection + .withGradientAccumulationStep(reader.getString()); + } else if ("layersToFreeze".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection.withLayersToFreeze(reader.getString()); + } else if ("learningRate".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection.withLearningRate(reader.getString()); + } else if ("learningRateScheduler".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection + .withLearningRateScheduler(reader.getString()); + } else if ("modelName".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection.withModelName(reader.getString()); + } else if ("momentum".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection.withMomentum(reader.getString()); + } else if ("nesterov".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection.withNesterov(reader.getString()); + } else if ("numberOfEpochs".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection.withNumberOfEpochs(reader.getString()); + } else if ("numberOfWorkers".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection.withNumberOfWorkers(reader.getString()); + } else if ("optimizer".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection.withOptimizer(reader.getString()); + } else if ("randomSeed".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection.withRandomSeed(reader.getString()); + } else if ("stepLRGamma".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection.withStepLRGamma(reader.getString()); + } else if ("stepLRStepSize".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection.withStepLRStepSize(reader.getString()); + } else if ("trainingBatchSize".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection.withTrainingBatchSize(reader.getString()); + } else if ("validationBatchSize".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection + .withValidationBatchSize(reader.getString()); + } else if ("warmupCosineLRCycles".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection + .withWarmupCosineLRCycles(reader.getString()); + } else if ("warmupCosineLRWarmupEpochs".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection + .withWarmupCosineLRWarmupEpochs(reader.getString()); + } else if ("weightDecay".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection.withWeightDecay(reader.getString()); + } else if ("boxDetectionsPerImage".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection.boxDetectionsPerImage + = reader.getString(); + } else if ("boxScoreThreshold".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection.boxScoreThreshold = reader.getString(); + } else if ("imageSize".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection.imageSize = reader.getString(); + } else if ("maxSize".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection.maxSize = reader.getString(); + } else if ("minSize".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection.minSize = reader.getString(); + } else if ("modelSize".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection.modelSize = reader.getString(); + } else if ("multiScale".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection.multiScale = reader.getString(); + } else if ("nmsIouThreshold".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection.nmsIouThreshold = reader.getString(); + } else if ("tileGridSize".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection.tileGridSize = reader.getString(); + } else if ("tileOverlapRatio".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection.tileOverlapRatio = reader.getString(); + } else if ("tilePredictionsNmsThreshold".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection.tilePredictionsNmsThreshold + = reader.getString(); + } else if ("validationIouThreshold".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection.validationIouThreshold + = reader.getString(); + } else if ("validationMetricType".equals(fieldName)) { + deserializedImageModelDistributionSettingsObjectDetection.validationMetricType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedImageModelDistributionSettingsObjectDetection; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelSettings.java index bd105b216e35e..7cb4c86373b88 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelSettings.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelSettings.java @@ -5,106 +5,96 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** - * Settings used for training the model. 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. + * Settings used for training the model. + * 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. */ @Fluent -public class ImageModelSettings { +public class ImageModelSettings implements JsonSerializable { /* * Settings for advanced scenarios. */ - @JsonProperty(value = "advancedSettings") private String advancedSettings; /* * Enable AMSGrad when optimizer is 'adam' or 'adamw'. */ - @JsonProperty(value = "amsGradient") private Boolean amsGradient; /* * Settings for using Augmentations. */ - @JsonProperty(value = "augmentations") private String augmentations; /* * Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range [0, 1]. */ - @JsonProperty(value = "beta1") private Float beta1; /* * Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range [0, 1]. */ - @JsonProperty(value = "beta2") private Float beta2; /* * Frequency to store model checkpoints. Must be a positive integer. */ - @JsonProperty(value = "checkpointFrequency") private Integer checkpointFrequency; /* * The pretrained checkpoint model for incremental training. */ - @JsonProperty(value = "checkpointModel") private MLFlowModelJobInput checkpointModel; /* * The id of a previous run that has a pretrained checkpoint for incremental training. */ - @JsonProperty(value = "checkpointRunId") private String checkpointRunId; /* * Whether to use distributed training. */ - @JsonProperty(value = "distributed") private Boolean distributed; /* * Enable early stopping logic during training. */ - @JsonProperty(value = "earlyStopping") private Boolean earlyStopping; /* * Minimum number of epochs or validation evaluations to wait before primary metric improvement * is tracked for early stopping. Must be a positive integer. */ - @JsonProperty(value = "earlyStoppingDelay") private Integer earlyStoppingDelay; /* * Minimum number of epochs or validation evaluations with no primary metric improvement before * the run is stopped. Must be a positive integer. */ - @JsonProperty(value = "earlyStoppingPatience") private Integer earlyStoppingPatience; /* * Enable normalization when exporting ONNX model. */ - @JsonProperty(value = "enableOnnxNormalization") private Boolean enableOnnxNormalization; /* * Frequency to evaluate validation dataset to get metric scores. Must be a positive integer. */ - @JsonProperty(value = "evaluationFrequency") private Integer evaluationFrequency; /* - * Gradient accumulation means running a configured number of "GradAccumulationStep"\ steps without + * Gradient accumulation means running a configured number of "GradAccumulationStep" steps without * updating the model weights while accumulating the gradients of those steps, and then using * the accumulated gradients to compute the weight updates. Must be a positive integer. */ - @JsonProperty(value = "gradientAccumulationStep") private Integer gradientAccumulationStep; /* @@ -113,19 +103,16 @@ public class ImageModelSettings { * freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please * see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. */ - @JsonProperty(value = "layersToFreeze") private Integer layersToFreeze; /* * Initial learning rate. Must be a float in the range [0, 1]. */ - @JsonProperty(value = "learningRate") private Float learningRate; /* * Type of learning rate scheduler. Must be 'warmup_cosine' or 'step'. */ - @JsonProperty(value = "learningRateScheduler") private LearningRateScheduler learningRateScheduler; /* @@ -133,94 +120,82 @@ public class ImageModelSettings { * For more information on the available models please visit the official documentation: * https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. */ - @JsonProperty(value = "modelName") private String modelName; /* * Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. */ - @JsonProperty(value = "momentum") private Float momentum; /* * Enable nesterov when optimizer is 'sgd'. */ - @JsonProperty(value = "nesterov") private Boolean nesterov; /* * Number of training epochs. Must be a positive integer. */ - @JsonProperty(value = "numberOfEpochs") private Integer numberOfEpochs; /* * Number of data loader workers. Must be a non-negative integer. */ - @JsonProperty(value = "numberOfWorkers") private Integer numberOfWorkers; /* * Type of optimizer. */ - @JsonProperty(value = "optimizer") private StochasticOptimizer optimizer; /* * Random seed to be used when using deterministic training. */ - @JsonProperty(value = "randomSeed") private Integer randomSeed; /* * Value of gamma when learning rate scheduler is 'step'. Must be a float in the range [0, 1]. */ - @JsonProperty(value = "stepLRGamma") private Float stepLRGamma; /* * Value of step size when learning rate scheduler is 'step'. Must be a positive integer. */ - @JsonProperty(value = "stepLRStepSize") private Integer stepLRStepSize; /* * Training batch size. Must be a positive integer. */ - @JsonProperty(value = "trainingBatchSize") private Integer trainingBatchSize; /* * Validation batch size. Must be a positive integer. */ - @JsonProperty(value = "validationBatchSize") private Integer validationBatchSize; /* * Value of cosine cycle when learning rate scheduler is 'warmup_cosine'. Must be a float in the range [0, 1]. */ - @JsonProperty(value = "warmupCosineLRCycles") private Float warmupCosineLRCycles; /* * Value of warmup epochs when learning rate scheduler is 'warmup_cosine'. Must be a positive integer. */ - @JsonProperty(value = "warmupCosineLRWarmupEpochs") private Integer warmupCosineLRWarmupEpochs; /* * Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be a float in the range[0, 1]. */ - @JsonProperty(value = "weightDecay") private Float weightDecay; - /** Creates an instance of ImageModelSettings class. */ + /** + * Creates an instance of ImageModelSettings class. + */ public ImageModelSettings() { } /** * Get the advancedSettings property: Settings for advanced scenarios. - * + * * @return the advancedSettings value. */ public String advancedSettings() { @@ -229,7 +204,7 @@ public String advancedSettings() { /** * Set the advancedSettings property: Settings for advanced scenarios. - * + * * @param advancedSettings the advancedSettings value to set. * @return the ImageModelSettings object itself. */ @@ -240,7 +215,7 @@ public ImageModelSettings withAdvancedSettings(String advancedSettings) { /** * Get the amsGradient property: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - * + * * @return the amsGradient value. */ public Boolean amsGradient() { @@ -249,7 +224,7 @@ public Boolean amsGradient() { /** * Set the amsGradient property: Enable AMSGrad when optimizer is 'adam' or 'adamw'. - * + * * @param amsGradient the amsGradient value to set. * @return the ImageModelSettings object itself. */ @@ -260,7 +235,7 @@ public ImageModelSettings withAmsGradient(Boolean amsGradient) { /** * Get the augmentations property: Settings for using Augmentations. - * + * * @return the augmentations value. */ public String augmentations() { @@ -269,7 +244,7 @@ public String augmentations() { /** * Set the augmentations property: Settings for using Augmentations. - * + * * @param augmentations the augmentations value to set. * @return the ImageModelSettings object itself. */ @@ -281,7 +256,7 @@ public ImageModelSettings withAugmentations(String augmentations) { /** * Get the beta1 property: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range [0, * 1]. - * + * * @return the beta1 value. */ public Float beta1() { @@ -291,7 +266,7 @@ public Float beta1() { /** * Set the beta1 property: Value of 'beta1' when optimizer is 'adam' or 'adamw'. Must be a float in the range [0, * 1]. - * + * * @param beta1 the beta1 value to set. * @return the ImageModelSettings object itself. */ @@ -303,7 +278,7 @@ public ImageModelSettings withBeta1(Float beta1) { /** * Get the beta2 property: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range [0, * 1]. - * + * * @return the beta2 value. */ public Float beta2() { @@ -313,7 +288,7 @@ public Float beta2() { /** * Set the beta2 property: Value of 'beta2' when optimizer is 'adam' or 'adamw'. Must be a float in the range [0, * 1]. - * + * * @param beta2 the beta2 value to set. * @return the ImageModelSettings object itself. */ @@ -324,7 +299,7 @@ public ImageModelSettings withBeta2(Float beta2) { /** * Get the checkpointFrequency property: Frequency to store model checkpoints. Must be a positive integer. - * + * * @return the checkpointFrequency value. */ public Integer checkpointFrequency() { @@ -333,7 +308,7 @@ public Integer checkpointFrequency() { /** * Set the checkpointFrequency property: Frequency to store model checkpoints. Must be a positive integer. - * + * * @param checkpointFrequency the checkpointFrequency value to set. * @return the ImageModelSettings object itself. */ @@ -344,7 +319,7 @@ public ImageModelSettings withCheckpointFrequency(Integer checkpointFrequency) { /** * Get the checkpointModel property: The pretrained checkpoint model for incremental training. - * + * * @return the checkpointModel value. */ public MLFlowModelJobInput checkpointModel() { @@ -353,7 +328,7 @@ public MLFlowModelJobInput checkpointModel() { /** * Set the checkpointModel property: The pretrained checkpoint model for incremental training. - * + * * @param checkpointModel the checkpointModel value to set. * @return the ImageModelSettings object itself. */ @@ -365,7 +340,7 @@ public ImageModelSettings withCheckpointModel(MLFlowModelJobInput checkpointMode /** * Get the checkpointRunId property: The id of a previous run that has a pretrained checkpoint for incremental * training. - * + * * @return the checkpointRunId value. */ public String checkpointRunId() { @@ -375,7 +350,7 @@ public String checkpointRunId() { /** * Set the checkpointRunId property: The id of a previous run that has a pretrained checkpoint for incremental * training. - * + * * @param checkpointRunId the checkpointRunId value to set. * @return the ImageModelSettings object itself. */ @@ -386,7 +361,7 @@ public ImageModelSettings withCheckpointRunId(String checkpointRunId) { /** * Get the distributed property: Whether to use distributed training. - * + * * @return the distributed value. */ public Boolean distributed() { @@ -395,7 +370,7 @@ public Boolean distributed() { /** * Set the distributed property: Whether to use distributed training. - * + * * @param distributed the distributed value to set. * @return the ImageModelSettings object itself. */ @@ -406,7 +381,7 @@ public ImageModelSettings withDistributed(Boolean distributed) { /** * Get the earlyStopping property: Enable early stopping logic during training. - * + * * @return the earlyStopping value. */ public Boolean earlyStopping() { @@ -415,7 +390,7 @@ public Boolean earlyStopping() { /** * Set the earlyStopping property: Enable early stopping logic during training. - * + * * @param earlyStopping the earlyStopping value to set. * @return the ImageModelSettings object itself. */ @@ -426,8 +401,9 @@ public ImageModelSettings withEarlyStopping(Boolean earlyStopping) { /** * Get the earlyStoppingDelay property: Minimum number of epochs or validation evaluations to wait before primary - * metric improvement is tracked for early stopping. Must be a positive integer. - * + * metric improvement + * is tracked for early stopping. Must be a positive integer. + * * @return the earlyStoppingDelay value. */ public Integer earlyStoppingDelay() { @@ -436,8 +412,9 @@ public Integer earlyStoppingDelay() { /** * Set the earlyStoppingDelay property: Minimum number of epochs or validation evaluations to wait before primary - * metric improvement is tracked for early stopping. Must be a positive integer. - * + * metric improvement + * is tracked for early stopping. Must be a positive integer. + * * @param earlyStoppingDelay the earlyStoppingDelay value to set. * @return the ImageModelSettings object itself. */ @@ -448,8 +425,9 @@ public ImageModelSettings withEarlyStoppingDelay(Integer earlyStoppingDelay) { /** * Get the earlyStoppingPatience property: Minimum number of epochs or validation evaluations with no primary metric - * improvement before the run is stopped. Must be a positive integer. - * + * improvement before + * the run is stopped. Must be a positive integer. + * * @return the earlyStoppingPatience value. */ public Integer earlyStoppingPatience() { @@ -458,8 +436,9 @@ public Integer earlyStoppingPatience() { /** * Set the earlyStoppingPatience property: Minimum number of epochs or validation evaluations with no primary metric - * improvement before the run is stopped. Must be a positive integer. - * + * improvement before + * the run is stopped. Must be a positive integer. + * * @param earlyStoppingPatience the earlyStoppingPatience value to set. * @return the ImageModelSettings object itself. */ @@ -470,7 +449,7 @@ public ImageModelSettings withEarlyStoppingPatience(Integer earlyStoppingPatienc /** * Get the enableOnnxNormalization property: Enable normalization when exporting ONNX model. - * + * * @return the enableOnnxNormalization value. */ public Boolean enableOnnxNormalization() { @@ -479,7 +458,7 @@ public Boolean enableOnnxNormalization() { /** * Set the enableOnnxNormalization property: Enable normalization when exporting ONNX model. - * + * * @param enableOnnxNormalization the enableOnnxNormalization value to set. * @return the ImageModelSettings object itself. */ @@ -491,7 +470,7 @@ public ImageModelSettings withEnableOnnxNormalization(Boolean enableOnnxNormaliz /** * Get the evaluationFrequency property: Frequency to evaluate validation dataset to get metric scores. Must be a * positive integer. - * + * * @return the evaluationFrequency value. */ public Integer evaluationFrequency() { @@ -501,7 +480,7 @@ public Integer evaluationFrequency() { /** * Set the evaluationFrequency property: Frequency to evaluate validation dataset to get metric scores. Must be a * positive integer. - * + * * @param evaluationFrequency the evaluationFrequency value to set. * @return the ImageModelSettings object itself. */ @@ -512,9 +491,10 @@ public ImageModelSettings withEvaluationFrequency(Integer evaluationFrequency) { /** * Get the gradientAccumulationStep property: Gradient accumulation means running a configured number of - * "GradAccumulationStep"\ steps without updating the model weights while accumulating the gradients of those steps, - * and then using the accumulated gradients to compute the weight updates. Must be a positive integer. - * + * "GradAccumulationStep" steps without + * updating the model weights while accumulating the gradients of those steps, and then using + * the accumulated gradients to compute the weight updates. Must be a positive integer. + * * @return the gradientAccumulationStep value. */ public Integer gradientAccumulationStep() { @@ -523,9 +503,10 @@ public Integer gradientAccumulationStep() { /** * Set the gradientAccumulationStep property: Gradient accumulation means running a configured number of - * "GradAccumulationStep"\ steps without updating the model weights while accumulating the gradients of those steps, - * and then using the accumulated gradients to compute the weight updates. Must be a positive integer. - * + * "GradAccumulationStep" steps without + * updating the model weights while accumulating the gradients of those steps, and then using + * the accumulated gradients to compute the weight updates. Must be a positive integer. + * * @param gradientAccumulationStep the gradientAccumulationStep value to set. * @return the ImageModelSettings object itself. */ @@ -535,11 +516,11 @@ public ImageModelSettings withGradientAccumulationStep(Integer gradientAccumulat } /** - * Get the layersToFreeze property: Number of layers to freeze for the model. Must be a positive integer. For - * instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models - * supported and details on layer freeze, please see: - * https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - * + * Get the layersToFreeze property: Number of layers to freeze for the model. Must be a positive integer. + * For instance, passing 2 as value for 'seresnext' means + * freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please + * see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + * * @return the layersToFreeze value. */ public Integer layersToFreeze() { @@ -547,11 +528,11 @@ public Integer layersToFreeze() { } /** - * Set the layersToFreeze property: Number of layers to freeze for the model. Must be a positive integer. For - * instance, passing 2 as value for 'seresnext' means freezing layer0 and layer1. For a full list of models - * supported and details on layer freeze, please see: - * https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - * + * Set the layersToFreeze property: Number of layers to freeze for the model. Must be a positive integer. + * For instance, passing 2 as value for 'seresnext' means + * freezing layer0 and layer1. For a full list of models supported and details on layer freeze, please + * see: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. + * * @param layersToFreeze the layersToFreeze value to set. * @return the ImageModelSettings object itself. */ @@ -562,7 +543,7 @@ public ImageModelSettings withLayersToFreeze(Integer layersToFreeze) { /** * Get the learningRate property: Initial learning rate. Must be a float in the range [0, 1]. - * + * * @return the learningRate value. */ public Float learningRate() { @@ -571,7 +552,7 @@ public Float learningRate() { /** * Set the learningRate property: Initial learning rate. Must be a float in the range [0, 1]. - * + * * @param learningRate the learningRate value to set. * @return the ImageModelSettings object itself. */ @@ -582,7 +563,7 @@ public ImageModelSettings withLearningRate(Float learningRate) { /** * Get the learningRateScheduler property: Type of learning rate scheduler. Must be 'warmup_cosine' or 'step'. - * + * * @return the learningRateScheduler value. */ public LearningRateScheduler learningRateScheduler() { @@ -591,7 +572,7 @@ public LearningRateScheduler learningRateScheduler() { /** * Set the learningRateScheduler property: Type of learning rate scheduler. Must be 'warmup_cosine' or 'step'. - * + * * @param learningRateScheduler the learningRateScheduler value to set. * @return the ImageModelSettings object itself. */ @@ -601,10 +582,10 @@ public ImageModelSettings withLearningRateScheduler(LearningRateScheduler learni } /** - * Get the modelName property: Name of the model to use for training. For more information on the available models - * please visit the official documentation: + * Get the modelName property: Name of the model to use for training. + * For more information on the available models please visit the official documentation: * https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - * + * * @return the modelName value. */ public String modelName() { @@ -612,10 +593,10 @@ public String modelName() { } /** - * Set the modelName property: Name of the model to use for training. For more information on the available models - * please visit the official documentation: + * Set the modelName property: Name of the model to use for training. + * For more information on the available models please visit the official documentation: * https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. - * + * * @param modelName the modelName value to set. * @return the ImageModelSettings object itself. */ @@ -626,7 +607,7 @@ public ImageModelSettings withModelName(String modelName) { /** * Get the momentum property: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - * + * * @return the momentum value. */ public Float momentum() { @@ -635,7 +616,7 @@ public Float momentum() { /** * Set the momentum property: Value of momentum when optimizer is 'sgd'. Must be a float in the range [0, 1]. - * + * * @param momentum the momentum value to set. * @return the ImageModelSettings object itself. */ @@ -646,7 +627,7 @@ public ImageModelSettings withMomentum(Float momentum) { /** * Get the nesterov property: Enable nesterov when optimizer is 'sgd'. - * + * * @return the nesterov value. */ public Boolean nesterov() { @@ -655,7 +636,7 @@ public Boolean nesterov() { /** * Set the nesterov property: Enable nesterov when optimizer is 'sgd'. - * + * * @param nesterov the nesterov value to set. * @return the ImageModelSettings object itself. */ @@ -666,7 +647,7 @@ public ImageModelSettings withNesterov(Boolean nesterov) { /** * Get the numberOfEpochs property: Number of training epochs. Must be a positive integer. - * + * * @return the numberOfEpochs value. */ public Integer numberOfEpochs() { @@ -675,7 +656,7 @@ public Integer numberOfEpochs() { /** * Set the numberOfEpochs property: Number of training epochs. Must be a positive integer. - * + * * @param numberOfEpochs the numberOfEpochs value to set. * @return the ImageModelSettings object itself. */ @@ -686,7 +667,7 @@ public ImageModelSettings withNumberOfEpochs(Integer numberOfEpochs) { /** * Get the numberOfWorkers property: Number of data loader workers. Must be a non-negative integer. - * + * * @return the numberOfWorkers value. */ public Integer numberOfWorkers() { @@ -695,7 +676,7 @@ public Integer numberOfWorkers() { /** * Set the numberOfWorkers property: Number of data loader workers. Must be a non-negative integer. - * + * * @param numberOfWorkers the numberOfWorkers value to set. * @return the ImageModelSettings object itself. */ @@ -706,7 +687,7 @@ public ImageModelSettings withNumberOfWorkers(Integer numberOfWorkers) { /** * Get the optimizer property: Type of optimizer. - * + * * @return the optimizer value. */ public StochasticOptimizer optimizer() { @@ -715,7 +696,7 @@ public StochasticOptimizer optimizer() { /** * Set the optimizer property: Type of optimizer. - * + * * @param optimizer the optimizer value to set. * @return the ImageModelSettings object itself. */ @@ -726,7 +707,7 @@ public ImageModelSettings withOptimizer(StochasticOptimizer optimizer) { /** * Get the randomSeed property: Random seed to be used when using deterministic training. - * + * * @return the randomSeed value. */ public Integer randomSeed() { @@ -735,7 +716,7 @@ public Integer randomSeed() { /** * Set the randomSeed property: Random seed to be used when using deterministic training. - * + * * @param randomSeed the randomSeed value to set. * @return the ImageModelSettings object itself. */ @@ -747,7 +728,7 @@ public ImageModelSettings withRandomSeed(Integer randomSeed) { /** * Get the stepLRGamma property: Value of gamma when learning rate scheduler is 'step'. Must be a float in the range * [0, 1]. - * + * * @return the stepLRGamma value. */ public Float stepLRGamma() { @@ -757,7 +738,7 @@ public Float stepLRGamma() { /** * Set the stepLRGamma property: Value of gamma when learning rate scheduler is 'step'. Must be a float in the range * [0, 1]. - * + * * @param stepLRGamma the stepLRGamma value to set. * @return the ImageModelSettings object itself. */ @@ -769,7 +750,7 @@ public ImageModelSettings withStepLRGamma(Float stepLRGamma) { /** * Get the stepLRStepSize property: Value of step size when learning rate scheduler is 'step'. Must be a positive * integer. - * + * * @return the stepLRStepSize value. */ public Integer stepLRStepSize() { @@ -779,7 +760,7 @@ public Integer stepLRStepSize() { /** * Set the stepLRStepSize property: Value of step size when learning rate scheduler is 'step'. Must be a positive * integer. - * + * * @param stepLRStepSize the stepLRStepSize value to set. * @return the ImageModelSettings object itself. */ @@ -790,7 +771,7 @@ public ImageModelSettings withStepLRStepSize(Integer stepLRStepSize) { /** * Get the trainingBatchSize property: Training batch size. Must be a positive integer. - * + * * @return the trainingBatchSize value. */ public Integer trainingBatchSize() { @@ -799,7 +780,7 @@ public Integer trainingBatchSize() { /** * Set the trainingBatchSize property: Training batch size. Must be a positive integer. - * + * * @param trainingBatchSize the trainingBatchSize value to set. * @return the ImageModelSettings object itself. */ @@ -810,7 +791,7 @@ public ImageModelSettings withTrainingBatchSize(Integer trainingBatchSize) { /** * Get the validationBatchSize property: Validation batch size. Must be a positive integer. - * + * * @return the validationBatchSize value. */ public Integer validationBatchSize() { @@ -819,7 +800,7 @@ public Integer validationBatchSize() { /** * Set the validationBatchSize property: Validation batch size. Must be a positive integer. - * + * * @param validationBatchSize the validationBatchSize value to set. * @return the ImageModelSettings object itself. */ @@ -831,7 +812,7 @@ public ImageModelSettings withValidationBatchSize(Integer validationBatchSize) { /** * Get the warmupCosineLRCycles property: Value of cosine cycle when learning rate scheduler is 'warmup_cosine'. * Must be a float in the range [0, 1]. - * + * * @return the warmupCosineLRCycles value. */ public Float warmupCosineLRCycles() { @@ -841,7 +822,7 @@ public Float warmupCosineLRCycles() { /** * Set the warmupCosineLRCycles property: Value of cosine cycle when learning rate scheduler is 'warmup_cosine'. * Must be a float in the range [0, 1]. - * + * * @param warmupCosineLRCycles the warmupCosineLRCycles value to set. * @return the ImageModelSettings object itself. */ @@ -853,7 +834,7 @@ public ImageModelSettings withWarmupCosineLRCycles(Float warmupCosineLRCycles) { /** * Get the warmupCosineLRWarmupEpochs property: Value of warmup epochs when learning rate scheduler is * 'warmup_cosine'. Must be a positive integer. - * + * * @return the warmupCosineLRWarmupEpochs value. */ public Integer warmupCosineLRWarmupEpochs() { @@ -863,7 +844,7 @@ public Integer warmupCosineLRWarmupEpochs() { /** * Set the warmupCosineLRWarmupEpochs property: Value of warmup epochs when learning rate scheduler is * 'warmup_cosine'. Must be a positive integer. - * + * * @param warmupCosineLRWarmupEpochs the warmupCosineLRWarmupEpochs value to set. * @return the ImageModelSettings object itself. */ @@ -875,7 +856,7 @@ public ImageModelSettings withWarmupCosineLRWarmupEpochs(Integer warmupCosineLRW /** * Get the weightDecay property: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be a float * in the range[0, 1]. - * + * * @return the weightDecay value. */ public Float weightDecay() { @@ -885,7 +866,7 @@ public Float weightDecay() { /** * Set the weightDecay property: Value of weight decay when optimizer is 'sgd', 'adam', or 'adamw'. Must be a float * in the range[0, 1]. - * + * * @param weightDecay the weightDecay value to set. * @return the ImageModelSettings object itself. */ @@ -896,7 +877,7 @@ public ImageModelSettings withWeightDecay(Float weightDecay) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -904,4 +885,135 @@ public void validate() { checkpointModel().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("advancedSettings", this.advancedSettings); + jsonWriter.writeBooleanField("amsGradient", this.amsGradient); + jsonWriter.writeStringField("augmentations", this.augmentations); + jsonWriter.writeNumberField("beta1", this.beta1); + jsonWriter.writeNumberField("beta2", this.beta2); + jsonWriter.writeNumberField("checkpointFrequency", this.checkpointFrequency); + jsonWriter.writeJsonField("checkpointModel", this.checkpointModel); + jsonWriter.writeStringField("checkpointRunId", this.checkpointRunId); + jsonWriter.writeBooleanField("distributed", this.distributed); + jsonWriter.writeBooleanField("earlyStopping", this.earlyStopping); + jsonWriter.writeNumberField("earlyStoppingDelay", this.earlyStoppingDelay); + jsonWriter.writeNumberField("earlyStoppingPatience", this.earlyStoppingPatience); + jsonWriter.writeBooleanField("enableOnnxNormalization", this.enableOnnxNormalization); + jsonWriter.writeNumberField("evaluationFrequency", this.evaluationFrequency); + jsonWriter.writeNumberField("gradientAccumulationStep", this.gradientAccumulationStep); + jsonWriter.writeNumberField("layersToFreeze", this.layersToFreeze); + jsonWriter.writeNumberField("learningRate", this.learningRate); + jsonWriter.writeStringField("learningRateScheduler", + this.learningRateScheduler == null ? null : this.learningRateScheduler.toString()); + jsonWriter.writeStringField("modelName", this.modelName); + jsonWriter.writeNumberField("momentum", this.momentum); + jsonWriter.writeBooleanField("nesterov", this.nesterov); + jsonWriter.writeNumberField("numberOfEpochs", this.numberOfEpochs); + jsonWriter.writeNumberField("numberOfWorkers", this.numberOfWorkers); + jsonWriter.writeStringField("optimizer", this.optimizer == null ? null : this.optimizer.toString()); + jsonWriter.writeNumberField("randomSeed", this.randomSeed); + jsonWriter.writeNumberField("stepLRGamma", this.stepLRGamma); + jsonWriter.writeNumberField("stepLRStepSize", this.stepLRStepSize); + jsonWriter.writeNumberField("trainingBatchSize", this.trainingBatchSize); + jsonWriter.writeNumberField("validationBatchSize", this.validationBatchSize); + jsonWriter.writeNumberField("warmupCosineLRCycles", this.warmupCosineLRCycles); + jsonWriter.writeNumberField("warmupCosineLRWarmupEpochs", this.warmupCosineLRWarmupEpochs); + jsonWriter.writeNumberField("weightDecay", this.weightDecay); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageModelSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageModelSettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ImageModelSettings. + */ + public static ImageModelSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageModelSettings deserializedImageModelSettings = new ImageModelSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("advancedSettings".equals(fieldName)) { + deserializedImageModelSettings.advancedSettings = reader.getString(); + } else if ("amsGradient".equals(fieldName)) { + deserializedImageModelSettings.amsGradient = reader.getNullable(JsonReader::getBoolean); + } else if ("augmentations".equals(fieldName)) { + deserializedImageModelSettings.augmentations = reader.getString(); + } else if ("beta1".equals(fieldName)) { + deserializedImageModelSettings.beta1 = reader.getNullable(JsonReader::getFloat); + } else if ("beta2".equals(fieldName)) { + deserializedImageModelSettings.beta2 = reader.getNullable(JsonReader::getFloat); + } else if ("checkpointFrequency".equals(fieldName)) { + deserializedImageModelSettings.checkpointFrequency = reader.getNullable(JsonReader::getInt); + } else if ("checkpointModel".equals(fieldName)) { + deserializedImageModelSettings.checkpointModel = MLFlowModelJobInput.fromJson(reader); + } else if ("checkpointRunId".equals(fieldName)) { + deserializedImageModelSettings.checkpointRunId = reader.getString(); + } else if ("distributed".equals(fieldName)) { + deserializedImageModelSettings.distributed = reader.getNullable(JsonReader::getBoolean); + } else if ("earlyStopping".equals(fieldName)) { + deserializedImageModelSettings.earlyStopping = reader.getNullable(JsonReader::getBoolean); + } else if ("earlyStoppingDelay".equals(fieldName)) { + deserializedImageModelSettings.earlyStoppingDelay = reader.getNullable(JsonReader::getInt); + } else if ("earlyStoppingPatience".equals(fieldName)) { + deserializedImageModelSettings.earlyStoppingPatience = reader.getNullable(JsonReader::getInt); + } else if ("enableOnnxNormalization".equals(fieldName)) { + deserializedImageModelSettings.enableOnnxNormalization = reader.getNullable(JsonReader::getBoolean); + } else if ("evaluationFrequency".equals(fieldName)) { + deserializedImageModelSettings.evaluationFrequency = reader.getNullable(JsonReader::getInt); + } else if ("gradientAccumulationStep".equals(fieldName)) { + deserializedImageModelSettings.gradientAccumulationStep = reader.getNullable(JsonReader::getInt); + } else if ("layersToFreeze".equals(fieldName)) { + deserializedImageModelSettings.layersToFreeze = reader.getNullable(JsonReader::getInt); + } else if ("learningRate".equals(fieldName)) { + deserializedImageModelSettings.learningRate = reader.getNullable(JsonReader::getFloat); + } else if ("learningRateScheduler".equals(fieldName)) { + deserializedImageModelSettings.learningRateScheduler + = LearningRateScheduler.fromString(reader.getString()); + } else if ("modelName".equals(fieldName)) { + deserializedImageModelSettings.modelName = reader.getString(); + } else if ("momentum".equals(fieldName)) { + deserializedImageModelSettings.momentum = reader.getNullable(JsonReader::getFloat); + } else if ("nesterov".equals(fieldName)) { + deserializedImageModelSettings.nesterov = reader.getNullable(JsonReader::getBoolean); + } else if ("numberOfEpochs".equals(fieldName)) { + deserializedImageModelSettings.numberOfEpochs = reader.getNullable(JsonReader::getInt); + } else if ("numberOfWorkers".equals(fieldName)) { + deserializedImageModelSettings.numberOfWorkers = reader.getNullable(JsonReader::getInt); + } else if ("optimizer".equals(fieldName)) { + deserializedImageModelSettings.optimizer = StochasticOptimizer.fromString(reader.getString()); + } else if ("randomSeed".equals(fieldName)) { + deserializedImageModelSettings.randomSeed = reader.getNullable(JsonReader::getInt); + } else if ("stepLRGamma".equals(fieldName)) { + deserializedImageModelSettings.stepLRGamma = reader.getNullable(JsonReader::getFloat); + } else if ("stepLRStepSize".equals(fieldName)) { + deserializedImageModelSettings.stepLRStepSize = reader.getNullable(JsonReader::getInt); + } else if ("trainingBatchSize".equals(fieldName)) { + deserializedImageModelSettings.trainingBatchSize = reader.getNullable(JsonReader::getInt); + } else if ("validationBatchSize".equals(fieldName)) { + deserializedImageModelSettings.validationBatchSize = reader.getNullable(JsonReader::getInt); + } else if ("warmupCosineLRCycles".equals(fieldName)) { + deserializedImageModelSettings.warmupCosineLRCycles = reader.getNullable(JsonReader::getFloat); + } else if ("warmupCosineLRWarmupEpochs".equals(fieldName)) { + deserializedImageModelSettings.warmupCosineLRWarmupEpochs = reader.getNullable(JsonReader::getInt); + } else if ("weightDecay".equals(fieldName)) { + deserializedImageModelSettings.weightDecay = reader.getNullable(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return deserializedImageModelSettings; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelSettingsClassification.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelSettingsClassification.java index 27e3463da73da..eb7e626dd978f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelSettingsClassification.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelSettingsClassification.java @@ -5,47 +5,49 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** - * Settings used for training the model. 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. + * Settings used for training the model. + * 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. */ @Fluent public final class ImageModelSettingsClassification extends ImageModelSettings { /* * Image crop size that is input to the neural network for the training dataset. Must be a positive integer. */ - @JsonProperty(value = "trainingCropSize") private Integer trainingCropSize; /* * Image crop size that is input to the neural network for the validation dataset. Must be a positive integer. */ - @JsonProperty(value = "validationCropSize") private Integer validationCropSize; /* * Image size to which to resize before cropping for validation dataset. Must be a positive integer. */ - @JsonProperty(value = "validationResizeSize") private Integer validationResizeSize; /* * Weighted loss. The accepted values are 0 for no weighted loss. * 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be 0 or 1 or 2. */ - @JsonProperty(value = "weightedLoss") private Integer weightedLoss; - /** Creates an instance of ImageModelSettingsClassification class. */ + /** + * Creates an instance of ImageModelSettingsClassification class. + */ public ImageModelSettingsClassification() { } /** * Get the trainingCropSize property: Image crop size that is input to the neural network for the training dataset. * Must be a positive integer. - * + * * @return the trainingCropSize value. */ public Integer trainingCropSize() { @@ -55,7 +57,7 @@ public Integer trainingCropSize() { /** * Set the trainingCropSize property: Image crop size that is input to the neural network for the training dataset. * Must be a positive integer. - * + * * @param trainingCropSize the trainingCropSize value to set. * @return the ImageModelSettingsClassification object itself. */ @@ -67,7 +69,7 @@ public ImageModelSettingsClassification withTrainingCropSize(Integer trainingCro /** * Get the validationCropSize property: Image crop size that is input to the neural network for the validation * dataset. Must be a positive integer. - * + * * @return the validationCropSize value. */ public Integer validationCropSize() { @@ -77,7 +79,7 @@ public Integer validationCropSize() { /** * Set the validationCropSize property: Image crop size that is input to the neural network for the validation * dataset. Must be a positive integer. - * + * * @param validationCropSize the validationCropSize value to set. * @return the ImageModelSettingsClassification object itself. */ @@ -89,7 +91,7 @@ public ImageModelSettingsClassification withValidationCropSize(Integer validatio /** * Get the validationResizeSize property: Image size to which to resize before cropping for validation dataset. Must * be a positive integer. - * + * * @return the validationResizeSize value. */ public Integer validationResizeSize() { @@ -99,7 +101,7 @@ public Integer validationResizeSize() { /** * Set the validationResizeSize property: Image size to which to resize before cropping for validation dataset. Must * be a positive integer. - * + * * @param validationResizeSize the validationResizeSize value to set. * @return the ImageModelSettingsClassification object itself. */ @@ -109,9 +111,9 @@ public ImageModelSettingsClassification withValidationResizeSize(Integer validat } /** - * Get the weightedLoss property: Weighted loss. The accepted values are 0 for no weighted loss. 1 for weighted loss - * with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be 0 or 1 or 2. - * + * Get the weightedLoss property: Weighted loss. The accepted values are 0 for no weighted loss. + * 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be 0 or 1 or 2. + * * @return the weightedLoss value. */ public Integer weightedLoss() { @@ -119,9 +121,9 @@ public Integer weightedLoss() { } /** - * Set the weightedLoss property: Weighted loss. The accepted values are 0 for no weighted loss. 1 for weighted loss - * with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be 0 or 1 or 2. - * + * Set the weightedLoss property: Weighted loss. The accepted values are 0 for no weighted loss. + * 1 for weighted loss with sqrt.(class_weights). 2 for weighted loss with class_weights. Must be 0 or 1 or 2. + * * @param weightedLoss the weightedLoss value to set. * @return the ImageModelSettingsClassification object itself. */ @@ -130,224 +132,288 @@ public ImageModelSettingsClassification withWeightedLoss(Integer weightedLoss) { return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsClassification withAdvancedSettings(String advancedSettings) { super.withAdvancedSettings(advancedSettings); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsClassification withAmsGradient(Boolean amsGradient) { super.withAmsGradient(amsGradient); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsClassification withAugmentations(String augmentations) { super.withAugmentations(augmentations); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsClassification withBeta1(Float beta1) { super.withBeta1(beta1); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsClassification withBeta2(Float beta2) { super.withBeta2(beta2); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsClassification withCheckpointFrequency(Integer checkpointFrequency) { super.withCheckpointFrequency(checkpointFrequency); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsClassification withCheckpointModel(MLFlowModelJobInput checkpointModel) { super.withCheckpointModel(checkpointModel); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsClassification withCheckpointRunId(String checkpointRunId) { super.withCheckpointRunId(checkpointRunId); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsClassification withDistributed(Boolean distributed) { super.withDistributed(distributed); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsClassification withEarlyStopping(Boolean earlyStopping) { super.withEarlyStopping(earlyStopping); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsClassification withEarlyStoppingDelay(Integer earlyStoppingDelay) { super.withEarlyStoppingDelay(earlyStoppingDelay); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsClassification withEarlyStoppingPatience(Integer earlyStoppingPatience) { super.withEarlyStoppingPatience(earlyStoppingPatience); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsClassification withEnableOnnxNormalization(Boolean enableOnnxNormalization) { super.withEnableOnnxNormalization(enableOnnxNormalization); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsClassification withEvaluationFrequency(Integer evaluationFrequency) { super.withEvaluationFrequency(evaluationFrequency); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsClassification withGradientAccumulationStep(Integer gradientAccumulationStep) { super.withGradientAccumulationStep(gradientAccumulationStep); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsClassification withLayersToFreeze(Integer layersToFreeze) { super.withLayersToFreeze(layersToFreeze); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsClassification withLearningRate(Float learningRate) { super.withLearningRate(learningRate); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsClassification withLearningRateScheduler(LearningRateScheduler learningRateScheduler) { super.withLearningRateScheduler(learningRateScheduler); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsClassification withModelName(String modelName) { super.withModelName(modelName); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsClassification withMomentum(Float momentum) { super.withMomentum(momentum); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsClassification withNesterov(Boolean nesterov) { super.withNesterov(nesterov); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsClassification withNumberOfEpochs(Integer numberOfEpochs) { super.withNumberOfEpochs(numberOfEpochs); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsClassification withNumberOfWorkers(Integer numberOfWorkers) { super.withNumberOfWorkers(numberOfWorkers); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsClassification withOptimizer(StochasticOptimizer optimizer) { super.withOptimizer(optimizer); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsClassification withRandomSeed(Integer randomSeed) { super.withRandomSeed(randomSeed); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsClassification withStepLRGamma(Float stepLRGamma) { super.withStepLRGamma(stepLRGamma); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsClassification withStepLRStepSize(Integer stepLRStepSize) { super.withStepLRStepSize(stepLRStepSize); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsClassification withTrainingBatchSize(Integer trainingBatchSize) { super.withTrainingBatchSize(trainingBatchSize); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsClassification withValidationBatchSize(Integer validationBatchSize) { super.withValidationBatchSize(validationBatchSize); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsClassification withWarmupCosineLRCycles(Float warmupCosineLRCycles) { super.withWarmupCosineLRCycles(warmupCosineLRCycles); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsClassification withWarmupCosineLRWarmupEpochs(Integer warmupCosineLRWarmupEpochs) { super.withWarmupCosineLRWarmupEpochs(warmupCosineLRWarmupEpochs); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsClassification withWeightDecay(Float weightDecay) { super.withWeightDecay(weightDecay); @@ -356,11 +422,181 @@ public ImageModelSettingsClassification withWeightDecay(Float weightDecay) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("advancedSettings", advancedSettings()); + jsonWriter.writeBooleanField("amsGradient", amsGradient()); + jsonWriter.writeStringField("augmentations", augmentations()); + jsonWriter.writeNumberField("beta1", beta1()); + jsonWriter.writeNumberField("beta2", beta2()); + jsonWriter.writeNumberField("checkpointFrequency", checkpointFrequency()); + jsonWriter.writeJsonField("checkpointModel", checkpointModel()); + jsonWriter.writeStringField("checkpointRunId", checkpointRunId()); + jsonWriter.writeBooleanField("distributed", distributed()); + jsonWriter.writeBooleanField("earlyStopping", earlyStopping()); + jsonWriter.writeNumberField("earlyStoppingDelay", earlyStoppingDelay()); + jsonWriter.writeNumberField("earlyStoppingPatience", earlyStoppingPatience()); + jsonWriter.writeBooleanField("enableOnnxNormalization", enableOnnxNormalization()); + jsonWriter.writeNumberField("evaluationFrequency", evaluationFrequency()); + jsonWriter.writeNumberField("gradientAccumulationStep", gradientAccumulationStep()); + jsonWriter.writeNumberField("layersToFreeze", layersToFreeze()); + jsonWriter.writeNumberField("learningRate", learningRate()); + jsonWriter.writeStringField("learningRateScheduler", + learningRateScheduler() == null ? null : learningRateScheduler().toString()); + jsonWriter.writeStringField("modelName", modelName()); + jsonWriter.writeNumberField("momentum", momentum()); + jsonWriter.writeBooleanField("nesterov", nesterov()); + jsonWriter.writeNumberField("numberOfEpochs", numberOfEpochs()); + jsonWriter.writeNumberField("numberOfWorkers", numberOfWorkers()); + jsonWriter.writeStringField("optimizer", optimizer() == null ? null : optimizer().toString()); + jsonWriter.writeNumberField("randomSeed", randomSeed()); + jsonWriter.writeNumberField("stepLRGamma", stepLRGamma()); + jsonWriter.writeNumberField("stepLRStepSize", stepLRStepSize()); + jsonWriter.writeNumberField("trainingBatchSize", trainingBatchSize()); + jsonWriter.writeNumberField("validationBatchSize", validationBatchSize()); + jsonWriter.writeNumberField("warmupCosineLRCycles", warmupCosineLRCycles()); + jsonWriter.writeNumberField("warmupCosineLRWarmupEpochs", warmupCosineLRWarmupEpochs()); + jsonWriter.writeNumberField("weightDecay", weightDecay()); + jsonWriter.writeNumberField("trainingCropSize", this.trainingCropSize); + jsonWriter.writeNumberField("validationCropSize", this.validationCropSize); + jsonWriter.writeNumberField("validationResizeSize", this.validationResizeSize); + jsonWriter.writeNumberField("weightedLoss", this.weightedLoss); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageModelSettingsClassification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageModelSettingsClassification if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ImageModelSettingsClassification. + */ + public static ImageModelSettingsClassification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageModelSettingsClassification deserializedImageModelSettingsClassification + = new ImageModelSettingsClassification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("advancedSettings".equals(fieldName)) { + deserializedImageModelSettingsClassification.withAdvancedSettings(reader.getString()); + } else if ("amsGradient".equals(fieldName)) { + deserializedImageModelSettingsClassification + .withAmsGradient(reader.getNullable(JsonReader::getBoolean)); + } else if ("augmentations".equals(fieldName)) { + deserializedImageModelSettingsClassification.withAugmentations(reader.getString()); + } else if ("beta1".equals(fieldName)) { + deserializedImageModelSettingsClassification.withBeta1(reader.getNullable(JsonReader::getFloat)); + } else if ("beta2".equals(fieldName)) { + deserializedImageModelSettingsClassification.withBeta2(reader.getNullable(JsonReader::getFloat)); + } else if ("checkpointFrequency".equals(fieldName)) { + deserializedImageModelSettingsClassification + .withCheckpointFrequency(reader.getNullable(JsonReader::getInt)); + } else if ("checkpointModel".equals(fieldName)) { + deserializedImageModelSettingsClassification + .withCheckpointModel(MLFlowModelJobInput.fromJson(reader)); + } else if ("checkpointRunId".equals(fieldName)) { + deserializedImageModelSettingsClassification.withCheckpointRunId(reader.getString()); + } else if ("distributed".equals(fieldName)) { + deserializedImageModelSettingsClassification + .withDistributed(reader.getNullable(JsonReader::getBoolean)); + } else if ("earlyStopping".equals(fieldName)) { + deserializedImageModelSettingsClassification + .withEarlyStopping(reader.getNullable(JsonReader::getBoolean)); + } else if ("earlyStoppingDelay".equals(fieldName)) { + deserializedImageModelSettingsClassification + .withEarlyStoppingDelay(reader.getNullable(JsonReader::getInt)); + } else if ("earlyStoppingPatience".equals(fieldName)) { + deserializedImageModelSettingsClassification + .withEarlyStoppingPatience(reader.getNullable(JsonReader::getInt)); + } else if ("enableOnnxNormalization".equals(fieldName)) { + deserializedImageModelSettingsClassification + .withEnableOnnxNormalization(reader.getNullable(JsonReader::getBoolean)); + } else if ("evaluationFrequency".equals(fieldName)) { + deserializedImageModelSettingsClassification + .withEvaluationFrequency(reader.getNullable(JsonReader::getInt)); + } else if ("gradientAccumulationStep".equals(fieldName)) { + deserializedImageModelSettingsClassification + .withGradientAccumulationStep(reader.getNullable(JsonReader::getInt)); + } else if ("layersToFreeze".equals(fieldName)) { + deserializedImageModelSettingsClassification + .withLayersToFreeze(reader.getNullable(JsonReader::getInt)); + } else if ("learningRate".equals(fieldName)) { + deserializedImageModelSettingsClassification + .withLearningRate(reader.getNullable(JsonReader::getFloat)); + } else if ("learningRateScheduler".equals(fieldName)) { + deserializedImageModelSettingsClassification + .withLearningRateScheduler(LearningRateScheduler.fromString(reader.getString())); + } else if ("modelName".equals(fieldName)) { + deserializedImageModelSettingsClassification.withModelName(reader.getString()); + } else if ("momentum".equals(fieldName)) { + deserializedImageModelSettingsClassification.withMomentum(reader.getNullable(JsonReader::getFloat)); + } else if ("nesterov".equals(fieldName)) { + deserializedImageModelSettingsClassification + .withNesterov(reader.getNullable(JsonReader::getBoolean)); + } else if ("numberOfEpochs".equals(fieldName)) { + deserializedImageModelSettingsClassification + .withNumberOfEpochs(reader.getNullable(JsonReader::getInt)); + } else if ("numberOfWorkers".equals(fieldName)) { + deserializedImageModelSettingsClassification + .withNumberOfWorkers(reader.getNullable(JsonReader::getInt)); + } else if ("optimizer".equals(fieldName)) { + deserializedImageModelSettingsClassification + .withOptimizer(StochasticOptimizer.fromString(reader.getString())); + } else if ("randomSeed".equals(fieldName)) { + deserializedImageModelSettingsClassification.withRandomSeed(reader.getNullable(JsonReader::getInt)); + } else if ("stepLRGamma".equals(fieldName)) { + deserializedImageModelSettingsClassification + .withStepLRGamma(reader.getNullable(JsonReader::getFloat)); + } else if ("stepLRStepSize".equals(fieldName)) { + deserializedImageModelSettingsClassification + .withStepLRStepSize(reader.getNullable(JsonReader::getInt)); + } else if ("trainingBatchSize".equals(fieldName)) { + deserializedImageModelSettingsClassification + .withTrainingBatchSize(reader.getNullable(JsonReader::getInt)); + } else if ("validationBatchSize".equals(fieldName)) { + deserializedImageModelSettingsClassification + .withValidationBatchSize(reader.getNullable(JsonReader::getInt)); + } else if ("warmupCosineLRCycles".equals(fieldName)) { + deserializedImageModelSettingsClassification + .withWarmupCosineLRCycles(reader.getNullable(JsonReader::getFloat)); + } else if ("warmupCosineLRWarmupEpochs".equals(fieldName)) { + deserializedImageModelSettingsClassification + .withWarmupCosineLRWarmupEpochs(reader.getNullable(JsonReader::getInt)); + } else if ("weightDecay".equals(fieldName)) { + deserializedImageModelSettingsClassification + .withWeightDecay(reader.getNullable(JsonReader::getFloat)); + } else if ("trainingCropSize".equals(fieldName)) { + deserializedImageModelSettingsClassification.trainingCropSize + = reader.getNullable(JsonReader::getInt); + } else if ("validationCropSize".equals(fieldName)) { + deserializedImageModelSettingsClassification.validationCropSize + = reader.getNullable(JsonReader::getInt); + } else if ("validationResizeSize".equals(fieldName)) { + deserializedImageModelSettingsClassification.validationResizeSize + = reader.getNullable(JsonReader::getInt); + } else if ("weightedLoss".equals(fieldName)) { + deserializedImageModelSettingsClassification.weightedLoss = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedImageModelSettingsClassification; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelSettingsObjectDetection.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelSettingsObjectDetection.java index aa171c49914da..50cad9fce6d13 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelSettingsObjectDetection.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageModelSettingsObjectDetection.java @@ -5,11 +5,15 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** - * Settings used for training the model. 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. + * Settings used for training the model. + * 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. */ @Fluent public final class ImageModelSettingsObjectDetection extends ImageModelSettings { @@ -17,14 +21,12 @@ public final class ImageModelSettingsObjectDetection extends ImageModelSettings * Maximum number of detections per image, for all classes. Must be a positive integer. * Note: This settings is not supported for the 'yolov5' algorithm. */ - @JsonProperty(value = "boxDetectionsPerImage") private Integer boxDetectionsPerImage; /* * During inference, only return proposals with a classification score greater than * BoxScoreThreshold. Must be a float in the range[0, 1]. */ - @JsonProperty(value = "boxScoreThreshold") private Float boxScoreThreshold; /* @@ -32,7 +34,6 @@ public final class ImageModelSettingsObjectDetection extends ImageModelSettings * Note: The training run may get into CUDA OOM if the size is too big. * Note: This settings is only supported for the 'yolov5' algorithm. */ - @JsonProperty(value = "imageSize") private Integer imageSize; /* @@ -40,7 +41,6 @@ public final class ImageModelSettingsObjectDetection extends ImageModelSettings * Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. * Note: This settings is not supported for the 'yolov5' algorithm. */ - @JsonProperty(value = "maxSize") private Integer maxSize; /* @@ -48,7 +48,6 @@ public final class ImageModelSettingsObjectDetection extends ImageModelSettings * Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. * Note: This settings is not supported for the 'yolov5' algorithm. */ - @JsonProperty(value = "minSize") private Integer minSize; /* @@ -56,7 +55,6 @@ public final class ImageModelSettingsObjectDetection extends ImageModelSettings * Note: training run may get into CUDA OOM if the model size is too big. * Note: This settings is only supported for the 'yolov5' algorithm. */ - @JsonProperty(value = "modelSize") private ModelSize modelSize; /* @@ -64,13 +62,11 @@ public final class ImageModelSettingsObjectDetection extends ImageModelSettings * Note: training run may get into CUDA OOM if no sufficient GPU memory. * Note: This settings is only supported for the 'yolov5' algorithm. */ - @JsonProperty(value = "multiScale") private Boolean multiScale; /* * IOU threshold used during inference in NMS post processing. Must be a float in the range [0, 1]. */ - @JsonProperty(value = "nmsIouThreshold") private Float nmsIouThreshold; /* @@ -78,14 +74,12 @@ public final class ImageModelSettingsObjectDetection extends ImageModelSettings * None to enable small object detection logic. A string containing two integers in mxn format. * Note: This settings is not supported for the 'yolov5' algorithm. */ - @JsonProperty(value = "tileGridSize") private String tileGridSize; /* * Overlap ratio between adjacent tiles in each dimension. Must be float in the range [0, 1). * Note: This settings is not supported for the 'yolov5' algorithm. */ - @JsonProperty(value = "tileOverlapRatio") private Float tileOverlapRatio; /* @@ -93,29 +87,29 @@ public final class ImageModelSettingsObjectDetection extends ImageModelSettings * Used in validation/ inference. Must be float in the range [0, 1]. * Note: This settings is not supported for the 'yolov5' algorithm. */ - @JsonProperty(value = "tilePredictionsNmsThreshold") private Float tilePredictionsNmsThreshold; /* * IOU threshold to use when computing validation metric. Must be float in the range [0, 1]. */ - @JsonProperty(value = "validationIouThreshold") private Float validationIouThreshold; /* * Metric computation method to use for validation metrics. */ - @JsonProperty(value = "validationMetricType") private ValidationMetricType validationMetricType; - /** Creates an instance of ImageModelSettingsObjectDetection class. */ + /** + * Creates an instance of ImageModelSettingsObjectDetection class. + */ public ImageModelSettingsObjectDetection() { } /** * Get the boxDetectionsPerImage property: Maximum number of detections per image, for all classes. Must be a - * positive integer. Note: This settings is not supported for the 'yolov5' algorithm. - * + * positive integer. + * Note: This settings is not supported for the 'yolov5' algorithm. + * * @return the boxDetectionsPerImage value. */ public Integer boxDetectionsPerImage() { @@ -124,8 +118,9 @@ public Integer boxDetectionsPerImage() { /** * Set the boxDetectionsPerImage property: Maximum number of detections per image, for all classes. Must be a - * positive integer. Note: This settings is not supported for the 'yolov5' algorithm. - * + * positive integer. + * Note: This settings is not supported for the 'yolov5' algorithm. + * * @param boxDetectionsPerImage the boxDetectionsPerImage value to set. * @return the ImageModelSettingsObjectDetection object itself. */ @@ -136,8 +131,9 @@ public ImageModelSettingsObjectDetection withBoxDetectionsPerImage(Integer boxDe /** * Get the boxScoreThreshold property: During inference, only return proposals with a classification score greater - * than BoxScoreThreshold. Must be a float in the range[0, 1]. - * + * than + * BoxScoreThreshold. Must be a float in the range[0, 1]. + * * @return the boxScoreThreshold value. */ public Float boxScoreThreshold() { @@ -146,8 +142,9 @@ public Float boxScoreThreshold() { /** * Set the boxScoreThreshold property: During inference, only return proposals with a classification score greater - * than BoxScoreThreshold. Must be a float in the range[0, 1]. - * + * than + * BoxScoreThreshold. Must be a float in the range[0, 1]. + * * @param boxScoreThreshold the boxScoreThreshold value to set. * @return the ImageModelSettingsObjectDetection object itself. */ @@ -157,10 +154,10 @@ public ImageModelSettingsObjectDetection withBoxScoreThreshold(Float boxScoreThr } /** - * Get the imageSize property: Image size for train and validation. Must be a positive integer. Note: The training - * run may get into CUDA OOM if the size is too big. Note: This settings is only supported for the 'yolov5' - * algorithm. - * + * Get the imageSize property: Image size for train and validation. Must be a positive integer. + * Note: The training run may get into CUDA OOM if the size is too big. + * Note: This settings is only supported for the 'yolov5' algorithm. + * * @return the imageSize value. */ public Integer imageSize() { @@ -168,10 +165,10 @@ public Integer imageSize() { } /** - * Set the imageSize property: Image size for train and validation. Must be a positive integer. Note: The training - * run may get into CUDA OOM if the size is too big. Note: This settings is only supported for the 'yolov5' - * algorithm. - * + * Set the imageSize property: Image size for train and validation. Must be a positive integer. + * Note: The training run may get into CUDA OOM if the size is too big. + * Note: This settings is only supported for the 'yolov5' algorithm. + * * @param imageSize the imageSize value to set. * @return the ImageModelSettingsObjectDetection object itself. */ @@ -181,10 +178,10 @@ public ImageModelSettingsObjectDetection withImageSize(Integer imageSize) { } /** - * Get the maxSize property: Maximum size of the image to be rescaled before feeding it to the backbone. Must be a - * positive integer. Note: training run may get into CUDA OOM if the size is too big. Note: This settings is not - * supported for the 'yolov5' algorithm. - * + * Get the maxSize property: Maximum size of the image to be rescaled before feeding it to the backbone. + * Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + * Note: This settings is not supported for the 'yolov5' algorithm. + * * @return the maxSize value. */ public Integer maxSize() { @@ -192,10 +189,10 @@ public Integer maxSize() { } /** - * Set the maxSize property: Maximum size of the image to be rescaled before feeding it to the backbone. Must be a - * positive integer. Note: training run may get into CUDA OOM if the size is too big. Note: This settings is not - * supported for the 'yolov5' algorithm. - * + * Set the maxSize property: Maximum size of the image to be rescaled before feeding it to the backbone. + * Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + * Note: This settings is not supported for the 'yolov5' algorithm. + * * @param maxSize the maxSize value to set. * @return the ImageModelSettingsObjectDetection object itself. */ @@ -205,10 +202,10 @@ public ImageModelSettingsObjectDetection withMaxSize(Integer maxSize) { } /** - * Get the minSize property: Minimum size of the image to be rescaled before feeding it to the backbone. Must be a - * positive integer. Note: training run may get into CUDA OOM if the size is too big. Note: This settings is not - * supported for the 'yolov5' algorithm. - * + * Get the minSize property: Minimum size of the image to be rescaled before feeding it to the backbone. + * Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + * Note: This settings is not supported for the 'yolov5' algorithm. + * * @return the minSize value. */ public Integer minSize() { @@ -216,10 +213,10 @@ public Integer minSize() { } /** - * Set the minSize property: Minimum size of the image to be rescaled before feeding it to the backbone. Must be a - * positive integer. Note: training run may get into CUDA OOM if the size is too big. Note: This settings is not - * supported for the 'yolov5' algorithm. - * + * Set the minSize property: Minimum size of the image to be rescaled before feeding it to the backbone. + * Must be a positive integer. Note: training run may get into CUDA OOM if the size is too big. + * Note: This settings is not supported for the 'yolov5' algorithm. + * * @param minSize the minSize value to set. * @return the ImageModelSettingsObjectDetection object itself. */ @@ -229,9 +226,10 @@ public ImageModelSettingsObjectDetection withMinSize(Integer minSize) { } /** - * Get the modelSize property: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. Note: training run may - * get into CUDA OOM if the model size is too big. Note: This settings is only supported for the 'yolov5' algorithm. - * + * Get the modelSize property: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. + * Note: training run may get into CUDA OOM if the model size is too big. + * Note: This settings is only supported for the 'yolov5' algorithm. + * * @return the modelSize value. */ public ModelSize modelSize() { @@ -239,9 +237,10 @@ public ModelSize modelSize() { } /** - * Set the modelSize property: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. Note: training run may - * get into CUDA OOM if the model size is too big. Note: This settings is only supported for the 'yolov5' algorithm. - * + * Set the modelSize property: Model size. Must be 'small', 'medium', 'large', or 'xlarge'. + * Note: training run may get into CUDA OOM if the model size is too big. + * Note: This settings is only supported for the 'yolov5' algorithm. + * * @param modelSize the modelSize value to set. * @return the ImageModelSettingsObjectDetection object itself. */ @@ -251,9 +250,10 @@ public ImageModelSettingsObjectDetection withModelSize(ModelSize modelSize) { } /** - * Get the multiScale property: Enable multi-scale image by varying image size by +/- 50%. Note: training run may - * get into CUDA OOM if no sufficient GPU memory. Note: This settings is only supported for the 'yolov5' algorithm. - * + * Get the multiScale property: Enable multi-scale image by varying image size by +/- 50%. + * Note: training run may get into CUDA OOM if no sufficient GPU memory. + * Note: This settings is only supported for the 'yolov5' algorithm. + * * @return the multiScale value. */ public Boolean multiScale() { @@ -261,9 +261,10 @@ public Boolean multiScale() { } /** - * Set the multiScale property: Enable multi-scale image by varying image size by +/- 50%. Note: training run may - * get into CUDA OOM if no sufficient GPU memory. Note: This settings is only supported for the 'yolov5' algorithm. - * + * Set the multiScale property: Enable multi-scale image by varying image size by +/- 50%. + * Note: training run may get into CUDA OOM if no sufficient GPU memory. + * Note: This settings is only supported for the 'yolov5' algorithm. + * * @param multiScale the multiScale value to set. * @return the ImageModelSettingsObjectDetection object itself. */ @@ -275,7 +276,7 @@ public ImageModelSettingsObjectDetection withMultiScale(Boolean multiScale) { /** * Get the nmsIouThreshold property: IOU threshold used during inference in NMS post processing. Must be a float in * the range [0, 1]. - * + * * @return the nmsIouThreshold value. */ public Float nmsIouThreshold() { @@ -285,7 +286,7 @@ public Float nmsIouThreshold() { /** * Set the nmsIouThreshold property: IOU threshold used during inference in NMS post processing. Must be a float in * the range [0, 1]. - * + * * @param nmsIouThreshold the nmsIouThreshold value to set. * @return the ImageModelSettingsObjectDetection object itself. */ @@ -295,10 +296,10 @@ public ImageModelSettingsObjectDetection withNmsIouThreshold(Float nmsIouThresho } /** - * Get the tileGridSize property: The grid size to use for tiling each image. Note: TileGridSize must not be None to - * enable small object detection logic. A string containing two integers in mxn format. Note: This settings is not - * supported for the 'yolov5' algorithm. - * + * Get the tileGridSize property: The grid size to use for tiling each image. Note: TileGridSize must not be + * None to enable small object detection logic. A string containing two integers in mxn format. + * Note: This settings is not supported for the 'yolov5' algorithm. + * * @return the tileGridSize value. */ public String tileGridSize() { @@ -306,10 +307,10 @@ public String tileGridSize() { } /** - * Set the tileGridSize property: The grid size to use for tiling each image. Note: TileGridSize must not be None to - * enable small object detection logic. A string containing two integers in mxn format. Note: This settings is not - * supported for the 'yolov5' algorithm. - * + * Set the tileGridSize property: The grid size to use for tiling each image. Note: TileGridSize must not be + * None to enable small object detection logic. A string containing two integers in mxn format. + * Note: This settings is not supported for the 'yolov5' algorithm. + * * @param tileGridSize the tileGridSize value to set. * @return the ImageModelSettingsObjectDetection object itself. */ @@ -320,8 +321,9 @@ public ImageModelSettingsObjectDetection withTileGridSize(String tileGridSize) { /** * Get the tileOverlapRatio property: Overlap ratio between adjacent tiles in each dimension. Must be float in the - * range [0, 1). Note: This settings is not supported for the 'yolov5' algorithm. - * + * range [0, 1). + * Note: This settings is not supported for the 'yolov5' algorithm. + * * @return the tileOverlapRatio value. */ public Float tileOverlapRatio() { @@ -330,8 +332,9 @@ public Float tileOverlapRatio() { /** * Set the tileOverlapRatio property: Overlap ratio between adjacent tiles in each dimension. Must be float in the - * range [0, 1). Note: This settings is not supported for the 'yolov5' algorithm. - * + * range [0, 1). + * Note: This settings is not supported for the 'yolov5' algorithm. + * * @param tileOverlapRatio the tileOverlapRatio value to set. * @return the ImageModelSettingsObjectDetection object itself. */ @@ -342,9 +345,10 @@ public ImageModelSettingsObjectDetection withTileOverlapRatio(Float tileOverlapR /** * Get the tilePredictionsNmsThreshold property: The IOU threshold to use to perform NMS while merging predictions - * from tiles and image. Used in validation/ inference. Must be float in the range [0, 1]. Note: This settings is - * not supported for the 'yolov5' algorithm. - * + * from tiles and image. + * Used in validation/ inference. Must be float in the range [0, 1]. + * Note: This settings is not supported for the 'yolov5' algorithm. + * * @return the tilePredictionsNmsThreshold value. */ public Float tilePredictionsNmsThreshold() { @@ -353,9 +357,10 @@ public Float tilePredictionsNmsThreshold() { /** * Set the tilePredictionsNmsThreshold property: The IOU threshold to use to perform NMS while merging predictions - * from tiles and image. Used in validation/ inference. Must be float in the range [0, 1]. Note: This settings is - * not supported for the 'yolov5' algorithm. - * + * from tiles and image. + * Used in validation/ inference. Must be float in the range [0, 1]. + * Note: This settings is not supported for the 'yolov5' algorithm. + * * @param tilePredictionsNmsThreshold the tilePredictionsNmsThreshold value to set. * @return the ImageModelSettingsObjectDetection object itself. */ @@ -367,7 +372,7 @@ public ImageModelSettingsObjectDetection withTilePredictionsNmsThreshold(Float t /** * Get the validationIouThreshold property: IOU threshold to use when computing validation metric. Must be float in * the range [0, 1]. - * + * * @return the validationIouThreshold value. */ public Float validationIouThreshold() { @@ -377,7 +382,7 @@ public Float validationIouThreshold() { /** * Set the validationIouThreshold property: IOU threshold to use when computing validation metric. Must be float in * the range [0, 1]. - * + * * @param validationIouThreshold the validationIouThreshold value to set. * @return the ImageModelSettingsObjectDetection object itself. */ @@ -388,7 +393,7 @@ public ImageModelSettingsObjectDetection withValidationIouThreshold(Float valida /** * Get the validationMetricType property: Metric computation method to use for validation metrics. - * + * * @return the validationMetricType value. */ public ValidationMetricType validationMetricType() { @@ -397,7 +402,7 @@ public ValidationMetricType validationMetricType() { /** * Set the validationMetricType property: Metric computation method to use for validation metrics. - * + * * @param validationMetricType the validationMetricType value to set. * @return the ImageModelSettingsObjectDetection object itself. */ @@ -406,224 +411,288 @@ public ImageModelSettingsObjectDetection withValidationMetricType(ValidationMetr return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsObjectDetection withAdvancedSettings(String advancedSettings) { super.withAdvancedSettings(advancedSettings); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsObjectDetection withAmsGradient(Boolean amsGradient) { super.withAmsGradient(amsGradient); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsObjectDetection withAugmentations(String augmentations) { super.withAugmentations(augmentations); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsObjectDetection withBeta1(Float beta1) { super.withBeta1(beta1); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsObjectDetection withBeta2(Float beta2) { super.withBeta2(beta2); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsObjectDetection withCheckpointFrequency(Integer checkpointFrequency) { super.withCheckpointFrequency(checkpointFrequency); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsObjectDetection withCheckpointModel(MLFlowModelJobInput checkpointModel) { super.withCheckpointModel(checkpointModel); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsObjectDetection withCheckpointRunId(String checkpointRunId) { super.withCheckpointRunId(checkpointRunId); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsObjectDetection withDistributed(Boolean distributed) { super.withDistributed(distributed); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsObjectDetection withEarlyStopping(Boolean earlyStopping) { super.withEarlyStopping(earlyStopping); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsObjectDetection withEarlyStoppingDelay(Integer earlyStoppingDelay) { super.withEarlyStoppingDelay(earlyStoppingDelay); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsObjectDetection withEarlyStoppingPatience(Integer earlyStoppingPatience) { super.withEarlyStoppingPatience(earlyStoppingPatience); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsObjectDetection withEnableOnnxNormalization(Boolean enableOnnxNormalization) { super.withEnableOnnxNormalization(enableOnnxNormalization); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsObjectDetection withEvaluationFrequency(Integer evaluationFrequency) { super.withEvaluationFrequency(evaluationFrequency); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsObjectDetection withGradientAccumulationStep(Integer gradientAccumulationStep) { super.withGradientAccumulationStep(gradientAccumulationStep); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsObjectDetection withLayersToFreeze(Integer layersToFreeze) { super.withLayersToFreeze(layersToFreeze); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsObjectDetection withLearningRate(Float learningRate) { super.withLearningRate(learningRate); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsObjectDetection withLearningRateScheduler(LearningRateScheduler learningRateScheduler) { super.withLearningRateScheduler(learningRateScheduler); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsObjectDetection withModelName(String modelName) { super.withModelName(modelName); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsObjectDetection withMomentum(Float momentum) { super.withMomentum(momentum); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsObjectDetection withNesterov(Boolean nesterov) { super.withNesterov(nesterov); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsObjectDetection withNumberOfEpochs(Integer numberOfEpochs) { super.withNumberOfEpochs(numberOfEpochs); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsObjectDetection withNumberOfWorkers(Integer numberOfWorkers) { super.withNumberOfWorkers(numberOfWorkers); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsObjectDetection withOptimizer(StochasticOptimizer optimizer) { super.withOptimizer(optimizer); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsObjectDetection withRandomSeed(Integer randomSeed) { super.withRandomSeed(randomSeed); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsObjectDetection withStepLRGamma(Float stepLRGamma) { super.withStepLRGamma(stepLRGamma); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsObjectDetection withStepLRStepSize(Integer stepLRStepSize) { super.withStepLRStepSize(stepLRStepSize); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsObjectDetection withTrainingBatchSize(Integer trainingBatchSize) { super.withTrainingBatchSize(trainingBatchSize); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsObjectDetection withValidationBatchSize(Integer validationBatchSize) { super.withValidationBatchSize(validationBatchSize); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsObjectDetection withWarmupCosineLRCycles(Float warmupCosineLRCycles) { super.withWarmupCosineLRCycles(warmupCosineLRCycles); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsObjectDetection withWarmupCosineLRWarmupEpochs(Integer warmupCosineLRWarmupEpochs) { super.withWarmupCosineLRWarmupEpochs(warmupCosineLRWarmupEpochs); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ImageModelSettingsObjectDetection withWeightDecay(Float weightDecay) { super.withWeightDecay(weightDecay); @@ -632,11 +701,216 @@ public ImageModelSettingsObjectDetection withWeightDecay(Float weightDecay) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("advancedSettings", advancedSettings()); + jsonWriter.writeBooleanField("amsGradient", amsGradient()); + jsonWriter.writeStringField("augmentations", augmentations()); + jsonWriter.writeNumberField("beta1", beta1()); + jsonWriter.writeNumberField("beta2", beta2()); + jsonWriter.writeNumberField("checkpointFrequency", checkpointFrequency()); + jsonWriter.writeJsonField("checkpointModel", checkpointModel()); + jsonWriter.writeStringField("checkpointRunId", checkpointRunId()); + jsonWriter.writeBooleanField("distributed", distributed()); + jsonWriter.writeBooleanField("earlyStopping", earlyStopping()); + jsonWriter.writeNumberField("earlyStoppingDelay", earlyStoppingDelay()); + jsonWriter.writeNumberField("earlyStoppingPatience", earlyStoppingPatience()); + jsonWriter.writeBooleanField("enableOnnxNormalization", enableOnnxNormalization()); + jsonWriter.writeNumberField("evaluationFrequency", evaluationFrequency()); + jsonWriter.writeNumberField("gradientAccumulationStep", gradientAccumulationStep()); + jsonWriter.writeNumberField("layersToFreeze", layersToFreeze()); + jsonWriter.writeNumberField("learningRate", learningRate()); + jsonWriter.writeStringField("learningRateScheduler", + learningRateScheduler() == null ? null : learningRateScheduler().toString()); + jsonWriter.writeStringField("modelName", modelName()); + jsonWriter.writeNumberField("momentum", momentum()); + jsonWriter.writeBooleanField("nesterov", nesterov()); + jsonWriter.writeNumberField("numberOfEpochs", numberOfEpochs()); + jsonWriter.writeNumberField("numberOfWorkers", numberOfWorkers()); + jsonWriter.writeStringField("optimizer", optimizer() == null ? null : optimizer().toString()); + jsonWriter.writeNumberField("randomSeed", randomSeed()); + jsonWriter.writeNumberField("stepLRGamma", stepLRGamma()); + jsonWriter.writeNumberField("stepLRStepSize", stepLRStepSize()); + jsonWriter.writeNumberField("trainingBatchSize", trainingBatchSize()); + jsonWriter.writeNumberField("validationBatchSize", validationBatchSize()); + jsonWriter.writeNumberField("warmupCosineLRCycles", warmupCosineLRCycles()); + jsonWriter.writeNumberField("warmupCosineLRWarmupEpochs", warmupCosineLRWarmupEpochs()); + jsonWriter.writeNumberField("weightDecay", weightDecay()); + jsonWriter.writeNumberField("boxDetectionsPerImage", this.boxDetectionsPerImage); + jsonWriter.writeNumberField("boxScoreThreshold", this.boxScoreThreshold); + jsonWriter.writeNumberField("imageSize", this.imageSize); + jsonWriter.writeNumberField("maxSize", this.maxSize); + jsonWriter.writeNumberField("minSize", this.minSize); + jsonWriter.writeStringField("modelSize", this.modelSize == null ? null : this.modelSize.toString()); + jsonWriter.writeBooleanField("multiScale", this.multiScale); + jsonWriter.writeNumberField("nmsIouThreshold", this.nmsIouThreshold); + jsonWriter.writeStringField("tileGridSize", this.tileGridSize); + jsonWriter.writeNumberField("tileOverlapRatio", this.tileOverlapRatio); + jsonWriter.writeNumberField("tilePredictionsNmsThreshold", this.tilePredictionsNmsThreshold); + jsonWriter.writeNumberField("validationIouThreshold", this.validationIouThreshold); + jsonWriter.writeStringField("validationMetricType", + this.validationMetricType == null ? null : this.validationMetricType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageModelSettingsObjectDetection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageModelSettingsObjectDetection if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ImageModelSettingsObjectDetection. + */ + public static ImageModelSettingsObjectDetection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageModelSettingsObjectDetection deserializedImageModelSettingsObjectDetection + = new ImageModelSettingsObjectDetection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("advancedSettings".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection.withAdvancedSettings(reader.getString()); + } else if ("amsGradient".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection + .withAmsGradient(reader.getNullable(JsonReader::getBoolean)); + } else if ("augmentations".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection.withAugmentations(reader.getString()); + } else if ("beta1".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection.withBeta1(reader.getNullable(JsonReader::getFloat)); + } else if ("beta2".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection.withBeta2(reader.getNullable(JsonReader::getFloat)); + } else if ("checkpointFrequency".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection + .withCheckpointFrequency(reader.getNullable(JsonReader::getInt)); + } else if ("checkpointModel".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection + .withCheckpointModel(MLFlowModelJobInput.fromJson(reader)); + } else if ("checkpointRunId".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection.withCheckpointRunId(reader.getString()); + } else if ("distributed".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection + .withDistributed(reader.getNullable(JsonReader::getBoolean)); + } else if ("earlyStopping".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection + .withEarlyStopping(reader.getNullable(JsonReader::getBoolean)); + } else if ("earlyStoppingDelay".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection + .withEarlyStoppingDelay(reader.getNullable(JsonReader::getInt)); + } else if ("earlyStoppingPatience".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection + .withEarlyStoppingPatience(reader.getNullable(JsonReader::getInt)); + } else if ("enableOnnxNormalization".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection + .withEnableOnnxNormalization(reader.getNullable(JsonReader::getBoolean)); + } else if ("evaluationFrequency".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection + .withEvaluationFrequency(reader.getNullable(JsonReader::getInt)); + } else if ("gradientAccumulationStep".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection + .withGradientAccumulationStep(reader.getNullable(JsonReader::getInt)); + } else if ("layersToFreeze".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection + .withLayersToFreeze(reader.getNullable(JsonReader::getInt)); + } else if ("learningRate".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection + .withLearningRate(reader.getNullable(JsonReader::getFloat)); + } else if ("learningRateScheduler".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection + .withLearningRateScheduler(LearningRateScheduler.fromString(reader.getString())); + } else if ("modelName".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection.withModelName(reader.getString()); + } else if ("momentum".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection + .withMomentum(reader.getNullable(JsonReader::getFloat)); + } else if ("nesterov".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection + .withNesterov(reader.getNullable(JsonReader::getBoolean)); + } else if ("numberOfEpochs".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection + .withNumberOfEpochs(reader.getNullable(JsonReader::getInt)); + } else if ("numberOfWorkers".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection + .withNumberOfWorkers(reader.getNullable(JsonReader::getInt)); + } else if ("optimizer".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection + .withOptimizer(StochasticOptimizer.fromString(reader.getString())); + } else if ("randomSeed".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection + .withRandomSeed(reader.getNullable(JsonReader::getInt)); + } else if ("stepLRGamma".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection + .withStepLRGamma(reader.getNullable(JsonReader::getFloat)); + } else if ("stepLRStepSize".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection + .withStepLRStepSize(reader.getNullable(JsonReader::getInt)); + } else if ("trainingBatchSize".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection + .withTrainingBatchSize(reader.getNullable(JsonReader::getInt)); + } else if ("validationBatchSize".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection + .withValidationBatchSize(reader.getNullable(JsonReader::getInt)); + } else if ("warmupCosineLRCycles".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection + .withWarmupCosineLRCycles(reader.getNullable(JsonReader::getFloat)); + } else if ("warmupCosineLRWarmupEpochs".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection + .withWarmupCosineLRWarmupEpochs(reader.getNullable(JsonReader::getInt)); + } else if ("weightDecay".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection + .withWeightDecay(reader.getNullable(JsonReader::getFloat)); + } else if ("boxDetectionsPerImage".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection.boxDetectionsPerImage + = reader.getNullable(JsonReader::getInt); + } else if ("boxScoreThreshold".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection.boxScoreThreshold + = reader.getNullable(JsonReader::getFloat); + } else if ("imageSize".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection.imageSize = reader.getNullable(JsonReader::getInt); + } else if ("maxSize".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection.maxSize = reader.getNullable(JsonReader::getInt); + } else if ("minSize".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection.minSize = reader.getNullable(JsonReader::getInt); + } else if ("modelSize".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection.modelSize = ModelSize.fromString(reader.getString()); + } else if ("multiScale".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection.multiScale + = reader.getNullable(JsonReader::getBoolean); + } else if ("nmsIouThreshold".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection.nmsIouThreshold + = reader.getNullable(JsonReader::getFloat); + } else if ("tileGridSize".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection.tileGridSize = reader.getString(); + } else if ("tileOverlapRatio".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection.tileOverlapRatio + = reader.getNullable(JsonReader::getFloat); + } else if ("tilePredictionsNmsThreshold".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection.tilePredictionsNmsThreshold + = reader.getNullable(JsonReader::getFloat); + } else if ("validationIouThreshold".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection.validationIouThreshold + = reader.getNullable(JsonReader::getFloat); + } else if ("validationMetricType".equals(fieldName)) { + deserializedImageModelSettingsObjectDetection.validationMetricType + = ValidationMetricType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedImageModelSettingsObjectDetection; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageObjectDetection.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageObjectDetection.java index 3e331ef4ba459..a253c27e7cdd9 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageObjectDetection.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageObjectDetection.java @@ -6,53 +6,51 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Image Object Detection. Object detection is used to identify objects in an image and locate each object with a * bounding box e.g. locate all dogs and cats in an image and draw a bounding box around each. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") -@JsonTypeName("ImageObjectDetection") @Fluent public final class ImageObjectDetection extends AutoMLVertical { + /* + * [Required] Task type for AutoMLJob. + */ + private TaskType taskType = TaskType.IMAGE_OBJECT_DETECTION; + /* * Primary metric to optimize for this task. */ - @JsonProperty(value = "primaryMetric") private ObjectDetectionPrimaryMetrics primaryMetric; /* * Settings used for training the model. */ - @JsonProperty(value = "modelSettings") private ImageModelSettingsObjectDetection modelSettings; /* * Search space for sampling different combinations of models and their hyperparameters. */ - @JsonProperty(value = "searchSpace") private List searchSpace; /* * [Required] Limit settings for the AutoML job. */ - @JsonProperty(value = "limitSettings", required = true) private ImageLimitSettings limitSettings; /* * Model sweeping and hyperparameter sweeping related settings. */ - @JsonProperty(value = "sweepSettings") private ImageSweepSettings sweepSettings; /* * Validation data inputs. */ - @JsonProperty(value = "validationData") private MLTableJobInput validationData; /* @@ -60,16 +58,27 @@ public final class ImageObjectDetection extends AutoMLVertical { * Values between (0.0 , 1.0) * Applied when validation dataset is not provided. */ - @JsonProperty(value = "validationDataSize") private Double validationDataSize; - /** Creates an instance of ImageObjectDetection class. */ + /** + * Creates an instance of ImageObjectDetection class. + */ public ImageObjectDetection() { } + /** + * Get the taskType property: [Required] Task type for AutoMLJob. + * + * @return the taskType value. + */ + @Override + public TaskType taskType() { + return this.taskType; + } + /** * Get the primaryMetric property: Primary metric to optimize for this task. - * + * * @return the primaryMetric value. */ public ObjectDetectionPrimaryMetrics primaryMetric() { @@ -78,7 +87,7 @@ public ObjectDetectionPrimaryMetrics primaryMetric() { /** * Set the primaryMetric property: Primary metric to optimize for this task. - * + * * @param primaryMetric the primaryMetric value to set. * @return the ImageObjectDetection object itself. */ @@ -89,7 +98,7 @@ public ImageObjectDetection withPrimaryMetric(ObjectDetectionPrimaryMetrics prim /** * Get the modelSettings property: Settings used for training the model. - * + * * @return the modelSettings value. */ public ImageModelSettingsObjectDetection modelSettings() { @@ -98,7 +107,7 @@ public ImageModelSettingsObjectDetection modelSettings() { /** * Set the modelSettings property: Settings used for training the model. - * + * * @param modelSettings the modelSettings value to set. * @return the ImageObjectDetection object itself. */ @@ -110,7 +119,7 @@ public ImageObjectDetection withModelSettings(ImageModelSettingsObjectDetection /** * Get the searchSpace property: Search space for sampling different combinations of models and their * hyperparameters. - * + * * @return the searchSpace value. */ public List searchSpace() { @@ -120,7 +129,7 @@ public List searchSpace() { /** * Set the searchSpace property: Search space for sampling different combinations of models and their * hyperparameters. - * + * * @param searchSpace the searchSpace value to set. * @return the ImageObjectDetection object itself. */ @@ -131,7 +140,7 @@ public ImageObjectDetection withSearchSpace(List e.validate()); } if (limitSettings() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property limitSettings in model ImageObjectDetection")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property limitSettings in model ImageObjectDetection")); } else { limitSettings().validate(); } @@ -263,4 +281,74 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(ImageObjectDetection.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("trainingData", trainingData()); + jsonWriter.writeStringField("logVerbosity", logVerbosity() == null ? null : logVerbosity().toString()); + jsonWriter.writeStringField("targetColumnName", targetColumnName()); + jsonWriter.writeJsonField("limitSettings", this.limitSettings); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); + jsonWriter.writeStringField("primaryMetric", this.primaryMetric == null ? null : this.primaryMetric.toString()); + jsonWriter.writeJsonField("modelSettings", this.modelSettings); + jsonWriter.writeArrayField("searchSpace", this.searchSpace, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("sweepSettings", this.sweepSettings); + jsonWriter.writeJsonField("validationData", this.validationData); + jsonWriter.writeNumberField("validationDataSize", this.validationDataSize); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageObjectDetection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageObjectDetection if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ImageObjectDetection. + */ + public static ImageObjectDetection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageObjectDetection deserializedImageObjectDetection = new ImageObjectDetection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("trainingData".equals(fieldName)) { + deserializedImageObjectDetection.withTrainingData(MLTableJobInput.fromJson(reader)); + } else if ("logVerbosity".equals(fieldName)) { + deserializedImageObjectDetection.withLogVerbosity(LogVerbosity.fromString(reader.getString())); + } else if ("targetColumnName".equals(fieldName)) { + deserializedImageObjectDetection.withTargetColumnName(reader.getString()); + } else if ("limitSettings".equals(fieldName)) { + deserializedImageObjectDetection.limitSettings = ImageLimitSettings.fromJson(reader); + } else if ("taskType".equals(fieldName)) { + deserializedImageObjectDetection.taskType = TaskType.fromString(reader.getString()); + } else if ("primaryMetric".equals(fieldName)) { + deserializedImageObjectDetection.primaryMetric + = ObjectDetectionPrimaryMetrics.fromString(reader.getString()); + } else if ("modelSettings".equals(fieldName)) { + deserializedImageObjectDetection.modelSettings = ImageModelSettingsObjectDetection.fromJson(reader); + } else if ("searchSpace".equals(fieldName)) { + List searchSpace + = reader.readArray(reader1 -> ImageModelDistributionSettingsObjectDetection.fromJson(reader1)); + deserializedImageObjectDetection.searchSpace = searchSpace; + } else if ("sweepSettings".equals(fieldName)) { + deserializedImageObjectDetection.sweepSettings = ImageSweepSettings.fromJson(reader); + } else if ("validationData".equals(fieldName)) { + deserializedImageObjectDetection.validationData = MLTableJobInput.fromJson(reader); + } else if ("validationDataSize".equals(fieldName)) { + deserializedImageObjectDetection.validationDataSize = reader.getNullable(JsonReader::getDouble); + } else { + reader.skipChildren(); + } + } + + return deserializedImageObjectDetection; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageObjectDetectionBase.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageObjectDetectionBase.java index e3a955e714ba8..23d39931454c9 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageObjectDetectionBase.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageObjectDetectionBase.java @@ -5,31 +5,36 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** The ImageObjectDetectionBase model. */ +/** + * The ImageObjectDetectionBase model. + */ @Fluent public class ImageObjectDetectionBase extends ImageVertical { /* * Settings used for training the model. */ - @JsonProperty(value = "modelSettings") private ImageModelSettingsObjectDetection modelSettings; /* * Search space for sampling different combinations of models and their hyperparameters. */ - @JsonProperty(value = "searchSpace") private List searchSpace; - /** Creates an instance of ImageObjectDetectionBase class. */ + /** + * Creates an instance of ImageObjectDetectionBase class. + */ public ImageObjectDetectionBase() { } /** * Get the modelSettings property: Settings used for training the model. - * + * * @return the modelSettings value. */ public ImageModelSettingsObjectDetection modelSettings() { @@ -38,7 +43,7 @@ public ImageModelSettingsObjectDetection modelSettings() { /** * Set the modelSettings property: Settings used for training the model. - * + * * @param modelSettings the modelSettings value to set. * @return the ImageObjectDetectionBase object itself. */ @@ -50,7 +55,7 @@ public ImageObjectDetectionBase withModelSettings(ImageModelSettingsObjectDetect /** * Get the searchSpace property: Search space for sampling different combinations of models and their * hyperparameters. - * + * * @return the searchSpace value. */ public List searchSpace() { @@ -60,7 +65,7 @@ public List searchSpace() { /** * Set the searchSpace property: Search space for sampling different combinations of models and their * hyperparameters. - * + * * @param searchSpace the searchSpace value to set. * @return the ImageObjectDetectionBase object itself. */ @@ -69,28 +74,36 @@ public ImageObjectDetectionBase withSearchSpace(List e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("limitSettings", limitSettings()); + jsonWriter.writeJsonField("sweepSettings", sweepSettings()); + jsonWriter.writeJsonField("validationData", validationData()); + jsonWriter.writeNumberField("validationDataSize", validationDataSize()); + jsonWriter.writeJsonField("modelSettings", this.modelSettings); + jsonWriter.writeArrayField("searchSpace", this.searchSpace, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageObjectDetectionBase from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageObjectDetectionBase if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ImageObjectDetectionBase. + */ + public static ImageObjectDetectionBase fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageObjectDetectionBase deserializedImageObjectDetectionBase = new ImageObjectDetectionBase(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("limitSettings".equals(fieldName)) { + deserializedImageObjectDetectionBase.withLimitSettings(ImageLimitSettings.fromJson(reader)); + } else if ("sweepSettings".equals(fieldName)) { + deserializedImageObjectDetectionBase.withSweepSettings(ImageSweepSettings.fromJson(reader)); + } else if ("validationData".equals(fieldName)) { + deserializedImageObjectDetectionBase.withValidationData(MLTableJobInput.fromJson(reader)); + } else if ("validationDataSize".equals(fieldName)) { + deserializedImageObjectDetectionBase + .withValidationDataSize(reader.getNullable(JsonReader::getDouble)); + } else if ("modelSettings".equals(fieldName)) { + deserializedImageObjectDetectionBase.modelSettings + = ImageModelSettingsObjectDetection.fromJson(reader); + } else if ("searchSpace".equals(fieldName)) { + List searchSpace + = reader.readArray(reader1 -> ImageModelDistributionSettingsObjectDetection.fromJson(reader1)); + deserializedImageObjectDetectionBase.searchSpace = searchSpace; + } else { + reader.skipChildren(); + } + } + + return deserializedImageObjectDetectionBase; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageSweepSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageSweepSettings.java index 4fd01023cbb25..2fa1ef673c3b8 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageSweepSettings.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageSweepSettings.java @@ -6,30 +6,36 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Model sweeping and hyperparameter sweeping related settings. */ +/** + * Model sweeping and hyperparameter sweeping related settings. + */ @Fluent -public final class ImageSweepSettings { +public final class ImageSweepSettings implements JsonSerializable { /* * Type of early termination policy. */ - @JsonProperty(value = "earlyTermination") private EarlyTerminationPolicy earlyTermination; /* * [Required] Type of the hyperparameter sampling algorithms. */ - @JsonProperty(value = "samplingAlgorithm", required = true) private SamplingAlgorithmType samplingAlgorithm; - /** Creates an instance of ImageSweepSettings class. */ + /** + * Creates an instance of ImageSweepSettings class. + */ public ImageSweepSettings() { } /** * Get the earlyTermination property: Type of early termination policy. - * + * * @return the earlyTermination value. */ public EarlyTerminationPolicy earlyTermination() { @@ -38,7 +44,7 @@ public EarlyTerminationPolicy earlyTermination() { /** * Set the earlyTermination property: Type of early termination policy. - * + * * @param earlyTermination the earlyTermination value to set. * @return the ImageSweepSettings object itself. */ @@ -49,7 +55,7 @@ public ImageSweepSettings withEarlyTermination(EarlyTerminationPolicy earlyTermi /** * Get the samplingAlgorithm property: [Required] Type of the hyperparameter sampling algorithms. - * + * * @return the samplingAlgorithm value. */ public SamplingAlgorithmType samplingAlgorithm() { @@ -58,7 +64,7 @@ public SamplingAlgorithmType samplingAlgorithm() { /** * Set the samplingAlgorithm property: [Required] Type of the hyperparameter sampling algorithms. - * + * * @param samplingAlgorithm the samplingAlgorithm value to set. * @return the ImageSweepSettings object itself. */ @@ -69,7 +75,7 @@ public ImageSweepSettings withSamplingAlgorithm(SamplingAlgorithmType samplingAl /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -77,12 +83,53 @@ public void validate() { earlyTermination().validate(); } if (samplingAlgorithm() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property samplingAlgorithm in model ImageSweepSettings")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property samplingAlgorithm in model ImageSweepSettings")); } } private static final ClientLogger LOGGER = new ClientLogger(ImageSweepSettings.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("samplingAlgorithm", + this.samplingAlgorithm == null ? null : this.samplingAlgorithm.toString()); + jsonWriter.writeJsonField("earlyTermination", this.earlyTermination); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageSweepSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageSweepSettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ImageSweepSettings. + */ + public static ImageSweepSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageSweepSettings deserializedImageSweepSettings = new ImageSweepSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("samplingAlgorithm".equals(fieldName)) { + deserializedImageSweepSettings.samplingAlgorithm + = SamplingAlgorithmType.fromString(reader.getString()); + } else if ("earlyTermination".equals(fieldName)) { + deserializedImageSweepSettings.earlyTermination = EarlyTerminationPolicy.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedImageSweepSettings; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageType.java new file mode 100644 index 0000000000000..ae3c83ed0d012 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageType.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of the image + * + * Type of the image. Possible values are: docker - For docker images. azureml - For AzureML images. + */ +public final class ImageType extends ExpandableStringEnum { + /** + * Static value docker for ImageType. + */ + public static final ImageType DOCKER = fromString("docker"); + + /** + * Static value azureml for ImageType. + */ + public static final ImageType AZUREML = fromString("azureml"); + + /** + * Creates a new instance of ImageType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ImageType() { + } + + /** + * Creates or finds a ImageType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ImageType. + */ + public static ImageType fromString(String name) { + return fromString(name, ImageType.class); + } + + /** + * Gets known ImageType values. + * + * @return known ImageType values. + */ + public static Collection values() { + return values(ImageType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageVertical.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageVertical.java index 01fc3de24e7dd..baa6f77c21284 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageVertical.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ImageVertical.java @@ -6,30 +6,32 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** - * Abstract class for AutoML tasks that train image (computer vision) models - such as Image Classification / Image - * Classification Multilabel / Image Object Detection / Image Instance Segmentation. + * Abstract class for AutoML tasks that train image (computer vision) models - + * such as Image Classification / Image Classification Multilabel / Image Object Detection / Image Instance + * Segmentation. */ @Fluent -public class ImageVertical { +public class ImageVertical implements JsonSerializable { /* * [Required] Limit settings for the AutoML job. */ - @JsonProperty(value = "limitSettings", required = true) private ImageLimitSettings limitSettings; /* * Model sweeping and hyperparameter sweeping related settings. */ - @JsonProperty(value = "sweepSettings") private ImageSweepSettings sweepSettings; /* * Validation data inputs. */ - @JsonProperty(value = "validationData") private MLTableJobInput validationData; /* @@ -37,16 +39,17 @@ public class ImageVertical { * Values between (0.0 , 1.0) * Applied when validation dataset is not provided. */ - @JsonProperty(value = "validationDataSize") private Double validationDataSize; - /** Creates an instance of ImageVertical class. */ + /** + * Creates an instance of ImageVertical class. + */ public ImageVertical() { } /** * Get the limitSettings property: [Required] Limit settings for the AutoML job. - * + * * @return the limitSettings value. */ public ImageLimitSettings limitSettings() { @@ -55,7 +58,7 @@ public ImageLimitSettings limitSettings() { /** * Set the limitSettings property: [Required] Limit settings for the AutoML job. - * + * * @param limitSettings the limitSettings value to set. * @return the ImageVertical object itself. */ @@ -66,7 +69,7 @@ public ImageVertical withLimitSettings(ImageLimitSettings limitSettings) { /** * Get the sweepSettings property: Model sweeping and hyperparameter sweeping related settings. - * + * * @return the sweepSettings value. */ public ImageSweepSettings sweepSettings() { @@ -75,7 +78,7 @@ public ImageSweepSettings sweepSettings() { /** * Set the sweepSettings property: Model sweeping and hyperparameter sweeping related settings. - * + * * @param sweepSettings the sweepSettings value to set. * @return the ImageVertical object itself. */ @@ -86,7 +89,7 @@ public ImageVertical withSweepSettings(ImageSweepSettings sweepSettings) { /** * Get the validationData property: Validation data inputs. - * + * * @return the validationData value. */ public MLTableJobInput validationData() { @@ -95,7 +98,7 @@ public MLTableJobInput validationData() { /** * Set the validationData property: Validation data inputs. - * + * * @param validationData the validationData value to set. * @return the ImageVertical object itself. */ @@ -106,8 +109,10 @@ public ImageVertical withValidationData(MLTableJobInput validationData) { /** * Get the validationDataSize property: 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. - * + * purpose. + * Values between (0.0 , 1.0) + * Applied when validation dataset is not provided. + * * @return the validationDataSize value. */ public Double validationDataSize() { @@ -116,8 +121,10 @@ public Double validationDataSize() { /** * Set the validationDataSize property: 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. - * + * purpose. + * Values between (0.0 , 1.0) + * Applied when validation dataset is not provided. + * * @param validationDataSize the validationDataSize value to set. * @return the ImageVertical object itself. */ @@ -128,14 +135,13 @@ public ImageVertical withValidationDataSize(Double validationDataSize) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (limitSettings() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property limitSettings in model ImageVertical")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property limitSettings in model ImageVertical")); } else { limitSettings().validate(); } @@ -148,4 +154,50 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(ImageVertical.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("limitSettings", this.limitSettings); + jsonWriter.writeJsonField("sweepSettings", this.sweepSettings); + jsonWriter.writeJsonField("validationData", this.validationData); + jsonWriter.writeNumberField("validationDataSize", this.validationDataSize); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageVertical from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageVertical if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ImageVertical. + */ + public static ImageVertical fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageVertical deserializedImageVertical = new ImageVertical(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("limitSettings".equals(fieldName)) { + deserializedImageVertical.limitSettings = ImageLimitSettings.fromJson(reader); + } else if ("sweepSettings".equals(fieldName)) { + deserializedImageVertical.sweepSettings = ImageSweepSettings.fromJson(reader); + } else if ("validationData".equals(fieldName)) { + deserializedImageVertical.validationData = MLTableJobInput.fromJson(reader); + } else if ("validationDataSize".equals(fieldName)) { + deserializedImageVertical.validationDataSize = reader.getNullable(JsonReader::getDouble); + } else { + reader.skipChildren(); + } + } + + return deserializedImageVertical; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IndexColumn.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IndexColumn.java new file mode 100644 index 0000000000000..4377a4a37a9cf --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IndexColumn.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * DTO object representing index column. + */ +@Fluent +public final class IndexColumn implements JsonSerializable { + /* + * Specifies the column name + */ + private String columnName; + + /* + * Specifies the data type + */ + private FeatureDataType dataType; + + /** + * Creates an instance of IndexColumn class. + */ + public IndexColumn() { + } + + /** + * Get the columnName property: Specifies the column name. + * + * @return the columnName value. + */ + public String columnName() { + return this.columnName; + } + + /** + * Set the columnName property: Specifies the column name. + * + * @param columnName the columnName value to set. + * @return the IndexColumn object itself. + */ + public IndexColumn withColumnName(String columnName) { + this.columnName = columnName; + return this; + } + + /** + * Get the dataType property: Specifies the data type. + * + * @return the dataType value. + */ + public FeatureDataType dataType() { + return this.dataType; + } + + /** + * Set the dataType property: Specifies the data type. + * + * @param dataType the dataType value to set. + * @return the IndexColumn object itself. + */ + public IndexColumn withDataType(FeatureDataType dataType) { + this.dataType = dataType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("columnName", this.columnName); + jsonWriter.writeStringField("dataType", this.dataType == null ? null : this.dataType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IndexColumn from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IndexColumn if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the IndexColumn. + */ + public static IndexColumn fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IndexColumn deserializedIndexColumn = new IndexColumn(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("columnName".equals(fieldName)) { + deserializedIndexColumn.columnName = reader.getString(); + } else if ("dataType".equals(fieldName)) { + deserializedIndexColumn.dataType = FeatureDataType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedIndexColumn; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/InferenceContainerProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/InferenceContainerProperties.java index 78878676f3264..ab6d72994f685 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/InferenceContainerProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/InferenceContainerProperties.java @@ -5,36 +5,41 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The InferenceContainerProperties model. */ +/** + * The InferenceContainerProperties model. + */ @Fluent -public final class InferenceContainerProperties { +public final class InferenceContainerProperties implements JsonSerializable { /* * The route to check the liveness of the inference server container. */ - @JsonProperty(value = "livenessRoute") private Route livenessRoute; /* * The route to check the readiness of the inference server container. */ - @JsonProperty(value = "readinessRoute") private Route readinessRoute; /* * The port to send the scoring requests to, within the inference server container. */ - @JsonProperty(value = "scoringRoute") private Route scoringRoute; - /** Creates an instance of InferenceContainerProperties class. */ + /** + * Creates an instance of InferenceContainerProperties class. + */ public InferenceContainerProperties() { } /** * Get the livenessRoute property: The route to check the liveness of the inference server container. - * + * * @return the livenessRoute value. */ public Route livenessRoute() { @@ -43,7 +48,7 @@ public Route livenessRoute() { /** * Set the livenessRoute property: The route to check the liveness of the inference server container. - * + * * @param livenessRoute the livenessRoute value to set. * @return the InferenceContainerProperties object itself. */ @@ -54,7 +59,7 @@ public InferenceContainerProperties withLivenessRoute(Route livenessRoute) { /** * Get the readinessRoute property: The route to check the readiness of the inference server container. - * + * * @return the readinessRoute value. */ public Route readinessRoute() { @@ -63,7 +68,7 @@ public Route readinessRoute() { /** * Set the readinessRoute property: The route to check the readiness of the inference server container. - * + * * @param readinessRoute the readinessRoute value to set. * @return the InferenceContainerProperties object itself. */ @@ -74,7 +79,7 @@ public InferenceContainerProperties withReadinessRoute(Route readinessRoute) { /** * Get the scoringRoute property: The port to send the scoring requests to, within the inference server container. - * + * * @return the scoringRoute value. */ public Route scoringRoute() { @@ -83,7 +88,7 @@ public Route scoringRoute() { /** * Set the scoringRoute property: The port to send the scoring requests to, within the inference server container. - * + * * @param scoringRoute the scoringRoute value to set. * @return the InferenceContainerProperties object itself. */ @@ -94,7 +99,7 @@ public InferenceContainerProperties withScoringRoute(Route scoringRoute) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -108,4 +113,46 @@ public void validate() { scoringRoute().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("livenessRoute", this.livenessRoute); + jsonWriter.writeJsonField("readinessRoute", this.readinessRoute); + jsonWriter.writeJsonField("scoringRoute", this.scoringRoute); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InferenceContainerProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InferenceContainerProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InferenceContainerProperties. + */ + public static InferenceContainerProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InferenceContainerProperties deserializedInferenceContainerProperties = new InferenceContainerProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("livenessRoute".equals(fieldName)) { + deserializedInferenceContainerProperties.livenessRoute = Route.fromJson(reader); + } else if ("readinessRoute".equals(fieldName)) { + deserializedInferenceContainerProperties.readinessRoute = Route.fromJson(reader); + } else if ("scoringRoute".equals(fieldName)) { + deserializedInferenceContainerProperties.scoringRoute = Route.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedInferenceContainerProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/InputDeliveryMode.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/InputDeliveryMode.java index 93f3ee308a117..28d59aaf93c1b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/InputDeliveryMode.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/InputDeliveryMode.java @@ -5,32 +5,45 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Enum to determine the input data delivery mode. */ +/** + * Enum to determine the input data delivery mode. + */ public final class InputDeliveryMode extends ExpandableStringEnum { - /** Static value ReadOnlyMount for InputDeliveryMode. */ + /** + * Static value ReadOnlyMount for InputDeliveryMode. + */ public static final InputDeliveryMode READ_ONLY_MOUNT = fromString("ReadOnlyMount"); - /** Static value ReadWriteMount for InputDeliveryMode. */ + /** + * Static value ReadWriteMount for InputDeliveryMode. + */ public static final InputDeliveryMode READ_WRITE_MOUNT = fromString("ReadWriteMount"); - /** Static value Download for InputDeliveryMode. */ + /** + * Static value Download for InputDeliveryMode. + */ public static final InputDeliveryMode DOWNLOAD = fromString("Download"); - /** Static value Direct for InputDeliveryMode. */ + /** + * Static value Direct for InputDeliveryMode. + */ public static final InputDeliveryMode DIRECT = fromString("Direct"); - /** Static value EvalMount for InputDeliveryMode. */ + /** + * Static value EvalMount for InputDeliveryMode. + */ public static final InputDeliveryMode EVAL_MOUNT = fromString("EvalMount"); - /** Static value EvalDownload for InputDeliveryMode. */ + /** + * Static value EvalDownload for InputDeliveryMode. + */ public static final InputDeliveryMode EVAL_DOWNLOAD = fromString("EvalDownload"); /** * Creates a new instance of InputDeliveryMode value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -39,18 +52,17 @@ public InputDeliveryMode() { /** * Creates or finds a InputDeliveryMode from its string representation. - * + * * @param name a name to look for. * @return the corresponding InputDeliveryMode. */ - @JsonCreator public static InputDeliveryMode fromString(String name) { return fromString(name, InputDeliveryMode.class); } /** * Gets known InputDeliveryMode values. - * + * * @return known InputDeliveryMode values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/InstanceSegmentationPrimaryMetrics.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/InstanceSegmentationPrimaryMetrics.java index b95f8b7936cb9..0244c94f50bc4 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/InstanceSegmentationPrimaryMetrics.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/InstanceSegmentationPrimaryMetrics.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Primary metrics for InstanceSegmentation tasks. */ +/** + * Primary metrics for InstanceSegmentation tasks. + */ public final class InstanceSegmentationPrimaryMetrics extends ExpandableStringEnum { - /** Static value MeanAveragePrecision for InstanceSegmentationPrimaryMetrics. */ + /** + * Static value MeanAveragePrecision for InstanceSegmentationPrimaryMetrics. + */ public static final InstanceSegmentationPrimaryMetrics MEAN_AVERAGE_PRECISION = fromString("MeanAveragePrecision"); /** * Creates a new instance of InstanceSegmentationPrimaryMetrics value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -24,18 +27,17 @@ public InstanceSegmentationPrimaryMetrics() { /** * Creates or finds a InstanceSegmentationPrimaryMetrics from its string representation. - * + * * @param name a name to look for. * @return the corresponding InstanceSegmentationPrimaryMetrics. */ - @JsonCreator public static InstanceSegmentationPrimaryMetrics fromString(String name) { return fromString(name, InstanceSegmentationPrimaryMetrics.class); } /** * Gets known InstanceSegmentationPrimaryMetrics values. - * + * * @return known InstanceSegmentationPrimaryMetrics values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/InstanceTypeSchema.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/InstanceTypeSchema.java index af0266978dd87..4ec3f90e25636 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/InstanceTypeSchema.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/InstanceTypeSchema.java @@ -5,33 +5,37 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Instance type schema. */ +/** + * Instance type schema. + */ @Fluent -public final class InstanceTypeSchema { +public final class InstanceTypeSchema implements JsonSerializable { /* * Node Selector */ - @JsonProperty(value = "nodeSelector") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map nodeSelector; /* * Resource requests/limits for this instance type */ - @JsonProperty(value = "resources") private InstanceTypeSchemaResources resources; - /** Creates an instance of InstanceTypeSchema class. */ + /** + * Creates an instance of InstanceTypeSchema class. + */ public InstanceTypeSchema() { } /** * Get the nodeSelector property: Node Selector. - * + * * @return the nodeSelector value. */ public Map nodeSelector() { @@ -40,7 +44,7 @@ public Map nodeSelector() { /** * Set the nodeSelector property: Node Selector. - * + * * @param nodeSelector the nodeSelector value to set. * @return the InstanceTypeSchema object itself. */ @@ -51,7 +55,7 @@ public InstanceTypeSchema withNodeSelector(Map nodeSelector) { /** * Get the resources property: Resource requests/limits for this instance type. - * + * * @return the resources value. */ public InstanceTypeSchemaResources resources() { @@ -60,7 +64,7 @@ public InstanceTypeSchemaResources resources() { /** * Set the resources property: Resource requests/limits for this instance type. - * + * * @param resources the resources value to set. * @return the InstanceTypeSchema object itself. */ @@ -71,7 +75,7 @@ public InstanceTypeSchema withResources(InstanceTypeSchemaResources resources) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -79,4 +83,44 @@ public void validate() { resources().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("nodeSelector", this.nodeSelector, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("resources", this.resources); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstanceTypeSchema from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstanceTypeSchema if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the InstanceTypeSchema. + */ + public static InstanceTypeSchema fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstanceTypeSchema deserializedInstanceTypeSchema = new InstanceTypeSchema(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nodeSelector".equals(fieldName)) { + Map nodeSelector = reader.readMap(reader1 -> reader1.getString()); + deserializedInstanceTypeSchema.nodeSelector = nodeSelector; + } else if ("resources".equals(fieldName)) { + deserializedInstanceTypeSchema.resources = InstanceTypeSchemaResources.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedInstanceTypeSchema; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/InstanceTypeSchemaResources.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/InstanceTypeSchemaResources.java index 661d7afb7006c..153fc9dec1f22 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/InstanceTypeSchemaResources.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/InstanceTypeSchemaResources.java @@ -5,34 +5,37 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Resource requests/limits for this instance type. */ +/** + * Resource requests/limits for this instance type. + */ @Fluent -public final class InstanceTypeSchemaResources { +public final class InstanceTypeSchemaResources implements JsonSerializable { /* * Resource requests for this instance type */ - @JsonProperty(value = "requests") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map requests; /* * Resource limits for this instance type */ - @JsonProperty(value = "limits") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map limits; - /** Creates an instance of InstanceTypeSchemaResources class. */ + /** + * Creates an instance of InstanceTypeSchemaResources class. + */ public InstanceTypeSchemaResources() { } /** * Get the requests property: Resource requests for this instance type. - * + * * @return the requests value. */ public Map requests() { @@ -41,7 +44,7 @@ public Map requests() { /** * Set the requests property: Resource requests for this instance type. - * + * * @param requests the requests value to set. * @return the InstanceTypeSchemaResources object itself. */ @@ -52,7 +55,7 @@ public InstanceTypeSchemaResources withRequests(Map requests) { /** * Get the limits property: Resource limits for this instance type. - * + * * @return the limits value. */ public Map limits() { @@ -61,7 +64,7 @@ public Map limits() { /** * Set the limits property: Resource limits for this instance type. - * + * * @param limits the limits value to set. * @return the InstanceTypeSchemaResources object itself. */ @@ -72,9 +75,50 @@ public InstanceTypeSchemaResources withLimits(Map limits) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("requests", this.requests, (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("limits", this.limits, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstanceTypeSchemaResources from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstanceTypeSchemaResources if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InstanceTypeSchemaResources. + */ + public static InstanceTypeSchemaResources fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstanceTypeSchemaResources deserializedInstanceTypeSchemaResources = new InstanceTypeSchemaResources(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("requests".equals(fieldName)) { + Map requests = reader.readMap(reader1 -> reader1.getString()); + deserializedInstanceTypeSchemaResources.requests = requests; + } else if ("limits".equals(fieldName)) { + Map limits = reader.readMap(reader1 -> reader1.getString()); + deserializedInstanceTypeSchemaResources.limits = limits; + } else { + reader.skipChildren(); + } + } + + return deserializedInstanceTypeSchemaResources; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IsolationMode.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IsolationMode.java new file mode 100644 index 0000000000000..05222c9696fe6 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/IsolationMode.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Isolation mode for the managed network of a machine learning workspace. + */ +public final class IsolationMode extends ExpandableStringEnum { + /** + * Static value Disabled for IsolationMode. + */ + public static final IsolationMode DISABLED = fromString("Disabled"); + + /** + * Static value AllowInternetOutbound for IsolationMode. + */ + public static final IsolationMode ALLOW_INTERNET_OUTBOUND = fromString("AllowInternetOutbound"); + + /** + * Static value AllowOnlyApprovedOutbound for IsolationMode. + */ + public static final IsolationMode ALLOW_ONLY_APPROVED_OUTBOUND = fromString("AllowOnlyApprovedOutbound"); + + /** + * Creates a new instance of IsolationMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IsolationMode() { + } + + /** + * Creates or finds a IsolationMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding IsolationMode. + */ + public static IsolationMode fromString(String name) { + return fromString(name, IsolationMode.class); + } + + /** + * Gets known IsolationMode values. + * + * @return known IsolationMode values. + */ + public static Collection values() { + return values(IsolationMode.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobBase.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobBase.java index 3e18abd293bd0..41f545757bf5b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobBase.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobBase.java @@ -8,90 +8,103 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.machinelearning.fluent.models.JobBaseInner; -/** An immutable client-side representation of JobBase. */ +/** + * An immutable client-side representation of JobBase. + */ public interface JobBase { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the properties property: [Required] Additional attributes of the entity. - * + * * @return the properties value. */ JobBaseProperties properties(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.JobBaseInner object. - * + * * @return the inner object. */ JobBaseInner innerModel(); - /** The entirety of the JobBase definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithParentResource, - DefinitionStages.WithProperties, - DefinitionStages.WithCreate { + /** + * The entirety of the JobBase definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, DefinitionStages.WithCreate { } - /** The JobBase definition stages. */ + + /** + * The JobBase definition stages. + */ interface DefinitionStages { - /** The first stage of the JobBase definition. */ + /** + * The first stage of the JobBase definition. + */ interface Blank extends WithParentResource { } - /** The stage of the JobBase definition allowing to specify parent resource. */ + + /** + * The stage of the JobBase definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, workspaceName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @return the next definition stage. */ WithProperties withExistingWorkspace(String resourceGroupName, String workspaceName); } - /** The stage of the JobBase definition allowing to specify properties. */ + + /** + * The stage of the JobBase definition allowing to specify properties. + */ interface WithProperties { /** * Specifies the properties property: [Required] Additional attributes of the entity.. - * + * * @param properties [Required] Additional attributes of the entity. * @return the next definition stage. */ WithCreate withProperties(JobBaseProperties properties); } + /** * The stage of the JobBase definition which contains all the minimum required properties for the resource to be * created, but also allows for any other optional properties to be specified. @@ -99,67 +112,76 @@ interface WithProperties { interface WithCreate { /** * Executes the create request. - * + * * @return the created resource. */ JobBase create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ JobBase create(Context context); } } + /** * Begins update for the JobBase resource. - * + * * @return the stage of resource update. */ JobBase.Update update(); - /** The template for JobBase update. */ + /** + * The template for JobBase update. + */ interface Update extends UpdateStages.WithProperties { /** * Executes the update request. - * + * * @return the updated resource. */ JobBase apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ JobBase apply(Context context); } - /** The JobBase update stages. */ + + /** + * The JobBase update stages. + */ interface UpdateStages { - /** The stage of the JobBase update allowing to specify properties. */ + /** + * The stage of the JobBase update allowing to specify properties. + */ interface WithProperties { /** * Specifies the properties property: [Required] Additional attributes of the entity.. - * + * * @param properties [Required] Additional attributes of the entity. * @return the next definition stage. */ Update withProperties(JobBaseProperties properties); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ JobBase refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ @@ -167,7 +189,7 @@ interface WithProperties { /** * Cancels a Job (asynchronous). - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @@ -175,7 +197,7 @@ interface WithProperties { /** * Cancels a Job (asynchronous). - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobBaseProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobBaseProperties.java index 8a72ed8f844bc..cf6b960abbb3d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobBaseProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobBaseProperties.java @@ -5,86 +5,87 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Base definition for a job. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "jobType", - defaultImpl = JobBaseProperties.class) -@JsonTypeName("JobBaseProperties") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "AutoML", value = AutoMLJob.class), - @JsonSubTypes.Type(name = "Command", value = CommandJob.class), - @JsonSubTypes.Type(name = "Pipeline", value = PipelineJob.class), - @JsonSubTypes.Type(name = "Sweep", value = SweepJob.class) -}) +/** + * Base definition for a job. + */ @Fluent public class JobBaseProperties extends ResourceBase { + /* + * [Required] Specifies the type of job. + */ + private JobType jobType = JobType.fromString("JobBaseProperties"); + /* * ARM resource ID of the component resource. */ - @JsonProperty(value = "componentId") private String componentId; /* * ARM resource ID of the compute resource. */ - @JsonProperty(value = "computeId") private String computeId; /* * Display name of job. */ - @JsonProperty(value = "displayName") private String displayName; /* * The name of the experiment the job belongs to. If not set, the job is placed in the "Default" experiment. */ - @JsonProperty(value = "experimentName") private String experimentName; /* * Identity configuration. If set, this should be one of AmlToken, ManagedIdentity, UserIdentity or null. * Defaults to AmlToken if null. */ - @JsonProperty(value = "identity") private IdentityConfiguration identity; /* * Is the asset archived? */ - @JsonProperty(value = "isArchived") private Boolean isArchived; + /* + * Notification setting for the job + */ + private NotificationSetting notificationSetting; + /* * List of JobEndpoints. * For local jobs, a job endpoint will have an endpoint value of FileStreamObject. */ - @JsonProperty(value = "services") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map services; /* * Status of the job. */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private JobStatus status; - /** Creates an instance of JobBaseProperties class. */ + /** + * Creates an instance of JobBaseProperties class. + */ public JobBaseProperties() { } + /** + * Get the jobType property: [Required] Specifies the type of job. + * + * @return the jobType value. + */ + public JobType jobType() { + return this.jobType; + } + /** * Get the componentId property: ARM resource ID of the component resource. - * + * * @return the componentId value. */ public String componentId() { @@ -93,7 +94,7 @@ public String componentId() { /** * Set the componentId property: ARM resource ID of the component resource. - * + * * @param componentId the componentId value to set. * @return the JobBaseProperties object itself. */ @@ -104,7 +105,7 @@ public JobBaseProperties withComponentId(String componentId) { /** * Get the computeId property: ARM resource ID of the compute resource. - * + * * @return the computeId value. */ public String computeId() { @@ -113,7 +114,7 @@ public String computeId() { /** * Set the computeId property: ARM resource ID of the compute resource. - * + * * @param computeId the computeId value to set. * @return the JobBaseProperties object itself. */ @@ -124,7 +125,7 @@ public JobBaseProperties withComputeId(String computeId) { /** * Get the displayName property: Display name of job. - * + * * @return the displayName value. */ public String displayName() { @@ -133,7 +134,7 @@ public String displayName() { /** * Set the displayName property: Display name of job. - * + * * @param displayName the displayName value to set. * @return the JobBaseProperties object itself. */ @@ -145,7 +146,7 @@ public JobBaseProperties withDisplayName(String displayName) { /** * Get the experimentName property: The name of the experiment the job belongs to. If not set, the job is placed in * the "Default" experiment. - * + * * @return the experimentName value. */ public String experimentName() { @@ -155,7 +156,7 @@ public String experimentName() { /** * Set the experimentName property: The name of the experiment the job belongs to. If not set, the job is placed in * the "Default" experiment. - * + * * @param experimentName the experimentName value to set. * @return the JobBaseProperties object itself. */ @@ -166,8 +167,9 @@ public JobBaseProperties withExperimentName(String experimentName) { /** * Get the identity property: Identity configuration. If set, this should be one of AmlToken, ManagedIdentity, - * UserIdentity or null. Defaults to AmlToken if null. - * + * UserIdentity or null. + * Defaults to AmlToken if null. + * * @return the identity value. */ public IdentityConfiguration identity() { @@ -176,8 +178,9 @@ public IdentityConfiguration identity() { /** * Set the identity property: Identity configuration. If set, this should be one of AmlToken, ManagedIdentity, - * UserIdentity or null. Defaults to AmlToken if null. - * + * UserIdentity or null. + * Defaults to AmlToken if null. + * * @param identity the identity value to set. * @return the JobBaseProperties object itself. */ @@ -188,7 +191,7 @@ public JobBaseProperties withIdentity(IdentityConfiguration identity) { /** * Get the isArchived property: Is the asset archived?. - * + * * @return the isArchived value. */ public Boolean isArchived() { @@ -197,7 +200,7 @@ public Boolean isArchived() { /** * Set the isArchived property: Is the asset archived?. - * + * * @param isArchived the isArchived value to set. * @return the JobBaseProperties object itself. */ @@ -207,9 +210,29 @@ public JobBaseProperties withIsArchived(Boolean isArchived) { } /** - * Get the services property: List of JobEndpoints. For local jobs, a job endpoint will have an endpoint value of - * FileStreamObject. - * + * Get the notificationSetting property: Notification setting for the job. + * + * @return the notificationSetting value. + */ + public NotificationSetting notificationSetting() { + return this.notificationSetting; + } + + /** + * Set the notificationSetting property: Notification setting for the job. + * + * @param notificationSetting the notificationSetting value to set. + * @return the JobBaseProperties object itself. + */ + public JobBaseProperties withNotificationSetting(NotificationSetting notificationSetting) { + this.notificationSetting = notificationSetting; + return this; + } + + /** + * Get the services property: List of JobEndpoints. + * For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + * * @return the services value. */ public Map services() { @@ -217,9 +240,9 @@ public Map services() { } /** - * Set the services property: List of JobEndpoints. For local jobs, a job endpoint will have an endpoint value of - * FileStreamObject. - * + * Set the services property: List of JobEndpoints. + * For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + * * @param services the services value to set. * @return the JobBaseProperties object itself. */ @@ -230,28 +253,45 @@ public JobBaseProperties withServices(Map services) { /** * Get the status property: Status of the job. - * + * * @return the status value. */ public JobStatus status() { return this.status; } - /** {@inheritDoc} */ + /** + * Set the status property: Status of the job. + * + * @param status the status value to set. + * @return the JobBaseProperties object itself. + */ + JobBaseProperties withStatus(JobStatus status) { + this.status = status; + return this; + } + + /** + * {@inheritDoc} + */ @Override public JobBaseProperties withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public JobBaseProperties withProperties(Map properties) { super.withProperties(properties); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public JobBaseProperties withTags(Map tags) { super.withTags(tags); @@ -260,7 +300,7 @@ public JobBaseProperties withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -269,15 +309,124 @@ public void validate() { if (identity() != null) { identity().validate(); } + if (notificationSetting() != null) { + notificationSetting().validate(); + } if (services() != null) { - services() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); + services().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("jobType", this.jobType == null ? null : this.jobType.toString()); + jsonWriter.writeStringField("componentId", this.componentId); + jsonWriter.writeStringField("computeId", this.computeId); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("experimentName", this.experimentName); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeBooleanField("isArchived", this.isArchived); + jsonWriter.writeJsonField("notificationSetting", this.notificationSetting); + jsonWriter.writeMapField("services", this.services, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobBaseProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobBaseProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the JobBaseProperties. + */ + public static JobBaseProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("jobType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("AutoML".equals(discriminatorValue)) { + return AutoMLJob.fromJson(readerToUse.reset()); + } else if ("Command".equals(discriminatorValue)) { + return CommandJob.fromJson(readerToUse.reset()); + } else if ("FineTuning".equals(discriminatorValue)) { + return FineTuningJob.fromJson(readerToUse.reset()); + } else if ("Pipeline".equals(discriminatorValue)) { + return PipelineJob.fromJson(readerToUse.reset()); + } else if ("Spark".equals(discriminatorValue)) { + return SparkJob.fromJson(readerToUse.reset()); + } else if ("Sweep".equals(discriminatorValue)) { + return SweepJob.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static JobBaseProperties fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobBaseProperties deserializedJobBaseProperties = new JobBaseProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedJobBaseProperties.withDescription(reader.getString()); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedJobBaseProperties.withProperties(properties); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedJobBaseProperties.withTags(tags); + } else if ("jobType".equals(fieldName)) { + deserializedJobBaseProperties.jobType = JobType.fromString(reader.getString()); + } else if ("componentId".equals(fieldName)) { + deserializedJobBaseProperties.componentId = reader.getString(); + } else if ("computeId".equals(fieldName)) { + deserializedJobBaseProperties.computeId = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedJobBaseProperties.displayName = reader.getString(); + } else if ("experimentName".equals(fieldName)) { + deserializedJobBaseProperties.experimentName = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedJobBaseProperties.identity = IdentityConfiguration.fromJson(reader); + } else if ("isArchived".equals(fieldName)) { + deserializedJobBaseProperties.isArchived = reader.getNullable(JsonReader::getBoolean); + } else if ("notificationSetting".equals(fieldName)) { + deserializedJobBaseProperties.notificationSetting = NotificationSetting.fromJson(reader); + } else if ("services".equals(fieldName)) { + Map services = reader.readMap(reader1 -> JobService.fromJson(reader1)); + deserializedJobBaseProperties.services = services; + } else if ("status".equals(fieldName)) { + deserializedJobBaseProperties.status = JobStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedJobBaseProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobBaseResourceArmPaginatedResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobBaseResourceArmPaginatedResult.java index c9675b3e0c18b..f506cfdd4b019 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobBaseResourceArmPaginatedResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobBaseResourceArmPaginatedResult.java @@ -5,32 +5,38 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.fluent.models.JobBaseInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** A paginated list of JobBase entities. */ +/** + * A paginated list of JobBase entities. + */ @Fluent -public final class JobBaseResourceArmPaginatedResult { +public final class JobBaseResourceArmPaginatedResult implements JsonSerializable { /* * The link to the next page of JobBase objects. If null, there are no additional pages. */ - @JsonProperty(value = "nextLink") private String nextLink; /* * An array of objects of type JobBase. */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of JobBaseResourceArmPaginatedResult class. */ + /** + * Creates an instance of JobBaseResourceArmPaginatedResult class. + */ public JobBaseResourceArmPaginatedResult() { } /** * Get the nextLink property: The link to the next page of JobBase objects. If null, there are no additional pages. - * + * * @return the nextLink value. */ public String nextLink() { @@ -39,7 +45,7 @@ public String nextLink() { /** * Set the nextLink property: The link to the next page of JobBase objects. If null, there are no additional pages. - * + * * @param nextLink the nextLink value to set. * @return the JobBaseResourceArmPaginatedResult object itself. */ @@ -50,7 +56,7 @@ public JobBaseResourceArmPaginatedResult withNextLink(String nextLink) { /** * Get the value property: An array of objects of type JobBase. - * + * * @return the value value. */ public List value() { @@ -59,7 +65,7 @@ public List value() { /** * Set the value property: An array of objects of type JobBase. - * + * * @param value the value value to set. * @return the JobBaseResourceArmPaginatedResult object itself. */ @@ -70,7 +76,7 @@ public JobBaseResourceArmPaginatedResult withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +84,45 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobBaseResourceArmPaginatedResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobBaseResourceArmPaginatedResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the JobBaseResourceArmPaginatedResult. + */ + public static JobBaseResourceArmPaginatedResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobBaseResourceArmPaginatedResult deserializedJobBaseResourceArmPaginatedResult + = new JobBaseResourceArmPaginatedResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedJobBaseResourceArmPaginatedResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> JobBaseInner.fromJson(reader1)); + deserializedJobBaseResourceArmPaginatedResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedJobBaseResourceArmPaginatedResult; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobInput.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobInput.java index 5cba43503e851..de3ee3097459f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobInput.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobInput.java @@ -5,42 +5,45 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Command job definition. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "jobInputType", - defaultImpl = JobInput.class) -@JsonTypeName("JobInput") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "mltable", value = MLTableJobInput.class), - @JsonSubTypes.Type(name = "custom_model", value = CustomModelJobInput.class), - @JsonSubTypes.Type(name = "mlflow_model", value = MLFlowModelJobInput.class), - @JsonSubTypes.Type(name = "literal", value = LiteralJobInput.class), - @JsonSubTypes.Type(name = "triton_model", value = TritonModelJobInput.class), - @JsonSubTypes.Type(name = "uri_file", value = UriFileJobInput.class), - @JsonSubTypes.Type(name = "uri_folder", value = UriFolderJobInput.class) -}) +/** + * Command job definition. + */ @Fluent -public class JobInput { +public class JobInput implements JsonSerializable { + /* + * [Required] Specifies the type of job. + */ + private JobInputType jobInputType = JobInputType.fromString("JobInput"); + /* * Description for the input. */ - @JsonProperty(value = "description") private String description; - /** Creates an instance of JobInput class. */ + /** + * Creates an instance of JobInput class. + */ public JobInput() { } + /** + * Get the jobInputType property: [Required] Specifies the type of job. + * + * @return the jobInputType value. + */ + public JobInputType jobInputType() { + return this.jobInputType; + } + /** * Get the description property: Description for the input. - * + * * @return the description value. */ public String description() { @@ -49,7 +52,7 @@ public String description() { /** * Set the description property: Description for the input. - * + * * @param description the description value to set. * @return the JobInput object itself. */ @@ -60,9 +63,85 @@ public JobInput withDescription(String description) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("jobInputType", this.jobInputType == null ? null : this.jobInputType.toString()); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobInput if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the JobInput. + */ + public static JobInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("jobInputType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("mltable".equals(discriminatorValue)) { + return MLTableJobInput.fromJson(readerToUse.reset()); + } else if ("mlflow_model".equals(discriminatorValue)) { + return MLFlowModelJobInput.fromJson(readerToUse.reset()); + } else if ("custom_model".equals(discriminatorValue)) { + return CustomModelJobInput.fromJson(readerToUse.reset()); + } else if ("literal".equals(discriminatorValue)) { + return LiteralJobInput.fromJson(readerToUse.reset()); + } else if ("triton_model".equals(discriminatorValue)) { + return TritonModelJobInput.fromJson(readerToUse.reset()); + } else if ("uri_file".equals(discriminatorValue)) { + return UriFileJobInput.fromJson(readerToUse.reset()); + } else if ("uri_folder".equals(discriminatorValue)) { + return UriFolderJobInput.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static JobInput fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobInput deserializedJobInput = new JobInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("jobInputType".equals(fieldName)) { + deserializedJobInput.jobInputType = JobInputType.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedJobInput.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedJobInput; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobInputType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobInputType.java index 92e6f586c7933..313bd4569147d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobInputType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobInputType.java @@ -5,35 +5,50 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Enum to determine the Job Input Type. */ +/** + * Enum to determine the Job Input Type. + */ public final class JobInputType extends ExpandableStringEnum { - /** Static value literal for JobInputType. */ + /** + * Static value literal for JobInputType. + */ public static final JobInputType LITERAL = fromString("literal"); - /** Static value uri_file for JobInputType. */ + /** + * Static value uri_file for JobInputType. + */ public static final JobInputType URI_FILE = fromString("uri_file"); - /** Static value uri_folder for JobInputType. */ + /** + * Static value uri_folder for JobInputType. + */ public static final JobInputType URI_FOLDER = fromString("uri_folder"); - /** Static value mltable for JobInputType. */ + /** + * Static value mltable for JobInputType. + */ public static final JobInputType MLTABLE = fromString("mltable"); - /** Static value custom_model for JobInputType. */ + /** + * Static value custom_model for JobInputType. + */ public static final JobInputType CUSTOM_MODEL = fromString("custom_model"); - /** Static value mlflow_model for JobInputType. */ + /** + * Static value mlflow_model for JobInputType. + */ public static final JobInputType MLFLOW_MODEL = fromString("mlflow_model"); - /** Static value triton_model for JobInputType. */ + /** + * Static value triton_model for JobInputType. + */ public static final JobInputType TRITON_MODEL = fromString("triton_model"); /** * Creates a new instance of JobInputType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -42,18 +57,17 @@ public JobInputType() { /** * Creates or finds a JobInputType from its string representation. - * + * * @param name a name to look for. * @return the corresponding JobInputType. */ - @JsonCreator public static JobInputType fromString(String name) { return fromString(name, JobInputType.class); } /** * Gets known JobInputType values. - * + * * @return known JobInputType values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobLimits.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobLimits.java index c79da820462ac..cb22815a974f0 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobLimits.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobLimits.java @@ -5,40 +5,49 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.Duration; -/** The JobLimits model. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "jobLimitsType", - defaultImpl = JobLimits.class) -@JsonTypeName("JobLimits") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "Command", value = CommandJobLimits.class), - @JsonSubTypes.Type(name = "Sweep", value = SweepJobLimits.class) -}) +/** + * The JobLimits model. + */ @Fluent -public class JobLimits { +public class JobLimits implements JsonSerializable { + /* + * [Required] JobLimit type. + */ + private JobLimitsType jobLimitsType = JobLimitsType.fromString("JobLimits"); + /* * The max run duration in ISO 8601 format, after which the job will be cancelled. Only supports duration with * precision as low as Seconds. */ - @JsonProperty(value = "timeout") private Duration timeout; - /** Creates an instance of JobLimits class. */ + /** + * Creates an instance of JobLimits class. + */ public JobLimits() { } + /** + * Get the jobLimitsType property: [Required] JobLimit type. + * + * @return the jobLimitsType value. + */ + public JobLimitsType jobLimitsType() { + return this.jobLimitsType; + } + /** * Get the timeout property: The max run duration in ISO 8601 format, after which the job will be cancelled. Only * supports duration with precision as low as Seconds. - * + * * @return the timeout value. */ public Duration timeout() { @@ -48,7 +57,7 @@ public Duration timeout() { /** * Set the timeout property: The max run duration in ISO 8601 format, after which the job will be cancelled. Only * supports duration with precision as low as Seconds. - * + * * @param timeout the timeout value to set. * @return the JobLimits object itself. */ @@ -59,9 +68,76 @@ public JobLimits withTimeout(Duration timeout) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("jobLimitsType", this.jobLimitsType == null ? null : this.jobLimitsType.toString()); + jsonWriter.writeStringField("timeout", CoreUtils.durationToStringWithDays(this.timeout)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobLimits from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobLimits if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the JobLimits. + */ + public static JobLimits fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("jobLimitsType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Command".equals(discriminatorValue)) { + return CommandJobLimits.fromJson(readerToUse.reset()); + } else if ("Sweep".equals(discriminatorValue)) { + return SweepJobLimits.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static JobLimits fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobLimits deserializedJobLimits = new JobLimits(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("jobLimitsType".equals(fieldName)) { + deserializedJobLimits.jobLimitsType = JobLimitsType.fromString(reader.getString()); + } else if ("timeout".equals(fieldName)) { + deserializedJobLimits.timeout + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedJobLimits; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobLimitsType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobLimitsType.java index 943280f65918d..701ae070452db 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobLimitsType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobLimitsType.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for JobLimitsType. */ +/** + * Defines values for JobLimitsType. + */ public final class JobLimitsType extends ExpandableStringEnum { - /** Static value Command for JobLimitsType. */ + /** + * Static value Command for JobLimitsType. + */ public static final JobLimitsType COMMAND = fromString("Command"); - /** Static value Sweep for JobLimitsType. */ + /** + * Static value Sweep for JobLimitsType. + */ public static final JobLimitsType SWEEP = fromString("Sweep"); /** * Creates a new instance of JobLimitsType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public JobLimitsType() { /** * Creates or finds a JobLimitsType from its string representation. - * + * * @param name a name to look for. * @return the corresponding JobLimitsType. */ - @JsonCreator public static JobLimitsType fromString(String name) { return fromString(name, JobLimitsType.class); } /** * Gets known JobLimitsType values. - * + * * @return known JobLimitsType values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobOutput.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobOutput.java index b8c523ed40f23..95004ccd7696b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobOutput.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobOutput.java @@ -5,41 +5,45 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Job output definition container information on where to find job output/logs. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "jobOutputType", - defaultImpl = JobOutput.class) -@JsonTypeName("JobOutput") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "custom_model", value = CustomModelJobOutput.class), - @JsonSubTypes.Type(name = "mlflow_model", value = MLFlowModelJobOutput.class), - @JsonSubTypes.Type(name = "mltable", value = MLTableJobOutput.class), - @JsonSubTypes.Type(name = "triton_model", value = TritonModelJobOutput.class), - @JsonSubTypes.Type(name = "uri_file", value = UriFileJobOutput.class), - @JsonSubTypes.Type(name = "uri_folder", value = UriFolderJobOutput.class) -}) +/** + * Job output definition container information on where to find job output/logs. + */ @Fluent -public class JobOutput { +public class JobOutput implements JsonSerializable { + /* + * [Required] Specifies the type of job. + */ + private JobOutputType jobOutputType = JobOutputType.fromString("JobOutput"); + /* * Description for the output. */ - @JsonProperty(value = "description") private String description; - /** Creates an instance of JobOutput class. */ + /** + * Creates an instance of JobOutput class. + */ public JobOutput() { } + /** + * Get the jobOutputType property: [Required] Specifies the type of job. + * + * @return the jobOutputType value. + */ + public JobOutputType jobOutputType() { + return this.jobOutputType; + } + /** * Get the description property: Description for the output. - * + * * @return the description value. */ public String description() { @@ -48,7 +52,7 @@ public String description() { /** * Set the description property: Description for the output. - * + * * @param description the description value to set. * @return the JobOutput object itself. */ @@ -59,9 +63,83 @@ public JobOutput withDescription(String description) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("jobOutputType", this.jobOutputType == null ? null : this.jobOutputType.toString()); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobOutput if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the JobOutput. + */ + public static JobOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("jobOutputType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("custom_model".equals(discriminatorValue)) { + return CustomModelJobOutput.fromJson(readerToUse.reset()); + } else if ("mlflow_model".equals(discriminatorValue)) { + return MLFlowModelJobOutput.fromJson(readerToUse.reset()); + } else if ("mltable".equals(discriminatorValue)) { + return MLTableJobOutput.fromJson(readerToUse.reset()); + } else if ("triton_model".equals(discriminatorValue)) { + return TritonModelJobOutput.fromJson(readerToUse.reset()); + } else if ("uri_file".equals(discriminatorValue)) { + return UriFileJobOutput.fromJson(readerToUse.reset()); + } else if ("uri_folder".equals(discriminatorValue)) { + return UriFolderJobOutput.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static JobOutput fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobOutput deserializedJobOutput = new JobOutput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("jobOutputType".equals(fieldName)) { + deserializedJobOutput.jobOutputType = JobOutputType.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedJobOutput.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedJobOutput; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobOutputType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobOutputType.java index c3d9ba0102f33..711b28b17355a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobOutputType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobOutputType.java @@ -5,32 +5,45 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Enum to determine the Job Output Type. */ +/** + * Enum to determine the Job Output Type. + */ public final class JobOutputType extends ExpandableStringEnum { - /** Static value uri_file for JobOutputType. */ + /** + * Static value uri_file for JobOutputType. + */ public static final JobOutputType URI_FILE = fromString("uri_file"); - /** Static value uri_folder for JobOutputType. */ + /** + * Static value uri_folder for JobOutputType. + */ public static final JobOutputType URI_FOLDER = fromString("uri_folder"); - /** Static value mltable for JobOutputType. */ + /** + * Static value mltable for JobOutputType. + */ public static final JobOutputType MLTABLE = fromString("mltable"); - /** Static value custom_model for JobOutputType. */ + /** + * Static value custom_model for JobOutputType. + */ public static final JobOutputType CUSTOM_MODEL = fromString("custom_model"); - /** Static value mlflow_model for JobOutputType. */ + /** + * Static value mlflow_model for JobOutputType. + */ public static final JobOutputType MLFLOW_MODEL = fromString("mlflow_model"); - /** Static value triton_model for JobOutputType. */ + /** + * Static value triton_model for JobOutputType. + */ public static final JobOutputType TRITON_MODEL = fromString("triton_model"); /** * Creates a new instance of JobOutputType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -39,18 +52,17 @@ public JobOutputType() { /** * Creates or finds a JobOutputType from its string representation. - * + * * @param name a name to look for. * @return the corresponding JobOutputType. */ - @JsonCreator public static JobOutputType fromString(String name) { return fromString(name, JobOutputType.class); } /** * Gets known JobOutputType values. - * + * * @return known JobOutputType values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobResourceConfiguration.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobResourceConfiguration.java index 37e80aca4c90c..21a385dc42899 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobResourceConfiguration.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobResourceConfiguration.java @@ -5,27 +5,32 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** The JobResourceConfiguration model. */ +/** + * The JobResourceConfiguration model. + */ @Fluent public final class JobResourceConfiguration extends ResourceConfiguration { /* * Extra arguments to pass to the Docker run command. This would override any parameters that have already been set * by the system, or in this section. This parameter is only supported for Azure ML compute types. */ - @JsonProperty(value = "dockerArgs") private String dockerArgs; /* * Size of the docker container's shared memory block. This should be in the format of (number)(unit) where number * as to be greater than 0 and the unit can be one of b(bytes), k(kilobytes), m(megabytes), or g(gigabytes). */ - @JsonProperty(value = "shmSize") private String shmSize; - /** Creates an instance of JobResourceConfiguration class. */ + /** + * Creates an instance of JobResourceConfiguration class. + */ public JobResourceConfiguration() { } @@ -33,7 +38,7 @@ public JobResourceConfiguration() { * Get the dockerArgs property: Extra arguments to pass to the Docker run command. This would override any * parameters that have already been set by the system, or in this section. This parameter is only supported for * Azure ML compute types. - * + * * @return the dockerArgs value. */ public String dockerArgs() { @@ -44,7 +49,7 @@ public String dockerArgs() { * Set the dockerArgs property: Extra arguments to pass to the Docker run command. This would override any * parameters that have already been set by the system, or in this section. This parameter is only supported for * Azure ML compute types. - * + * * @param dockerArgs the dockerArgs value to set. * @return the JobResourceConfiguration object itself. */ @@ -57,7 +62,7 @@ public JobResourceConfiguration withDockerArgs(String dockerArgs) { * Get the shmSize property: Size of the docker container's shared memory block. This should be in the format of * (number)(unit) where number as to be greater than 0 and the unit can be one of b(bytes), k(kilobytes), * m(megabytes), or g(gigabytes). - * + * * @return the shmSize value. */ public String shmSize() { @@ -68,7 +73,7 @@ public String shmSize() { * Set the shmSize property: Size of the docker container's shared memory block. This should be in the format of * (number)(unit) where number as to be greater than 0 and the unit can be one of b(bytes), k(kilobytes), * m(megabytes), or g(gigabytes). - * + * * @param shmSize the shmSize value to set. * @return the JobResourceConfiguration object itself. */ @@ -77,21 +82,27 @@ public JobResourceConfiguration withShmSize(String shmSize) { return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public JobResourceConfiguration withInstanceCount(Integer instanceCount) { super.withInstanceCount(instanceCount); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public JobResourceConfiguration withInstanceType(String instanceType) { super.withInstanceType(instanceType); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public JobResourceConfiguration withProperties(Map properties) { super.withProperties(properties); @@ -100,11 +111,60 @@ public JobResourceConfiguration withProperties(Map properties) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("instanceCount", instanceCount()); + jsonWriter.writeStringField("instanceType", instanceType()); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeStringField("dockerArgs", this.dockerArgs); + jsonWriter.writeStringField("shmSize", this.shmSize); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobResourceConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobResourceConfiguration if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the JobResourceConfiguration. + */ + public static JobResourceConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobResourceConfiguration deserializedJobResourceConfiguration = new JobResourceConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("instanceCount".equals(fieldName)) { + deserializedJobResourceConfiguration.withInstanceCount(reader.getNullable(JsonReader::getInt)); + } else if ("instanceType".equals(fieldName)) { + deserializedJobResourceConfiguration.withInstanceType(reader.getString()); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedJobResourceConfiguration.withProperties(properties); + } else if ("dockerArgs".equals(fieldName)) { + deserializedJobResourceConfiguration.dockerArgs = reader.getString(); + } else if ("shmSize".equals(fieldName)) { + deserializedJobResourceConfiguration.shmSize = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedJobResourceConfiguration; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobResources.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobResources.java new file mode 100644 index 0000000000000..956f794d78762 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobResources.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The JobResources model. + */ +@Fluent +public final class JobResources implements JsonSerializable { + /* + * List of instance types to choose from. + */ + private List instanceTypes; + + /** + * Creates an instance of JobResources class. + */ + public JobResources() { + } + + /** + * Get the instanceTypes property: List of instance types to choose from. + * + * @return the instanceTypes value. + */ + public List instanceTypes() { + return this.instanceTypes; + } + + /** + * Set the instanceTypes property: List of instance types to choose from. + * + * @param instanceTypes the instanceTypes value to set. + * @return the JobResources object itself. + */ + public JobResources withInstanceTypes(List instanceTypes) { + this.instanceTypes = instanceTypes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("instanceTypes", this.instanceTypes, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobResources from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobResources if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the JobResources. + */ + public static JobResources fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobResources deserializedJobResources = new JobResources(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("instanceTypes".equals(fieldName)) { + List instanceTypes = reader.readArray(reader1 -> reader1.getString()); + deserializedJobResources.instanceTypes = instanceTypes; + } else { + reader.skipChildren(); + } + } + + return deserializedJobResources; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobScheduleAction.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobScheduleAction.java index c1c7ffbdf77ad..9fb78f3743d19 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobScheduleAction.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobScheduleAction.java @@ -6,28 +6,45 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The JobScheduleAction model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "actionType") -@JsonTypeName("CreateJob") +/** + * The JobScheduleAction model. + */ @Fluent public final class JobScheduleAction extends ScheduleActionBase { + /* + * [Required] Specifies the action type of the schedule + */ + private ScheduleActionType actionType = ScheduleActionType.CREATE_JOB; + /* * [Required] Defines Schedule action definition details. */ - @JsonProperty(value = "jobDefinition", required = true) private JobBaseProperties jobDefinition; - /** Creates an instance of JobScheduleAction class. */ + /** + * Creates an instance of JobScheduleAction class. + */ public JobScheduleAction() { } + /** + * Get the actionType property: [Required] Specifies the action type of the schedule. + * + * @return the actionType value. + */ + @Override + public ScheduleActionType actionType() { + return this.actionType; + } + /** * Get the jobDefinition property: [Required] Defines Schedule action definition details. - * + * * @return the jobDefinition value. */ public JobBaseProperties jobDefinition() { @@ -36,7 +53,7 @@ public JobBaseProperties jobDefinition() { /** * Set the jobDefinition property: [Required] Defines Schedule action definition details. - * + * * @param jobDefinition the jobDefinition value to set. * @return the JobScheduleAction object itself. */ @@ -47,15 +64,15 @@ public JobScheduleAction withJobDefinition(JobBaseProperties jobDefinition) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (jobDefinition() == null) { - throw LOGGER - .logExceptionAsError( + throw LOGGER.atError() + .log( new IllegalArgumentException("Missing required property jobDefinition in model JobScheduleAction")); } else { jobDefinition().validate(); @@ -63,4 +80,44 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(JobScheduleAction.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("jobDefinition", this.jobDefinition); + jsonWriter.writeStringField("actionType", this.actionType == null ? null : this.actionType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobScheduleAction from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobScheduleAction if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the JobScheduleAction. + */ + public static JobScheduleAction fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobScheduleAction deserializedJobScheduleAction = new JobScheduleAction(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("jobDefinition".equals(fieldName)) { + deserializedJobScheduleAction.jobDefinition = JobBaseProperties.fromJson(reader); + } else if ("actionType".equals(fieldName)) { + deserializedJobScheduleAction.actionType = ScheduleActionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedJobScheduleAction; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobService.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobService.java index a581c73835ad3..1f1aee2570d86 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobService.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobService.java @@ -5,57 +5,63 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Job endpoint definition. */ +/** + * Job endpoint definition. + */ @Fluent -public final class JobService { +public final class JobService implements JsonSerializable { /* * Url for endpoint. */ - @JsonProperty(value = "endpoint") private String endpoint; /* * Any error in the service. */ - @JsonProperty(value = "errorMessage", access = JsonProperty.Access.WRITE_ONLY) private String errorMessage; /* * Endpoint type. */ - @JsonProperty(value = "jobServiceType") private String jobServiceType; + /* + * 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. + */ + private Nodes nodes; + /* * Port for endpoint. */ - @JsonProperty(value = "port") private Integer port; /* * Additional properties to set on the endpoint. */ - @JsonProperty(value = "properties") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map properties; /* * Status of endpoint. */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private String status; - /** Creates an instance of JobService class. */ + /** + * Creates an instance of JobService class. + */ public JobService() { } /** * Get the endpoint property: Url for endpoint. - * + * * @return the endpoint value. */ public String endpoint() { @@ -64,7 +70,7 @@ public String endpoint() { /** * Set the endpoint property: Url for endpoint. - * + * * @param endpoint the endpoint value to set. * @return the JobService object itself. */ @@ -75,7 +81,7 @@ public JobService withEndpoint(String endpoint) { /** * Get the errorMessage property: Any error in the service. - * + * * @return the errorMessage value. */ public String errorMessage() { @@ -84,7 +90,7 @@ public String errorMessage() { /** * Get the jobServiceType property: Endpoint type. - * + * * @return the jobServiceType value. */ public String jobServiceType() { @@ -93,7 +99,7 @@ public String jobServiceType() { /** * Set the jobServiceType property: Endpoint type. - * + * * @param jobServiceType the jobServiceType value to set. * @return the JobService object itself. */ @@ -102,9 +108,31 @@ public JobService withJobServiceType(String jobServiceType) { return this; } + /** + * Get the nodes property: 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. + * + * @return the nodes value. + */ + public Nodes nodes() { + return this.nodes; + } + + /** + * Set the nodes property: 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. + * + * @param nodes the nodes value to set. + * @return the JobService object itself. + */ + public JobService withNodes(Nodes nodes) { + this.nodes = nodes; + return this; + } + /** * Get the port property: Port for endpoint. - * + * * @return the port value. */ public Integer port() { @@ -113,7 +141,7 @@ public Integer port() { /** * Set the port property: Port for endpoint. - * + * * @param port the port value to set. * @return the JobService object itself. */ @@ -124,7 +152,7 @@ public JobService withPort(Integer port) { /** * Get the properties property: Additional properties to set on the endpoint. - * + * * @return the properties value. */ public Map properties() { @@ -133,7 +161,7 @@ public Map properties() { /** * Set the properties property: Additional properties to set on the endpoint. - * + * * @param properties the properties value to set. * @return the JobService object itself. */ @@ -144,7 +172,7 @@ public JobService withProperties(Map properties) { /** * Get the status property: Status of endpoint. - * + * * @return the status value. */ public String status() { @@ -153,9 +181,65 @@ public String status() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (nodes() != null) { + nodes().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("endpoint", this.endpoint); + jsonWriter.writeStringField("jobServiceType", this.jobServiceType); + jsonWriter.writeJsonField("nodes", this.nodes); + jsonWriter.writeNumberField("port", this.port); + jsonWriter.writeMapField("properties", this.properties, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobService from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobService if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the JobService. + */ + public static JobService fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobService deserializedJobService = new JobService(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("endpoint".equals(fieldName)) { + deserializedJobService.endpoint = reader.getString(); + } else if ("errorMessage".equals(fieldName)) { + deserializedJobService.errorMessage = reader.getString(); + } else if ("jobServiceType".equals(fieldName)) { + deserializedJobService.jobServiceType = reader.getString(); + } else if ("nodes".equals(fieldName)) { + deserializedJobService.nodes = Nodes.fromJson(reader); + } else if ("port".equals(fieldName)) { + deserializedJobService.port = reader.getNullable(JsonReader::getInt); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedJobService.properties = properties; + } else if ("status".equals(fieldName)) { + deserializedJobService.status = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedJobService; + }); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobStatus.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobStatus.java index 009ec1b6995b5..9a2a2d5a618ec 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobStatus.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobStatus.java @@ -5,56 +5,85 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The status of a job. */ +/** + * The status of a job. + */ public final class JobStatus extends ExpandableStringEnum { - /** Static value NotStarted for JobStatus. */ + /** + * Static value NotStarted for JobStatus. + */ public static final JobStatus NOT_STARTED = fromString("NotStarted"); - /** Static value Starting for JobStatus. */ + /** + * Static value Starting for JobStatus. + */ public static final JobStatus STARTING = fromString("Starting"); - /** Static value Provisioning for JobStatus. */ + /** + * Static value Provisioning for JobStatus. + */ public static final JobStatus PROVISIONING = fromString("Provisioning"); - /** Static value Preparing for JobStatus. */ + /** + * Static value Preparing for JobStatus. + */ public static final JobStatus PREPARING = fromString("Preparing"); - /** Static value Queued for JobStatus. */ + /** + * Static value Queued for JobStatus. + */ public static final JobStatus QUEUED = fromString("Queued"); - /** Static value Running for JobStatus. */ + /** + * Static value Running for JobStatus. + */ public static final JobStatus RUNNING = fromString("Running"); - /** Static value Finalizing for JobStatus. */ + /** + * Static value Finalizing for JobStatus. + */ public static final JobStatus FINALIZING = fromString("Finalizing"); - /** Static value CancelRequested for JobStatus. */ + /** + * Static value CancelRequested for JobStatus. + */ public static final JobStatus CANCEL_REQUESTED = fromString("CancelRequested"); - /** Static value Completed for JobStatus. */ + /** + * Static value Completed for JobStatus. + */ public static final JobStatus COMPLETED = fromString("Completed"); - /** Static value Failed for JobStatus. */ + /** + * Static value Failed for JobStatus. + */ public static final JobStatus FAILED = fromString("Failed"); - /** Static value Canceled for JobStatus. */ + /** + * Static value Canceled for JobStatus. + */ public static final JobStatus CANCELED = fromString("Canceled"); - /** Static value NotResponding for JobStatus. */ + /** + * Static value NotResponding for JobStatus. + */ public static final JobStatus NOT_RESPONDING = fromString("NotResponding"); - /** Static value Paused for JobStatus. */ + /** + * Static value Paused for JobStatus. + */ public static final JobStatus PAUSED = fromString("Paused"); - /** Static value Unknown for JobStatus. */ + /** + * Static value Unknown for JobStatus. + */ public static final JobStatus UNKNOWN = fromString("Unknown"); /** * Creates a new instance of JobStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -63,18 +92,17 @@ public JobStatus() { /** * Creates or finds a JobStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding JobStatus. */ - @JsonCreator public static JobStatus fromString(String name) { return fromString(name, JobStatus.class); } /** * Gets known JobStatus values. - * + * * @return known JobStatus values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobTier.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobTier.java new file mode 100644 index 0000000000000..a4ea9676a29f6 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobTier.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum to determine the job tier. + */ +public final class JobTier extends ExpandableStringEnum { + /** + * Static value Null for JobTier. + */ + public static final JobTier NULL = fromString("Null"); + + /** + * Static value Spot for JobTier. + */ + public static final JobTier SPOT = fromString("Spot"); + + /** + * Static value Basic for JobTier. + */ + public static final JobTier BASIC = fromString("Basic"); + + /** + * Static value Standard for JobTier. + */ + public static final JobTier STANDARD = fromString("Standard"); + + /** + * Static value Premium for JobTier. + */ + public static final JobTier PREMIUM = fromString("Premium"); + + /** + * Creates a new instance of JobTier value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public JobTier() { + } + + /** + * Creates or finds a JobTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding JobTier. + */ + public static JobTier fromString(String name) { + return fromString(name, JobTier.class); + } + + /** + * Gets known JobTier values. + * + * @return known JobTier values. + */ + public static Collection values() { + return values(JobTier.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobType.java index 681eb7abb0448..db094bc9d706b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/JobType.java @@ -5,26 +5,45 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Enum to determine the type of job. */ +/** + * Enum to determine the type of job. + */ public final class JobType extends ExpandableStringEnum { - /** Static value AutoML for JobType. */ + /** + * Static value AutoML for JobType. + */ public static final JobType AUTO_ML = fromString("AutoML"); - /** Static value Command for JobType. */ + /** + * Static value Command for JobType. + */ public static final JobType COMMAND = fromString("Command"); - /** Static value Sweep for JobType. */ + /** + * Static value Sweep for JobType. + */ public static final JobType SWEEP = fromString("Sweep"); - /** Static value Pipeline for JobType. */ + /** + * Static value Pipeline for JobType. + */ public static final JobType PIPELINE = fromString("Pipeline"); + /** + * Static value Spark for JobType. + */ + public static final JobType SPARK = fromString("Spark"); + + /** + * Static value FineTuning for JobType. + */ + public static final JobType FINE_TUNING = fromString("FineTuning"); + /** * Creates a new instance of JobType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,18 +52,17 @@ public JobType() { /** * Creates or finds a JobType from its string representation. - * + * * @param name a name to look for. * @return the corresponding JobType. */ - @JsonCreator public static JobType fromString(String name) { return fromString(name, JobType.class); } /** * Gets known JobType values. - * + * * @return known JobType values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Jobs.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Jobs.java index cba708d43905e..bc5f3be5a755e 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Jobs.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Jobs.java @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Jobs. */ +/** + * Resource collection API of Jobs. + */ public interface Jobs { /** * Lists Jobs in the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -24,31 +26,27 @@ public interface Jobs { /** * Lists Jobs in the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. * @param jobType Type of job to be returned. * @param tag Jobs returned will have this tag key. * @param listViewType View type for including/excluding (for example) archived entities. + * @param properties Comma-separated list of user property names (and optionally values). Example: + * prop1,prop2=value2. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of JobBase entities as paginated response with {@link PagedIterable}. */ - PagedIterable list( - String resourceGroupName, - String workspaceName, - String skip, - String jobType, - String tag, - ListViewType listViewType, - Context context); + PagedIterable list(String resourceGroupName, String workspaceName, String skip, String jobType, String tag, + ListViewType listViewType, String properties, Context context); /** * Deletes a Job (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -60,7 +58,7 @@ PagedIterable list( /** * Deletes a Job (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -73,7 +71,7 @@ PagedIterable list( /** * Gets a Job by name/id. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -87,7 +85,7 @@ PagedIterable list( /** * Gets a Job by name/id. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -100,7 +98,7 @@ PagedIterable list( /** * Cancels a Job (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -112,7 +110,7 @@ PagedIterable list( /** * Cancels a Job (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param id The name and identifier for the Job. This is case-sensitive. @@ -125,7 +123,7 @@ PagedIterable list( /** * Gets a Job by name/id. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -136,7 +134,7 @@ PagedIterable list( /** * Gets a Job by name/id. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -148,7 +146,7 @@ PagedIterable list( /** * Deletes a Job (asynchronous). - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -158,7 +156,7 @@ PagedIterable list( /** * Deletes a Job (asynchronous). - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -169,7 +167,7 @@ PagedIterable list( /** * Begins definition for a new JobBase resource. - * + * * @param name resource name. * @return the first stage of the new JobBase definition. */ diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/KeyType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/KeyType.java index 5485b2f4e8bc7..6e0cf938e18d6 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/KeyType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/KeyType.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for KeyType. */ +/** + * Defines values for KeyType. + */ public final class KeyType extends ExpandableStringEnum { - /** Static value Primary for KeyType. */ + /** + * Static value Primary for KeyType. + */ public static final KeyType PRIMARY = fromString("Primary"); - /** Static value Secondary for KeyType. */ + /** + * Static value Secondary for KeyType. + */ public static final KeyType SECONDARY = fromString("Secondary"); /** * Creates a new instance of KeyType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public KeyType() { /** * Creates or finds a KeyType from its string representation. - * + * * @param name a name to look for. * @return the corresponding KeyType. */ - @JsonCreator public static KeyType fromString(String name) { return fromString(name, KeyType.class); } /** * Gets known KeyType values. - * + * * @return known KeyType values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Kubernetes.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Kubernetes.java index e5f2de0d139f2..d28ca97e56c61 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Kubernetes.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Kubernetes.java @@ -5,28 +5,75 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; -/** A Machine Learning compute based on Kubernetes Compute. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "computeType") -@JsonTypeName("Kubernetes") +/** + * A Machine Learning compute based on Kubernetes Compute. + */ @Fluent public final class Kubernetes extends Compute { + /* + * The type of compute + */ + private ComputeType computeType = ComputeType.KUBERNETES; + /* * Properties of Kubernetes */ - @JsonProperty(value = "properties") private KubernetesProperties properties; - /** Creates an instance of Kubernetes class. */ + /* + * The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. + */ + private ProvisioningState provisioningState; + + /* + * The time at which the compute was created. + */ + private OffsetDateTime createdOn; + + /* + * The time at which the compute was last modified. + */ + private OffsetDateTime modifiedOn; + + /* + * Errors during provisioning + */ + private List provisioningErrors; + + /* + * Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning + * service provisioned it if false. + */ + private Boolean isAttachedCompute; + + /** + * Creates an instance of Kubernetes class. + */ public Kubernetes() { } + /** + * Get the computeType property: The type of compute. + * + * @return the computeType value. + */ + @Override + public ComputeType computeType() { + return this.computeType; + } + /** * Get the properties property: Properties of Kubernetes. - * + * * @return the properties value. */ public KubernetesProperties properties() { @@ -35,7 +82,7 @@ public KubernetesProperties properties() { /** * Set the properties property: Properties of Kubernetes. - * + * * @param properties the properties value to set. * @return the Kubernetes object itself. */ @@ -44,28 +91,88 @@ public Kubernetes withProperties(KubernetesProperties properties) { return this; } - /** {@inheritDoc} */ + /** + * Get the provisioningState property: The provision state of the cluster. Valid values are Unknown, Updating, + * Provisioning, Succeeded, and Failed. + * + * @return the provisioningState value. + */ + @Override + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the createdOn property: The time at which the compute was created. + * + * @return the createdOn value. + */ + @Override + public OffsetDateTime createdOn() { + return this.createdOn; + } + + /** + * Get the modifiedOn property: The time at which the compute was last modified. + * + * @return the modifiedOn value. + */ + @Override + public OffsetDateTime modifiedOn() { + return this.modifiedOn; + } + + /** + * Get the provisioningErrors property: Errors during provisioning. + * + * @return the provisioningErrors value. + */ + @Override + public List provisioningErrors() { + return this.provisioningErrors; + } + + /** + * Get the isAttachedCompute property: Indicating whether the compute was provisioned by user and brought from + * outside if true, or machine learning service provisioned it if false. + * + * @return the isAttachedCompute value. + */ + @Override + public Boolean isAttachedCompute() { + return this.isAttachedCompute; + } + + /** + * {@inheritDoc} + */ @Override public Kubernetes withComputeLocation(String computeLocation) { super.withComputeLocation(computeLocation); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public Kubernetes withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public Kubernetes withResourceId(String resourceId) { super.withResourceId(resourceId); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public Kubernetes withDisableLocalAuth(Boolean disableLocalAuth) { super.withDisableLocalAuth(disableLocalAuth); @@ -74,7 +181,7 @@ public Kubernetes withDisableLocalAuth(Boolean disableLocalAuth) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -84,4 +191,69 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("computeLocation", computeLocation()); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("resourceId", resourceId()); + jsonWriter.writeBooleanField("disableLocalAuth", disableLocalAuth()); + jsonWriter.writeStringField("computeType", this.computeType == null ? null : this.computeType.toString()); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Kubernetes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Kubernetes if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Kubernetes. + */ + public static Kubernetes fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Kubernetes deserializedKubernetes = new Kubernetes(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("computeLocation".equals(fieldName)) { + deserializedKubernetes.withComputeLocation(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedKubernetes.provisioningState = ProvisioningState.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedKubernetes.withDescription(reader.getString()); + } else if ("createdOn".equals(fieldName)) { + deserializedKubernetes.createdOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("modifiedOn".equals(fieldName)) { + deserializedKubernetes.modifiedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("resourceId".equals(fieldName)) { + deserializedKubernetes.withResourceId(reader.getString()); + } else if ("provisioningErrors".equals(fieldName)) { + List provisioningErrors + = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); + deserializedKubernetes.provisioningErrors = provisioningErrors; + } else if ("isAttachedCompute".equals(fieldName)) { + deserializedKubernetes.isAttachedCompute = reader.getNullable(JsonReader::getBoolean); + } else if ("disableLocalAuth".equals(fieldName)) { + deserializedKubernetes.withDisableLocalAuth(reader.getNullable(JsonReader::getBoolean)); + } else if ("computeType".equals(fieldName)) { + deserializedKubernetes.computeType = ComputeType.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedKubernetes.properties = KubernetesProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedKubernetes; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/KubernetesOnlineDeployment.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/KubernetesOnlineDeployment.java index 9a07bac3c9c53..a425a41001746 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/KubernetesOnlineDeployment.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/KubernetesOnlineDeployment.java @@ -5,29 +5,51 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Properties specific to a KubernetesOnlineDeployment. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "endpointComputeType") -@JsonTypeName("Kubernetes") +/** + * Properties specific to a KubernetesOnlineDeployment. + */ @Fluent public final class KubernetesOnlineDeployment extends OnlineDeploymentProperties { + /* + * [Required] The compute type of the endpoint. + */ + private EndpointComputeType endpointComputeType = EndpointComputeType.KUBERNETES; + /* * The resource requirements for the container (cpu and memory). */ - @JsonProperty(value = "containerResourceRequirements") private ContainerResourceRequirements containerResourceRequirements; - /** Creates an instance of KubernetesOnlineDeployment class. */ + /* + * Provisioning state for the endpoint deployment. + */ + private DeploymentProvisioningState provisioningState; + + /** + * Creates an instance of KubernetesOnlineDeployment class. + */ public KubernetesOnlineDeployment() { } + /** + * Get the endpointComputeType property: [Required] The compute type of the endpoint. + * + * @return the endpointComputeType value. + */ + @Override + public EndpointComputeType endpointComputeType() { + return this.endpointComputeType; + } + /** * Get the containerResourceRequirements property: The resource requirements for the container (cpu and memory). - * + * * @return the containerResourceRequirements value. */ public ContainerResourceRequirements containerResourceRequirements() { @@ -36,109 +58,156 @@ public ContainerResourceRequirements containerResourceRequirements() { /** * Set the containerResourceRequirements property: The resource requirements for the container (cpu and memory). - * + * * @param containerResourceRequirements the containerResourceRequirements value to set. * @return the KubernetesOnlineDeployment object itself. */ - public KubernetesOnlineDeployment withContainerResourceRequirements( - ContainerResourceRequirements containerResourceRequirements) { + public KubernetesOnlineDeployment + withContainerResourceRequirements(ContainerResourceRequirements containerResourceRequirements) { this.containerResourceRequirements = containerResourceRequirements; return this; } - /** {@inheritDoc} */ + /** + * Get the provisioningState property: Provisioning state for the endpoint deployment. + * + * @return the provisioningState value. + */ + @Override + public DeploymentProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ @Override public KubernetesOnlineDeployment withAppInsightsEnabled(Boolean appInsightsEnabled) { super.withAppInsightsEnabled(appInsightsEnabled); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ + @Override + public KubernetesOnlineDeployment withDataCollector(DataCollector dataCollector) { + super.withDataCollector(dataCollector); + return this; + } + + /** + * {@inheritDoc} + */ @Override - public KubernetesOnlineDeployment withEgressPublicNetworkAccess( - EgressPublicNetworkAccessType egressPublicNetworkAccess) { + public KubernetesOnlineDeployment + withEgressPublicNetworkAccess(EgressPublicNetworkAccessType egressPublicNetworkAccess) { super.withEgressPublicNetworkAccess(egressPublicNetworkAccess); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public KubernetesOnlineDeployment withInstanceType(String instanceType) { super.withInstanceType(instanceType); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public KubernetesOnlineDeployment withLivenessProbe(ProbeSettings livenessProbe) { super.withLivenessProbe(livenessProbe); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public KubernetesOnlineDeployment withModel(String model) { super.withModel(model); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public KubernetesOnlineDeployment withModelMountPath(String modelMountPath) { super.withModelMountPath(modelMountPath); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public KubernetesOnlineDeployment withReadinessProbe(ProbeSettings readinessProbe) { super.withReadinessProbe(readinessProbe); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public KubernetesOnlineDeployment withRequestSettings(OnlineRequestSettings requestSettings) { super.withRequestSettings(requestSettings); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public KubernetesOnlineDeployment withScaleSettings(OnlineScaleSettings scaleSettings) { super.withScaleSettings(scaleSettings); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public KubernetesOnlineDeployment withCodeConfiguration(CodeConfiguration codeConfiguration) { super.withCodeConfiguration(codeConfiguration); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public KubernetesOnlineDeployment withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public KubernetesOnlineDeployment withEnvironmentId(String environmentId) { super.withEnvironmentId(environmentId); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public KubernetesOnlineDeployment withEnvironmentVariables(Map environmentVariables) { super.withEnvironmentVariables(environmentVariables); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public KubernetesOnlineDeployment withProperties(Map properties) { super.withProperties(properties); @@ -147,7 +216,7 @@ public KubernetesOnlineDeployment withProperties(Map properties) /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -157,4 +226,100 @@ public void validate() { containerResourceRequirements().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("codeConfiguration", codeConfiguration()); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("environmentId", environmentId()); + jsonWriter.writeMapField("environmentVariables", environmentVariables(), + (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("appInsightsEnabled", appInsightsEnabled()); + jsonWriter.writeJsonField("dataCollector", dataCollector()); + jsonWriter.writeStringField("egressPublicNetworkAccess", + egressPublicNetworkAccess() == null ? null : egressPublicNetworkAccess().toString()); + jsonWriter.writeStringField("instanceType", instanceType()); + jsonWriter.writeJsonField("livenessProbe", livenessProbe()); + jsonWriter.writeStringField("model", model()); + jsonWriter.writeStringField("modelMountPath", modelMountPath()); + jsonWriter.writeJsonField("readinessProbe", readinessProbe()); + jsonWriter.writeJsonField("requestSettings", requestSettings()); + jsonWriter.writeJsonField("scaleSettings", scaleSettings()); + jsonWriter.writeStringField("endpointComputeType", + this.endpointComputeType == null ? null : this.endpointComputeType.toString()); + jsonWriter.writeJsonField("containerResourceRequirements", this.containerResourceRequirements); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KubernetesOnlineDeployment from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KubernetesOnlineDeployment if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the KubernetesOnlineDeployment. + */ + public static KubernetesOnlineDeployment fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KubernetesOnlineDeployment deserializedKubernetesOnlineDeployment = new KubernetesOnlineDeployment(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("codeConfiguration".equals(fieldName)) { + deserializedKubernetesOnlineDeployment.withCodeConfiguration(CodeConfiguration.fromJson(reader)); + } else if ("description".equals(fieldName)) { + deserializedKubernetesOnlineDeployment.withDescription(reader.getString()); + } else if ("environmentId".equals(fieldName)) { + deserializedKubernetesOnlineDeployment.withEnvironmentId(reader.getString()); + } else if ("environmentVariables".equals(fieldName)) { + Map environmentVariables = reader.readMap(reader1 -> reader1.getString()); + deserializedKubernetesOnlineDeployment.withEnvironmentVariables(environmentVariables); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedKubernetesOnlineDeployment.withProperties(properties); + } else if ("appInsightsEnabled".equals(fieldName)) { + deserializedKubernetesOnlineDeployment + .withAppInsightsEnabled(reader.getNullable(JsonReader::getBoolean)); + } else if ("dataCollector".equals(fieldName)) { + deserializedKubernetesOnlineDeployment.withDataCollector(DataCollector.fromJson(reader)); + } else if ("egressPublicNetworkAccess".equals(fieldName)) { + deserializedKubernetesOnlineDeployment + .withEgressPublicNetworkAccess(EgressPublicNetworkAccessType.fromString(reader.getString())); + } else if ("instanceType".equals(fieldName)) { + deserializedKubernetesOnlineDeployment.withInstanceType(reader.getString()); + } else if ("livenessProbe".equals(fieldName)) { + deserializedKubernetesOnlineDeployment.withLivenessProbe(ProbeSettings.fromJson(reader)); + } else if ("model".equals(fieldName)) { + deserializedKubernetesOnlineDeployment.withModel(reader.getString()); + } else if ("modelMountPath".equals(fieldName)) { + deserializedKubernetesOnlineDeployment.withModelMountPath(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedKubernetesOnlineDeployment.provisioningState + = DeploymentProvisioningState.fromString(reader.getString()); + } else if ("readinessProbe".equals(fieldName)) { + deserializedKubernetesOnlineDeployment.withReadinessProbe(ProbeSettings.fromJson(reader)); + } else if ("requestSettings".equals(fieldName)) { + deserializedKubernetesOnlineDeployment.withRequestSettings(OnlineRequestSettings.fromJson(reader)); + } else if ("scaleSettings".equals(fieldName)) { + deserializedKubernetesOnlineDeployment.withScaleSettings(OnlineScaleSettings.fromJson(reader)); + } else if ("endpointComputeType".equals(fieldName)) { + deserializedKubernetesOnlineDeployment.endpointComputeType + = EndpointComputeType.fromString(reader.getString()); + } else if ("containerResourceRequirements".equals(fieldName)) { + deserializedKubernetesOnlineDeployment.containerResourceRequirements + = ContainerResourceRequirements.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedKubernetesOnlineDeployment; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/KubernetesProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/KubernetesProperties.java index a361ed5f3a585..55437affe3b87 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/KubernetesProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/KubernetesProperties.java @@ -5,69 +5,67 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Kubernetes properties. */ +/** + * Kubernetes properties. + */ @Fluent -public final class KubernetesProperties { +public final class KubernetesProperties implements JsonSerializable { /* * Relay connection string. */ - @JsonProperty(value = "relayConnectionString") private String relayConnectionString; /* * ServiceBus connection string. */ - @JsonProperty(value = "serviceBusConnectionString") private String serviceBusConnectionString; /* * Extension principal-id. */ - @JsonProperty(value = "extensionPrincipalId") private String extensionPrincipalId; /* * Extension instance release train. */ - @JsonProperty(value = "extensionInstanceReleaseTrain") private String extensionInstanceReleaseTrain; /* * VC name. */ - @JsonProperty(value = "vcName") private String vcName; /* * Compute namespace */ - @JsonProperty(value = "namespace") private String namespace; /* * Default instance type */ - @JsonProperty(value = "defaultInstanceType") private String defaultInstanceType; /* * Instance Type Schema */ - @JsonProperty(value = "instanceTypes") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map instanceTypes; - /** Creates an instance of KubernetesProperties class. */ + /** + * Creates an instance of KubernetesProperties class. + */ public KubernetesProperties() { } /** * Get the relayConnectionString property: Relay connection string. - * + * * @return the relayConnectionString value. */ public String relayConnectionString() { @@ -76,7 +74,7 @@ public String relayConnectionString() { /** * Set the relayConnectionString property: Relay connection string. - * + * * @param relayConnectionString the relayConnectionString value to set. * @return the KubernetesProperties object itself. */ @@ -87,7 +85,7 @@ public KubernetesProperties withRelayConnectionString(String relayConnectionStri /** * Get the serviceBusConnectionString property: ServiceBus connection string. - * + * * @return the serviceBusConnectionString value. */ public String serviceBusConnectionString() { @@ -96,7 +94,7 @@ public String serviceBusConnectionString() { /** * Set the serviceBusConnectionString property: ServiceBus connection string. - * + * * @param serviceBusConnectionString the serviceBusConnectionString value to set. * @return the KubernetesProperties object itself. */ @@ -107,7 +105,7 @@ public KubernetesProperties withServiceBusConnectionString(String serviceBusConn /** * Get the extensionPrincipalId property: Extension principal-id. - * + * * @return the extensionPrincipalId value. */ public String extensionPrincipalId() { @@ -116,7 +114,7 @@ public String extensionPrincipalId() { /** * Set the extensionPrincipalId property: Extension principal-id. - * + * * @param extensionPrincipalId the extensionPrincipalId value to set. * @return the KubernetesProperties object itself. */ @@ -127,7 +125,7 @@ public KubernetesProperties withExtensionPrincipalId(String extensionPrincipalId /** * Get the extensionInstanceReleaseTrain property: Extension instance release train. - * + * * @return the extensionInstanceReleaseTrain value. */ public String extensionInstanceReleaseTrain() { @@ -136,7 +134,7 @@ public String extensionInstanceReleaseTrain() { /** * Set the extensionInstanceReleaseTrain property: Extension instance release train. - * + * * @param extensionInstanceReleaseTrain the extensionInstanceReleaseTrain value to set. * @return the KubernetesProperties object itself. */ @@ -147,7 +145,7 @@ public KubernetesProperties withExtensionInstanceReleaseTrain(String extensionIn /** * Get the vcName property: VC name. - * + * * @return the vcName value. */ public String vcName() { @@ -156,7 +154,7 @@ public String vcName() { /** * Set the vcName property: VC name. - * + * * @param vcName the vcName value to set. * @return the KubernetesProperties object itself. */ @@ -167,7 +165,7 @@ public KubernetesProperties withVcName(String vcName) { /** * Get the namespace property: Compute namespace. - * + * * @return the namespace value. */ public String namespace() { @@ -176,7 +174,7 @@ public String namespace() { /** * Set the namespace property: Compute namespace. - * + * * @param namespace the namespace value to set. * @return the KubernetesProperties object itself. */ @@ -187,7 +185,7 @@ public KubernetesProperties withNamespace(String namespace) { /** * Get the defaultInstanceType property: Default instance type. - * + * * @return the defaultInstanceType value. */ public String defaultInstanceType() { @@ -196,7 +194,7 @@ public String defaultInstanceType() { /** * Set the defaultInstanceType property: Default instance type. - * + * * @param defaultInstanceType the defaultInstanceType value to set. * @return the KubernetesProperties object itself. */ @@ -207,7 +205,7 @@ public KubernetesProperties withDefaultInstanceType(String defaultInstanceType) /** * Get the instanceTypes property: Instance Type Schema. - * + * * @return the instanceTypes value. */ public Map instanceTypes() { @@ -216,7 +214,7 @@ public Map instanceTypes() { /** * Set the instanceTypes property: Instance Type Schema. - * + * * @param instanceTypes the instanceTypes value to set. * @return the KubernetesProperties object itself. */ @@ -227,19 +225,75 @@ public KubernetesProperties withInstanceTypes(Map in /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (instanceTypes() != null) { - instanceTypes() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); + instanceTypes().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("relayConnectionString", this.relayConnectionString); + jsonWriter.writeStringField("serviceBusConnectionString", this.serviceBusConnectionString); + jsonWriter.writeStringField("extensionPrincipalId", this.extensionPrincipalId); + jsonWriter.writeStringField("extensionInstanceReleaseTrain", this.extensionInstanceReleaseTrain); + jsonWriter.writeStringField("vcName", this.vcName); + jsonWriter.writeStringField("namespace", this.namespace); + jsonWriter.writeStringField("defaultInstanceType", this.defaultInstanceType); + jsonWriter.writeMapField("instanceTypes", this.instanceTypes, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KubernetesProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KubernetesProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the KubernetesProperties. + */ + public static KubernetesProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KubernetesProperties deserializedKubernetesProperties = new KubernetesProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("relayConnectionString".equals(fieldName)) { + deserializedKubernetesProperties.relayConnectionString = reader.getString(); + } else if ("serviceBusConnectionString".equals(fieldName)) { + deserializedKubernetesProperties.serviceBusConnectionString = reader.getString(); + } else if ("extensionPrincipalId".equals(fieldName)) { + deserializedKubernetesProperties.extensionPrincipalId = reader.getString(); + } else if ("extensionInstanceReleaseTrain".equals(fieldName)) { + deserializedKubernetesProperties.extensionInstanceReleaseTrain = reader.getString(); + } else if ("vcName".equals(fieldName)) { + deserializedKubernetesProperties.vcName = reader.getString(); + } else if ("namespace".equals(fieldName)) { + deserializedKubernetesProperties.namespace = reader.getString(); + } else if ("defaultInstanceType".equals(fieldName)) { + deserializedKubernetesProperties.defaultInstanceType = reader.getString(); + } else if ("instanceTypes".equals(fieldName)) { + Map instanceTypes + = reader.readMap(reader1 -> InstanceTypeSchema.fromJson(reader1)); + deserializedKubernetesProperties.instanceTypes = instanceTypes; + } else { + reader.skipChildren(); + } + } + + return deserializedKubernetesProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/KubernetesSchema.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/KubernetesSchema.java index 98634b93fcb39..1466829889c50 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/KubernetesSchema.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/KubernetesSchema.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Kubernetes Compute Schema. */ +/** + * Kubernetes Compute Schema. + */ @Fluent -public class KubernetesSchema { +public class KubernetesSchema implements JsonSerializable { /* * Properties of Kubernetes */ - @JsonProperty(value = "properties") private KubernetesProperties properties; - /** Creates an instance of KubernetesSchema class. */ + /** + * Creates an instance of KubernetesSchema class. + */ public KubernetesSchema() { } /** * Get the properties property: Properties of Kubernetes. - * + * * @return the properties value. */ public KubernetesProperties properties() { @@ -31,7 +38,7 @@ public KubernetesProperties properties() { /** * Set the properties property: Properties of Kubernetes. - * + * * @param properties the properties value to set. * @return the KubernetesSchema object itself. */ @@ -42,7 +49,7 @@ public KubernetesSchema withProperties(KubernetesProperties properties) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -50,4 +57,40 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KubernetesSchema from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KubernetesSchema if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the KubernetesSchema. + */ + public static KubernetesSchema fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KubernetesSchema deserializedKubernetesSchema = new KubernetesSchema(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedKubernetesSchema.properties = KubernetesProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedKubernetesSchema; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LakeHouseArtifact.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LakeHouseArtifact.java new file mode 100644 index 0000000000000..3d32d196877cb --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LakeHouseArtifact.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The LakeHouseArtifact model. + */ +@Fluent +public final class LakeHouseArtifact extends OneLakeArtifact { + /* + * [Required] OneLake artifact type + */ + private OneLakeArtifactType artifactType = OneLakeArtifactType.LAKE_HOUSE; + + /** + * Creates an instance of LakeHouseArtifact class. + */ + public LakeHouseArtifact() { + } + + /** + * Get the artifactType property: [Required] OneLake artifact type. + * + * @return the artifactType value. + */ + @Override + public OneLakeArtifactType artifactType() { + return this.artifactType; + } + + /** + * {@inheritDoc} + */ + @Override + public LakeHouseArtifact withArtifactName(String artifactName) { + super.withArtifactName(artifactName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("artifactName", artifactName()); + jsonWriter.writeStringField("artifactType", this.artifactType == null ? null : this.artifactType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LakeHouseArtifact from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LakeHouseArtifact if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LakeHouseArtifact. + */ + public static LakeHouseArtifact fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LakeHouseArtifact deserializedLakeHouseArtifact = new LakeHouseArtifact(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("artifactName".equals(fieldName)) { + deserializedLakeHouseArtifact.withArtifactName(reader.getString()); + } else if ("artifactType".equals(fieldName)) { + deserializedLakeHouseArtifact.artifactType = OneLakeArtifactType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedLakeHouseArtifact; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LearningRateScheduler.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LearningRateScheduler.java index 1b916e37dd4c6..ddd62a953a6aa 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LearningRateScheduler.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LearningRateScheduler.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Learning rate scheduler enum. */ +/** + * Learning rate scheduler enum. + */ public final class LearningRateScheduler extends ExpandableStringEnum { - /** Static value None for LearningRateScheduler. */ + /** + * Static value None for LearningRateScheduler. + */ public static final LearningRateScheduler NONE = fromString("None"); - /** Static value WarmupCosine for LearningRateScheduler. */ + /** + * Static value WarmupCosine for LearningRateScheduler. + */ public static final LearningRateScheduler WARMUP_COSINE = fromString("WarmupCosine"); - /** Static value Step for LearningRateScheduler. */ + /** + * Static value Step for LearningRateScheduler. + */ public static final LearningRateScheduler STEP = fromString("Step"); /** * Creates a new instance of LearningRateScheduler value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public LearningRateScheduler() { /** * Creates or finds a LearningRateScheduler from its string representation. - * + * * @param name a name to look for. * @return the corresponding LearningRateScheduler. */ - @JsonCreator public static LearningRateScheduler fromString(String name) { return fromString(name, LearningRateScheduler.class); } /** * Gets known LearningRateScheduler values. - * + * * @return known LearningRateScheduler values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListAmlUserFeatureResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListAmlUserFeatureResult.java index 4eb345cb6c34b..5be8fc567662f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListAmlUserFeatureResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListAmlUserFeatureResult.java @@ -5,33 +5,39 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.fluent.models.AmlUserFeatureInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** The List Aml user feature operation response. */ +/** + * The List Aml user feature operation response. + */ @Immutable -public final class ListAmlUserFeatureResult { +public final class ListAmlUserFeatureResult implements JsonSerializable { /* * The list of AML user facing features. */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* - * The URI to fetch the next page of AML user features information. Call ListNext() with this to fetch the next - * page of AML user features information. + * The URI to fetch the next page of AML user features information. Call ListNext() with this to fetch the next page + * of AML user features information. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of ListAmlUserFeatureResult class. */ + /** + * Creates an instance of ListAmlUserFeatureResult class. + */ public ListAmlUserFeatureResult() { } /** * Get the value property: The list of AML user facing features. - * + * * @return the value value. */ public List value() { @@ -41,7 +47,7 @@ public List value() { /** * Get the nextLink property: The URI to fetch the next page of AML user features information. Call ListNext() with * this to fetch the next page of AML user features information. - * + * * @return the nextLink value. */ public String nextLink() { @@ -50,7 +56,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -58,4 +64,43 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListAmlUserFeatureResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListAmlUserFeatureResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ListAmlUserFeatureResult. + */ + public static ListAmlUserFeatureResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListAmlUserFeatureResult deserializedListAmlUserFeatureResult = new ListAmlUserFeatureResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> AmlUserFeatureInner.fromJson(reader1)); + deserializedListAmlUserFeatureResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListAmlUserFeatureResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListAmlUserFeatureResult; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListNotebookKeysResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListNotebookKeysResult.java index 7ee8bc352a961..5c1b85f07b185 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListNotebookKeysResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListNotebookKeysResult.java @@ -6,25 +6,27 @@ import com.azure.resourcemanager.machinelearning.fluent.models.ListNotebookKeysResultInner; -/** An immutable client-side representation of ListNotebookKeysResult. */ +/** + * An immutable client-side representation of ListNotebookKeysResult. + */ public interface ListNotebookKeysResult { /** * Gets the primaryAccessKey property: The primaryAccessKey property. - * + * * @return the primaryAccessKey value. */ String primaryAccessKey(); /** * Gets the secondaryAccessKey property: The secondaryAccessKey property. - * + * * @return the secondaryAccessKey value. */ String secondaryAccessKey(); /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.ListNotebookKeysResultInner object. - * + * * @return the inner object. */ ListNotebookKeysResultInner innerModel(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListStorageAccountKeysResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListStorageAccountKeysResult.java index 53a4f6c3e392d..e730c56ef0d43 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListStorageAccountKeysResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListStorageAccountKeysResult.java @@ -6,18 +6,20 @@ import com.azure.resourcemanager.machinelearning.fluent.models.ListStorageAccountKeysResultInner; -/** An immutable client-side representation of ListStorageAccountKeysResult. */ +/** + * An immutable client-side representation of ListStorageAccountKeysResult. + */ public interface ListStorageAccountKeysResult { /** * Gets the userStorageKey property: The userStorageKey property. - * + * * @return the userStorageKey value. */ String userStorageKey(); /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.ListStorageAccountKeysResultInner object. - * + * * @return the inner object. */ ListStorageAccountKeysResultInner innerModel(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListUsagesResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListUsagesResult.java index dd06b71d3580f..b6bc66cf0c61a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListUsagesResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListUsagesResult.java @@ -5,33 +5,39 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.fluent.models.UsageInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** The List Usages operation response. */ +/** + * The List Usages operation response. + */ @Immutable -public final class ListUsagesResult { +public final class ListUsagesResult implements JsonSerializable { /* * The list of AML resource usages. */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* * The URI to fetch the next page of AML resource usage information. Call ListNext() with this to fetch the next * page of AML resource usage information. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of ListUsagesResult class. */ + /** + * Creates an instance of ListUsagesResult class. + */ public ListUsagesResult() { } /** * Get the value property: The list of AML resource usages. - * + * * @return the value value. */ public List value() { @@ -41,7 +47,7 @@ public List value() { /** * Get the nextLink property: The URI to fetch the next page of AML resource usage information. Call ListNext() with * this to fetch the next page of AML resource usage information. - * + * * @return the nextLink value. */ public String nextLink() { @@ -50,7 +56,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -58,4 +64,42 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListUsagesResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListUsagesResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ListUsagesResult. + */ + public static ListUsagesResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListUsagesResult deserializedListUsagesResult = new ListUsagesResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> UsageInner.fromJson(reader1)); + deserializedListUsagesResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListUsagesResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListUsagesResult; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListViewType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListViewType.java index 8f096a4b8567c..2ca4088002d84 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListViewType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListViewType.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ListViewType. */ +/** + * Defines values for ListViewType. + */ public final class ListViewType extends ExpandableStringEnum { - /** Static value ActiveOnly for ListViewType. */ + /** + * Static value ActiveOnly for ListViewType. + */ public static final ListViewType ACTIVE_ONLY = fromString("ActiveOnly"); - /** Static value ArchivedOnly for ListViewType. */ + /** + * Static value ArchivedOnly for ListViewType. + */ public static final ListViewType ARCHIVED_ONLY = fromString("ArchivedOnly"); - /** Static value All for ListViewType. */ + /** + * Static value All for ListViewType. + */ public static final ListViewType ALL = fromString("All"); /** * Creates a new instance of ListViewType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public ListViewType() { /** * Creates or finds a ListViewType from its string representation. - * + * * @param name a name to look for. * @return the corresponding ListViewType. */ - @JsonCreator public static ListViewType fromString(String name) { return fromString(name, ListViewType.class); } /** * Gets known ListViewType values. - * + * * @return known ListViewType values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListWorkspaceKeysResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListWorkspaceKeysResult.java index 37ea530b96fb2..f66447f27bbfe 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListWorkspaceKeysResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListWorkspaceKeysResult.java @@ -6,46 +6,48 @@ import com.azure.resourcemanager.machinelearning.fluent.models.ListWorkspaceKeysResultInner; -/** An immutable client-side representation of ListWorkspaceKeysResult. */ +/** + * An immutable client-side representation of ListWorkspaceKeysResult. + */ public interface ListWorkspaceKeysResult { /** * Gets the userStorageKey property: The userStorageKey property. - * + * * @return the userStorageKey value. */ String userStorageKey(); /** * Gets the userStorageResourceId property: The userStorageResourceId property. - * + * * @return the userStorageResourceId value. */ String userStorageResourceId(); /** * Gets the appInsightsInstrumentationKey property: The appInsightsInstrumentationKey property. - * + * * @return the appInsightsInstrumentationKey value. */ String appInsightsInstrumentationKey(); /** * Gets the containerRegistryCredentials property: The containerRegistryCredentials property. - * + * * @return the containerRegistryCredentials value. */ RegistryListCredentialsResult containerRegistryCredentials(); /** * Gets the notebookAccessKeys property: The notebookAccessKeys property. - * + * * @return the notebookAccessKeys value. */ ListNotebookKeysResult notebookAccessKeys(); /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.ListWorkspaceKeysResultInner object. - * + * * @return the inner object. */ ListWorkspaceKeysResultInner innerModel(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListWorkspaceQuotas.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListWorkspaceQuotas.java index a54a6f6a93f09..fd651f77c4079 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListWorkspaceQuotas.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ListWorkspaceQuotas.java @@ -5,33 +5,39 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.fluent.models.ResourceQuotaInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** The List WorkspaceQuotasByVMFamily operation response. */ +/** + * The List WorkspaceQuotasByVMFamily operation response. + */ @Immutable -public final class ListWorkspaceQuotas { +public final class ListWorkspaceQuotas implements JsonSerializable { /* * The list of Workspace Quotas by VM Family */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* * The URI to fetch the next page of workspace quota information by VM Family. Call ListNext() with this to fetch * the next page of Workspace Quota information. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of ListWorkspaceQuotas class. */ + /** + * Creates an instance of ListWorkspaceQuotas class. + */ public ListWorkspaceQuotas() { } /** * Get the value property: The list of Workspace Quotas by VM Family. - * + * * @return the value value. */ public List value() { @@ -41,7 +47,7 @@ public List value() { /** * Get the nextLink property: The URI to fetch the next page of workspace quota information by VM Family. Call * ListNext() with this to fetch the next page of Workspace Quota information. - * + * * @return the nextLink value. */ public String nextLink() { @@ -50,7 +56,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -58,4 +64,42 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListWorkspaceQuotas from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListWorkspaceQuotas if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ListWorkspaceQuotas. + */ + public static ListWorkspaceQuotas fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListWorkspaceQuotas deserializedListWorkspaceQuotas = new ListWorkspaceQuotas(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> ResourceQuotaInner.fromJson(reader1)); + deserializedListWorkspaceQuotas.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListWorkspaceQuotas.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListWorkspaceQuotas; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LiteralJobInput.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LiteralJobInput.java index bd08d1b9305af..f1deadd6f7c1a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LiteralJobInput.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LiteralJobInput.java @@ -6,28 +6,45 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Literal input type. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobInputType") -@JsonTypeName("literal") +/** + * Literal input type. + */ @Fluent public final class LiteralJobInput extends JobInput { + /* + * [Required] Specifies the type of job. + */ + private JobInputType jobInputType = JobInputType.LITERAL; + /* * [Required] Literal value for the input. */ - @JsonProperty(value = "value", required = true) private String value; - /** Creates an instance of LiteralJobInput class. */ + /** + * Creates an instance of LiteralJobInput class. + */ public LiteralJobInput() { } + /** + * Get the jobInputType property: [Required] Specifies the type of job. + * + * @return the jobInputType value. + */ + @Override + public JobInputType jobInputType() { + return this.jobInputType; + } + /** * Get the value property: [Required] Literal value for the input. - * + * * @return the value value. */ public String value() { @@ -36,7 +53,7 @@ public String value() { /** * Set the value property: [Required] Literal value for the input. - * + * * @param value the value value to set. * @return the LiteralJobInput object itself. */ @@ -45,7 +62,9 @@ public LiteralJobInput withValue(String value) { return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public LiteralJobInput withDescription(String description) { super.withDescription(description); @@ -54,18 +73,60 @@ public LiteralJobInput withDescription(String description) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model LiteralJobInput")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model LiteralJobInput")); } } private static final ClientLogger LOGGER = new ClientLogger(LiteralJobInput.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("value", this.value); + jsonWriter.writeStringField("jobInputType", this.jobInputType == null ? null : this.jobInputType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LiteralJobInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LiteralJobInput if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LiteralJobInput. + */ + public static LiteralJobInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LiteralJobInput deserializedLiteralJobInput = new LiteralJobInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedLiteralJobInput.withDescription(reader.getString()); + } else if ("value".equals(fieldName)) { + deserializedLiteralJobInput.value = reader.getString(); + } else if ("jobInputType".equals(fieldName)) { + deserializedLiteralJobInput.jobInputType = JobInputType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedLiteralJobInput; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LoadBalancerType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LoadBalancerType.java index 045fe35c90231..badce22c4f017 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LoadBalancerType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LoadBalancerType.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Load Balancer Type. */ +/** + * Load Balancer Type. + */ public final class LoadBalancerType extends ExpandableStringEnum { - /** Static value PublicIp for LoadBalancerType. */ + /** + * Static value PublicIp for LoadBalancerType. + */ public static final LoadBalancerType PUBLIC_IP = fromString("PublicIp"); - /** Static value InternalLoadBalancer for LoadBalancerType. */ + /** + * Static value InternalLoadBalancer for LoadBalancerType. + */ public static final LoadBalancerType INTERNAL_LOAD_BALANCER = fromString("InternalLoadBalancer"); /** * Creates a new instance of LoadBalancerType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public LoadBalancerType() { /** * Creates or finds a LoadBalancerType from its string representation. - * + * * @param name a name to look for. * @return the corresponding LoadBalancerType. */ - @JsonCreator public static LoadBalancerType fromString(String name) { return fromString(name, LoadBalancerType.class); } /** * Gets known LoadBalancerType values. - * + * * @return known LoadBalancerType values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LogVerbosity.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LogVerbosity.java index 0d8fac3b0e253..2e95e895cf831 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LogVerbosity.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/LogVerbosity.java @@ -5,32 +5,45 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Enum for setting log verbosity. */ +/** + * Enum for setting log verbosity. + */ public final class LogVerbosity extends ExpandableStringEnum { - /** Static value NotSet for LogVerbosity. */ + /** + * Static value NotSet for LogVerbosity. + */ public static final LogVerbosity NOT_SET = fromString("NotSet"); - /** Static value Debug for LogVerbosity. */ + /** + * Static value Debug for LogVerbosity. + */ public static final LogVerbosity DEBUG = fromString("Debug"); - /** Static value Info for LogVerbosity. */ + /** + * Static value Info for LogVerbosity. + */ public static final LogVerbosity INFO = fromString("Info"); - /** Static value Warning for LogVerbosity. */ + /** + * Static value Warning for LogVerbosity. + */ public static final LogVerbosity WARNING = fromString("Warning"); - /** Static value Error for LogVerbosity. */ + /** + * Static value Error for LogVerbosity. + */ public static final LogVerbosity ERROR = fromString("Error"); - /** Static value Critical for LogVerbosity. */ + /** + * Static value Critical for LogVerbosity. + */ public static final LogVerbosity CRITICAL = fromString("Critical"); /** * Creates a new instance of LogVerbosity value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -39,18 +52,17 @@ public LogVerbosity() { /** * Creates or finds a LogVerbosity from its string representation. - * + * * @param name a name to look for. * @return the corresponding LogVerbosity. */ - @JsonCreator public static LogVerbosity fromString(String name) { return fromString(name, LogVerbosity.class); } /** * Gets known LogVerbosity values. - * + * * @return known LogVerbosity values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLFlowModelJobInput.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLFlowModelJobInput.java index 375ee999b449c..a5546011d56fc 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLFlowModelJobInput.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLFlowModelJobInput.java @@ -6,34 +6,50 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The MLFlowModelJobInput model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobInputType") -@JsonTypeName("mlflow_model") +/** + * The MLFlowModelJobInput model. + */ @Fluent public final class MLFlowModelJobInput extends JobInput { + /* + * [Required] Specifies the type of job. + */ + private JobInputType jobInputType = JobInputType.MLFLOW_MODEL; + /* * Input Asset Delivery Mode. */ - @JsonProperty(value = "mode") private InputDeliveryMode mode; /* * [Required] Input Asset URI. */ - @JsonProperty(value = "uri", required = true) private String uri; - /** Creates an instance of MLFlowModelJobInput class. */ + /** + * Creates an instance of MLFlowModelJobInput class. + */ public MLFlowModelJobInput() { } + /** + * Get the jobInputType property: [Required] Specifies the type of job. + * + * @return the jobInputType value. + */ + @Override + public JobInputType jobInputType() { + return this.jobInputType; + } + /** * Get the mode property: Input Asset Delivery Mode. - * + * * @return the mode value. */ public InputDeliveryMode mode() { @@ -42,7 +58,7 @@ public InputDeliveryMode mode() { /** * Set the mode property: Input Asset Delivery Mode. - * + * * @param mode the mode value to set. * @return the MLFlowModelJobInput object itself. */ @@ -53,7 +69,7 @@ public MLFlowModelJobInput withMode(InputDeliveryMode mode) { /** * Get the uri property: [Required] Input Asset URI. - * + * * @return the uri value. */ public String uri() { @@ -62,7 +78,7 @@ public String uri() { /** * Set the uri property: [Required] Input Asset URI. - * + * * @param uri the uri value to set. * @return the MLFlowModelJobInput object itself. */ @@ -71,7 +87,9 @@ public MLFlowModelJobInput withUri(String uri) { return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MLFlowModelJobInput withDescription(String description) { super.withDescription(description); @@ -80,18 +98,63 @@ public MLFlowModelJobInput withDescription(String description) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (uri() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property uri in model MLFlowModelJobInput")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property uri in model MLFlowModelJobInput")); } } private static final ClientLogger LOGGER = new ClientLogger(MLFlowModelJobInput.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("uri", this.uri); + jsonWriter.writeStringField("jobInputType", this.jobInputType == null ? null : this.jobInputType.toString()); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MLFlowModelJobInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MLFlowModelJobInput if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MLFlowModelJobInput. + */ + public static MLFlowModelJobInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MLFlowModelJobInput deserializedMLFlowModelJobInput = new MLFlowModelJobInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedMLFlowModelJobInput.withDescription(reader.getString()); + } else if ("uri".equals(fieldName)) { + deserializedMLFlowModelJobInput.uri = reader.getString(); + } else if ("jobInputType".equals(fieldName)) { + deserializedMLFlowModelJobInput.jobInputType = JobInputType.fromString(reader.getString()); + } else if ("mode".equals(fieldName)) { + deserializedMLFlowModelJobInput.mode = InputDeliveryMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMLFlowModelJobInput; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLFlowModelJobOutput.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLFlowModelJobOutput.java index e695c2c2e12c4..2eac16c57f380 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLFlowModelJobOutput.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLFlowModelJobOutput.java @@ -5,34 +5,50 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The MLFlowModelJobOutput model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobOutputType") -@JsonTypeName("mlflow_model") +/** + * The MLFlowModelJobOutput model. + */ @Fluent public final class MLFlowModelJobOutput extends JobOutput { + /* + * [Required] Specifies the type of job. + */ + private JobOutputType jobOutputType = JobOutputType.MLFLOW_MODEL; + /* * Output Asset Delivery Mode. */ - @JsonProperty(value = "mode") private OutputDeliveryMode mode; /* * Output Asset URI. */ - @JsonProperty(value = "uri") private String uri; - /** Creates an instance of MLFlowModelJobOutput class. */ + /** + * Creates an instance of MLFlowModelJobOutput class. + */ public MLFlowModelJobOutput() { } + /** + * Get the jobOutputType property: [Required] Specifies the type of job. + * + * @return the jobOutputType value. + */ + @Override + public JobOutputType jobOutputType() { + return this.jobOutputType; + } + /** * Get the mode property: Output Asset Delivery Mode. - * + * * @return the mode value. */ public OutputDeliveryMode mode() { @@ -41,7 +57,7 @@ public OutputDeliveryMode mode() { /** * Set the mode property: Output Asset Delivery Mode. - * + * * @param mode the mode value to set. * @return the MLFlowModelJobOutput object itself. */ @@ -52,7 +68,7 @@ public MLFlowModelJobOutput withMode(OutputDeliveryMode mode) { /** * Get the uri property: Output Asset URI. - * + * * @return the uri value. */ public String uri() { @@ -61,7 +77,7 @@ public String uri() { /** * Set the uri property: Output Asset URI. - * + * * @param uri the uri value to set. * @return the MLFlowModelJobOutput object itself. */ @@ -70,7 +86,9 @@ public MLFlowModelJobOutput withUri(String uri) { return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MLFlowModelJobOutput withDescription(String description) { super.withDescription(description); @@ -79,11 +97,56 @@ public MLFlowModelJobOutput withDescription(String description) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("jobOutputType", this.jobOutputType == null ? null : this.jobOutputType.toString()); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + jsonWriter.writeStringField("uri", this.uri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MLFlowModelJobOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MLFlowModelJobOutput if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the MLFlowModelJobOutput. + */ + public static MLFlowModelJobOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MLFlowModelJobOutput deserializedMLFlowModelJobOutput = new MLFlowModelJobOutput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedMLFlowModelJobOutput.withDescription(reader.getString()); + } else if ("jobOutputType".equals(fieldName)) { + deserializedMLFlowModelJobOutput.jobOutputType = JobOutputType.fromString(reader.getString()); + } else if ("mode".equals(fieldName)) { + deserializedMLFlowModelJobOutput.mode = OutputDeliveryMode.fromString(reader.getString()); + } else if ("uri".equals(fieldName)) { + deserializedMLFlowModelJobOutput.uri = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMLFlowModelJobOutput; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLTableData.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLTableData.java index 009f42261a0e6..24ac92dfe9837 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLTableData.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLTableData.java @@ -5,30 +5,47 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; import java.util.Map; -/** MLTable data definition. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "dataType") -@JsonTypeName("mltable") +/** + * MLTable data definition. + */ @Fluent public final class MLTableData extends DataVersionBaseProperties { + /* + * [Required] Specifies the type of data. + */ + private DataType dataType = DataType.MLTABLE; + /* * Uris referenced in the MLTable definition (required for lineage) */ - @JsonProperty(value = "referencedUris") private List referencedUris; - /** Creates an instance of MLTableData class. */ + /** + * Creates an instance of MLTableData class. + */ public MLTableData() { } + /** + * Get the dataType property: [Required] Specifies the type of data. + * + * @return the dataType value. + */ + @Override + public DataType dataType() { + return this.dataType; + } + /** * Get the referencedUris property: Uris referenced in the MLTable definition (required for lineage). - * + * * @return the referencedUris value. */ public List referencedUris() { @@ -37,7 +54,7 @@ public List referencedUris() { /** * Set the referencedUris property: Uris referenced in the MLTable definition (required for lineage). - * + * * @param referencedUris the referencedUris value to set. * @return the MLTableData object itself. */ @@ -46,42 +63,54 @@ public MLTableData withReferencedUris(List referencedUris) { return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MLTableData withDataUri(String dataUri) { super.withDataUri(dataUri); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MLTableData withIsAnonymous(Boolean isAnonymous) { super.withIsAnonymous(isAnonymous); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MLTableData withIsArchived(Boolean isArchived) { super.withIsArchived(isArchived); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MLTableData withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MLTableData withProperties(Map properties) { super.withProperties(properties); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MLTableData withTags(Map tags) { super.withTags(tags); @@ -90,11 +119,73 @@ public MLTableData withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("dataUri", dataUri()); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("isAnonymous", isAnonymous()); + jsonWriter.writeBooleanField("isArchived", isArchived()); + jsonWriter.writeStringField("dataType", this.dataType == null ? null : this.dataType.toString()); + jsonWriter.writeArrayField("referencedUris", this.referencedUris, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MLTableData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MLTableData if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MLTableData. + */ + public static MLTableData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MLTableData deserializedMLTableData = new MLTableData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dataUri".equals(fieldName)) { + deserializedMLTableData.withDataUri(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedMLTableData.withDescription(reader.getString()); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedMLTableData.withProperties(properties); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedMLTableData.withTags(tags); + } else if ("isAnonymous".equals(fieldName)) { + deserializedMLTableData.withIsAnonymous(reader.getNullable(JsonReader::getBoolean)); + } else if ("isArchived".equals(fieldName)) { + deserializedMLTableData.withIsArchived(reader.getNullable(JsonReader::getBoolean)); + } else if ("dataType".equals(fieldName)) { + deserializedMLTableData.dataType = DataType.fromString(reader.getString()); + } else if ("referencedUris".equals(fieldName)) { + List referencedUris = reader.readArray(reader1 -> reader1.getString()); + deserializedMLTableData.referencedUris = referencedUris; + } else { + reader.skipChildren(); + } + } + + return deserializedMLTableData; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLTableJobInput.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLTableJobInput.java index fa1f992030c3d..92edda8bdca4d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLTableJobInput.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLTableJobInput.java @@ -6,34 +6,50 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The MLTableJobInput model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobInputType") -@JsonTypeName("mltable") +/** + * The MLTableJobInput model. + */ @Fluent public final class MLTableJobInput extends JobInput { + /* + * [Required] Specifies the type of job. + */ + private JobInputType jobInputType = JobInputType.MLTABLE; + /* * Input Asset Delivery Mode. */ - @JsonProperty(value = "mode") private InputDeliveryMode mode; /* * [Required] Input Asset URI. */ - @JsonProperty(value = "uri", required = true) private String uri; - /** Creates an instance of MLTableJobInput class. */ + /** + * Creates an instance of MLTableJobInput class. + */ public MLTableJobInput() { } + /** + * Get the jobInputType property: [Required] Specifies the type of job. + * + * @return the jobInputType value. + */ + @Override + public JobInputType jobInputType() { + return this.jobInputType; + } + /** * Get the mode property: Input Asset Delivery Mode. - * + * * @return the mode value. */ public InputDeliveryMode mode() { @@ -42,7 +58,7 @@ public InputDeliveryMode mode() { /** * Set the mode property: Input Asset Delivery Mode. - * + * * @param mode the mode value to set. * @return the MLTableJobInput object itself. */ @@ -53,7 +69,7 @@ public MLTableJobInput withMode(InputDeliveryMode mode) { /** * Get the uri property: [Required] Input Asset URI. - * + * * @return the uri value. */ public String uri() { @@ -62,7 +78,7 @@ public String uri() { /** * Set the uri property: [Required] Input Asset URI. - * + * * @param uri the uri value to set. * @return the MLTableJobInput object itself. */ @@ -71,7 +87,9 @@ public MLTableJobInput withUri(String uri) { return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MLTableJobInput withDescription(String description) { super.withDescription(description); @@ -80,18 +98,63 @@ public MLTableJobInput withDescription(String description) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (uri() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property uri in model MLTableJobInput")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property uri in model MLTableJobInput")); } } private static final ClientLogger LOGGER = new ClientLogger(MLTableJobInput.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("uri", this.uri); + jsonWriter.writeStringField("jobInputType", this.jobInputType == null ? null : this.jobInputType.toString()); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MLTableJobInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MLTableJobInput if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MLTableJobInput. + */ + public static MLTableJobInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MLTableJobInput deserializedMLTableJobInput = new MLTableJobInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedMLTableJobInput.withDescription(reader.getString()); + } else if ("uri".equals(fieldName)) { + deserializedMLTableJobInput.uri = reader.getString(); + } else if ("jobInputType".equals(fieldName)) { + deserializedMLTableJobInput.jobInputType = JobInputType.fromString(reader.getString()); + } else if ("mode".equals(fieldName)) { + deserializedMLTableJobInput.mode = InputDeliveryMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMLTableJobInput; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLTableJobOutput.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLTableJobOutput.java index 168360d6a0155..c2cb99ac56758 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLTableJobOutput.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MLTableJobOutput.java @@ -5,34 +5,50 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The MLTableJobOutput model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobOutputType") -@JsonTypeName("mltable") +/** + * The MLTableJobOutput model. + */ @Fluent public final class MLTableJobOutput extends JobOutput { + /* + * [Required] Specifies the type of job. + */ + private JobOutputType jobOutputType = JobOutputType.MLTABLE; + /* * Output Asset Delivery Mode. */ - @JsonProperty(value = "mode") private OutputDeliveryMode mode; /* * Output Asset URI. */ - @JsonProperty(value = "uri") private String uri; - /** Creates an instance of MLTableJobOutput class. */ + /** + * Creates an instance of MLTableJobOutput class. + */ public MLTableJobOutput() { } + /** + * Get the jobOutputType property: [Required] Specifies the type of job. + * + * @return the jobOutputType value. + */ + @Override + public JobOutputType jobOutputType() { + return this.jobOutputType; + } + /** * Get the mode property: Output Asset Delivery Mode. - * + * * @return the mode value. */ public OutputDeliveryMode mode() { @@ -41,7 +57,7 @@ public OutputDeliveryMode mode() { /** * Set the mode property: Output Asset Delivery Mode. - * + * * @param mode the mode value to set. * @return the MLTableJobOutput object itself. */ @@ -52,7 +68,7 @@ public MLTableJobOutput withMode(OutputDeliveryMode mode) { /** * Get the uri property: Output Asset URI. - * + * * @return the uri value. */ public String uri() { @@ -61,7 +77,7 @@ public String uri() { /** * Set the uri property: Output Asset URI. - * + * * @param uri the uri value to set. * @return the MLTableJobOutput object itself. */ @@ -70,7 +86,9 @@ public MLTableJobOutput withUri(String uri) { return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MLTableJobOutput withDescription(String description) { super.withDescription(description); @@ -79,11 +97,56 @@ public MLTableJobOutput withDescription(String description) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("jobOutputType", this.jobOutputType == null ? null : this.jobOutputType.toString()); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + jsonWriter.writeStringField("uri", this.uri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MLTableJobOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MLTableJobOutput if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MLTableJobOutput. + */ + public static MLTableJobOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MLTableJobOutput deserializedMLTableJobOutput = new MLTableJobOutput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedMLTableJobOutput.withDescription(reader.getString()); + } else if ("jobOutputType".equals(fieldName)) { + deserializedMLTableJobOutput.jobOutputType = JobOutputType.fromString(reader.getString()); + } else if ("mode".equals(fieldName)) { + deserializedMLTableJobOutput.mode = OutputDeliveryMode.fromString(reader.getString()); + } else if ("uri".equals(fieldName)) { + deserializedMLTableJobOutput.uri = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMLTableJobOutput; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedComputeIdentity.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedComputeIdentity.java new file mode 100644 index 0000000000000..dc253a8faae2a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedComputeIdentity.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Managed compute identity definition. + */ +@Fluent +public final class ManagedComputeIdentity extends MonitorComputeIdentityBase { + /* + * [Required] Specifies the type of identity to use within the monitoring jobs. + */ + private MonitorComputeIdentityType computeIdentityType = MonitorComputeIdentityType.MANAGED_IDENTITY; + + /* + * The identity which will be leveraged by the monitoring jobs. + */ + private ManagedServiceIdentity identity; + + /** + * Creates an instance of ManagedComputeIdentity class. + */ + public ManagedComputeIdentity() { + } + + /** + * Get the computeIdentityType property: [Required] Specifies the type of identity to use within the monitoring + * jobs. + * + * @return the computeIdentityType value. + */ + @Override + public MonitorComputeIdentityType computeIdentityType() { + return this.computeIdentityType; + } + + /** + * Get the identity property: The identity which will be leveraged by the monitoring jobs. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity which will be leveraged by the monitoring jobs. + * + * @param identity the identity value to set. + * @return the ManagedComputeIdentity object itself. + */ + public ManagedComputeIdentity withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (identity() != null) { + identity().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("computeIdentityType", + this.computeIdentityType == null ? null : this.computeIdentityType.toString()); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedComputeIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedComputeIdentity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedComputeIdentity. + */ + public static ManagedComputeIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedComputeIdentity deserializedManagedComputeIdentity = new ManagedComputeIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("computeIdentityType".equals(fieldName)) { + deserializedManagedComputeIdentity.computeIdentityType + = MonitorComputeIdentityType.fromString(reader.getString()); + } else if ("identity".equals(fieldName)) { + deserializedManagedComputeIdentity.identity = ManagedServiceIdentity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedComputeIdentity; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedIdentity.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedIdentity.java index 6ff0f7e2b121d..6bff81da57789 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedIdentity.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedIdentity.java @@ -5,42 +5,58 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Objects; import java.util.UUID; -/** Managed identity configuration. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "identityType") -@JsonTypeName("Managed") +/** + * Managed identity configuration. + */ @Fluent -public class ManagedIdentity extends IdentityConfiguration { +public final class ManagedIdentity extends IdentityConfiguration { + /* + * [Required] Specifies the type of identity framework. + */ + private IdentityConfigurationType identityType = IdentityConfigurationType.MANAGED; + /* * Specifies a user-assigned identity by client ID. For system-assigned, do not set this field. */ - @JsonProperty(value = "clientId") private UUID clientId; /* * Specifies a user-assigned identity by object ID. For system-assigned, do not set this field. */ - @JsonProperty(value = "objectId") private UUID objectId; /* * Specifies a user-assigned identity by ARM resource ID. For system-assigned, do not set this field. */ - @JsonProperty(value = "resourceId") private String resourceId; - /** Creates an instance of ManagedIdentity class. */ + /** + * Creates an instance of ManagedIdentity class. + */ public ManagedIdentity() { } + /** + * Get the identityType property: [Required] Specifies the type of identity framework. + * + * @return the identityType value. + */ + @Override + public IdentityConfigurationType identityType() { + return this.identityType; + } + /** * Get the clientId property: Specifies a user-assigned identity by client ID. For system-assigned, do not set this * field. - * + * * @return the clientId value. */ public UUID clientId() { @@ -50,7 +66,7 @@ public UUID clientId() { /** * Set the clientId property: Specifies a user-assigned identity by client ID. For system-assigned, do not set this * field. - * + * * @param clientId the clientId value to set. * @return the ManagedIdentity object itself. */ @@ -62,7 +78,7 @@ public ManagedIdentity withClientId(UUID clientId) { /** * Get the objectId property: Specifies a user-assigned identity by object ID. For system-assigned, do not set this * field. - * + * * @return the objectId value. */ public UUID objectId() { @@ -72,7 +88,7 @@ public UUID objectId() { /** * Set the objectId property: Specifies a user-assigned identity by object ID. For system-assigned, do not set this * field. - * + * * @param objectId the objectId value to set. * @return the ManagedIdentity object itself. */ @@ -84,7 +100,7 @@ public ManagedIdentity withObjectId(UUID objectId) { /** * Get the resourceId property: Specifies a user-assigned identity by ARM resource ID. For system-assigned, do not * set this field. - * + * * @return the resourceId value. */ public String resourceId() { @@ -94,7 +110,7 @@ public String resourceId() { /** * Set the resourceId property: Specifies a user-assigned identity by ARM resource ID. For system-assigned, do not * set this field. - * + * * @param resourceId the resourceId value to set. * @return the ManagedIdentity object itself. */ @@ -105,11 +121,58 @@ public ManagedIdentity withResourceId(String resourceId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("identityType", this.identityType == null ? null : this.identityType.toString()); + jsonWriter.writeStringField("clientId", Objects.toString(this.clientId, null)); + jsonWriter.writeStringField("objectId", Objects.toString(this.objectId, null)); + jsonWriter.writeStringField("resourceId", this.resourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedIdentity if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedIdentity. + */ + public static ManagedIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedIdentity deserializedManagedIdentity = new ManagedIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("identityType".equals(fieldName)) { + deserializedManagedIdentity.identityType = IdentityConfigurationType.fromString(reader.getString()); + } else if ("clientId".equals(fieldName)) { + deserializedManagedIdentity.clientId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("objectId".equals(fieldName)) { + deserializedManagedIdentity.objectId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("resourceId".equals(fieldName)) { + deserializedManagedIdentity.resourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedIdentity; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedIdentityAuthTypeWorkspaceConnectionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedIdentityAuthTypeWorkspaceConnectionProperties.java index a117d892d2775..5023b0d28125e 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedIdentityAuthTypeWorkspaceConnectionProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedIdentityAuthTypeWorkspaceConnectionProperties.java @@ -5,28 +5,60 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; -/** The ManagedIdentityAuthTypeWorkspaceConnectionProperties model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "authType") -@JsonTypeName("ManagedIdentity") +/** + * The ManagedIdentityAuthTypeWorkspaceConnectionProperties model. + */ @Fluent public final class ManagedIdentityAuthTypeWorkspaceConnectionProperties extends WorkspaceConnectionPropertiesV2 { + /* + * Authentication type of the connection target + */ + private ConnectionAuthType authType = ConnectionAuthType.MANAGED_IDENTITY; + /* * The credentials property. */ - @JsonProperty(value = "credentials") private WorkspaceConnectionManagedIdentity credentials; - /** Creates an instance of ManagedIdentityAuthTypeWorkspaceConnectionProperties class. */ + /* + * The createdByWorkspaceArmId property. + */ + private String createdByWorkspaceArmId; + + /* + * Group based on connection category + */ + private ConnectionGroup group; + + /** + * Creates an instance of ManagedIdentityAuthTypeWorkspaceConnectionProperties class. + */ public ManagedIdentityAuthTypeWorkspaceConnectionProperties() { } + /** + * Get the authType property: Authentication type of the connection target. + * + * @return the authType value. + */ + @Override + public ConnectionAuthType authType() { + return this.authType; + } + /** * Get the credentials property: The credentials property. - * + * * @return the credentials value. */ public WorkspaceConnectionManagedIdentity credentials() { @@ -35,38 +67,102 @@ public WorkspaceConnectionManagedIdentity credentials() { /** * Set the credentials property: The credentials property. - * + * * @param credentials the credentials value to set. * @return the ManagedIdentityAuthTypeWorkspaceConnectionProperties object itself. */ - public ManagedIdentityAuthTypeWorkspaceConnectionProperties withCredentials( - WorkspaceConnectionManagedIdentity credentials) { + public ManagedIdentityAuthTypeWorkspaceConnectionProperties + withCredentials(WorkspaceConnectionManagedIdentity credentials) { this.credentials = credentials; return this; } - /** {@inheritDoc} */ + /** + * Get the createdByWorkspaceArmId property: The createdByWorkspaceArmId property. + * + * @return the createdByWorkspaceArmId value. + */ + @Override + public String createdByWorkspaceArmId() { + return this.createdByWorkspaceArmId; + } + + /** + * Get the group property: Group based on connection category. + * + * @return the group value. + */ + @Override + public ConnectionGroup group() { + return this.group; + } + + /** + * {@inheritDoc} + */ @Override public ManagedIdentityAuthTypeWorkspaceConnectionProperties withCategory(ConnectionCategory category) { super.withCategory(category); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ + @Override + public ManagedIdentityAuthTypeWorkspaceConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { + super.withExpiryTime(expiryTime); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedIdentityAuthTypeWorkspaceConnectionProperties withIsSharedToAll(Boolean isSharedToAll) { + super.withIsSharedToAll(isSharedToAll); + return this; + } + + /** + * {@inheritDoc} + */ @Override public ManagedIdentityAuthTypeWorkspaceConnectionProperties withTarget(String target) { super.withTarget(target); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ + @Override + public ManagedIdentityAuthTypeWorkspaceConnectionProperties withMetadata(Map metadata) { + super.withMetadata(metadata); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedIdentityAuthTypeWorkspaceConnectionProperties withSharedUserList(List sharedUserList) { + super.withSharedUserList(sharedUserList); + return this; + } + + /** + * {@inheritDoc} + */ @Override public ManagedIdentityAuthTypeWorkspaceConnectionProperties withValue(String value) { super.withValue(value); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ManagedIdentityAuthTypeWorkspaceConnectionProperties withValueFormat(ValueFormat valueFormat) { super.withValueFormat(valueFormat); @@ -75,7 +171,7 @@ public ManagedIdentityAuthTypeWorkspaceConnectionProperties withValueFormat(Valu /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -85,4 +181,85 @@ public void validate() { credentials().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", category() == null ? null : category().toString()); + jsonWriter.writeStringField("expiryTime", + expiryTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expiryTime())); + jsonWriter.writeBooleanField("isSharedToAll", isSharedToAll()); + jsonWriter.writeStringField("target", target()); + jsonWriter.writeMapField("metadata", metadata(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("sharedUserList", sharedUserList(), + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("value", value()); + jsonWriter.writeStringField("valueFormat", valueFormat() == null ? null : valueFormat().toString()); + jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); + jsonWriter.writeJsonField("credentials", this.credentials); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedIdentityAuthTypeWorkspaceConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedIdentityAuthTypeWorkspaceConnectionProperties if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedIdentityAuthTypeWorkspaceConnectionProperties. + */ + public static ManagedIdentityAuthTypeWorkspaceConnectionProperties fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ManagedIdentityAuthTypeWorkspaceConnectionProperties deserializedManagedIdentityAuthTypeWorkspaceConnectionProperties + = new ManagedIdentityAuthTypeWorkspaceConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedManagedIdentityAuthTypeWorkspaceConnectionProperties + .withCategory(ConnectionCategory.fromString(reader.getString())); + } else if ("createdByWorkspaceArmId".equals(fieldName)) { + deserializedManagedIdentityAuthTypeWorkspaceConnectionProperties.createdByWorkspaceArmId + = reader.getString(); + } else if ("expiryTime".equals(fieldName)) { + deserializedManagedIdentityAuthTypeWorkspaceConnectionProperties.withExpiryTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("group".equals(fieldName)) { + deserializedManagedIdentityAuthTypeWorkspaceConnectionProperties.group + = ConnectionGroup.fromString(reader.getString()); + } else if ("isSharedToAll".equals(fieldName)) { + deserializedManagedIdentityAuthTypeWorkspaceConnectionProperties + .withIsSharedToAll(reader.getNullable(JsonReader::getBoolean)); + } else if ("target".equals(fieldName)) { + deserializedManagedIdentityAuthTypeWorkspaceConnectionProperties.withTarget(reader.getString()); + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedManagedIdentityAuthTypeWorkspaceConnectionProperties.withMetadata(metadata); + } else if ("sharedUserList".equals(fieldName)) { + List sharedUserList = reader.readArray(reader1 -> reader1.getString()); + deserializedManagedIdentityAuthTypeWorkspaceConnectionProperties.withSharedUserList(sharedUserList); + } else if ("value".equals(fieldName)) { + deserializedManagedIdentityAuthTypeWorkspaceConnectionProperties.withValue(reader.getString()); + } else if ("valueFormat".equals(fieldName)) { + deserializedManagedIdentityAuthTypeWorkspaceConnectionProperties + .withValueFormat(ValueFormat.fromString(reader.getString())); + } else if ("authType".equals(fieldName)) { + deserializedManagedIdentityAuthTypeWorkspaceConnectionProperties.authType + = ConnectionAuthType.fromString(reader.getString()); + } else if ("credentials".equals(fieldName)) { + deserializedManagedIdentityAuthTypeWorkspaceConnectionProperties.credentials + = WorkspaceConnectionManagedIdentity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedIdentityAuthTypeWorkspaceConnectionProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedIdentityCredential.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedIdentityCredential.java new file mode 100644 index 0000000000000..4e45e6cdfa8db --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedIdentityCredential.java @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Credential for user managed identity. + */ +@Fluent +public final class ManagedIdentityCredential extends DataReferenceCredential { + /* + * [Required] Credential type used to authentication with storage. + */ + private DataReferenceCredentialType credentialType = DataReferenceCredentialType.MANAGED_IDENTITY; + + /* + * ManagedIdentityCredential identity type + */ + private String managedIdentityType; + + /* + * ClientId for the UAMI. For ManagedIdentityType = SystemManaged, this field is null. + */ + private String userManagedIdentityClientId; + + /* + * PrincipalId for the UAMI. For ManagedIdentityType = SystemManaged, this field is null. + */ + private String userManagedIdentityPrincipalId; + + /* + * Full arm scope for the Id. For ManagedIdentityType = SystemManaged, this field is null. + */ + private String userManagedIdentityResourceId; + + /* + * TenantId for the UAMI. For ManagedIdentityType = SystemManaged, this field is null. + */ + private String userManagedIdentityTenantId; + + /** + * Creates an instance of ManagedIdentityCredential class. + */ + public ManagedIdentityCredential() { + } + + /** + * Get the credentialType property: [Required] Credential type used to authentication with storage. + * + * @return the credentialType value. + */ + @Override + public DataReferenceCredentialType credentialType() { + return this.credentialType; + } + + /** + * Get the managedIdentityType property: ManagedIdentityCredential identity type. + * + * @return the managedIdentityType value. + */ + public String managedIdentityType() { + return this.managedIdentityType; + } + + /** + * Set the managedIdentityType property: ManagedIdentityCredential identity type. + * + * @param managedIdentityType the managedIdentityType value to set. + * @return the ManagedIdentityCredential object itself. + */ + public ManagedIdentityCredential withManagedIdentityType(String managedIdentityType) { + this.managedIdentityType = managedIdentityType; + return this; + } + + /** + * Get the userManagedIdentityClientId property: ClientId for the UAMI. For ManagedIdentityType = SystemManaged, + * this field is null. + * + * @return the userManagedIdentityClientId value. + */ + public String userManagedIdentityClientId() { + return this.userManagedIdentityClientId; + } + + /** + * Set the userManagedIdentityClientId property: ClientId for the UAMI. For ManagedIdentityType = SystemManaged, + * this field is null. + * + * @param userManagedIdentityClientId the userManagedIdentityClientId value to set. + * @return the ManagedIdentityCredential object itself. + */ + public ManagedIdentityCredential withUserManagedIdentityClientId(String userManagedIdentityClientId) { + this.userManagedIdentityClientId = userManagedIdentityClientId; + return this; + } + + /** + * Get the userManagedIdentityPrincipalId property: PrincipalId for the UAMI. For ManagedIdentityType = + * SystemManaged, this field is null. + * + * @return the userManagedIdentityPrincipalId value. + */ + public String userManagedIdentityPrincipalId() { + return this.userManagedIdentityPrincipalId; + } + + /** + * Set the userManagedIdentityPrincipalId property: PrincipalId for the UAMI. For ManagedIdentityType = + * SystemManaged, this field is null. + * + * @param userManagedIdentityPrincipalId the userManagedIdentityPrincipalId value to set. + * @return the ManagedIdentityCredential object itself. + */ + public ManagedIdentityCredential withUserManagedIdentityPrincipalId(String userManagedIdentityPrincipalId) { + this.userManagedIdentityPrincipalId = userManagedIdentityPrincipalId; + return this; + } + + /** + * Get the userManagedIdentityResourceId property: Full arm scope for the Id. For ManagedIdentityType = + * SystemManaged, this field is null. + * + * @return the userManagedIdentityResourceId value. + */ + public String userManagedIdentityResourceId() { + return this.userManagedIdentityResourceId; + } + + /** + * Set the userManagedIdentityResourceId property: Full arm scope for the Id. For ManagedIdentityType = + * SystemManaged, this field is null. + * + * @param userManagedIdentityResourceId the userManagedIdentityResourceId value to set. + * @return the ManagedIdentityCredential object itself. + */ + public ManagedIdentityCredential withUserManagedIdentityResourceId(String userManagedIdentityResourceId) { + this.userManagedIdentityResourceId = userManagedIdentityResourceId; + return this; + } + + /** + * Get the userManagedIdentityTenantId property: TenantId for the UAMI. For ManagedIdentityType = SystemManaged, + * this field is null. + * + * @return the userManagedIdentityTenantId value. + */ + public String userManagedIdentityTenantId() { + return this.userManagedIdentityTenantId; + } + + /** + * Set the userManagedIdentityTenantId property: TenantId for the UAMI. For ManagedIdentityType = SystemManaged, + * this field is null. + * + * @param userManagedIdentityTenantId the userManagedIdentityTenantId value to set. + * @return the ManagedIdentityCredential object itself. + */ + public ManagedIdentityCredential withUserManagedIdentityTenantId(String userManagedIdentityTenantId) { + this.userManagedIdentityTenantId = userManagedIdentityTenantId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("credentialType", + this.credentialType == null ? null : this.credentialType.toString()); + jsonWriter.writeStringField("managedIdentityType", this.managedIdentityType); + jsonWriter.writeStringField("userManagedIdentityClientId", this.userManagedIdentityClientId); + jsonWriter.writeStringField("userManagedIdentityPrincipalId", this.userManagedIdentityPrincipalId); + jsonWriter.writeStringField("userManagedIdentityResourceId", this.userManagedIdentityResourceId); + jsonWriter.writeStringField("userManagedIdentityTenantId", this.userManagedIdentityTenantId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedIdentityCredential from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedIdentityCredential if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedIdentityCredential. + */ + public static ManagedIdentityCredential fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedIdentityCredential deserializedManagedIdentityCredential = new ManagedIdentityCredential(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("credentialType".equals(fieldName)) { + deserializedManagedIdentityCredential.credentialType + = DataReferenceCredentialType.fromString(reader.getString()); + } else if ("managedIdentityType".equals(fieldName)) { + deserializedManagedIdentityCredential.managedIdentityType = reader.getString(); + } else if ("userManagedIdentityClientId".equals(fieldName)) { + deserializedManagedIdentityCredential.userManagedIdentityClientId = reader.getString(); + } else if ("userManagedIdentityPrincipalId".equals(fieldName)) { + deserializedManagedIdentityCredential.userManagedIdentityPrincipalId = reader.getString(); + } else if ("userManagedIdentityResourceId".equals(fieldName)) { + deserializedManagedIdentityCredential.userManagedIdentityResourceId = reader.getString(); + } else if ("userManagedIdentityTenantId".equals(fieldName)) { + deserializedManagedIdentityCredential.userManagedIdentityTenantId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedIdentityCredential; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedNetworkProvisionOptions.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedNetworkProvisionOptions.java new file mode 100644 index 0000000000000..387a884188564 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedNetworkProvisionOptions.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Managed Network Provisioning options for managed network of a machine learning workspace. + */ +@Fluent +public final class ManagedNetworkProvisionOptions implements JsonSerializable { + /* + * The includeSpark property. + */ + private Boolean includeSpark; + + /** + * Creates an instance of ManagedNetworkProvisionOptions class. + */ + public ManagedNetworkProvisionOptions() { + } + + /** + * Get the includeSpark property: The includeSpark property. + * + * @return the includeSpark value. + */ + public Boolean includeSpark() { + return this.includeSpark; + } + + /** + * Set the includeSpark property: The includeSpark property. + * + * @param includeSpark the includeSpark value to set. + * @return the ManagedNetworkProvisionOptions object itself. + */ + public ManagedNetworkProvisionOptions withIncludeSpark(Boolean includeSpark) { + this.includeSpark = includeSpark; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("includeSpark", this.includeSpark); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedNetworkProvisionOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedNetworkProvisionOptions if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedNetworkProvisionOptions. + */ + public static ManagedNetworkProvisionOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedNetworkProvisionOptions deserializedManagedNetworkProvisionOptions + = new ManagedNetworkProvisionOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("includeSpark".equals(fieldName)) { + deserializedManagedNetworkProvisionOptions.includeSpark + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedNetworkProvisionOptions; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedNetworkProvisionStatus.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedNetworkProvisionStatus.java new file mode 100644 index 0000000000000..0a0f251111775 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedNetworkProvisionStatus.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.resourcemanager.machinelearning.fluent.models.ManagedNetworkProvisionStatusInner; + +/** + * An immutable client-side representation of ManagedNetworkProvisionStatus. + */ +public interface ManagedNetworkProvisionStatus { + /** + * Gets the sparkReady property: The sparkReady property. + * + * @return the sparkReady value. + */ + Boolean sparkReady(); + + /** + * Gets the status property: Status for the managed network of a machine learning workspace. + * + * @return the status value. + */ + ManagedNetworkStatus status(); + + /** + * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.ManagedNetworkProvisionStatusInner object. + * + * @return the inner object. + */ + ManagedNetworkProvisionStatusInner innerModel(); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedNetworkProvisions.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedNetworkProvisions.java new file mode 100644 index 0000000000000..ec0e9d8318581 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedNetworkProvisions.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.Context; + +/** + * Resource collection API of ManagedNetworkProvisions. + */ +public interface ManagedNetworkProvisions { + /** + * Provisions the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of the Provisioning for the managed network of a machine learning workspace. + */ + ManagedNetworkProvisionStatus provisionManagedNetwork(String resourceGroupName, String workspaceName); + + /** + * Provisions the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param body Managed Network Provisioning Options for a machine learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of the Provisioning for the managed network of a machine learning workspace. + */ + ManagedNetworkProvisionStatus provisionManagedNetwork(String resourceGroupName, String workspaceName, + ManagedNetworkProvisionOptions body, Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedNetworkSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedNetworkSettings.java new file mode 100644 index 0000000000000..52447f06592b6 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedNetworkSettings.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.resourcemanager.machinelearning.fluent.models.ManagedNetworkSettingsInner; +import java.util.Map; + +/** + * An immutable client-side representation of ManagedNetworkSettings. + */ +public interface ManagedNetworkSettings { + /** + * Gets the isolationMode property: Isolation mode for the managed network of a machine learning workspace. + * + * @return the isolationMode value. + */ + IsolationMode isolationMode(); + + /** + * Gets the networkId property: The networkId property. + * + * @return the networkId value. + */ + String networkId(); + + /** + * Gets the outboundRules property: Dictionary of <OutboundRule>. + * + * @return the outboundRules value. + */ + Map outboundRules(); + + /** + * Gets the status property: Status of the Provisioning for the managed network of a machine learning workspace. + * + * @return the status value. + */ + ManagedNetworkProvisionStatus status(); + + /** + * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.ManagedNetworkSettingsInner object. + * + * @return the inner object. + */ + ManagedNetworkSettingsInner innerModel(); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedNetworkSettingsRules.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedNetworkSettingsRules.java new file mode 100644 index 0000000000000..56d61089d4ca5 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedNetworkSettingsRules.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ManagedNetworkSettingsRules. + */ +public interface ManagedNetworkSettingsRules { + /** + * Lists the managed network outbound rules for a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of outbound rules for the managed network of a machine learning workspace as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Lists the managed network outbound rules for a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of outbound rules for the managed network of a machine learning workspace as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, Context context); + + /** + * Deletes an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String ruleName); + + /** + * Deletes an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String ruleName, Context context); + + /** + * Gets an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an outbound rule from the managed network of a machine learning workspace along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, String ruleName, + Context context); + + /** + * Gets an outbound rule from the managed network of a machine learning workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param ruleName Name of the workspace managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an outbound rule from the managed network of a machine learning workspace. + */ + OutboundRuleBasicResource get(String resourceGroupName, String workspaceName, String ruleName); + + /** + * Gets an outbound rule from the managed network of a machine learning workspace. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an outbound rule from the managed network of a machine learning workspace along with {@link Response}. + */ + OutboundRuleBasicResource getById(String id); + + /** + * Gets an outbound rule from the managed network of a machine learning workspace. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an outbound rule from the managed network of a machine learning workspace along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an outbound rule from the managed network of a machine learning workspace. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes an outbound rule from the managed network of a machine learning workspace. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new OutboundRuleBasicResource resource. + * + * @param name resource name. + * @return the first stage of the new OutboundRuleBasicResource definition. + */ + OutboundRuleBasicResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedNetworkStatus.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedNetworkStatus.java new file mode 100644 index 0000000000000..ed7ff73885ae8 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedNetworkStatus.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Status for the managed network of a machine learning workspace. + */ +public final class ManagedNetworkStatus extends ExpandableStringEnum { + /** + * Static value Inactive for ManagedNetworkStatus. + */ + public static final ManagedNetworkStatus INACTIVE = fromString("Inactive"); + + /** + * Static value Active for ManagedNetworkStatus. + */ + public static final ManagedNetworkStatus ACTIVE = fromString("Active"); + + /** + * Creates a new instance of ManagedNetworkStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedNetworkStatus() { + } + + /** + * Creates or finds a ManagedNetworkStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedNetworkStatus. + */ + public static ManagedNetworkStatus fromString(String name) { + return fromString(name, ManagedNetworkStatus.class); + } + + /** + * Gets known ManagedNetworkStatus values. + * + * @return known ManagedNetworkStatus values. + */ + public static Collection values() { + return values(ManagedNetworkStatus.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedOnlineDeployment.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedOnlineDeployment.java index 41a6593e52d78..a54a1c3de62d2 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedOnlineDeployment.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedOnlineDeployment.java @@ -5,112 +5,183 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Properties specific to a ManagedOnlineDeployment. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "endpointComputeType") -@JsonTypeName("Managed") +/** + * Properties specific to a ManagedOnlineDeployment. + */ @Fluent public final class ManagedOnlineDeployment extends OnlineDeploymentProperties { - /** Creates an instance of ManagedOnlineDeployment class. */ + /* + * [Required] The compute type of the endpoint. + */ + private EndpointComputeType endpointComputeType = EndpointComputeType.MANAGED; + + /* + * Provisioning state for the endpoint deployment. + */ + private DeploymentProvisioningState provisioningState; + + /** + * Creates an instance of ManagedOnlineDeployment class. + */ public ManagedOnlineDeployment() { } - /** {@inheritDoc} */ + /** + * Get the endpointComputeType property: [Required] The compute type of the endpoint. + * + * @return the endpointComputeType value. + */ + @Override + public EndpointComputeType endpointComputeType() { + return this.endpointComputeType; + } + + /** + * Get the provisioningState property: Provisioning state for the endpoint deployment. + * + * @return the provisioningState value. + */ + @Override + public DeploymentProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ @Override public ManagedOnlineDeployment withAppInsightsEnabled(Boolean appInsightsEnabled) { super.withAppInsightsEnabled(appInsightsEnabled); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override - public ManagedOnlineDeployment withEgressPublicNetworkAccess( - EgressPublicNetworkAccessType egressPublicNetworkAccess) { + public ManagedOnlineDeployment withDataCollector(DataCollector dataCollector) { + super.withDataCollector(dataCollector); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedOnlineDeployment + withEgressPublicNetworkAccess(EgressPublicNetworkAccessType egressPublicNetworkAccess) { super.withEgressPublicNetworkAccess(egressPublicNetworkAccess); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ManagedOnlineDeployment withInstanceType(String instanceType) { super.withInstanceType(instanceType); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ManagedOnlineDeployment withLivenessProbe(ProbeSettings livenessProbe) { super.withLivenessProbe(livenessProbe); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ManagedOnlineDeployment withModel(String model) { super.withModel(model); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ManagedOnlineDeployment withModelMountPath(String modelMountPath) { super.withModelMountPath(modelMountPath); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ManagedOnlineDeployment withReadinessProbe(ProbeSettings readinessProbe) { super.withReadinessProbe(readinessProbe); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ManagedOnlineDeployment withRequestSettings(OnlineRequestSettings requestSettings) { super.withRequestSettings(requestSettings); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ManagedOnlineDeployment withScaleSettings(OnlineScaleSettings scaleSettings) { super.withScaleSettings(scaleSettings); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ManagedOnlineDeployment withCodeConfiguration(CodeConfiguration codeConfiguration) { super.withCodeConfiguration(codeConfiguration); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ManagedOnlineDeployment withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ManagedOnlineDeployment withEnvironmentId(String environmentId) { super.withEnvironmentId(environmentId); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ManagedOnlineDeployment withEnvironmentVariables(Map environmentVariables) { super.withEnvironmentVariables(environmentVariables); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ManagedOnlineDeployment withProperties(Map properties) { super.withProperties(properties); @@ -119,11 +190,103 @@ public ManagedOnlineDeployment withProperties(Map properties) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("codeConfiguration", codeConfiguration()); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("environmentId", environmentId()); + jsonWriter.writeMapField("environmentVariables", environmentVariables(), + (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("appInsightsEnabled", appInsightsEnabled()); + jsonWriter.writeJsonField("dataCollector", dataCollector()); + jsonWriter.writeStringField("egressPublicNetworkAccess", + egressPublicNetworkAccess() == null ? null : egressPublicNetworkAccess().toString()); + jsonWriter.writeStringField("instanceType", instanceType()); + jsonWriter.writeJsonField("livenessProbe", livenessProbe()); + jsonWriter.writeStringField("model", model()); + jsonWriter.writeStringField("modelMountPath", modelMountPath()); + jsonWriter.writeJsonField("readinessProbe", readinessProbe()); + jsonWriter.writeJsonField("requestSettings", requestSettings()); + jsonWriter.writeJsonField("scaleSettings", scaleSettings()); + jsonWriter.writeStringField("endpointComputeType", + this.endpointComputeType == null ? null : this.endpointComputeType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedOnlineDeployment from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedOnlineDeployment if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedOnlineDeployment. + */ + public static ManagedOnlineDeployment fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedOnlineDeployment deserializedManagedOnlineDeployment = new ManagedOnlineDeployment(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("codeConfiguration".equals(fieldName)) { + deserializedManagedOnlineDeployment.withCodeConfiguration(CodeConfiguration.fromJson(reader)); + } else if ("description".equals(fieldName)) { + deserializedManagedOnlineDeployment.withDescription(reader.getString()); + } else if ("environmentId".equals(fieldName)) { + deserializedManagedOnlineDeployment.withEnvironmentId(reader.getString()); + } else if ("environmentVariables".equals(fieldName)) { + Map environmentVariables = reader.readMap(reader1 -> reader1.getString()); + deserializedManagedOnlineDeployment.withEnvironmentVariables(environmentVariables); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedManagedOnlineDeployment.withProperties(properties); + } else if ("appInsightsEnabled".equals(fieldName)) { + deserializedManagedOnlineDeployment + .withAppInsightsEnabled(reader.getNullable(JsonReader::getBoolean)); + } else if ("dataCollector".equals(fieldName)) { + deserializedManagedOnlineDeployment.withDataCollector(DataCollector.fromJson(reader)); + } else if ("egressPublicNetworkAccess".equals(fieldName)) { + deserializedManagedOnlineDeployment + .withEgressPublicNetworkAccess(EgressPublicNetworkAccessType.fromString(reader.getString())); + } else if ("instanceType".equals(fieldName)) { + deserializedManagedOnlineDeployment.withInstanceType(reader.getString()); + } else if ("livenessProbe".equals(fieldName)) { + deserializedManagedOnlineDeployment.withLivenessProbe(ProbeSettings.fromJson(reader)); + } else if ("model".equals(fieldName)) { + deserializedManagedOnlineDeployment.withModel(reader.getString()); + } else if ("modelMountPath".equals(fieldName)) { + deserializedManagedOnlineDeployment.withModelMountPath(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedManagedOnlineDeployment.provisioningState + = DeploymentProvisioningState.fromString(reader.getString()); + } else if ("readinessProbe".equals(fieldName)) { + deserializedManagedOnlineDeployment.withReadinessProbe(ProbeSettings.fromJson(reader)); + } else if ("requestSettings".equals(fieldName)) { + deserializedManagedOnlineDeployment.withRequestSettings(OnlineRequestSettings.fromJson(reader)); + } else if ("scaleSettings".equals(fieldName)) { + deserializedManagedOnlineDeployment.withScaleSettings(OnlineScaleSettings.fromJson(reader)); + } else if ("endpointComputeType".equals(fieldName)) { + deserializedManagedOnlineDeployment.endpointComputeType + = EndpointComputeType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedOnlineDeployment; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedServiceIdentity.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedServiceIdentity.java index 3fc7e30e4fcc9..28cfe427d69f4 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedServiceIdentity.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedServiceIdentity.java @@ -6,72 +6,98 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; import java.util.UUID; -/** Managed service identity (system assigned and/or user assigned identities). */ +/** + * Managed service identity (system assigned and/or user assigned identities). + */ @Fluent -public class ManagedServiceIdentity { +public class ManagedServiceIdentity implements JsonSerializable { /* * The service principal ID of the system assigned identity. This property will only be provided for a system * assigned identity. */ - @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) private UUID principalId; /* * The tenant ID of the system assigned identity. This property will only be provided for a system assigned * identity. */ - @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) private UUID tenantId; /* * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). */ - @JsonProperty(value = "type", required = true) private ManagedServiceIdentityType type; /* - * 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. + * 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. */ - @JsonProperty(value = "userAssignedIdentities") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map userAssignedIdentities; - /** Creates an instance of ManagedServiceIdentity class. */ + /** + * Creates an instance of ManagedServiceIdentity class. + */ public ManagedServiceIdentity() { } /** * Get the principalId property: The service principal ID of the system assigned identity. This property will only * be provided for a system assigned identity. - * + * * @return the principalId value. */ public UUID principalId() { return this.principalId; } + /** + * Set the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @param principalId the principalId value to set. + * @return the ManagedServiceIdentity object itself. + */ + ManagedServiceIdentity withPrincipalId(UUID principalId) { + this.principalId = principalId; + return this; + } + /** * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for * a system assigned identity. - * + * * @return the tenantId value. */ public UUID tenantId() { return this.tenantId; } + /** + * Set the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @param tenantId the tenantId value to set. + * @return the ManagedServiceIdentity object itself. + */ + ManagedServiceIdentity withTenantId(UUID tenantId) { + this.tenantId = tenantId; + return this; + } + /** * Get the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are * allowed). - * + * * @return the type value. */ public ManagedServiceIdentityType type() { @@ -81,7 +107,7 @@ public ManagedServiceIdentityType type() { /** * Set the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are * allowed). - * + * * @param type the type value to set. * @return the ManagedServiceIdentity object itself. */ @@ -95,7 +121,7 @@ public ManagedServiceIdentity withType(ManagedServiceIdentityType type) { * 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. - * + * * @return the userAssignedIdentities value. */ public Map userAssignedIdentities() { @@ -107,7 +133,7 @@ public Map userAssignedIdentities() { * 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. - * + * * @param userAssignedIdentities the userAssignedIdentities value to set. * @return the ManagedServiceIdentity object itself. */ @@ -118,26 +144,71 @@ public ManagedServiceIdentity withUserAssignedIdentities(Map { - if (e != null) { - e.validate(); - } - }); + userAssignedIdentities().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); } } private static final ClientLogger LOGGER = new ClientLogger(ManagedServiceIdentity.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedServiceIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedServiceIdentity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedServiceIdentity. + */ + public static ManagedServiceIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedServiceIdentity deserializedManagedServiceIdentity = new ManagedServiceIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedManagedServiceIdentity.type = ManagedServiceIdentityType.fromString(reader.getString()); + } else if ("principalId".equals(fieldName)) { + deserializedManagedServiceIdentity.principalId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("tenantId".equals(fieldName)) { + deserializedManagedServiceIdentity.tenantId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); + deserializedManagedServiceIdentity.userAssignedIdentities = userAssignedIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedServiceIdentity; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedServiceIdentityType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedServiceIdentityType.java index b066c34ad136d..d848e98fabe15 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedServiceIdentityType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ManagedServiceIdentityType.java @@ -5,27 +5,36 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). */ +/** + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ public final class ManagedServiceIdentityType extends ExpandableStringEnum { - /** Static value None for ManagedServiceIdentityType. */ + /** + * Static value None for ManagedServiceIdentityType. + */ public static final ManagedServiceIdentityType NONE = fromString("None"); - /** Static value SystemAssigned for ManagedServiceIdentityType. */ + /** + * Static value SystemAssigned for ManagedServiceIdentityType. + */ public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); - /** Static value UserAssigned for ManagedServiceIdentityType. */ + /** + * Static value UserAssigned for ManagedServiceIdentityType. + */ public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); - /** Static value SystemAssigned,UserAssigned for ManagedServiceIdentityType. */ - public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED = - fromString("SystemAssigned,UserAssigned"); + /** + * Static value SystemAssigned,UserAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED + = fromString("SystemAssigned,UserAssigned"); /** * Creates a new instance of ManagedServiceIdentityType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -34,18 +43,17 @@ public ManagedServiceIdentityType() { /** * Creates or finds a ManagedServiceIdentityType from its string representation. - * + * * @param name a name to look for. * @return the corresponding ManagedServiceIdentityType. */ - @JsonCreator public static ManagedServiceIdentityType fromString(String name) { return fromString(name, ManagedServiceIdentityType.class); } /** * Gets known ManagedServiceIdentityType values. - * + * * @return known ManagedServiceIdentityType values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MarketplacePlan.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MarketplacePlan.java new file mode 100644 index 0000000000000..b9865ce75eda0 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MarketplacePlan.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The MarketplacePlan model. + */ +@Immutable +public final class MarketplacePlan implements JsonSerializable { + /* + * The identifying name of the Offer of the Marketplace Plan. + */ + private String offerId; + + /* + * The identifying name of the Plan of the Marketplace Plan. + */ + private String planId; + + /* + * The identifying name of the Publisher of the Marketplace Plan. + */ + private String publisherId; + + /** + * Creates an instance of MarketplacePlan class. + */ + public MarketplacePlan() { + } + + /** + * Get the offerId property: The identifying name of the Offer of the Marketplace Plan. + * + * @return the offerId value. + */ + public String offerId() { + return this.offerId; + } + + /** + * Get the planId property: The identifying name of the Plan of the Marketplace Plan. + * + * @return the planId value. + */ + public String planId() { + return this.planId; + } + + /** + * Get the publisherId property: The identifying name of the Publisher of the Marketplace Plan. + * + * @return the publisherId value. + */ + public String publisherId() { + return this.publisherId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MarketplacePlan from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MarketplacePlan if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MarketplacePlan. + */ + public static MarketplacePlan fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MarketplacePlan deserializedMarketplacePlan = new MarketplacePlan(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("offerId".equals(fieldName)) { + deserializedMarketplacePlan.offerId = reader.getString(); + } else if ("planId".equals(fieldName)) { + deserializedMarketplacePlan.planId = reader.getString(); + } else if ("publisherId".equals(fieldName)) { + deserializedMarketplacePlan.publisherId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMarketplacePlan; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MarketplaceSubscription.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MarketplaceSubscription.java new file mode 100644 index 0000000000000..6ce854789abeb --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MarketplaceSubscription.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.MarketplaceSubscriptionInner; + +/** + * An immutable client-side representation of MarketplaceSubscription. + */ +public interface MarketplaceSubscription { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: [Required] Additional attributes of the entity. + * + * @return the properties value. + */ + MarketplaceSubscriptionProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.MarketplaceSubscriptionInner object. + * + * @return the inner object. + */ + MarketplaceSubscriptionInner innerModel(); + + /** + * The entirety of the MarketplaceSubscription definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * The MarketplaceSubscription definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the MarketplaceSubscription definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the MarketplaceSubscription definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, workspaceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @return the next definition stage. + */ + WithProperties withExistingWorkspace(String resourceGroupName, String workspaceName); + } + + /** + * The stage of the MarketplaceSubscription definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: [Required] Additional attributes of the entity.. + * + * @param properties [Required] Additional attributes of the entity. + * @return the next definition stage. + */ + WithCreate withProperties(MarketplaceSubscriptionProperties properties); + } + + /** + * The stage of the MarketplaceSubscription definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate { + /** + * Executes the create request. + * + * @return the created resource. + */ + MarketplaceSubscription create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + MarketplaceSubscription create(Context context); + } + } + + /** + * Begins update for the MarketplaceSubscription resource. + * + * @return the stage of resource update. + */ + MarketplaceSubscription.Update update(); + + /** + * The template for MarketplaceSubscription update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + MarketplaceSubscription apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + MarketplaceSubscription apply(Context context); + } + + /** + * The MarketplaceSubscription update stages. + */ + interface UpdateStages { + /** + * The stage of the MarketplaceSubscription update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: [Required] Additional attributes of the entity.. + * + * @param properties [Required] Additional attributes of the entity. + * @return the next definition stage. + */ + Update withProperties(MarketplaceSubscriptionProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + MarketplaceSubscription refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + MarketplaceSubscription refresh(Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MarketplaceSubscriptionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MarketplaceSubscriptionProperties.java new file mode 100644 index 0000000000000..cd2c526afc59b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MarketplaceSubscriptionProperties.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The MarketplaceSubscriptionProperties model. + */ +@Fluent +public final class MarketplaceSubscriptionProperties implements JsonSerializable { + /* + * Marketplace Plan associated with the Marketplace Subscription. + */ + private MarketplacePlan marketplacePlan; + + /* + * Current status of the Marketplace Subscription. + */ + private MarketplaceSubscriptionStatus marketplaceSubscriptionStatus; + + /* + * [Required] Target Marketplace Model ID to create a Marketplace Subscription for. + */ + private String modelId; + + /* + * Provisioning State of the Marketplace Subscription. + */ + private MarketplaceSubscriptionProvisioningState provisioningState; + + /** + * Creates an instance of MarketplaceSubscriptionProperties class. + */ + public MarketplaceSubscriptionProperties() { + } + + /** + * Get the marketplacePlan property: Marketplace Plan associated with the Marketplace Subscription. + * + * @return the marketplacePlan value. + */ + public MarketplacePlan marketplacePlan() { + return this.marketplacePlan; + } + + /** + * Get the marketplaceSubscriptionStatus property: Current status of the Marketplace Subscription. + * + * @return the marketplaceSubscriptionStatus value. + */ + public MarketplaceSubscriptionStatus marketplaceSubscriptionStatus() { + return this.marketplaceSubscriptionStatus; + } + + /** + * Get the modelId property: [Required] Target Marketplace Model ID to create a Marketplace Subscription for. + * + * @return the modelId value. + */ + public String modelId() { + return this.modelId; + } + + /** + * Set the modelId property: [Required] Target Marketplace Model ID to create a Marketplace Subscription for. + * + * @param modelId the modelId value to set. + * @return the MarketplaceSubscriptionProperties object itself. + */ + public MarketplaceSubscriptionProperties withModelId(String modelId) { + this.modelId = modelId; + return this; + } + + /** + * Get the provisioningState property: Provisioning State of the Marketplace Subscription. + * + * @return the provisioningState value. + */ + public MarketplaceSubscriptionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (marketplacePlan() != null) { + marketplacePlan().validate(); + } + if (modelId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property modelId in model MarketplaceSubscriptionProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MarketplaceSubscriptionProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("modelId", this.modelId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MarketplaceSubscriptionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MarketplaceSubscriptionProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MarketplaceSubscriptionProperties. + */ + public static MarketplaceSubscriptionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MarketplaceSubscriptionProperties deserializedMarketplaceSubscriptionProperties + = new MarketplaceSubscriptionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("modelId".equals(fieldName)) { + deserializedMarketplaceSubscriptionProperties.modelId = reader.getString(); + } else if ("marketplacePlan".equals(fieldName)) { + deserializedMarketplaceSubscriptionProperties.marketplacePlan = MarketplacePlan.fromJson(reader); + } else if ("marketplaceSubscriptionStatus".equals(fieldName)) { + deserializedMarketplaceSubscriptionProperties.marketplaceSubscriptionStatus + = MarketplaceSubscriptionStatus.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedMarketplaceSubscriptionProperties.provisioningState + = MarketplaceSubscriptionProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMarketplaceSubscriptionProperties; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MarketplaceSubscriptionProvisioningState.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MarketplaceSubscriptionProvisioningState.java new file mode 100644 index 0000000000000..02e4f541478d8 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MarketplaceSubscriptionProvisioningState.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for MarketplaceSubscriptionProvisioningState. + */ +public final class MarketplaceSubscriptionProvisioningState + extends ExpandableStringEnum { + /** + * Static value Creating for MarketplaceSubscriptionProvisioningState. + */ + public static final MarketplaceSubscriptionProvisioningState CREATING = fromString("Creating"); + + /** + * Static value Deleting for MarketplaceSubscriptionProvisioningState. + */ + public static final MarketplaceSubscriptionProvisioningState DELETING = fromString("Deleting"); + + /** + * Static value Succeeded for MarketplaceSubscriptionProvisioningState. + */ + public static final MarketplaceSubscriptionProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for MarketplaceSubscriptionProvisioningState. + */ + public static final MarketplaceSubscriptionProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Updating for MarketplaceSubscriptionProvisioningState. + */ + public static final MarketplaceSubscriptionProvisioningState UPDATING = fromString("Updating"); + + /** + * Static value Canceled for MarketplaceSubscriptionProvisioningState. + */ + public static final MarketplaceSubscriptionProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of MarketplaceSubscriptionProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MarketplaceSubscriptionProvisioningState() { + } + + /** + * Creates or finds a MarketplaceSubscriptionProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding MarketplaceSubscriptionProvisioningState. + */ + public static MarketplaceSubscriptionProvisioningState fromString(String name) { + return fromString(name, MarketplaceSubscriptionProvisioningState.class); + } + + /** + * Gets known MarketplaceSubscriptionProvisioningState values. + * + * @return known MarketplaceSubscriptionProvisioningState values. + */ + public static Collection values() { + return values(MarketplaceSubscriptionProvisioningState.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MarketplaceSubscriptionResourceArmPaginatedResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MarketplaceSubscriptionResourceArmPaginatedResult.java new file mode 100644 index 0000000000000..1b3903fb7e228 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MarketplaceSubscriptionResourceArmPaginatedResult.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.machinelearning.fluent.models.MarketplaceSubscriptionInner; +import java.io.IOException; +import java.util.List; + +/** + * A paginated list of MarketplaceSubscription entities. + */ +@Fluent +public final class MarketplaceSubscriptionResourceArmPaginatedResult + implements JsonSerializable { + /* + * The link to the next page of MarketplaceSubscription objects. If null, there are no additional pages. + */ + private String nextLink; + + /* + * An array of objects of type MarketplaceSubscription. + */ + private List value; + + /** + * Creates an instance of MarketplaceSubscriptionResourceArmPaginatedResult class. + */ + public MarketplaceSubscriptionResourceArmPaginatedResult() { + } + + /** + * Get the nextLink property: The link to the next page of MarketplaceSubscription objects. If null, there are no + * additional pages. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of MarketplaceSubscription objects. If null, there are no + * additional pages. + * + * @param nextLink the nextLink value to set. + * @return the MarketplaceSubscriptionResourceArmPaginatedResult object itself. + */ + public MarketplaceSubscriptionResourceArmPaginatedResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: An array of objects of type MarketplaceSubscription. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of objects of type MarketplaceSubscription. + * + * @param value the value value to set. + * @return the MarketplaceSubscriptionResourceArmPaginatedResult object itself. + */ + public MarketplaceSubscriptionResourceArmPaginatedResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MarketplaceSubscriptionResourceArmPaginatedResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MarketplaceSubscriptionResourceArmPaginatedResult if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MarketplaceSubscriptionResourceArmPaginatedResult. + */ + public static MarketplaceSubscriptionResourceArmPaginatedResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MarketplaceSubscriptionResourceArmPaginatedResult deserializedMarketplaceSubscriptionResourceArmPaginatedResult + = new MarketplaceSubscriptionResourceArmPaginatedResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedMarketplaceSubscriptionResourceArmPaginatedResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> MarketplaceSubscriptionInner.fromJson(reader1)); + deserializedMarketplaceSubscriptionResourceArmPaginatedResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedMarketplaceSubscriptionResourceArmPaginatedResult; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MarketplaceSubscriptionStatus.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MarketplaceSubscriptionStatus.java new file mode 100644 index 0000000000000..b4b81c8b38757 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MarketplaceSubscriptionStatus.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for MarketplaceSubscriptionStatus. + */ +public final class MarketplaceSubscriptionStatus extends ExpandableStringEnum { + /** + * Static value Subscribed for MarketplaceSubscriptionStatus. + */ + public static final MarketplaceSubscriptionStatus SUBSCRIBED = fromString("Subscribed"); + + /** + * Static value Suspended for MarketplaceSubscriptionStatus. + */ + public static final MarketplaceSubscriptionStatus SUSPENDED = fromString("Suspended"); + + /** + * Static value Unsubscribed for MarketplaceSubscriptionStatus. + */ + public static final MarketplaceSubscriptionStatus UNSUBSCRIBED = fromString("Unsubscribed"); + + /** + * Creates a new instance of MarketplaceSubscriptionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MarketplaceSubscriptionStatus() { + } + + /** + * Creates or finds a MarketplaceSubscriptionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding MarketplaceSubscriptionStatus. + */ + public static MarketplaceSubscriptionStatus fromString(String name) { + return fromString(name, MarketplaceSubscriptionStatus.class); + } + + /** + * Gets known MarketplaceSubscriptionStatus values. + * + * @return known MarketplaceSubscriptionStatus values. + */ + public static Collection values() { + return values(MarketplaceSubscriptionStatus.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MarketplaceSubscriptions.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MarketplaceSubscriptions.java new file mode 100644 index 0000000000000..ef3e61d607736 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MarketplaceSubscriptions.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of MarketplaceSubscriptions. + */ +public interface MarketplaceSubscriptions { + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of MarketplaceSubscription entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of MarketplaceSubscription entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String skip, + Context context); + + /** + * Delete Marketplace Subscription (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Marketplace Subscription name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String name); + + /** + * Delete Marketplace Subscription (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Marketplace Subscription name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String name, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, String name, + Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container. + */ + MarketplaceSubscription get(String resourceGroupName, String workspaceName, String name); + + /** + * Get container. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + MarketplaceSubscription getById(String id); + + /** + * Get container. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete Marketplace Subscription (asynchronous). + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete Marketplace Subscription (asynchronous). + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new MarketplaceSubscription resource. + * + * @param name resource name. + * @return the first stage of the new MarketplaceSubscription definition. + */ + MarketplaceSubscription.DefinitionStages.Blank define(String name); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MaterializationComputeResource.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MaterializationComputeResource.java new file mode 100644 index 0000000000000..3ef07ac06f9dd --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MaterializationComputeResource.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * DTO object representing compute resource. + */ +@Fluent +public final class MaterializationComputeResource implements JsonSerializable { + /* + * Specifies the instance type + */ + private String instanceType; + + /** + * Creates an instance of MaterializationComputeResource class. + */ + public MaterializationComputeResource() { + } + + /** + * Get the instanceType property: Specifies the instance type. + * + * @return the instanceType value. + */ + public String instanceType() { + return this.instanceType; + } + + /** + * Set the instanceType property: Specifies the instance type. + * + * @param instanceType the instanceType value to set. + * @return the MaterializationComputeResource object itself. + */ + public MaterializationComputeResource withInstanceType(String instanceType) { + this.instanceType = instanceType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("instanceType", this.instanceType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MaterializationComputeResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MaterializationComputeResource if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MaterializationComputeResource. + */ + public static MaterializationComputeResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MaterializationComputeResource deserializedMaterializationComputeResource + = new MaterializationComputeResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("instanceType".equals(fieldName)) { + deserializedMaterializationComputeResource.instanceType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMaterializationComputeResource; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MaterializationSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MaterializationSettings.java new file mode 100644 index 0000000000000..3d1cc749a054e --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MaterializationSettings.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The MaterializationSettings model. + */ +@Fluent +public final class MaterializationSettings implements JsonSerializable { + /* + * Specifies the notification details + */ + private NotificationSetting notification; + + /* + * Specifies the compute resource settings + */ + private MaterializationComputeResource resource; + + /* + * Specifies the schedule details + */ + private RecurrenceTrigger schedule; + + /* + * Specifies the spark compute settings + */ + private Map sparkConfiguration; + + /* + * Specifies the stores to which materialization should happen + */ + private MaterializationStoreType storeType; + + /** + * Creates an instance of MaterializationSettings class. + */ + public MaterializationSettings() { + } + + /** + * Get the notification property: Specifies the notification details. + * + * @return the notification value. + */ + public NotificationSetting notification() { + return this.notification; + } + + /** + * Set the notification property: Specifies the notification details. + * + * @param notification the notification value to set. + * @return the MaterializationSettings object itself. + */ + public MaterializationSettings withNotification(NotificationSetting notification) { + this.notification = notification; + return this; + } + + /** + * Get the resource property: Specifies the compute resource settings. + * + * @return the resource value. + */ + public MaterializationComputeResource resource() { + return this.resource; + } + + /** + * Set the resource property: Specifies the compute resource settings. + * + * @param resource the resource value to set. + * @return the MaterializationSettings object itself. + */ + public MaterializationSettings withResource(MaterializationComputeResource resource) { + this.resource = resource; + return this; + } + + /** + * Get the schedule property: Specifies the schedule details. + * + * @return the schedule value. + */ + public RecurrenceTrigger schedule() { + return this.schedule; + } + + /** + * Set the schedule property: Specifies the schedule details. + * + * @param schedule the schedule value to set. + * @return the MaterializationSettings object itself. + */ + public MaterializationSettings withSchedule(RecurrenceTrigger schedule) { + this.schedule = schedule; + return this; + } + + /** + * Get the sparkConfiguration property: Specifies the spark compute settings. + * + * @return the sparkConfiguration value. + */ + public Map sparkConfiguration() { + return this.sparkConfiguration; + } + + /** + * Set the sparkConfiguration property: Specifies the spark compute settings. + * + * @param sparkConfiguration the sparkConfiguration value to set. + * @return the MaterializationSettings object itself. + */ + public MaterializationSettings withSparkConfiguration(Map sparkConfiguration) { + this.sparkConfiguration = sparkConfiguration; + return this; + } + + /** + * Get the storeType property: Specifies the stores to which materialization should happen. + * + * @return the storeType value. + */ + public MaterializationStoreType storeType() { + return this.storeType; + } + + /** + * Set the storeType property: Specifies the stores to which materialization should happen. + * + * @param storeType the storeType value to set. + * @return the MaterializationSettings object itself. + */ + public MaterializationSettings withStoreType(MaterializationStoreType storeType) { + this.storeType = storeType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (notification() != null) { + notification().validate(); + } + if (resource() != null) { + resource().validate(); + } + if (schedule() != null) { + schedule().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("notification", this.notification); + jsonWriter.writeJsonField("resource", this.resource); + jsonWriter.writeJsonField("schedule", this.schedule); + jsonWriter.writeMapField("sparkConfiguration", this.sparkConfiguration, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("storeType", this.storeType == null ? null : this.storeType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MaterializationSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MaterializationSettings if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the MaterializationSettings. + */ + public static MaterializationSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MaterializationSettings deserializedMaterializationSettings = new MaterializationSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("notification".equals(fieldName)) { + deserializedMaterializationSettings.notification = NotificationSetting.fromJson(reader); + } else if ("resource".equals(fieldName)) { + deserializedMaterializationSettings.resource = MaterializationComputeResource.fromJson(reader); + } else if ("schedule".equals(fieldName)) { + deserializedMaterializationSettings.schedule = RecurrenceTrigger.fromJson(reader); + } else if ("sparkConfiguration".equals(fieldName)) { + Map sparkConfiguration = reader.readMap(reader1 -> reader1.getString()); + deserializedMaterializationSettings.sparkConfiguration = sparkConfiguration; + } else if ("storeType".equals(fieldName)) { + deserializedMaterializationSettings.storeType + = MaterializationStoreType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMaterializationSettings; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MaterializationStoreType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MaterializationStoreType.java new file mode 100644 index 0000000000000..43f7debbfb3ec --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MaterializationStoreType.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for MaterializationStoreType. + */ +public final class MaterializationStoreType extends ExpandableStringEnum { + /** + * Static value None for MaterializationStoreType. + */ + public static final MaterializationStoreType NONE = fromString("None"); + + /** + * Static value Online for MaterializationStoreType. + */ + public static final MaterializationStoreType ONLINE = fromString("Online"); + + /** + * Static value Offline for MaterializationStoreType. + */ + public static final MaterializationStoreType OFFLINE = fromString("Offline"); + + /** + * Static value OnlineAndOffline for MaterializationStoreType. + */ + public static final MaterializationStoreType ONLINE_AND_OFFLINE = fromString("OnlineAndOffline"); + + /** + * Creates a new instance of MaterializationStoreType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MaterializationStoreType() { + } + + /** + * Creates or finds a MaterializationStoreType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MaterializationStoreType. + */ + public static MaterializationStoreType fromString(String name) { + return fromString(name, MaterializationStoreType.class); + } + + /** + * Gets known MaterializationStoreType values. + * + * @return known MaterializationStoreType values. + */ + public static Collection values() { + return values(MaterializationStoreType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MedianStoppingPolicy.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MedianStoppingPolicy.java index 786701cbc5483..0c70c5ec95de0 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MedianStoppingPolicy.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MedianStoppingPolicy.java @@ -5,26 +5,49 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Defines an early termination policy based on running averages of the primary metric of all runs. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "policyType") -@JsonTypeName("MedianStopping") +/** + * Defines an early termination policy based on running averages of the primary metric of all runs. + */ @Fluent public final class MedianStoppingPolicy extends EarlyTerminationPolicy { - /** Creates an instance of MedianStoppingPolicy class. */ + /* + * [Required] Name of policy configuration + */ + private EarlyTerminationPolicyType policyType = EarlyTerminationPolicyType.MEDIAN_STOPPING; + + /** + * Creates an instance of MedianStoppingPolicy class. + */ public MedianStoppingPolicy() { } - /** {@inheritDoc} */ + /** + * Get the policyType property: [Required] Name of policy configuration. + * + * @return the policyType value. + */ + @Override + public EarlyTerminationPolicyType policyType() { + return this.policyType; + } + + /** + * {@inheritDoc} + */ @Override public MedianStoppingPolicy withDelayEvaluation(Integer delayEvaluation) { super.withDelayEvaluation(delayEvaluation); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MedianStoppingPolicy withEvaluationInterval(Integer evaluationInterval) { super.withEvaluationInterval(evaluationInterval); @@ -33,11 +56,54 @@ public MedianStoppingPolicy withEvaluationInterval(Integer evaluationInterval) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("delayEvaluation", delayEvaluation()); + jsonWriter.writeNumberField("evaluationInterval", evaluationInterval()); + jsonWriter.writeStringField("policyType", this.policyType == null ? null : this.policyType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MedianStoppingPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MedianStoppingPolicy if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the MedianStoppingPolicy. + */ + public static MedianStoppingPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MedianStoppingPolicy deserializedMedianStoppingPolicy = new MedianStoppingPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("delayEvaluation".equals(fieldName)) { + deserializedMedianStoppingPolicy.withDelayEvaluation(reader.getNullable(JsonReader::getInt)); + } else if ("evaluationInterval".equals(fieldName)) { + deserializedMedianStoppingPolicy.withEvaluationInterval(reader.getNullable(JsonReader::getInt)); + } else if ("policyType".equals(fieldName)) { + deserializedMedianStoppingPolicy.policyType + = EarlyTerminationPolicyType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMedianStoppingPolicy; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelContainer.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelContainer.java index 0841f457eef91..d7c609b3de7f3 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelContainer.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelContainer.java @@ -8,90 +8,103 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.machinelearning.fluent.models.ModelContainerInner; -/** An immutable client-side representation of ModelContainer. */ +/** + * An immutable client-side representation of ModelContainer. + */ public interface ModelContainer { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the properties property: [Required] Additional attributes of the entity. - * + * * @return the properties value. */ ModelContainerProperties properties(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.ModelContainerInner object. - * + * * @return the inner object. */ ModelContainerInner innerModel(); - /** The entirety of the ModelContainer definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithParentResource, - DefinitionStages.WithProperties, - DefinitionStages.WithCreate { + /** + * The entirety of the ModelContainer definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, DefinitionStages.WithCreate { } - /** The ModelContainer definition stages. */ + + /** + * The ModelContainer definition stages. + */ interface DefinitionStages { - /** The first stage of the ModelContainer definition. */ + /** + * The first stage of the ModelContainer definition. + */ interface Blank extends WithParentResource { } - /** The stage of the ModelContainer definition allowing to specify parent resource. */ + + /** + * The stage of the ModelContainer definition allowing to specify parent resource. + */ interface WithParentResource { /** - * Specifies resourceGroupName, workspaceName. - * + * Specifies resourceGroupName, registryName. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. * @return the next definition stage. */ - WithProperties withExistingWorkspace(String resourceGroupName, String workspaceName); + WithProperties withExistingRegistry(String resourceGroupName, String registryName); } - /** The stage of the ModelContainer definition allowing to specify properties. */ + + /** + * The stage of the ModelContainer definition allowing to specify properties. + */ interface WithProperties { /** * Specifies the properties property: [Required] Additional attributes of the entity.. - * + * * @param properties [Required] Additional attributes of the entity. * @return the next definition stage. */ WithCreate withProperties(ModelContainerProperties properties); } + /** * The stage of the ModelContainer definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. @@ -99,67 +112,76 @@ interface WithProperties { interface WithCreate { /** * Executes the create request. - * + * * @return the created resource. */ ModelContainer create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ ModelContainer create(Context context); } } + /** * Begins update for the ModelContainer resource. - * + * * @return the stage of resource update. */ ModelContainer.Update update(); - /** The template for ModelContainer update. */ + /** + * The template for ModelContainer update. + */ interface Update extends UpdateStages.WithProperties { /** * Executes the update request. - * + * * @return the updated resource. */ ModelContainer apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ ModelContainer apply(Context context); } - /** The ModelContainer update stages. */ + + /** + * The ModelContainer update stages. + */ interface UpdateStages { - /** The stage of the ModelContainer update allowing to specify properties. */ + /** + * The stage of the ModelContainer update allowing to specify properties. + */ interface WithProperties { /** * Specifies the properties property: [Required] Additional attributes of the entity.. - * + * * @param properties [Required] Additional attributes of the entity. * @return the next definition stage. */ Update withProperties(ModelContainerProperties properties); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ ModelContainer refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelContainerProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelContainerProperties.java index aaf2c9cb402a9..a0960ce1cc2d4 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelContainerProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelContainerProperties.java @@ -5,37 +5,97 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** The ModelContainerProperties model. */ +/** + * The ModelContainerProperties model. + */ @Fluent public final class ModelContainerProperties extends AssetContainer { - /** Creates an instance of ModelContainerProperties class. */ + /* + * Provisioning state for the model container. + */ + private AssetProvisioningState provisioningState; + + /* + * The latest version inside this container. + */ + private String latestVersion; + + /* + * The next auto incremental version + */ + private String nextVersion; + + /** + * Creates an instance of ModelContainerProperties class. + */ public ModelContainerProperties() { } - /** {@inheritDoc} */ + /** + * Get the provisioningState property: Provisioning state for the model container. + * + * @return the provisioningState value. + */ + public AssetProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the latestVersion property: The latest version inside this container. + * + * @return the latestVersion value. + */ + @Override + public String latestVersion() { + return this.latestVersion; + } + + /** + * Get the nextVersion property: The next auto incremental version. + * + * @return the nextVersion value. + */ + @Override + public String nextVersion() { + return this.nextVersion; + } + + /** + * {@inheritDoc} + */ @Override public ModelContainerProperties withIsArchived(Boolean isArchived) { super.withIsArchived(isArchived); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ModelContainerProperties withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ModelContainerProperties withProperties(Map properties) { super.withProperties(properties); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ModelContainerProperties withTags(Map tags) { super.withTags(tags); @@ -44,11 +104,65 @@ public ModelContainerProperties withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("isArchived", isArchived()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ModelContainerProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ModelContainerProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ModelContainerProperties. + */ + public static ModelContainerProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ModelContainerProperties deserializedModelContainerProperties = new ModelContainerProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedModelContainerProperties.withDescription(reader.getString()); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedModelContainerProperties.withProperties(properties); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedModelContainerProperties.withTags(tags); + } else if ("isArchived".equals(fieldName)) { + deserializedModelContainerProperties.withIsArchived(reader.getNullable(JsonReader::getBoolean)); + } else if ("latestVersion".equals(fieldName)) { + deserializedModelContainerProperties.latestVersion = reader.getString(); + } else if ("nextVersion".equals(fieldName)) { + deserializedModelContainerProperties.nextVersion = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedModelContainerProperties.provisioningState + = AssetProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedModelContainerProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelContainerResourceArmPaginatedResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelContainerResourceArmPaginatedResult.java index cccb640d70baa..c35292b3cec13 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelContainerResourceArmPaginatedResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelContainerResourceArmPaginatedResult.java @@ -5,33 +5,40 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.fluent.models.ModelContainerInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** A paginated list of ModelContainer entities. */ +/** + * A paginated list of ModelContainer entities. + */ @Fluent -public final class ModelContainerResourceArmPaginatedResult { +public final class ModelContainerResourceArmPaginatedResult + implements JsonSerializable { /* * The link to the next page of ModelContainer objects. If null, there are no additional pages. */ - @JsonProperty(value = "nextLink") private String nextLink; /* * An array of objects of type ModelContainer. */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of ModelContainerResourceArmPaginatedResult class. */ + /** + * Creates an instance of ModelContainerResourceArmPaginatedResult class. + */ public ModelContainerResourceArmPaginatedResult() { } /** * Get the nextLink property: The link to the next page of ModelContainer objects. If null, there are no additional * pages. - * + * * @return the nextLink value. */ public String nextLink() { @@ -41,7 +48,7 @@ public String nextLink() { /** * Set the nextLink property: The link to the next page of ModelContainer objects. If null, there are no additional * pages. - * + * * @param nextLink the nextLink value to set. * @return the ModelContainerResourceArmPaginatedResult object itself. */ @@ -52,7 +59,7 @@ public ModelContainerResourceArmPaginatedResult withNextLink(String nextLink) { /** * Get the value property: An array of objects of type ModelContainer. - * + * * @return the value value. */ public List value() { @@ -61,7 +68,7 @@ public List value() { /** * Set the value property: An array of objects of type ModelContainer. - * + * * @param value the value value to set. * @return the ModelContainerResourceArmPaginatedResult object itself. */ @@ -72,7 +79,7 @@ public ModelContainerResourceArmPaginatedResult withValue(List e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ModelContainerResourceArmPaginatedResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ModelContainerResourceArmPaginatedResult if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ModelContainerResourceArmPaginatedResult. + */ + public static ModelContainerResourceArmPaginatedResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ModelContainerResourceArmPaginatedResult deserializedModelContainerResourceArmPaginatedResult + = new ModelContainerResourceArmPaginatedResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedModelContainerResourceArmPaginatedResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ModelContainerInner.fromJson(reader1)); + deserializedModelContainerResourceArmPaginatedResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedModelContainerResourceArmPaginatedResult; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelContainers.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelContainers.java index e6173d6d334ed..5e556489395c8 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelContainers.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelContainers.java @@ -7,12 +7,15 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.ModelContainerInner; -/** Resource collection API of ModelContainers. */ +/** + * Resource collection API of ModelContainers. + */ public interface ModelContainers { /** * List model containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -24,7 +27,7 @@ public interface ModelContainers { /** * List model containers. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -36,17 +39,12 @@ public interface ModelContainers { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of ModelContainer entities as paginated response with {@link PagedIterable}. */ - PagedIterable list( - String resourceGroupName, - String workspaceName, - String skip, - Integer count, - ListViewType listViewType, - Context context); + PagedIterable list(String resourceGroupName, String workspaceName, String skip, Integer count, + ListViewType listViewType, Context context); /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -60,7 +58,7 @@ PagedIterable list( /** * Delete container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -72,7 +70,7 @@ PagedIterable list( /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -82,12 +80,12 @@ PagedIterable list( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return container along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String name, Context context); + Response getWithResponse(String resourceGroupName, String workspaceName, String name, + Context context); /** * Get container. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -99,55 +97,33 @@ Response getWithResponse( ModelContainer get(String resourceGroupName, String workspaceName, String name); /** - * Get container. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container along with {@link Response}. - */ - ModelContainer getById(String id); - - /** - * Get container. - * - * @param id the resource ID. + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container along with {@link Response}. + * @return azure Resource Manager resource envelope along with {@link Response}. */ - Response getByIdWithResponse(String id, Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, String name, + ModelContainerInner body, Context context); /** - * Delete container. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Delete container. - * - * @param id the resource ID. - * @param context The context to associate with this operation. + * Create or update container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param body Container entity to create or update. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new ModelContainer resource. - * - * @param name resource name. - * @return the first stage of the new ModelContainer definition. + * @return azure Resource Manager resource envelope. */ - ModelContainer.DefinitionStages.Blank define(String name); + ModelContainer createOrUpdate(String resourceGroupName, String workspaceName, String name, + ModelContainerInner body); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelProvider.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelProvider.java new file mode 100644 index 0000000000000..afde2dc830908 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelProvider.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum to determine the type of fine tuning. + */ +public final class ModelProvider extends ExpandableStringEnum { + /** + * Static value AzureOpenAI for ModelProvider. + */ + public static final ModelProvider AZURE_OPEN_AI = fromString("AzureOpenAI"); + + /** + * Static value Custom for ModelProvider. + */ + public static final ModelProvider CUSTOM = fromString("Custom"); + + /** + * Creates a new instance of ModelProvider value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ModelProvider() { + } + + /** + * Creates or finds a ModelProvider from its string representation. + * + * @param name a name to look for. + * @return the corresponding ModelProvider. + */ + public static ModelProvider fromString(String name) { + return fromString(name, ModelProvider.class); + } + + /** + * Gets known ModelProvider values. + * + * @return known ModelProvider values. + */ + public static Collection values() { + return values(ModelProvider.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelSettings.java new file mode 100644 index 0000000000000..c0dcb4fd0a3d3 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelSettings.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The ModelSettings model. + */ +@Fluent +public final class ModelSettings implements JsonSerializable { + /* + * The unique model identifier that this ServerlessEndpoint should provision. + */ + private String modelId; + + /** + * Creates an instance of ModelSettings class. + */ + public ModelSettings() { + } + + /** + * Get the modelId property: The unique model identifier that this ServerlessEndpoint should provision. + * + * @return the modelId value. + */ + public String modelId() { + return this.modelId; + } + + /** + * Set the modelId property: The unique model identifier that this ServerlessEndpoint should provision. + * + * @param modelId the modelId value to set. + * @return the ModelSettings object itself. + */ + public ModelSettings withModelId(String modelId) { + this.modelId = modelId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("modelId", this.modelId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ModelSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ModelSettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ModelSettings. + */ + public static ModelSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ModelSettings deserializedModelSettings = new ModelSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("modelId".equals(fieldName)) { + deserializedModelSettings.modelId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedModelSettings; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelSize.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelSize.java index 79c3c14802b88..c32502aa8bd1c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelSize.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelSize.java @@ -5,29 +5,40 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Image model size. */ +/** + * Image model size. + */ public final class ModelSize extends ExpandableStringEnum { - /** Static value None for ModelSize. */ + /** + * Static value None for ModelSize. + */ public static final ModelSize NONE = fromString("None"); - /** Static value Small for ModelSize. */ + /** + * Static value Small for ModelSize. + */ public static final ModelSize SMALL = fromString("Small"); - /** Static value Medium for ModelSize. */ + /** + * Static value Medium for ModelSize. + */ public static final ModelSize MEDIUM = fromString("Medium"); - /** Static value Large for ModelSize. */ + /** + * Static value Large for ModelSize. + */ public static final ModelSize LARGE = fromString("Large"); - /** Static value ExtraLarge for ModelSize. */ + /** + * Static value ExtraLarge for ModelSize. + */ public static final ModelSize EXTRA_LARGE = fromString("ExtraLarge"); /** * Creates a new instance of ModelSize value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -36,18 +47,17 @@ public ModelSize() { /** * Creates or finds a ModelSize from its string representation. - * + * * @param name a name to look for. * @return the corresponding ModelSize. */ - @JsonCreator public static ModelSize fromString(String name) { return fromString(name, ModelSize.class); } /** * Gets known ModelSize values. - * + * * @return known ModelSize values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelTaskType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelTaskType.java new file mode 100644 index 0000000000000..47f7534e2ebf9 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelTaskType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Model task type enum. + */ +public final class ModelTaskType extends ExpandableStringEnum { + /** + * Static value Classification for ModelTaskType. + */ + public static final ModelTaskType CLASSIFICATION = fromString("Classification"); + + /** + * Static value Regression for ModelTaskType. + */ + public static final ModelTaskType REGRESSION = fromString("Regression"); + + /** + * Creates a new instance of ModelTaskType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ModelTaskType() { + } + + /** + * Creates or finds a ModelTaskType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ModelTaskType. + */ + public static ModelTaskType fromString(String name) { + return fromString(name, ModelTaskType.class); + } + + /** + * Gets known ModelTaskType values. + * + * @return known ModelTaskType values. + */ + public static Collection values() { + return values(ModelTaskType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelVersion.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelVersion.java index 6d8d49f169842..d140ba8d4432a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelVersion.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelVersion.java @@ -4,95 +4,109 @@ package com.azure.resourcemanager.machinelearning.models; +import com.azure.core.http.rest.Response; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.machinelearning.fluent.models.ModelVersionInner; -/** An immutable client-side representation of ModelVersion. */ +/** + * An immutable client-side representation of ModelVersion. + */ public interface ModelVersion { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the properties property: [Required] Additional attributes of the entity. - * + * * @return the properties value. */ ModelVersionProperties properties(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.ModelVersionInner object. - * + * * @return the inner object. */ ModelVersionInner innerModel(); - /** The entirety of the ModelVersion definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithParentResource, - DefinitionStages.WithProperties, - DefinitionStages.WithCreate { + /** + * The entirety of the ModelVersion definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, DefinitionStages.WithCreate { } - /** The ModelVersion definition stages. */ + + /** + * The ModelVersion definition stages. + */ interface DefinitionStages { - /** The first stage of the ModelVersion definition. */ + /** + * The first stage of the ModelVersion definition. + */ interface Blank extends WithParentResource { } - /** The stage of the ModelVersion definition allowing to specify parent resource. */ + + /** + * The stage of the ModelVersion definition allowing to specify parent resource. + */ interface WithParentResource { /** - * Specifies resourceGroupName, workspaceName, name. - * + * Specifies resourceGroupName, registryName, modelName. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName Name of Azure Machine Learning workspace. - * @param name Container name. This is case-sensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. * @return the next definition stage. */ - WithProperties withExistingModel(String resourceGroupName, String workspaceName, String name); + WithProperties withExistingModel(String resourceGroupName, String registryName, String modelName); } - /** The stage of the ModelVersion definition allowing to specify properties. */ + + /** + * The stage of the ModelVersion definition allowing to specify properties. + */ interface WithProperties { /** * Specifies the properties property: [Required] Additional attributes of the entity.. - * + * * @param properties [Required] Additional attributes of the entity. * @return the next definition stage. */ WithCreate withProperties(ModelVersionProperties properties); } + /** * The stage of the ModelVersion definition which contains all the minimum required properties for the resource * to be created, but also allows for any other optional properties to be specified. @@ -100,69 +114,102 @@ interface WithProperties { interface WithCreate { /** * Executes the create request. - * + * * @return the created resource. */ ModelVersion create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ ModelVersion create(Context context); } } + /** * Begins update for the ModelVersion resource. - * + * * @return the stage of resource update. */ ModelVersion.Update update(); - /** The template for ModelVersion update. */ + /** + * The template for ModelVersion update. + */ interface Update extends UpdateStages.WithProperties { /** * Executes the update request. - * + * * @return the updated resource. */ ModelVersion apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ ModelVersion apply(Context context); } - /** The ModelVersion update stages. */ + + /** + * The ModelVersion update stages. + */ interface UpdateStages { - /** The stage of the ModelVersion update allowing to specify properties. */ + /** + * The stage of the ModelVersion update allowing to specify properties. + */ interface WithProperties { /** * Specifies the properties property: [Required] Additional attributes of the entity.. - * + * * @param properties [Required] Additional attributes of the entity. * @return the next definition stage. */ Update withProperties(ModelVersionProperties properties); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ ModelVersion refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ ModelVersion refresh(Context context); + + /** + * Generate a storage location and credential for the client to upload a model asset to. + * + * @param body Pending upload request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + Response createOrGetStartPendingUploadWithResponse(PendingUploadRequestDto body, + Context context); + + /** + * Generate a storage location and credential for the client to upload a model asset to. + * + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + PendingUploadResponseDto createOrGetStartPendingUpload(PendingUploadRequestDto body); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelVersionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelVersionProperties.java index 93b7cedb104b1..c026c512256a6 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelVersionProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelVersionProperties.java @@ -5,45 +5,56 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Model asset version details. */ +/** + * Model asset version details. + */ @Fluent public final class ModelVersionProperties extends AssetBase { /* * Mapping of model flavors to their properties. */ - @JsonProperty(value = "flavors") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map flavors; /* * Name of the training job which produced this model */ - @JsonProperty(value = "jobName") private String jobName; /* * The storage format for this entity. Used for NCD. */ - @JsonProperty(value = "modelType") private String modelType; /* * The URI path to the model contents. */ - @JsonProperty(value = "modelUri") private String modelUri; - /** Creates an instance of ModelVersionProperties class. */ + /* + * Provisioning state for the model version. + */ + private AssetProvisioningState provisioningState; + + /* + * Stage in the model lifecycle assigned to this model + */ + private String stage; + + /** + * Creates an instance of ModelVersionProperties class. + */ public ModelVersionProperties() { } /** * Get the flavors property: Mapping of model flavors to their properties. - * + * * @return the flavors value. */ public Map flavors() { @@ -52,7 +63,7 @@ public Map flavors() { /** * Set the flavors property: Mapping of model flavors to their properties. - * + * * @param flavors the flavors value to set. * @return the ModelVersionProperties object itself. */ @@ -63,7 +74,7 @@ public ModelVersionProperties withFlavors(Map flavors) { /** * Get the jobName property: Name of the training job which produced this model. - * + * * @return the jobName value. */ public String jobName() { @@ -72,7 +83,7 @@ public String jobName() { /** * Set the jobName property: Name of the training job which produced this model. - * + * * @param jobName the jobName value to set. * @return the ModelVersionProperties object itself. */ @@ -83,7 +94,7 @@ public ModelVersionProperties withJobName(String jobName) { /** * Get the modelType property: The storage format for this entity. Used for NCD. - * + * * @return the modelType value. */ public String modelType() { @@ -92,7 +103,7 @@ public String modelType() { /** * Set the modelType property: The storage format for this entity. Used for NCD. - * + * * @param modelType the modelType value to set. * @return the ModelVersionProperties object itself. */ @@ -103,7 +114,7 @@ public ModelVersionProperties withModelType(String modelType) { /** * Get the modelUri property: The URI path to the model contents. - * + * * @return the modelUri value. */ public String modelUri() { @@ -112,7 +123,7 @@ public String modelUri() { /** * Set the modelUri property: The URI path to the model contents. - * + * * @param modelUri the modelUri value to set. * @return the ModelVersionProperties object itself. */ @@ -121,35 +132,74 @@ public ModelVersionProperties withModelUri(String modelUri) { return this; } - /** {@inheritDoc} */ + /** + * Get the provisioningState property: Provisioning state for the model version. + * + * @return the provisioningState value. + */ + public AssetProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the stage property: Stage in the model lifecycle assigned to this model. + * + * @return the stage value. + */ + public String stage() { + return this.stage; + } + + /** + * Set the stage property: Stage in the model lifecycle assigned to this model. + * + * @param stage the stage value to set. + * @return the ModelVersionProperties object itself. + */ + public ModelVersionProperties withStage(String stage) { + this.stage = stage; + return this; + } + + /** + * {@inheritDoc} + */ @Override public ModelVersionProperties withIsAnonymous(Boolean isAnonymous) { super.withIsAnonymous(isAnonymous); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ModelVersionProperties withIsArchived(Boolean isArchived) { super.withIsArchived(isArchived); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ModelVersionProperties withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ModelVersionProperties withProperties(Map properties) { super.withProperties(properties); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ModelVersionProperties withTags(Map tags) { super.withTags(tags); @@ -158,21 +208,87 @@ public ModelVersionProperties withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (flavors() != null) { - flavors() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); + flavors().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("isAnonymous", isAnonymous()); + jsonWriter.writeBooleanField("isArchived", isArchived()); + jsonWriter.writeMapField("flavors", this.flavors, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("jobName", this.jobName); + jsonWriter.writeStringField("modelType", this.modelType); + jsonWriter.writeStringField("modelUri", this.modelUri); + jsonWriter.writeStringField("stage", this.stage); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ModelVersionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ModelVersionProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ModelVersionProperties. + */ + public static ModelVersionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ModelVersionProperties deserializedModelVersionProperties = new ModelVersionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedModelVersionProperties.withDescription(reader.getString()); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedModelVersionProperties.withProperties(properties); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedModelVersionProperties.withTags(tags); + } else if ("isAnonymous".equals(fieldName)) { + deserializedModelVersionProperties.withIsAnonymous(reader.getNullable(JsonReader::getBoolean)); + } else if ("isArchived".equals(fieldName)) { + deserializedModelVersionProperties.withIsArchived(reader.getNullable(JsonReader::getBoolean)); + } else if ("flavors".equals(fieldName)) { + Map flavors = reader.readMap(reader1 -> FlavorData.fromJson(reader1)); + deserializedModelVersionProperties.flavors = flavors; + } else if ("jobName".equals(fieldName)) { + deserializedModelVersionProperties.jobName = reader.getString(); + } else if ("modelType".equals(fieldName)) { + deserializedModelVersionProperties.modelType = reader.getString(); + } else if ("modelUri".equals(fieldName)) { + deserializedModelVersionProperties.modelUri = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedModelVersionProperties.provisioningState + = AssetProvisioningState.fromString(reader.getString()); + } else if ("stage".equals(fieldName)) { + deserializedModelVersionProperties.stage = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedModelVersionProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelVersionResourceArmPaginatedResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelVersionResourceArmPaginatedResult.java index c5a4f372df037..39d36440989ad 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelVersionResourceArmPaginatedResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelVersionResourceArmPaginatedResult.java @@ -5,33 +5,40 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.fluent.models.ModelVersionInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** A paginated list of ModelVersion entities. */ +/** + * A paginated list of ModelVersion entities. + */ @Fluent -public final class ModelVersionResourceArmPaginatedResult { +public final class ModelVersionResourceArmPaginatedResult + implements JsonSerializable { /* * The link to the next page of ModelVersion objects. If null, there are no additional pages. */ - @JsonProperty(value = "nextLink") private String nextLink; /* * An array of objects of type ModelVersion. */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of ModelVersionResourceArmPaginatedResult class. */ + /** + * Creates an instance of ModelVersionResourceArmPaginatedResult class. + */ public ModelVersionResourceArmPaginatedResult() { } /** * Get the nextLink property: The link to the next page of ModelVersion objects. If null, there are no additional * pages. - * + * * @return the nextLink value. */ public String nextLink() { @@ -41,7 +48,7 @@ public String nextLink() { /** * Set the nextLink property: The link to the next page of ModelVersion objects. If null, there are no additional * pages. - * + * * @param nextLink the nextLink value to set. * @return the ModelVersionResourceArmPaginatedResult object itself. */ @@ -52,7 +59,7 @@ public ModelVersionResourceArmPaginatedResult withNextLink(String nextLink) { /** * Get the value property: An array of objects of type ModelVersion. - * + * * @return the value value. */ public List value() { @@ -61,7 +68,7 @@ public List value() { /** * Set the value property: An array of objects of type ModelVersion. - * + * * @param value the value value to set. * @return the ModelVersionResourceArmPaginatedResult object itself. */ @@ -72,7 +79,7 @@ public ModelVersionResourceArmPaginatedResult withValue(List /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -80,4 +87,45 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ModelVersionResourceArmPaginatedResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ModelVersionResourceArmPaginatedResult if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ModelVersionResourceArmPaginatedResult. + */ + public static ModelVersionResourceArmPaginatedResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ModelVersionResourceArmPaginatedResult deserializedModelVersionResourceArmPaginatedResult + = new ModelVersionResourceArmPaginatedResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedModelVersionResourceArmPaginatedResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> ModelVersionInner.fromJson(reader1)); + deserializedModelVersionResourceArmPaginatedResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedModelVersionResourceArmPaginatedResult; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelVersions.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelVersions.java index 050389e0716e0..e743c3543651c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelVersions.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ModelVersions.java @@ -7,12 +7,15 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.ModelVersionInner; -/** Resource collection API of ModelVersions. */ +/** + * Resource collection API of ModelVersions. + */ public interface ModelVersions { /** * List model versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Model name. This is case-sensitive. @@ -25,7 +28,7 @@ public interface ModelVersions { /** * List model versions. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Model name. This is case-sensitive. @@ -45,25 +48,13 @@ public interface ModelVersions { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of ModelVersion entities as paginated response with {@link PagedIterable}. */ - PagedIterable list( - String resourceGroupName, - String workspaceName, - String name, - String skip, - String orderBy, - Integer top, - String version, - String description, - Integer offset, - String tags, - String properties, - String feed, - ListViewType listViewType, - Context context); + PagedIterable list(String resourceGroupName, String workspaceName, String name, String skip, + String orderBy, Integer top, String version, String description, Integer offset, String tags, String properties, + String feed, ListViewType listViewType, Context context); /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -74,12 +65,12 @@ PagedIterable list( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ - Response deleteWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context); + Response deleteWithResponse(String resourceGroupName, String workspaceName, String name, String version, + Context context); /** * Delete version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -92,7 +83,7 @@ Response deleteWithResponse( /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -103,12 +94,12 @@ Response deleteWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return version along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String name, String version, Context context); + Response getWithResponse(String resourceGroupName, String workspaceName, String name, String version, + Context context); /** * Get version. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Container name. This is case-sensitive. @@ -121,55 +112,65 @@ Response getWithResponse( ModelVersion get(String resourceGroupName, String workspaceName, String name, String version); /** - * Get version. - * - * @param id the resource ID. + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return version along with {@link Response}. + * @return azure Resource Manager resource envelope along with {@link Response}. */ - ModelVersion getById(String id); + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, String name, + String version, ModelVersionInner body, Context context); /** - * Get version. - * - * @param id the resource ID. - * @param context The context to associate with this operation. + * Create or update version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Version entity to create or update. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return version along with {@link Response}. + * @return azure Resource Manager resource envelope. */ - Response getByIdWithResponse(String id, Context context); + ModelVersion createOrUpdate(String resourceGroupName, String workspaceName, String name, String version, + ModelVersionInner body); /** - * Delete version. - * - * @param id the resource ID. + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void deleteById(String id); + void publish(String resourceGroupName, String workspaceName, String name, String version, DestinationAsset body); /** - * Delete version. - * - * @param id the resource ID. + * Publish version asset into registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Container name. + * @param version Version identifier. + * @param body Destination registry info. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new ModelVersion resource. - * - * @param name resource name. - * @return the first stage of the new ModelVersion definition. - */ - ModelVersion.DefinitionStages.Blank define(String name); + void publish(String resourceGroupName, String workspaceName, String name, String version, DestinationAsset body, + Context context); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorComputeConfigurationBase.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorComputeConfigurationBase.java new file mode 100644 index 0000000000000..bbf1d37b8c20c --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorComputeConfigurationBase.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Monitor compute configuration base definition. + */ +@Immutable +public class MonitorComputeConfigurationBase implements JsonSerializable { + /* + * [Required] Specifies the type of signal to monitor. + */ + private MonitorComputeType computeType = MonitorComputeType.fromString("MonitorComputeConfigurationBase"); + + /** + * Creates an instance of MonitorComputeConfigurationBase class. + */ + public MonitorComputeConfigurationBase() { + } + + /** + * Get the computeType property: [Required] Specifies the type of signal to monitor. + * + * @return the computeType value. + */ + public MonitorComputeType computeType() { + return this.computeType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("computeType", this.computeType == null ? null : this.computeType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MonitorComputeConfigurationBase from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MonitorComputeConfigurationBase if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MonitorComputeConfigurationBase. + */ + public static MonitorComputeConfigurationBase fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("computeType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("ServerlessSpark".equals(discriminatorValue)) { + return MonitorServerlessSparkCompute.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static MonitorComputeConfigurationBase fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MonitorComputeConfigurationBase deserializedMonitorComputeConfigurationBase + = new MonitorComputeConfigurationBase(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("computeType".equals(fieldName)) { + deserializedMonitorComputeConfigurationBase.computeType + = MonitorComputeType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMonitorComputeConfigurationBase; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorComputeIdentityBase.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorComputeIdentityBase.java new file mode 100644 index 0000000000000..2f4cdfb68eb16 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorComputeIdentityBase.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Monitor compute identity base definition. + */ +@Immutable +public class MonitorComputeIdentityBase implements JsonSerializable { + /* + * [Required] Specifies the type of identity to use within the monitoring jobs. + */ + private MonitorComputeIdentityType computeIdentityType + = MonitorComputeIdentityType.fromString("MonitorComputeIdentityBase"); + + /** + * Creates an instance of MonitorComputeIdentityBase class. + */ + public MonitorComputeIdentityBase() { + } + + /** + * Get the computeIdentityType property: [Required] Specifies the type of identity to use within the monitoring + * jobs. + * + * @return the computeIdentityType value. + */ + public MonitorComputeIdentityType computeIdentityType() { + return this.computeIdentityType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("computeIdentityType", + this.computeIdentityType == null ? null : this.computeIdentityType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MonitorComputeIdentityBase from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MonitorComputeIdentityBase if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MonitorComputeIdentityBase. + */ + public static MonitorComputeIdentityBase fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("computeIdentityType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("AmlToken".equals(discriminatorValue)) { + return AmlTokenComputeIdentity.fromJson(readerToUse.reset()); + } else if ("ManagedIdentity".equals(discriminatorValue)) { + return ManagedComputeIdentity.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static MonitorComputeIdentityBase fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MonitorComputeIdentityBase deserializedMonitorComputeIdentityBase = new MonitorComputeIdentityBase(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("computeIdentityType".equals(fieldName)) { + deserializedMonitorComputeIdentityBase.computeIdentityType + = MonitorComputeIdentityType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMonitorComputeIdentityBase; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorComputeIdentityType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorComputeIdentityType.java new file mode 100644 index 0000000000000..c13556b09de5a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorComputeIdentityType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Monitor compute identity type enum. + */ +public final class MonitorComputeIdentityType extends ExpandableStringEnum { + /** + * Static value AmlToken for MonitorComputeIdentityType. + */ + public static final MonitorComputeIdentityType AML_TOKEN = fromString("AmlToken"); + + /** + * Static value ManagedIdentity for MonitorComputeIdentityType. + */ + public static final MonitorComputeIdentityType MANAGED_IDENTITY = fromString("ManagedIdentity"); + + /** + * Creates a new instance of MonitorComputeIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MonitorComputeIdentityType() { + } + + /** + * Creates or finds a MonitorComputeIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MonitorComputeIdentityType. + */ + public static MonitorComputeIdentityType fromString(String name) { + return fromString(name, MonitorComputeIdentityType.class); + } + + /** + * Gets known MonitorComputeIdentityType values. + * + * @return known MonitorComputeIdentityType values. + */ + public static Collection values() { + return values(MonitorComputeIdentityType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorComputeType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorComputeType.java new file mode 100644 index 0000000000000..262241787ec43 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorComputeType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Monitor compute type enum. + */ +public final class MonitorComputeType extends ExpandableStringEnum { + /** + * Static value ServerlessSpark for MonitorComputeType. + */ + public static final MonitorComputeType SERVERLESS_SPARK = fromString("ServerlessSpark"); + + /** + * Creates a new instance of MonitorComputeType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MonitorComputeType() { + } + + /** + * Creates or finds a MonitorComputeType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MonitorComputeType. + */ + public static MonitorComputeType fromString(String name) { + return fromString(name, MonitorComputeType.class); + } + + /** + * Gets known MonitorComputeType values. + * + * @return known MonitorComputeType values. + */ + public static Collection values() { + return values(MonitorComputeType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorDefinition.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorDefinition.java new file mode 100644 index 0000000000000..b1d30e4170433 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorDefinition.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The MonitorDefinition model. + */ +@Fluent +public final class MonitorDefinition implements JsonSerializable { + /* + * The monitor's notification settings. + */ + private MonitorNotificationSettings alertNotificationSettings; + + /* + * [Required] The ARM resource ID of the compute resource to run the monitoring job on. + */ + private MonitorComputeConfigurationBase computeConfiguration; + + /* + * The entities targeted by the monitor. + */ + private MonitoringTarget monitoringTarget; + + /* + * [Required] The signals to monitor. + */ + private Map signals; + + /** + * Creates an instance of MonitorDefinition class. + */ + public MonitorDefinition() { + } + + /** + * Get the alertNotificationSettings property: The monitor's notification settings. + * + * @return the alertNotificationSettings value. + */ + public MonitorNotificationSettings alertNotificationSettings() { + return this.alertNotificationSettings; + } + + /** + * Set the alertNotificationSettings property: The monitor's notification settings. + * + * @param alertNotificationSettings the alertNotificationSettings value to set. + * @return the MonitorDefinition object itself. + */ + public MonitorDefinition withAlertNotificationSettings(MonitorNotificationSettings alertNotificationSettings) { + this.alertNotificationSettings = alertNotificationSettings; + return this; + } + + /** + * Get the computeConfiguration property: [Required] The ARM resource ID of the compute resource to run the + * monitoring job on. + * + * @return the computeConfiguration value. + */ + public MonitorComputeConfigurationBase computeConfiguration() { + return this.computeConfiguration; + } + + /** + * Set the computeConfiguration property: [Required] The ARM resource ID of the compute resource to run the + * monitoring job on. + * + * @param computeConfiguration the computeConfiguration value to set. + * @return the MonitorDefinition object itself. + */ + public MonitorDefinition withComputeConfiguration(MonitorComputeConfigurationBase computeConfiguration) { + this.computeConfiguration = computeConfiguration; + return this; + } + + /** + * Get the monitoringTarget property: The entities targeted by the monitor. + * + * @return the monitoringTarget value. + */ + public MonitoringTarget monitoringTarget() { + return this.monitoringTarget; + } + + /** + * Set the monitoringTarget property: The entities targeted by the monitor. + * + * @param monitoringTarget the monitoringTarget value to set. + * @return the MonitorDefinition object itself. + */ + public MonitorDefinition withMonitoringTarget(MonitoringTarget monitoringTarget) { + this.monitoringTarget = monitoringTarget; + return this; + } + + /** + * Get the signals property: [Required] The signals to monitor. + * + * @return the signals value. + */ + public Map signals() { + return this.signals; + } + + /** + * Set the signals property: [Required] The signals to monitor. + * + * @param signals the signals value to set. + * @return the MonitorDefinition object itself. + */ + public MonitorDefinition withSignals(Map signals) { + this.signals = signals; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (alertNotificationSettings() != null) { + alertNotificationSettings().validate(); + } + if (computeConfiguration() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property computeConfiguration in model MonitorDefinition")); + } else { + computeConfiguration().validate(); + } + if (monitoringTarget() != null) { + monitoringTarget().validate(); + } + if (signals() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property signals in model MonitorDefinition")); + } else { + signals().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MonitorDefinition.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("computeConfiguration", this.computeConfiguration); + jsonWriter.writeMapField("signals", this.signals, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("alertNotificationSettings", this.alertNotificationSettings); + jsonWriter.writeJsonField("monitoringTarget", this.monitoringTarget); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MonitorDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MonitorDefinition if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MonitorDefinition. + */ + public static MonitorDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MonitorDefinition deserializedMonitorDefinition = new MonitorDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("computeConfiguration".equals(fieldName)) { + deserializedMonitorDefinition.computeConfiguration + = MonitorComputeConfigurationBase.fromJson(reader); + } else if ("signals".equals(fieldName)) { + Map signals + = reader.readMap(reader1 -> MonitoringSignalBase.fromJson(reader1)); + deserializedMonitorDefinition.signals = signals; + } else if ("alertNotificationSettings".equals(fieldName)) { + deserializedMonitorDefinition.alertNotificationSettings + = MonitorNotificationSettings.fromJson(reader); + } else if ("monitoringTarget".equals(fieldName)) { + deserializedMonitorDefinition.monitoringTarget = MonitoringTarget.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMonitorDefinition; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorEmailNotificationSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorEmailNotificationSettings.java new file mode 100644 index 0000000000000..b9ae80c6d2b6c --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorEmailNotificationSettings.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The MonitorEmailNotificationSettings model. + */ +@Fluent +public final class MonitorEmailNotificationSettings implements JsonSerializable { + /* + * The email recipient list which has a limitation of 499 characters in total. + */ + private List emails; + + /** + * Creates an instance of MonitorEmailNotificationSettings class. + */ + public MonitorEmailNotificationSettings() { + } + + /** + * Get the emails property: The email recipient list which has a limitation of 499 characters in total. + * + * @return the emails value. + */ + public List emails() { + return this.emails; + } + + /** + * Set the emails property: The email recipient list which has a limitation of 499 characters in total. + * + * @param emails the emails value to set. + * @return the MonitorEmailNotificationSettings object itself. + */ + public MonitorEmailNotificationSettings withEmails(List emails) { + this.emails = emails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("emails", this.emails, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MonitorEmailNotificationSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MonitorEmailNotificationSettings if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MonitorEmailNotificationSettings. + */ + public static MonitorEmailNotificationSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MonitorEmailNotificationSettings deserializedMonitorEmailNotificationSettings + = new MonitorEmailNotificationSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("emails".equals(fieldName)) { + List emails = reader.readArray(reader1 -> reader1.getString()); + deserializedMonitorEmailNotificationSettings.emails = emails; + } else { + reader.skipChildren(); + } + } + + return deserializedMonitorEmailNotificationSettings; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorNotificationSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorNotificationSettings.java new file mode 100644 index 0000000000000..07d6891a98887 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorNotificationSettings.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The MonitorNotificationSettings model. + */ +@Fluent +public final class MonitorNotificationSettings implements JsonSerializable { + /* + * The AML notification email settings. + */ + private MonitorEmailNotificationSettings emailNotificationSettings; + + /** + * Creates an instance of MonitorNotificationSettings class. + */ + public MonitorNotificationSettings() { + } + + /** + * Get the emailNotificationSettings property: The AML notification email settings. + * + * @return the emailNotificationSettings value. + */ + public MonitorEmailNotificationSettings emailNotificationSettings() { + return this.emailNotificationSettings; + } + + /** + * Set the emailNotificationSettings property: The AML notification email settings. + * + * @param emailNotificationSettings the emailNotificationSettings value to set. + * @return the MonitorNotificationSettings object itself. + */ + public MonitorNotificationSettings + withEmailNotificationSettings(MonitorEmailNotificationSettings emailNotificationSettings) { + this.emailNotificationSettings = emailNotificationSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (emailNotificationSettings() != null) { + emailNotificationSettings().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("emailNotificationSettings", this.emailNotificationSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MonitorNotificationSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MonitorNotificationSettings if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MonitorNotificationSettings. + */ + public static MonitorNotificationSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MonitorNotificationSettings deserializedMonitorNotificationSettings = new MonitorNotificationSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("emailNotificationSettings".equals(fieldName)) { + deserializedMonitorNotificationSettings.emailNotificationSettings + = MonitorEmailNotificationSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMonitorNotificationSettings; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorServerlessSparkCompute.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorServerlessSparkCompute.java new file mode 100644 index 0000000000000..84973c6525064 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitorServerlessSparkCompute.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Monitor serverless spark compute definition. + */ +@Fluent +public final class MonitorServerlessSparkCompute extends MonitorComputeConfigurationBase { + /* + * [Required] Specifies the type of signal to monitor. + */ + private MonitorComputeType computeType = MonitorComputeType.SERVERLESS_SPARK; + + /* + * [Required] The identity scheme leveraged to by the spark jobs running on serverless Spark. + */ + private MonitorComputeIdentityBase computeIdentity; + + /* + * [Required] The instance type running the Spark job. + */ + private String instanceType; + + /* + * [Required] The Spark runtime version. + */ + private String runtimeVersion; + + /** + * Creates an instance of MonitorServerlessSparkCompute class. + */ + public MonitorServerlessSparkCompute() { + } + + /** + * Get the computeType property: [Required] Specifies the type of signal to monitor. + * + * @return the computeType value. + */ + @Override + public MonitorComputeType computeType() { + return this.computeType; + } + + /** + * Get the computeIdentity property: [Required] The identity scheme leveraged to by the spark jobs running on + * serverless Spark. + * + * @return the computeIdentity value. + */ + public MonitorComputeIdentityBase computeIdentity() { + return this.computeIdentity; + } + + /** + * Set the computeIdentity property: [Required] The identity scheme leveraged to by the spark jobs running on + * serverless Spark. + * + * @param computeIdentity the computeIdentity value to set. + * @return the MonitorServerlessSparkCompute object itself. + */ + public MonitorServerlessSparkCompute withComputeIdentity(MonitorComputeIdentityBase computeIdentity) { + this.computeIdentity = computeIdentity; + return this; + } + + /** + * Get the instanceType property: [Required] The instance type running the Spark job. + * + * @return the instanceType value. + */ + public String instanceType() { + return this.instanceType; + } + + /** + * Set the instanceType property: [Required] The instance type running the Spark job. + * + * @param instanceType the instanceType value to set. + * @return the MonitorServerlessSparkCompute object itself. + */ + public MonitorServerlessSparkCompute withInstanceType(String instanceType) { + this.instanceType = instanceType; + return this; + } + + /** + * Get the runtimeVersion property: [Required] The Spark runtime version. + * + * @return the runtimeVersion value. + */ + public String runtimeVersion() { + return this.runtimeVersion; + } + + /** + * Set the runtimeVersion property: [Required] The Spark runtime version. + * + * @param runtimeVersion the runtimeVersion value to set. + * @return the MonitorServerlessSparkCompute object itself. + */ + public MonitorServerlessSparkCompute withRuntimeVersion(String runtimeVersion) { + this.runtimeVersion = runtimeVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (computeIdentity() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property computeIdentity in model MonitorServerlessSparkCompute")); + } else { + computeIdentity().validate(); + } + if (instanceType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property instanceType in model MonitorServerlessSparkCompute")); + } + if (runtimeVersion() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property runtimeVersion in model MonitorServerlessSparkCompute")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MonitorServerlessSparkCompute.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("computeIdentity", this.computeIdentity); + jsonWriter.writeStringField("instanceType", this.instanceType); + jsonWriter.writeStringField("runtimeVersion", this.runtimeVersion); + jsonWriter.writeStringField("computeType", this.computeType == null ? null : this.computeType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MonitorServerlessSparkCompute from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MonitorServerlessSparkCompute if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MonitorServerlessSparkCompute. + */ + public static MonitorServerlessSparkCompute fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MonitorServerlessSparkCompute deserializedMonitorServerlessSparkCompute + = new MonitorServerlessSparkCompute(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("computeIdentity".equals(fieldName)) { + deserializedMonitorServerlessSparkCompute.computeIdentity + = MonitorComputeIdentityBase.fromJson(reader); + } else if ("instanceType".equals(fieldName)) { + deserializedMonitorServerlessSparkCompute.instanceType = reader.getString(); + } else if ("runtimeVersion".equals(fieldName)) { + deserializedMonitorServerlessSparkCompute.runtimeVersion = reader.getString(); + } else if ("computeType".equals(fieldName)) { + deserializedMonitorServerlessSparkCompute.computeType + = MonitorComputeType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMonitorServerlessSparkCompute; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringFeatureDataType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringFeatureDataType.java new file mode 100644 index 0000000000000..a3ded87dc7d2a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringFeatureDataType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for MonitoringFeatureDataType. + */ +public final class MonitoringFeatureDataType extends ExpandableStringEnum { + /** + * Static value Numerical for MonitoringFeatureDataType. + */ + public static final MonitoringFeatureDataType NUMERICAL = fromString("Numerical"); + + /** + * Static value Categorical for MonitoringFeatureDataType. + */ + public static final MonitoringFeatureDataType CATEGORICAL = fromString("Categorical"); + + /** + * Creates a new instance of MonitoringFeatureDataType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MonitoringFeatureDataType() { + } + + /** + * Creates or finds a MonitoringFeatureDataType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MonitoringFeatureDataType. + */ + public static MonitoringFeatureDataType fromString(String name) { + return fromString(name, MonitoringFeatureDataType.class); + } + + /** + * Gets known MonitoringFeatureDataType values. + * + * @return known MonitoringFeatureDataType values. + */ + public static Collection values() { + return values(MonitoringFeatureDataType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringFeatureFilterBase.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringFeatureFilterBase.java new file mode 100644 index 0000000000000..e4d0e269413a4 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringFeatureFilterBase.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The MonitoringFeatureFilterBase model. + */ +@Immutable +public class MonitoringFeatureFilterBase implements JsonSerializable { + /* + * [Required] Specifies the feature filter to leverage when selecting features to calculate metrics over. + */ + private MonitoringFeatureFilterType filterType + = MonitoringFeatureFilterType.fromString("MonitoringFeatureFilterBase"); + + /** + * Creates an instance of MonitoringFeatureFilterBase class. + */ + public MonitoringFeatureFilterBase() { + } + + /** + * Get the filterType property: [Required] Specifies the feature filter to leverage when selecting features to + * calculate metrics over. + * + * @return the filterType value. + */ + public MonitoringFeatureFilterType filterType() { + return this.filterType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("filterType", this.filterType == null ? null : this.filterType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MonitoringFeatureFilterBase from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MonitoringFeatureFilterBase if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MonitoringFeatureFilterBase. + */ + public static MonitoringFeatureFilterBase fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("filterType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("AllFeatures".equals(discriminatorValue)) { + return AllFeatures.fromJson(readerToUse.reset()); + } else if ("FeatureSubset".equals(discriminatorValue)) { + return FeatureSubset.fromJson(readerToUse.reset()); + } else if ("TopNByAttribution".equals(discriminatorValue)) { + return TopNFeaturesByAttribution.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static MonitoringFeatureFilterBase fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MonitoringFeatureFilterBase deserializedMonitoringFeatureFilterBase = new MonitoringFeatureFilterBase(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("filterType".equals(fieldName)) { + deserializedMonitoringFeatureFilterBase.filterType + = MonitoringFeatureFilterType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMonitoringFeatureFilterBase; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringFeatureFilterType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringFeatureFilterType.java new file mode 100644 index 0000000000000..15011a097b47a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringFeatureFilterType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for MonitoringFeatureFilterType. + */ +public final class MonitoringFeatureFilterType extends ExpandableStringEnum { + /** + * Static value AllFeatures for MonitoringFeatureFilterType. + */ + public static final MonitoringFeatureFilterType ALL_FEATURES = fromString("AllFeatures"); + + /** + * Static value TopNByAttribution for MonitoringFeatureFilterType. + */ + public static final MonitoringFeatureFilterType TOP_NBY_ATTRIBUTION = fromString("TopNByAttribution"); + + /** + * Static value FeatureSubset for MonitoringFeatureFilterType. + */ + public static final MonitoringFeatureFilterType FEATURE_SUBSET = fromString("FeatureSubset"); + + /** + * Creates a new instance of MonitoringFeatureFilterType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MonitoringFeatureFilterType() { + } + + /** + * Creates or finds a MonitoringFeatureFilterType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MonitoringFeatureFilterType. + */ + public static MonitoringFeatureFilterType fromString(String name) { + return fromString(name, MonitoringFeatureFilterType.class); + } + + /** + * Gets known MonitoringFeatureFilterType values. + * + * @return known MonitoringFeatureFilterType values. + */ + public static Collection values() { + return values(MonitoringFeatureFilterType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringInputDataBase.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringInputDataBase.java new file mode 100644 index 0000000000000..89a21ca045f4a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringInputDataBase.java @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Monitoring input data base definition. + */ +@Fluent +public class MonitoringInputDataBase implements JsonSerializable { + /* + * [Required] Specifies the type of signal to monitor. + */ + private MonitoringInputDataType inputDataType = MonitoringInputDataType.fromString("MonitoringInputDataBase"); + + /* + * Mapping of column names to special uses. + */ + private Map columns; + + /* + * The context metadata of the data source. + */ + private String dataContext; + + /* + * [Required] Specifies the type of job. + */ + private JobInputType jobInputType; + + /* + * [Required] Input Asset URI. + */ + private String uri; + + /** + * Creates an instance of MonitoringInputDataBase class. + */ + public MonitoringInputDataBase() { + } + + /** + * Get the inputDataType property: [Required] Specifies the type of signal to monitor. + * + * @return the inputDataType value. + */ + public MonitoringInputDataType inputDataType() { + return this.inputDataType; + } + + /** + * Get the columns property: Mapping of column names to special uses. + * + * @return the columns value. + */ + public Map columns() { + return this.columns; + } + + /** + * Set the columns property: Mapping of column names to special uses. + * + * @param columns the columns value to set. + * @return the MonitoringInputDataBase object itself. + */ + public MonitoringInputDataBase withColumns(Map columns) { + this.columns = columns; + return this; + } + + /** + * Get the dataContext property: The context metadata of the data source. + * + * @return the dataContext value. + */ + public String dataContext() { + return this.dataContext; + } + + /** + * Set the dataContext property: The context metadata of the data source. + * + * @param dataContext the dataContext value to set. + * @return the MonitoringInputDataBase object itself. + */ + public MonitoringInputDataBase withDataContext(String dataContext) { + this.dataContext = dataContext; + return this; + } + + /** + * Get the jobInputType property: [Required] Specifies the type of job. + * + * @return the jobInputType value. + */ + public JobInputType jobInputType() { + return this.jobInputType; + } + + /** + * Set the jobInputType property: [Required] Specifies the type of job. + * + * @param jobInputType the jobInputType value to set. + * @return the MonitoringInputDataBase object itself. + */ + public MonitoringInputDataBase withJobInputType(JobInputType jobInputType) { + this.jobInputType = jobInputType; + return this; + } + + /** + * Get the uri property: [Required] Input Asset URI. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri property: [Required] Input Asset URI. + * + * @param uri the uri value to set. + * @return the MonitoringInputDataBase object itself. + */ + public MonitoringInputDataBase withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (jobInputType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property jobInputType in model MonitoringInputDataBase")); + } + if (uri() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property uri in model MonitoringInputDataBase")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MonitoringInputDataBase.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("jobInputType", this.jobInputType == null ? null : this.jobInputType.toString()); + jsonWriter.writeStringField("uri", this.uri); + jsonWriter.writeStringField("inputDataType", this.inputDataType == null ? null : this.inputDataType.toString()); + jsonWriter.writeMapField("columns", this.columns, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("dataContext", this.dataContext); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MonitoringInputDataBase from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MonitoringInputDataBase if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MonitoringInputDataBase. + */ + public static MonitoringInputDataBase fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("inputDataType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Fixed".equals(discriminatorValue)) { + return FixedInputData.fromJson(readerToUse.reset()); + } else if ("Rolling".equals(discriminatorValue)) { + return RollingInputData.fromJson(readerToUse.reset()); + } else if ("Static".equals(discriminatorValue)) { + return StaticInputData.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static MonitoringInputDataBase fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MonitoringInputDataBase deserializedMonitoringInputDataBase = new MonitoringInputDataBase(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("jobInputType".equals(fieldName)) { + deserializedMonitoringInputDataBase.jobInputType = JobInputType.fromString(reader.getString()); + } else if ("uri".equals(fieldName)) { + deserializedMonitoringInputDataBase.uri = reader.getString(); + } else if ("inputDataType".equals(fieldName)) { + deserializedMonitoringInputDataBase.inputDataType + = MonitoringInputDataType.fromString(reader.getString()); + } else if ("columns".equals(fieldName)) { + Map columns = reader.readMap(reader1 -> reader1.getString()); + deserializedMonitoringInputDataBase.columns = columns; + } else if ("dataContext".equals(fieldName)) { + deserializedMonitoringInputDataBase.dataContext = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMonitoringInputDataBase; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringInputDataType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringInputDataType.java new file mode 100644 index 0000000000000..9e27f332f8b42 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringInputDataType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Monitoring input data type enum. + */ +public final class MonitoringInputDataType extends ExpandableStringEnum { + /** + * Static value Static for MonitoringInputDataType. + */ + public static final MonitoringInputDataType STATIC = fromString("Static"); + + /** + * Static value Rolling for MonitoringInputDataType. + */ + public static final MonitoringInputDataType ROLLING = fromString("Rolling"); + + /** + * Static value Fixed for MonitoringInputDataType. + */ + public static final MonitoringInputDataType FIXED = fromString("Fixed"); + + /** + * Creates a new instance of MonitoringInputDataType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MonitoringInputDataType() { + } + + /** + * Creates or finds a MonitoringInputDataType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MonitoringInputDataType. + */ + public static MonitoringInputDataType fromString(String name) { + return fromString(name, MonitoringInputDataType.class); + } + + /** + * Gets known MonitoringInputDataType values. + * + * @return known MonitoringInputDataType values. + */ + public static Collection values() { + return values(MonitoringInputDataType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringNotificationType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringNotificationType.java new file mode 100644 index 0000000000000..d6b6b8fa7e011 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringNotificationType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for MonitoringNotificationType. + */ +public final class MonitoringNotificationType extends ExpandableStringEnum { + /** + * Static value AmlNotification for MonitoringNotificationType. + */ + public static final MonitoringNotificationType AML_NOTIFICATION = fromString("AmlNotification"); + + /** + * Creates a new instance of MonitoringNotificationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MonitoringNotificationType() { + } + + /** + * Creates or finds a MonitoringNotificationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MonitoringNotificationType. + */ + public static MonitoringNotificationType fromString(String name) { + return fromString(name, MonitoringNotificationType.class); + } + + /** + * Gets known MonitoringNotificationType values. + * + * @return known MonitoringNotificationType values. + */ + public static Collection values() { + return values(MonitoringNotificationType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringSignalBase.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringSignalBase.java new file mode 100644 index 0000000000000..769095444e516 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringSignalBase.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * The MonitoringSignalBase model. + */ +@Fluent +public class MonitoringSignalBase implements JsonSerializable { + /* + * [Required] Specifies the type of signal to monitor. + */ + private MonitoringSignalType signalType = MonitoringSignalType.fromString("MonitoringSignalBase"); + + /* + * The current notification mode for this signal. + */ + private List notificationTypes; + + /* + * Property dictionary. Properties can be added, but not removed or altered. + */ + private Map properties; + + /** + * Creates an instance of MonitoringSignalBase class. + */ + public MonitoringSignalBase() { + } + + /** + * Get the signalType property: [Required] Specifies the type of signal to monitor. + * + * @return the signalType value. + */ + public MonitoringSignalType signalType() { + return this.signalType; + } + + /** + * Get the notificationTypes property: The current notification mode for this signal. + * + * @return the notificationTypes value. + */ + public List notificationTypes() { + return this.notificationTypes; + } + + /** + * Set the notificationTypes property: The current notification mode for this signal. + * + * @param notificationTypes the notificationTypes value to set. + * @return the MonitoringSignalBase object itself. + */ + public MonitoringSignalBase withNotificationTypes(List notificationTypes) { + this.notificationTypes = notificationTypes; + return this; + } + + /** + * Get the properties property: Property dictionary. Properties can be added, but not removed or altered. + * + * @return the properties value. + */ + public Map properties() { + return this.properties; + } + + /** + * Set the properties property: Property dictionary. Properties can be added, but not removed or altered. + * + * @param properties the properties value to set. + * @return the MonitoringSignalBase object itself. + */ + public MonitoringSignalBase withProperties(Map properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("signalType", this.signalType == null ? null : this.signalType.toString()); + jsonWriter.writeArrayField("notificationTypes", this.notificationTypes, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeMapField("properties", this.properties, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MonitoringSignalBase from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MonitoringSignalBase if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the MonitoringSignalBase. + */ + public static MonitoringSignalBase fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("signalType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Custom".equals(discriminatorValue)) { + return CustomMonitoringSignal.fromJson(readerToUse.reset()); + } else if ("DataDrift".equals(discriminatorValue)) { + return DataDriftMonitoringSignal.fromJson(readerToUse.reset()); + } else if ("DataQuality".equals(discriminatorValue)) { + return DataQualityMonitoringSignal.fromJson(readerToUse.reset()); + } else if ("FeatureAttributionDrift".equals(discriminatorValue)) { + return FeatureAttributionDriftMonitoringSignal.fromJson(readerToUse.reset()); + } else if ("PredictionDrift".equals(discriminatorValue)) { + return PredictionDriftMonitoringSignal.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static MonitoringSignalBase fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MonitoringSignalBase deserializedMonitoringSignalBase = new MonitoringSignalBase(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("signalType".equals(fieldName)) { + deserializedMonitoringSignalBase.signalType = MonitoringSignalType.fromString(reader.getString()); + } else if ("notificationTypes".equals(fieldName)) { + List notificationTypes + = reader.readArray(reader1 -> MonitoringNotificationType.fromString(reader1.getString())); + deserializedMonitoringSignalBase.notificationTypes = notificationTypes; + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedMonitoringSignalBase.properties = properties; + } else { + reader.skipChildren(); + } + } + + return deserializedMonitoringSignalBase; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringSignalType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringSignalType.java new file mode 100644 index 0000000000000..bce3846d43f9e --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringSignalType.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for MonitoringSignalType. + */ +public final class MonitoringSignalType extends ExpandableStringEnum { + /** + * Static value DataDrift for MonitoringSignalType. + */ + public static final MonitoringSignalType DATA_DRIFT = fromString("DataDrift"); + + /** + * Static value PredictionDrift for MonitoringSignalType. + */ + public static final MonitoringSignalType PREDICTION_DRIFT = fromString("PredictionDrift"); + + /** + * Static value DataQuality for MonitoringSignalType. + */ + public static final MonitoringSignalType DATA_QUALITY = fromString("DataQuality"); + + /** + * Static value FeatureAttributionDrift for MonitoringSignalType. + */ + public static final MonitoringSignalType FEATURE_ATTRIBUTION_DRIFT = fromString("FeatureAttributionDrift"); + + /** + * Static value Custom for MonitoringSignalType. + */ + public static final MonitoringSignalType CUSTOM = fromString("Custom"); + + /** + * Creates a new instance of MonitoringSignalType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MonitoringSignalType() { + } + + /** + * Creates or finds a MonitoringSignalType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MonitoringSignalType. + */ + public static MonitoringSignalType fromString(String name) { + return fromString(name, MonitoringSignalType.class); + } + + /** + * Gets known MonitoringSignalType values. + * + * @return known MonitoringSignalType values. + */ + public static Collection values() { + return values(MonitoringSignalType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringTarget.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringTarget.java new file mode 100644 index 0000000000000..1b05c6637f170 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringTarget.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Monitoring target definition. + */ +@Fluent +public final class MonitoringTarget implements JsonSerializable { + /* + * Reference to the deployment asset targeted by this monitor. + */ + private String deploymentId; + + /* + * Reference to the model asset targeted by this monitor. + */ + private String modelId; + + /* + * [Required] The machine learning task type of the monitored model. + */ + private ModelTaskType taskType; + + /** + * Creates an instance of MonitoringTarget class. + */ + public MonitoringTarget() { + } + + /** + * Get the deploymentId property: Reference to the deployment asset targeted by this monitor. + * + * @return the deploymentId value. + */ + public String deploymentId() { + return this.deploymentId; + } + + /** + * Set the deploymentId property: Reference to the deployment asset targeted by this monitor. + * + * @param deploymentId the deploymentId value to set. + * @return the MonitoringTarget object itself. + */ + public MonitoringTarget withDeploymentId(String deploymentId) { + this.deploymentId = deploymentId; + return this; + } + + /** + * Get the modelId property: Reference to the model asset targeted by this monitor. + * + * @return the modelId value. + */ + public String modelId() { + return this.modelId; + } + + /** + * Set the modelId property: Reference to the model asset targeted by this monitor. + * + * @param modelId the modelId value to set. + * @return the MonitoringTarget object itself. + */ + public MonitoringTarget withModelId(String modelId) { + this.modelId = modelId; + return this; + } + + /** + * Get the taskType property: [Required] The machine learning task type of the monitored model. + * + * @return the taskType value. + */ + public ModelTaskType taskType() { + return this.taskType; + } + + /** + * Set the taskType property: [Required] The machine learning task type of the monitored model. + * + * @param taskType the taskType value to set. + * @return the MonitoringTarget object itself. + */ + public MonitoringTarget withTaskType(ModelTaskType taskType) { + this.taskType = taskType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (taskType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property taskType in model MonitoringTarget")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MonitoringTarget.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); + jsonWriter.writeStringField("deploymentId", this.deploymentId); + jsonWriter.writeStringField("modelId", this.modelId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MonitoringTarget from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MonitoringTarget if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MonitoringTarget. + */ + public static MonitoringTarget fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MonitoringTarget deserializedMonitoringTarget = new MonitoringTarget(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("taskType".equals(fieldName)) { + deserializedMonitoringTarget.taskType = ModelTaskType.fromString(reader.getString()); + } else if ("deploymentId".equals(fieldName)) { + deserializedMonitoringTarget.deploymentId = reader.getString(); + } else if ("modelId".equals(fieldName)) { + deserializedMonitoringTarget.modelId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMonitoringTarget; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringThreshold.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringThreshold.java new file mode 100644 index 0000000000000..184b5ea74ded8 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MonitoringThreshold.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The MonitoringThreshold model. + */ +@Fluent +public final class MonitoringThreshold implements JsonSerializable { + /* + * The threshold value. If null, the set default is dependent on the metric type. + */ + private Double value; + + /** + * Creates an instance of MonitoringThreshold class. + */ + public MonitoringThreshold() { + } + + /** + * Get the value property: The threshold value. If null, the set default is dependent on the metric type. + * + * @return the value value. + */ + public Double value() { + return this.value; + } + + /** + * Set the value property: The threshold value. If null, the set default is dependent on the metric type. + * + * @param value the value value to set. + * @return the MonitoringThreshold object itself. + */ + public MonitoringThreshold withValue(Double value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MonitoringThreshold from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MonitoringThreshold if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MonitoringThreshold. + */ + public static MonitoringThreshold fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MonitoringThreshold deserializedMonitoringThreshold = new MonitoringThreshold(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedMonitoringThreshold.value = reader.getNullable(JsonReader::getDouble); + } else { + reader.skipChildren(); + } + } + + return deserializedMonitoringThreshold; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MountAction.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MountAction.java index ea7e3aa4d0e0a..6942678af7e86 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MountAction.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MountAction.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Mount Action. */ +/** + * Mount Action. + */ public final class MountAction extends ExpandableStringEnum { - /** Static value Mount for MountAction. */ + /** + * Static value Mount for MountAction. + */ public static final MountAction MOUNT = fromString("Mount"); - /** Static value Unmount for MountAction. */ + /** + * Static value Unmount for MountAction. + */ public static final MountAction UNMOUNT = fromString("Unmount"); /** * Creates a new instance of MountAction value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public MountAction() { /** * Creates or finds a MountAction from its string representation. - * + * * @param name a name to look for. * @return the corresponding MountAction. */ - @JsonCreator public static MountAction fromString(String name) { return fromString(name, MountAction.class); } /** * Gets known MountAction values. - * + * * @return known MountAction values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MountState.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MountState.java index 4682b19476306..fbdabad2aa987 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MountState.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/MountState.java @@ -5,32 +5,45 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Mount state. */ +/** + * Mount state. + */ public final class MountState extends ExpandableStringEnum { - /** Static value MountRequested for MountState. */ + /** + * Static value MountRequested for MountState. + */ public static final MountState MOUNT_REQUESTED = fromString("MountRequested"); - /** Static value Mounted for MountState. */ + /** + * Static value Mounted for MountState. + */ public static final MountState MOUNTED = fromString("Mounted"); - /** Static value MountFailed for MountState. */ + /** + * Static value MountFailed for MountState. + */ public static final MountState MOUNT_FAILED = fromString("MountFailed"); - /** Static value UnmountRequested for MountState. */ + /** + * Static value UnmountRequested for MountState. + */ public static final MountState UNMOUNT_REQUESTED = fromString("UnmountRequested"); - /** Static value UnmountFailed for MountState. */ + /** + * Static value UnmountFailed for MountState. + */ public static final MountState UNMOUNT_FAILED = fromString("UnmountFailed"); - /** Static value Unmounted for MountState. */ + /** + * Static value Unmounted for MountState. + */ public static final MountState UNMOUNTED = fromString("Unmounted"); /** * Creates a new instance of MountState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -39,18 +52,17 @@ public MountState() { /** * Creates or finds a MountState from its string representation. - * + * * @param name a name to look for. * @return the corresponding MountState. */ - @JsonCreator public static MountState fromString(String name) { return fromString(name, MountState.class); } /** * Gets known MountState values. - * + * * @return known MountState values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Mpi.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Mpi.java index 3aacc74147d05..4819ae9be889a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Mpi.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Mpi.java @@ -5,28 +5,45 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** MPI distribution configuration. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "distributionType") -@JsonTypeName("Mpi") +/** + * MPI distribution configuration. + */ @Fluent public final class Mpi extends DistributionConfiguration { + /* + * [Required] Specifies the type of distribution framework. + */ + private DistributionType distributionType = DistributionType.MPI; + /* * Number of processes per MPI node. */ - @JsonProperty(value = "processCountPerInstance") private Integer processCountPerInstance; - /** Creates an instance of Mpi class. */ + /** + * Creates an instance of Mpi class. + */ public Mpi() { } + /** + * Get the distributionType property: [Required] Specifies the type of distribution framework. + * + * @return the distributionType value. + */ + @Override + public DistributionType distributionType() { + return this.distributionType; + } + /** * Get the processCountPerInstance property: Number of processes per MPI node. - * + * * @return the processCountPerInstance value. */ public Integer processCountPerInstance() { @@ -35,7 +52,7 @@ public Integer processCountPerInstance() { /** * Set the processCountPerInstance property: Number of processes per MPI node. - * + * * @param processCountPerInstance the processCountPerInstance value to set. * @return the Mpi object itself. */ @@ -46,11 +63,51 @@ public Mpi withProcessCountPerInstance(Integer processCountPerInstance) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("distributionType", + this.distributionType == null ? null : this.distributionType.toString()); + jsonWriter.writeNumberField("processCountPerInstance", this.processCountPerInstance); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Mpi from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Mpi if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Mpi. + */ + public static Mpi fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Mpi deserializedMpi = new Mpi(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("distributionType".equals(fieldName)) { + deserializedMpi.distributionType = DistributionType.fromString(reader.getString()); + } else if ("processCountPerInstance".equals(fieldName)) { + deserializedMpi.processCountPerInstance = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedMpi; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NCrossValidations.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NCrossValidations.java index 8613307ed6c03..7c85af83bfa97 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NCrossValidations.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NCrossValidations.java @@ -5,32 +5,105 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** N-Cross validations value. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "mode", - defaultImpl = NCrossValidations.class) -@JsonTypeName("NCrossValidations") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "Auto", value = AutoNCrossValidations.class), - @JsonSubTypes.Type(name = "Custom", value = CustomNCrossValidations.class) -}) +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * N-Cross validations value. + */ @Immutable -public class NCrossValidations { - /** Creates an instance of NCrossValidations class. */ +public class NCrossValidations implements JsonSerializable { + /* + * [Required] Mode for determining N-Cross validations. + */ + private NCrossValidationsMode mode = NCrossValidationsMode.fromString("NCrossValidations"); + + /** + * Creates an instance of NCrossValidations class. + */ public NCrossValidations() { } + /** + * Get the mode property: [Required] Mode for determining N-Cross validations. + * + * @return the mode value. + */ + public NCrossValidationsMode mode() { + return this.mode; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NCrossValidations from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NCrossValidations if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the NCrossValidations. + */ + public static NCrossValidations fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("mode".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Auto".equals(discriminatorValue)) { + return AutoNCrossValidations.fromJson(readerToUse.reset()); + } else if ("Custom".equals(discriminatorValue)) { + return CustomNCrossValidations.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static NCrossValidations fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NCrossValidations deserializedNCrossValidations = new NCrossValidations(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("mode".equals(fieldName)) { + deserializedNCrossValidations.mode = NCrossValidationsMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedNCrossValidations; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NCrossValidationsMode.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NCrossValidationsMode.java index 2aff7dcb0c65f..f7b8e5fdc09d8 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NCrossValidationsMode.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NCrossValidationsMode.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Determines how N-Cross validations value is determined. */ +/** + * Determines how N-Cross validations value is determined. + */ public final class NCrossValidationsMode extends ExpandableStringEnum { - /** Static value Auto for NCrossValidationsMode. */ + /** + * Static value Auto for NCrossValidationsMode. + */ public static final NCrossValidationsMode AUTO = fromString("Auto"); - /** Static value Custom for NCrossValidationsMode. */ + /** + * Static value Custom for NCrossValidationsMode. + */ public static final NCrossValidationsMode CUSTOM = fromString("Custom"); /** * Creates a new instance of NCrossValidationsMode value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public NCrossValidationsMode() { /** * Creates or finds a NCrossValidationsMode from its string representation. - * + * * @param name a name to look for. * @return the corresponding NCrossValidationsMode. */ - @JsonCreator public static NCrossValidationsMode fromString(String name) { return fromString(name, NCrossValidationsMode.class); } /** * Gets known NCrossValidationsMode values. - * + * * @return known NCrossValidationsMode values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Network.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Network.java index bf7109d15c4af..da852cefa0a94 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Network.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Network.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** network of this container. */ +/** + * network of this container. + */ public final class Network extends ExpandableStringEnum { - /** Static value Bridge for Network. */ + /** + * Static value Bridge for Network. + */ public static final Network BRIDGE = fromString("Bridge"); - /** Static value Host for Network. */ + /** + * Static value Host for Network. + */ public static final Network HOST = fromString("Host"); /** * Creates a new instance of Network value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public Network() { /** * Creates or finds a Network from its string representation. - * + * * @param name a name to look for. * @return the corresponding Network. */ - @JsonCreator public static Network fromString(String name) { return fromString(name, Network.class); } /** * Gets known Network values. - * + * * @return known Network values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NlpVertical.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NlpVertical.java index deab5558f7010..5d4df2b0343bc 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NlpVertical.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NlpVertical.java @@ -5,36 +5,42 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Abstract class for NLP related AutoML tasks. NLP - Natural Language Processing. */ +/** + * Abstract class for NLP related AutoML tasks. + * NLP - Natural Language Processing. + */ @Fluent -public class NlpVertical { +public class NlpVertical implements JsonSerializable { /* * Featurization inputs needed for AutoML job. */ - @JsonProperty(value = "featurizationSettings") private NlpVerticalFeaturizationSettings featurizationSettings; /* * Execution constraints for AutoMLJob. */ - @JsonProperty(value = "limitSettings") private NlpVerticalLimitSettings limitSettings; /* * Validation data inputs. */ - @JsonProperty(value = "validationData") private MLTableJobInput validationData; - /** Creates an instance of NlpVertical class. */ + /** + * Creates an instance of NlpVertical class. + */ public NlpVertical() { } /** * Get the featurizationSettings property: Featurization inputs needed for AutoML job. - * + * * @return the featurizationSettings value. */ public NlpVerticalFeaturizationSettings featurizationSettings() { @@ -43,7 +49,7 @@ public NlpVerticalFeaturizationSettings featurizationSettings() { /** * Set the featurizationSettings property: Featurization inputs needed for AutoML job. - * + * * @param featurizationSettings the featurizationSettings value to set. * @return the NlpVertical object itself. */ @@ -54,7 +60,7 @@ public NlpVertical withFeaturizationSettings(NlpVerticalFeaturizationSettings fe /** * Get the limitSettings property: Execution constraints for AutoMLJob. - * + * * @return the limitSettings value. */ public NlpVerticalLimitSettings limitSettings() { @@ -63,7 +69,7 @@ public NlpVerticalLimitSettings limitSettings() { /** * Set the limitSettings property: Execution constraints for AutoMLJob. - * + * * @param limitSettings the limitSettings value to set. * @return the NlpVertical object itself. */ @@ -74,7 +80,7 @@ public NlpVertical withLimitSettings(NlpVerticalLimitSettings limitSettings) { /** * Get the validationData property: Validation data inputs. - * + * * @return the validationData value. */ public MLTableJobInput validationData() { @@ -83,7 +89,7 @@ public MLTableJobInput validationData() { /** * Set the validationData property: Validation data inputs. - * + * * @param validationData the validationData value to set. * @return the NlpVertical object itself. */ @@ -94,7 +100,7 @@ public NlpVertical withValidationData(MLTableJobInput validationData) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -108,4 +114,46 @@ public void validate() { validationData().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("featurizationSettings", this.featurizationSettings); + jsonWriter.writeJsonField("limitSettings", this.limitSettings); + jsonWriter.writeJsonField("validationData", this.validationData); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NlpVertical from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NlpVertical if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the NlpVertical. + */ + public static NlpVertical fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NlpVertical deserializedNlpVertical = new NlpVertical(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("featurizationSettings".equals(fieldName)) { + deserializedNlpVertical.featurizationSettings = NlpVerticalFeaturizationSettings.fromJson(reader); + } else if ("limitSettings".equals(fieldName)) { + deserializedNlpVertical.limitSettings = NlpVerticalLimitSettings.fromJson(reader); + } else if ("validationData".equals(fieldName)) { + deserializedNlpVertical.validationData = MLTableJobInput.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNlpVertical; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NlpVerticalFeaturizationSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NlpVerticalFeaturizationSettings.java index fa5c771710dba..ac035c0e317f9 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NlpVerticalFeaturizationSettings.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NlpVerticalFeaturizationSettings.java @@ -5,15 +5,25 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The NlpVerticalFeaturizationSettings model. */ +/** + * The NlpVerticalFeaturizationSettings model. + */ @Fluent public final class NlpVerticalFeaturizationSettings extends FeaturizationSettings { - /** Creates an instance of NlpVerticalFeaturizationSettings class. */ + /** + * Creates an instance of NlpVerticalFeaturizationSettings class. + */ public NlpVerticalFeaturizationSettings() { } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public NlpVerticalFeaturizationSettings withDatasetLanguage(String datasetLanguage) { super.withDatasetLanguage(datasetLanguage); @@ -22,11 +32,48 @@ public NlpVerticalFeaturizationSettings withDatasetLanguage(String datasetLangua /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("datasetLanguage", datasetLanguage()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NlpVerticalFeaturizationSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NlpVerticalFeaturizationSettings if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NlpVerticalFeaturizationSettings. + */ + public static NlpVerticalFeaturizationSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NlpVerticalFeaturizationSettings deserializedNlpVerticalFeaturizationSettings + = new NlpVerticalFeaturizationSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("datasetLanguage".equals(fieldName)) { + deserializedNlpVerticalFeaturizationSettings.withDatasetLanguage(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedNlpVerticalFeaturizationSettings; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NlpVerticalLimitSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NlpVerticalLimitSettings.java index 82dddc5df409e..813e357f44a58 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NlpVerticalLimitSettings.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NlpVerticalLimitSettings.java @@ -5,37 +5,43 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.Duration; -/** Job execution constraints. */ +/** + * Job execution constraints. + */ @Fluent -public final class NlpVerticalLimitSettings { +public final class NlpVerticalLimitSettings implements JsonSerializable { /* * Maximum Concurrent AutoML iterations. */ - @JsonProperty(value = "maxConcurrentTrials") private Integer maxConcurrentTrials; /* * Number of AutoML iterations. */ - @JsonProperty(value = "maxTrials") private Integer maxTrials; /* * AutoML job timeout. */ - @JsonProperty(value = "timeout") private Duration timeout; - /** Creates an instance of NlpVerticalLimitSettings class. */ + /** + * Creates an instance of NlpVerticalLimitSettings class. + */ public NlpVerticalLimitSettings() { } /** * Get the maxConcurrentTrials property: Maximum Concurrent AutoML iterations. - * + * * @return the maxConcurrentTrials value. */ public Integer maxConcurrentTrials() { @@ -44,7 +50,7 @@ public Integer maxConcurrentTrials() { /** * Set the maxConcurrentTrials property: Maximum Concurrent AutoML iterations. - * + * * @param maxConcurrentTrials the maxConcurrentTrials value to set. * @return the NlpVerticalLimitSettings object itself. */ @@ -55,7 +61,7 @@ public NlpVerticalLimitSettings withMaxConcurrentTrials(Integer maxConcurrentTri /** * Get the maxTrials property: Number of AutoML iterations. - * + * * @return the maxTrials value. */ public Integer maxTrials() { @@ -64,7 +70,7 @@ public Integer maxTrials() { /** * Set the maxTrials property: Number of AutoML iterations. - * + * * @param maxTrials the maxTrials value to set. * @return the NlpVerticalLimitSettings object itself. */ @@ -75,7 +81,7 @@ public NlpVerticalLimitSettings withMaxTrials(Integer maxTrials) { /** * Get the timeout property: AutoML job timeout. - * + * * @return the timeout value. */ public Duration timeout() { @@ -84,7 +90,7 @@ public Duration timeout() { /** * Set the timeout property: AutoML job timeout. - * + * * @param timeout the timeout value to set. * @return the NlpVerticalLimitSettings object itself. */ @@ -95,9 +101,52 @@ public NlpVerticalLimitSettings withTimeout(Duration timeout) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("maxConcurrentTrials", this.maxConcurrentTrials); + jsonWriter.writeNumberField("maxTrials", this.maxTrials); + jsonWriter.writeStringField("timeout", CoreUtils.durationToStringWithDays(this.timeout)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NlpVerticalLimitSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NlpVerticalLimitSettings if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NlpVerticalLimitSettings. + */ + public static NlpVerticalLimitSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NlpVerticalLimitSettings deserializedNlpVerticalLimitSettings = new NlpVerticalLimitSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("maxConcurrentTrials".equals(fieldName)) { + deserializedNlpVerticalLimitSettings.maxConcurrentTrials = reader.getNullable(JsonReader::getInt); + } else if ("maxTrials".equals(fieldName)) { + deserializedNlpVerticalLimitSettings.maxTrials = reader.getNullable(JsonReader::getInt); + } else if ("timeout".equals(fieldName)) { + deserializedNlpVerticalLimitSettings.timeout + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedNlpVerticalLimitSettings; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NodeState.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NodeState.java index ea30f45a6afbc..9585317b1bd01 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NodeState.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NodeState.java @@ -5,32 +5,45 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** State of the compute node. Values are idle, running, preparing, unusable, leaving and preempted. */ +/** + * State of the compute node. Values are idle, running, preparing, unusable, leaving and preempted. + */ public final class NodeState extends ExpandableStringEnum { - /** Static value idle for NodeState. */ + /** + * Static value idle for NodeState. + */ public static final NodeState IDLE = fromString("idle"); - /** Static value running for NodeState. */ + /** + * Static value running for NodeState. + */ public static final NodeState RUNNING = fromString("running"); - /** Static value preparing for NodeState. */ + /** + * Static value preparing for NodeState. + */ public static final NodeState PREPARING = fromString("preparing"); - /** Static value unusable for NodeState. */ + /** + * Static value unusable for NodeState. + */ public static final NodeState UNUSABLE = fromString("unusable"); - /** Static value leaving for NodeState. */ + /** + * Static value leaving for NodeState. + */ public static final NodeState LEAVING = fromString("leaving"); - /** Static value preempted for NodeState. */ + /** + * Static value preempted for NodeState. + */ public static final NodeState PREEMPTED = fromString("preempted"); /** * Creates a new instance of NodeState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -39,18 +52,17 @@ public NodeState() { /** * Creates or finds a NodeState from its string representation. - * + * * @param name a name to look for. * @return the corresponding NodeState. */ - @JsonCreator public static NodeState fromString(String name) { return fromString(name, NodeState.class); } /** * Gets known NodeState values. - * + * * @return known NodeState values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NodeStateCounts.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NodeStateCounts.java index a7004e0e8690f..f18e968373d19 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NodeStateCounts.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NodeStateCounts.java @@ -5,68 +5,56 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Counts of various compute node states on the amlCompute. */ +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Counts of various compute node states on the amlCompute. + */ @Immutable -public final class NodeStateCounts { +public final class NodeStateCounts implements JsonSerializable { /* - * Idle node count. - * * Number of compute nodes in idle state. */ - @JsonProperty(value = "idleNodeCount", access = JsonProperty.Access.WRITE_ONLY) private Integer idleNodeCount; /* - * Running node count. - * * Number of compute nodes which are running jobs. */ - @JsonProperty(value = "runningNodeCount", access = JsonProperty.Access.WRITE_ONLY) private Integer runningNodeCount; /* - * Preparing node count. - * * Number of compute nodes which are being prepared. */ - @JsonProperty(value = "preparingNodeCount", access = JsonProperty.Access.WRITE_ONLY) private Integer preparingNodeCount; /* - * Unusable node count. - * * Number of compute nodes which are in unusable state. */ - @JsonProperty(value = "unusableNodeCount", access = JsonProperty.Access.WRITE_ONLY) private Integer unusableNodeCount; /* - * Leaving node count. - * * Number of compute nodes which are leaving the amlCompute. */ - @JsonProperty(value = "leavingNodeCount", access = JsonProperty.Access.WRITE_ONLY) private Integer leavingNodeCount; /* - * Preempted node count. - * * Number of compute nodes which are in preempted state. */ - @JsonProperty(value = "preemptedNodeCount", access = JsonProperty.Access.WRITE_ONLY) private Integer preemptedNodeCount; - /** Creates an instance of NodeStateCounts class. */ + /** + * Creates an instance of NodeStateCounts class. + */ public NodeStateCounts() { } /** - * Get the idleNodeCount property: Idle node count. - * - *

Number of compute nodes in idle state. - * + * Get the idleNodeCount property: Number of compute nodes in idle state. + * * @return the idleNodeCount value. */ public Integer idleNodeCount() { @@ -74,10 +62,8 @@ public Integer idleNodeCount() { } /** - * Get the runningNodeCount property: Running node count. - * - *

Number of compute nodes which are running jobs. - * + * Get the runningNodeCount property: Number of compute nodes which are running jobs. + * * @return the runningNodeCount value. */ public Integer runningNodeCount() { @@ -85,10 +71,8 @@ public Integer runningNodeCount() { } /** - * Get the preparingNodeCount property: Preparing node count. - * - *

Number of compute nodes which are being prepared. - * + * Get the preparingNodeCount property: Number of compute nodes which are being prepared. + * * @return the preparingNodeCount value. */ public Integer preparingNodeCount() { @@ -96,10 +80,8 @@ public Integer preparingNodeCount() { } /** - * Get the unusableNodeCount property: Unusable node count. - * - *

Number of compute nodes which are in unusable state. - * + * Get the unusableNodeCount property: Number of compute nodes which are in unusable state. + * * @return the unusableNodeCount value. */ public Integer unusableNodeCount() { @@ -107,10 +89,8 @@ public Integer unusableNodeCount() { } /** - * Get the leavingNodeCount property: Leaving node count. - * - *

Number of compute nodes which are leaving the amlCompute. - * + * Get the leavingNodeCount property: Number of compute nodes which are leaving the amlCompute. + * * @return the leavingNodeCount value. */ public Integer leavingNodeCount() { @@ -118,10 +98,8 @@ public Integer leavingNodeCount() { } /** - * Get the preemptedNodeCount property: Preempted node count. - * - *

Number of compute nodes which are in preempted state. - * + * Get the preemptedNodeCount property: Number of compute nodes which are in preempted state. + * * @return the preemptedNodeCount value. */ public Integer preemptedNodeCount() { @@ -130,9 +108,54 @@ public Integer preemptedNodeCount() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NodeStateCounts from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NodeStateCounts if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the NodeStateCounts. + */ + public static NodeStateCounts fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NodeStateCounts deserializedNodeStateCounts = new NodeStateCounts(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("idleNodeCount".equals(fieldName)) { + deserializedNodeStateCounts.idleNodeCount = reader.getNullable(JsonReader::getInt); + } else if ("runningNodeCount".equals(fieldName)) { + deserializedNodeStateCounts.runningNodeCount = reader.getNullable(JsonReader::getInt); + } else if ("preparingNodeCount".equals(fieldName)) { + deserializedNodeStateCounts.preparingNodeCount = reader.getNullable(JsonReader::getInt); + } else if ("unusableNodeCount".equals(fieldName)) { + deserializedNodeStateCounts.unusableNodeCount = reader.getNullable(JsonReader::getInt); + } else if ("leavingNodeCount".equals(fieldName)) { + deserializedNodeStateCounts.leavingNodeCount = reader.getNullable(JsonReader::getInt); + } else if ("preemptedNodeCount".equals(fieldName)) { + deserializedNodeStateCounts.preemptedNodeCount = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedNodeStateCounts; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Nodes.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Nodes.java new file mode 100644 index 0000000000000..7fa852b13a2d1 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Nodes.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Abstract Nodes definition. + */ +@Immutable +public class Nodes implements JsonSerializable { + /* + * [Required] Type of the Nodes value + */ + private NodesValueType nodesValueType = NodesValueType.fromString("Nodes"); + + /** + * Creates an instance of Nodes class. + */ + public Nodes() { + } + + /** + * Get the nodesValueType property: [Required] Type of the Nodes value. + * + * @return the nodesValueType value. + */ + public NodesValueType nodesValueType() { + return this.nodesValueType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nodesValueType", + this.nodesValueType == null ? null : this.nodesValueType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Nodes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Nodes if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Nodes. + */ + public static Nodes fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("nodesValueType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("All".equals(discriminatorValue)) { + return AllNodes.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static Nodes fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Nodes deserializedNodes = new Nodes(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nodesValueType".equals(fieldName)) { + deserializedNodes.nodesValueType = NodesValueType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedNodes; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NodesValueType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NodesValueType.java new file mode 100644 index 0000000000000..c6e506e0f89bc --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NodesValueType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The enumerated types for the nodes value. + */ +public final class NodesValueType extends ExpandableStringEnum { + /** + * Static value All for NodesValueType. + */ + public static final NodesValueType ALL = fromString("All"); + + /** + * Creates a new instance of NodesValueType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NodesValueType() { + } + + /** + * Creates or finds a NodesValueType from its string representation. + * + * @param name a name to look for. + * @return the corresponding NodesValueType. + */ + public static NodesValueType fromString(String name) { + return fromString(name, NodesValueType.class); + } + + /** + * Gets known NodesValueType values. + * + * @return known NodesValueType values. + */ + public static Collection values() { + return values(NodesValueType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NoneAuthTypeWorkspaceConnectionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NoneAuthTypeWorkspaceConnectionProperties.java index 79af891099d09..1fbdf1bc301ab 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NoneAuthTypeWorkspaceConnectionProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NoneAuthTypeWorkspaceConnectionProperties.java @@ -5,40 +5,138 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; -/** The NoneAuthTypeWorkspaceConnectionProperties model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "authType") -@JsonTypeName("None") +/** + * The NoneAuthTypeWorkspaceConnectionProperties model. + */ @Fluent public final class NoneAuthTypeWorkspaceConnectionProperties extends WorkspaceConnectionPropertiesV2 { - /** Creates an instance of NoneAuthTypeWorkspaceConnectionProperties class. */ + /* + * Authentication type of the connection target + */ + private ConnectionAuthType authType = ConnectionAuthType.NONE; + + /* + * The createdByWorkspaceArmId property. + */ + private String createdByWorkspaceArmId; + + /* + * Group based on connection category + */ + private ConnectionGroup group; + + /** + * Creates an instance of NoneAuthTypeWorkspaceConnectionProperties class. + */ public NoneAuthTypeWorkspaceConnectionProperties() { } - /** {@inheritDoc} */ + /** + * Get the authType property: Authentication type of the connection target. + * + * @return the authType value. + */ + @Override + public ConnectionAuthType authType() { + return this.authType; + } + + /** + * Get the createdByWorkspaceArmId property: The createdByWorkspaceArmId property. + * + * @return the createdByWorkspaceArmId value. + */ + @Override + public String createdByWorkspaceArmId() { + return this.createdByWorkspaceArmId; + } + + /** + * Get the group property: Group based on connection category. + * + * @return the group value. + */ + @Override + public ConnectionGroup group() { + return this.group; + } + + /** + * {@inheritDoc} + */ @Override public NoneAuthTypeWorkspaceConnectionProperties withCategory(ConnectionCategory category) { super.withCategory(category); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ + @Override + public NoneAuthTypeWorkspaceConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { + super.withExpiryTime(expiryTime); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public NoneAuthTypeWorkspaceConnectionProperties withIsSharedToAll(Boolean isSharedToAll) { + super.withIsSharedToAll(isSharedToAll); + return this; + } + + /** + * {@inheritDoc} + */ @Override public NoneAuthTypeWorkspaceConnectionProperties withTarget(String target) { super.withTarget(target); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ + @Override + public NoneAuthTypeWorkspaceConnectionProperties withMetadata(Map metadata) { + super.withMetadata(metadata); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public NoneAuthTypeWorkspaceConnectionProperties withSharedUserList(List sharedUserList) { + super.withSharedUserList(sharedUserList); + return this; + } + + /** + * {@inheritDoc} + */ @Override public NoneAuthTypeWorkspaceConnectionProperties withValue(String value) { super.withValue(value); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public NoneAuthTypeWorkspaceConnectionProperties withValueFormat(ValueFormat valueFormat) { super.withValueFormat(valueFormat); @@ -47,11 +145,86 @@ public NoneAuthTypeWorkspaceConnectionProperties withValueFormat(ValueFormat val /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", category() == null ? null : category().toString()); + jsonWriter.writeStringField("expiryTime", + expiryTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expiryTime())); + jsonWriter.writeBooleanField("isSharedToAll", isSharedToAll()); + jsonWriter.writeStringField("target", target()); + jsonWriter.writeMapField("metadata", metadata(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("sharedUserList", sharedUserList(), + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("value", value()); + jsonWriter.writeStringField("valueFormat", valueFormat() == null ? null : valueFormat().toString()); + jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NoneAuthTypeWorkspaceConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NoneAuthTypeWorkspaceConnectionProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NoneAuthTypeWorkspaceConnectionProperties. + */ + public static NoneAuthTypeWorkspaceConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NoneAuthTypeWorkspaceConnectionProperties deserializedNoneAuthTypeWorkspaceConnectionProperties + = new NoneAuthTypeWorkspaceConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedNoneAuthTypeWorkspaceConnectionProperties + .withCategory(ConnectionCategory.fromString(reader.getString())); + } else if ("createdByWorkspaceArmId".equals(fieldName)) { + deserializedNoneAuthTypeWorkspaceConnectionProperties.createdByWorkspaceArmId = reader.getString(); + } else if ("expiryTime".equals(fieldName)) { + deserializedNoneAuthTypeWorkspaceConnectionProperties.withExpiryTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("group".equals(fieldName)) { + deserializedNoneAuthTypeWorkspaceConnectionProperties.group + = ConnectionGroup.fromString(reader.getString()); + } else if ("isSharedToAll".equals(fieldName)) { + deserializedNoneAuthTypeWorkspaceConnectionProperties + .withIsSharedToAll(reader.getNullable(JsonReader::getBoolean)); + } else if ("target".equals(fieldName)) { + deserializedNoneAuthTypeWorkspaceConnectionProperties.withTarget(reader.getString()); + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedNoneAuthTypeWorkspaceConnectionProperties.withMetadata(metadata); + } else if ("sharedUserList".equals(fieldName)) { + List sharedUserList = reader.readArray(reader1 -> reader1.getString()); + deserializedNoneAuthTypeWorkspaceConnectionProperties.withSharedUserList(sharedUserList); + } else if ("value".equals(fieldName)) { + deserializedNoneAuthTypeWorkspaceConnectionProperties.withValue(reader.getString()); + } else if ("valueFormat".equals(fieldName)) { + deserializedNoneAuthTypeWorkspaceConnectionProperties + .withValueFormat(ValueFormat.fromString(reader.getString())); + } else if ("authType".equals(fieldName)) { + deserializedNoneAuthTypeWorkspaceConnectionProperties.authType + = ConnectionAuthType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedNoneAuthTypeWorkspaceConnectionProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NoneDatastoreCredentials.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NoneDatastoreCredentials.java index 01b0ba2366047..1181f71399432 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NoneDatastoreCredentials.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NoneDatastoreCredentials.java @@ -5,25 +5,82 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Empty/none datastore credentials. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "credentialsType") -@JsonTypeName("None") +/** + * Empty/none datastore credentials. + */ @Immutable public final class NoneDatastoreCredentials extends DatastoreCredentials { - /** Creates an instance of NoneDatastoreCredentials class. */ + /* + * [Required] Credential type used to authentication with storage. + */ + private CredentialsType credentialsType = CredentialsType.NONE; + + /** + * Creates an instance of NoneDatastoreCredentials class. + */ public NoneDatastoreCredentials() { } + /** + * Get the credentialsType property: [Required] Credential type used to authentication with storage. + * + * @return the credentialsType value. + */ + @Override + public CredentialsType credentialsType() { + return this.credentialsType; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("credentialsType", + this.credentialsType == null ? null : this.credentialsType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NoneDatastoreCredentials from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NoneDatastoreCredentials if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NoneDatastoreCredentials. + */ + public static NoneDatastoreCredentials fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NoneDatastoreCredentials deserializedNoneDatastoreCredentials = new NoneDatastoreCredentials(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("credentialsType".equals(fieldName)) { + deserializedNoneDatastoreCredentials.credentialsType + = CredentialsType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedNoneDatastoreCredentials; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NotebookAccessTokenResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NotebookAccessTokenResult.java index 4e28342a32c7d..16f860733f315 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NotebookAccessTokenResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NotebookAccessTokenResult.java @@ -6,67 +6,69 @@ import com.azure.resourcemanager.machinelearning.fluent.models.NotebookAccessTokenResultInner; -/** An immutable client-side representation of NotebookAccessTokenResult. */ +/** + * An immutable client-side representation of NotebookAccessTokenResult. + */ public interface NotebookAccessTokenResult { /** * Gets the notebookResourceId property: The notebookResourceId property. - * + * * @return the notebookResourceId value. */ String notebookResourceId(); /** * Gets the hostname property: The hostName property. - * + * * @return the hostname value. */ String hostname(); /** * Gets the publicDns property: The publicDns property. - * + * * @return the publicDns value. */ String publicDns(); /** * Gets the accessToken property: The accessToken property. - * + * * @return the accessToken value. */ String accessToken(); /** * Gets the tokenType property: The tokenType property. - * + * * @return the tokenType value. */ String tokenType(); /** * Gets the expiresIn property: The expiresIn property. - * + * * @return the expiresIn value. */ Integer expiresIn(); /** * Gets the refreshToken property: The refreshToken property. - * + * * @return the refreshToken value. */ String refreshToken(); /** * Gets the scope property: The scope property. - * + * * @return the scope value. */ String scope(); /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.NotebookAccessTokenResultInner object. - * + * * @return the inner object. */ NotebookAccessTokenResultInner innerModel(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NotebookPreparationError.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NotebookPreparationError.java index ab2aef26e6b09..f68e7d2965886 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NotebookPreparationError.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NotebookPreparationError.java @@ -5,30 +5,36 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The NotebookPreparationError model. */ +/** + * The NotebookPreparationError model. + */ @Fluent -public final class NotebookPreparationError { +public final class NotebookPreparationError implements JsonSerializable { /* * The errorMessage property. */ - @JsonProperty(value = "errorMessage") private String errorMessage; /* * The statusCode property. */ - @JsonProperty(value = "statusCode") private Integer statusCode; - /** Creates an instance of NotebookPreparationError class. */ + /** + * Creates an instance of NotebookPreparationError class. + */ public NotebookPreparationError() { } /** * Get the errorMessage property: The errorMessage property. - * + * * @return the errorMessage value. */ public String errorMessage() { @@ -37,7 +43,7 @@ public String errorMessage() { /** * Set the errorMessage property: The errorMessage property. - * + * * @param errorMessage the errorMessage value to set. * @return the NotebookPreparationError object itself. */ @@ -48,7 +54,7 @@ public NotebookPreparationError withErrorMessage(String errorMessage) { /** * Get the statusCode property: The statusCode property. - * + * * @return the statusCode value. */ public Integer statusCode() { @@ -57,7 +63,7 @@ public Integer statusCode() { /** * Set the statusCode property: The statusCode property. - * + * * @param statusCode the statusCode value to set. * @return the NotebookPreparationError object itself. */ @@ -68,9 +74,48 @@ public NotebookPreparationError withStatusCode(Integer statusCode) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("errorMessage", this.errorMessage); + jsonWriter.writeNumberField("statusCode", this.statusCode); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NotebookPreparationError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NotebookPreparationError if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NotebookPreparationError. + */ + public static NotebookPreparationError fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NotebookPreparationError deserializedNotebookPreparationError = new NotebookPreparationError(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errorMessage".equals(fieldName)) { + deserializedNotebookPreparationError.errorMessage = reader.getString(); + } else if ("statusCode".equals(fieldName)) { + deserializedNotebookPreparationError.statusCode = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedNotebookPreparationError; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NotebookResourceInfo.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NotebookResourceInfo.java index f8aa5bb01e786..fc2e207583091 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NotebookResourceInfo.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NotebookResourceInfo.java @@ -6,32 +6,34 @@ import com.azure.resourcemanager.machinelearning.fluent.models.NotebookResourceInfoInner; -/** An immutable client-side representation of NotebookResourceInfo. */ +/** + * An immutable client-side representation of NotebookResourceInfo. + */ public interface NotebookResourceInfo { /** * Gets the fqdn property: The fqdn property. - * + * * @return the fqdn value. */ String fqdn(); /** * Gets the resourceId property: the data plane resourceId that used to initialize notebook component. - * + * * @return the resourceId value. */ String resourceId(); /** * Gets the notebookPreparationError property: The error that occurs when preparing notebook. - * + * * @return the notebookPreparationError value. */ NotebookPreparationError notebookPreparationError(); /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.NotebookResourceInfoInner object. - * + * * @return the inner object. */ NotebookResourceInfoInner innerModel(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NotificationSetting.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NotificationSetting.java new file mode 100644 index 0000000000000..27202868b14a1 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NotificationSetting.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Configuration for notification. + */ +@Fluent +public final class NotificationSetting implements JsonSerializable { + /* + * Send email notification to user on specified notification type + */ + private List emailOn; + + /* + * This is the email recipient list which has a limitation of 499 characters in total concat with comma separator + */ + private List emails; + + /* + * Send webhook callback to a service. Key is a user-provided name for the webhook. + */ + private Map webhooks; + + /** + * Creates an instance of NotificationSetting class. + */ + public NotificationSetting() { + } + + /** + * Get the emailOn property: Send email notification to user on specified notification type. + * + * @return the emailOn value. + */ + public List emailOn() { + return this.emailOn; + } + + /** + * Set the emailOn property: Send email notification to user on specified notification type. + * + * @param emailOn the emailOn value to set. + * @return the NotificationSetting object itself. + */ + public NotificationSetting withEmailOn(List emailOn) { + this.emailOn = emailOn; + return this; + } + + /** + * Get the emails property: This is the email recipient list which has a limitation of 499 characters in total + * concat with comma separator. + * + * @return the emails value. + */ + public List emails() { + return this.emails; + } + + /** + * Set the emails property: This is the email recipient list which has a limitation of 499 characters in total + * concat with comma separator. + * + * @param emails the emails value to set. + * @return the NotificationSetting object itself. + */ + public NotificationSetting withEmails(List emails) { + this.emails = emails; + return this; + } + + /** + * Get the webhooks property: Send webhook callback to a service. Key is a user-provided name for the webhook. + * + * @return the webhooks value. + */ + public Map webhooks() { + return this.webhooks; + } + + /** + * Set the webhooks property: Send webhook callback to a service. Key is a user-provided name for the webhook. + * + * @param webhooks the webhooks value to set. + * @return the NotificationSetting object itself. + */ + public NotificationSetting withWebhooks(Map webhooks) { + this.webhooks = webhooks; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (webhooks() != null) { + webhooks().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("emailOn", this.emailOn, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("emails", this.emails, (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("webhooks", this.webhooks, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NotificationSetting from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NotificationSetting if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the NotificationSetting. + */ + public static NotificationSetting fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NotificationSetting deserializedNotificationSetting = new NotificationSetting(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("emailOn".equals(fieldName)) { + List emailOn + = reader.readArray(reader1 -> EmailNotificationEnableType.fromString(reader1.getString())); + deserializedNotificationSetting.emailOn = emailOn; + } else if ("emails".equals(fieldName)) { + List emails = reader.readArray(reader1 -> reader1.getString()); + deserializedNotificationSetting.emails = emails; + } else if ("webhooks".equals(fieldName)) { + Map webhooks = reader.readMap(reader1 -> Webhook.fromJson(reader1)); + deserializedNotificationSetting.webhooks = webhooks; + } else { + reader.skipChildren(); + } + } + + return deserializedNotificationSetting; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NumericalDataDriftMetric.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NumericalDataDriftMetric.java new file mode 100644 index 0000000000000..a35da18f7bcb3 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NumericalDataDriftMetric.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for NumericalDataDriftMetric. + */ +public final class NumericalDataDriftMetric extends ExpandableStringEnum { + /** + * Static value JensenShannonDistance for NumericalDataDriftMetric. + */ + public static final NumericalDataDriftMetric JENSEN_SHANNON_DISTANCE = fromString("JensenShannonDistance"); + + /** + * Static value PopulationStabilityIndex for NumericalDataDriftMetric. + */ + public static final NumericalDataDriftMetric POPULATION_STABILITY_INDEX = fromString("PopulationStabilityIndex"); + + /** + * Static value NormalizedWassersteinDistance for NumericalDataDriftMetric. + */ + public static final NumericalDataDriftMetric NORMALIZED_WASSERSTEIN_DISTANCE + = fromString("NormalizedWassersteinDistance"); + + /** + * Static value TwoSampleKolmogorovSmirnovTest for NumericalDataDriftMetric. + */ + public static final NumericalDataDriftMetric TWO_SAMPLE_KOLMOGOROV_SMIRNOV_TEST + = fromString("TwoSampleKolmogorovSmirnovTest"); + + /** + * Creates a new instance of NumericalDataDriftMetric value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NumericalDataDriftMetric() { + } + + /** + * Creates or finds a NumericalDataDriftMetric from its string representation. + * + * @param name a name to look for. + * @return the corresponding NumericalDataDriftMetric. + */ + public static NumericalDataDriftMetric fromString(String name) { + return fromString(name, NumericalDataDriftMetric.class); + } + + /** + * Gets known NumericalDataDriftMetric values. + * + * @return known NumericalDataDriftMetric values. + */ + public static Collection values() { + return values(NumericalDataDriftMetric.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NumericalDataDriftMetricThreshold.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NumericalDataDriftMetricThreshold.java new file mode 100644 index 0000000000000..8d04f58ba940a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NumericalDataDriftMetricThreshold.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The NumericalDataDriftMetricThreshold model. + */ +@Fluent +public final class NumericalDataDriftMetricThreshold extends DataDriftMetricThresholdBase { + /* + * [Required] Specifies the data type of the metric threshold. + */ + private MonitoringFeatureDataType dataType = MonitoringFeatureDataType.NUMERICAL; + + /* + * [Required] The numerical data drift metric to calculate. + */ + private NumericalDataDriftMetric metric; + + /** + * Creates an instance of NumericalDataDriftMetricThreshold class. + */ + public NumericalDataDriftMetricThreshold() { + } + + /** + * Get the dataType property: [Required] Specifies the data type of the metric threshold. + * + * @return the dataType value. + */ + @Override + public MonitoringFeatureDataType dataType() { + return this.dataType; + } + + /** + * Get the metric property: [Required] The numerical data drift metric to calculate. + * + * @return the metric value. + */ + public NumericalDataDriftMetric metric() { + return this.metric; + } + + /** + * Set the metric property: [Required] The numerical data drift metric to calculate. + * + * @param metric the metric value to set. + * @return the NumericalDataDriftMetricThreshold object itself. + */ + public NumericalDataDriftMetricThreshold withMetric(NumericalDataDriftMetric metric) { + this.metric = metric; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public NumericalDataDriftMetricThreshold withThreshold(MonitoringThreshold threshold) { + super.withThreshold(threshold); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (metric() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property metric in model NumericalDataDriftMetricThreshold")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NumericalDataDriftMetricThreshold.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("threshold", threshold()); + jsonWriter.writeStringField("metric", this.metric == null ? null : this.metric.toString()); + jsonWriter.writeStringField("dataType", this.dataType == null ? null : this.dataType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NumericalDataDriftMetricThreshold from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NumericalDataDriftMetricThreshold if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NumericalDataDriftMetricThreshold. + */ + public static NumericalDataDriftMetricThreshold fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NumericalDataDriftMetricThreshold deserializedNumericalDataDriftMetricThreshold + = new NumericalDataDriftMetricThreshold(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("threshold".equals(fieldName)) { + deserializedNumericalDataDriftMetricThreshold.withThreshold(MonitoringThreshold.fromJson(reader)); + } else if ("metric".equals(fieldName)) { + deserializedNumericalDataDriftMetricThreshold.metric + = NumericalDataDriftMetric.fromString(reader.getString()); + } else if ("dataType".equals(fieldName)) { + deserializedNumericalDataDriftMetricThreshold.dataType + = MonitoringFeatureDataType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedNumericalDataDriftMetricThreshold; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NumericalDataQualityMetric.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NumericalDataQualityMetric.java new file mode 100644 index 0000000000000..cb11945fcfa35 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NumericalDataQualityMetric.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for NumericalDataQualityMetric. + */ +public final class NumericalDataQualityMetric extends ExpandableStringEnum { + /** + * Static value NullValueRate for NumericalDataQualityMetric. + */ + public static final NumericalDataQualityMetric NULL_VALUE_RATE = fromString("NullValueRate"); + + /** + * Static value DataTypeErrorRate for NumericalDataQualityMetric. + */ + public static final NumericalDataQualityMetric DATA_TYPE_ERROR_RATE = fromString("DataTypeErrorRate"); + + /** + * Static value OutOfBoundsRate for NumericalDataQualityMetric. + */ + public static final NumericalDataQualityMetric OUT_OF_BOUNDS_RATE = fromString("OutOfBoundsRate"); + + /** + * Creates a new instance of NumericalDataQualityMetric value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NumericalDataQualityMetric() { + } + + /** + * Creates or finds a NumericalDataQualityMetric from its string representation. + * + * @param name a name to look for. + * @return the corresponding NumericalDataQualityMetric. + */ + public static NumericalDataQualityMetric fromString(String name) { + return fromString(name, NumericalDataQualityMetric.class); + } + + /** + * Gets known NumericalDataQualityMetric values. + * + * @return known NumericalDataQualityMetric values. + */ + public static Collection values() { + return values(NumericalDataQualityMetric.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NumericalDataQualityMetricThreshold.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NumericalDataQualityMetricThreshold.java new file mode 100644 index 0000000000000..52d7eb95ec72d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NumericalDataQualityMetricThreshold.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The NumericalDataQualityMetricThreshold model. + */ +@Fluent +public final class NumericalDataQualityMetricThreshold extends DataQualityMetricThresholdBase { + /* + * [Required] Specifies the data type of the metric threshold. + */ + private MonitoringFeatureDataType dataType = MonitoringFeatureDataType.NUMERICAL; + + /* + * [Required] The numerical data quality metric to calculate. + */ + private NumericalDataQualityMetric metric; + + /** + * Creates an instance of NumericalDataQualityMetricThreshold class. + */ + public NumericalDataQualityMetricThreshold() { + } + + /** + * Get the dataType property: [Required] Specifies the data type of the metric threshold. + * + * @return the dataType value. + */ + @Override + public MonitoringFeatureDataType dataType() { + return this.dataType; + } + + /** + * Get the metric property: [Required] The numerical data quality metric to calculate. + * + * @return the metric value. + */ + public NumericalDataQualityMetric metric() { + return this.metric; + } + + /** + * Set the metric property: [Required] The numerical data quality metric to calculate. + * + * @param metric the metric value to set. + * @return the NumericalDataQualityMetricThreshold object itself. + */ + public NumericalDataQualityMetricThreshold withMetric(NumericalDataQualityMetric metric) { + this.metric = metric; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public NumericalDataQualityMetricThreshold withThreshold(MonitoringThreshold threshold) { + super.withThreshold(threshold); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (metric() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property metric in model NumericalDataQualityMetricThreshold")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NumericalDataQualityMetricThreshold.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("threshold", threshold()); + jsonWriter.writeStringField("metric", this.metric == null ? null : this.metric.toString()); + jsonWriter.writeStringField("dataType", this.dataType == null ? null : this.dataType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NumericalDataQualityMetricThreshold from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NumericalDataQualityMetricThreshold if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NumericalDataQualityMetricThreshold. + */ + public static NumericalDataQualityMetricThreshold fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NumericalDataQualityMetricThreshold deserializedNumericalDataQualityMetricThreshold + = new NumericalDataQualityMetricThreshold(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("threshold".equals(fieldName)) { + deserializedNumericalDataQualityMetricThreshold.withThreshold(MonitoringThreshold.fromJson(reader)); + } else if ("metric".equals(fieldName)) { + deserializedNumericalDataQualityMetricThreshold.metric + = NumericalDataQualityMetric.fromString(reader.getString()); + } else if ("dataType".equals(fieldName)) { + deserializedNumericalDataQualityMetricThreshold.dataType + = MonitoringFeatureDataType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedNumericalDataQualityMetricThreshold; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NumericalPredictionDriftMetric.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NumericalPredictionDriftMetric.java new file mode 100644 index 0000000000000..379949abac71a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NumericalPredictionDriftMetric.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for NumericalPredictionDriftMetric. + */ +public final class NumericalPredictionDriftMetric extends ExpandableStringEnum { + /** + * Static value JensenShannonDistance for NumericalPredictionDriftMetric. + */ + public static final NumericalPredictionDriftMetric JENSEN_SHANNON_DISTANCE = fromString("JensenShannonDistance"); + + /** + * Static value PopulationStabilityIndex for NumericalPredictionDriftMetric. + */ + public static final NumericalPredictionDriftMetric POPULATION_STABILITY_INDEX + = fromString("PopulationStabilityIndex"); + + /** + * Static value NormalizedWassersteinDistance for NumericalPredictionDriftMetric. + */ + public static final NumericalPredictionDriftMetric NORMALIZED_WASSERSTEIN_DISTANCE + = fromString("NormalizedWassersteinDistance"); + + /** + * Static value TwoSampleKolmogorovSmirnovTest for NumericalPredictionDriftMetric. + */ + public static final NumericalPredictionDriftMetric TWO_SAMPLE_KOLMOGOROV_SMIRNOV_TEST + = fromString("TwoSampleKolmogorovSmirnovTest"); + + /** + * Creates a new instance of NumericalPredictionDriftMetric value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NumericalPredictionDriftMetric() { + } + + /** + * Creates or finds a NumericalPredictionDriftMetric from its string representation. + * + * @param name a name to look for. + * @return the corresponding NumericalPredictionDriftMetric. + */ + public static NumericalPredictionDriftMetric fromString(String name) { + return fromString(name, NumericalPredictionDriftMetric.class); + } + + /** + * Gets known NumericalPredictionDriftMetric values. + * + * @return known NumericalPredictionDriftMetric values. + */ + public static Collection values() { + return values(NumericalPredictionDriftMetric.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NumericalPredictionDriftMetricThreshold.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NumericalPredictionDriftMetricThreshold.java new file mode 100644 index 0000000000000..e56d7ca78a4e7 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/NumericalPredictionDriftMetricThreshold.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The NumericalPredictionDriftMetricThreshold model. + */ +@Fluent +public final class NumericalPredictionDriftMetricThreshold extends PredictionDriftMetricThresholdBase { + /* + * [Required] Specifies the data type of the metric threshold. + */ + private MonitoringFeatureDataType dataType = MonitoringFeatureDataType.NUMERICAL; + + /* + * [Required] The numerical prediction drift metric to calculate. + */ + private NumericalPredictionDriftMetric metric; + + /** + * Creates an instance of NumericalPredictionDriftMetricThreshold class. + */ + public NumericalPredictionDriftMetricThreshold() { + } + + /** + * Get the dataType property: [Required] Specifies the data type of the metric threshold. + * + * @return the dataType value. + */ + @Override + public MonitoringFeatureDataType dataType() { + return this.dataType; + } + + /** + * Get the metric property: [Required] The numerical prediction drift metric to calculate. + * + * @return the metric value. + */ + public NumericalPredictionDriftMetric metric() { + return this.metric; + } + + /** + * Set the metric property: [Required] The numerical prediction drift metric to calculate. + * + * @param metric the metric value to set. + * @return the NumericalPredictionDriftMetricThreshold object itself. + */ + public NumericalPredictionDriftMetricThreshold withMetric(NumericalPredictionDriftMetric metric) { + this.metric = metric; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public NumericalPredictionDriftMetricThreshold withThreshold(MonitoringThreshold threshold) { + super.withThreshold(threshold); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (metric() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property metric in model NumericalPredictionDriftMetricThreshold")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NumericalPredictionDriftMetricThreshold.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("threshold", threshold()); + jsonWriter.writeStringField("metric", this.metric == null ? null : this.metric.toString()); + jsonWriter.writeStringField("dataType", this.dataType == null ? null : this.dataType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NumericalPredictionDriftMetricThreshold from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NumericalPredictionDriftMetricThreshold if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NumericalPredictionDriftMetricThreshold. + */ + public static NumericalPredictionDriftMetricThreshold fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NumericalPredictionDriftMetricThreshold deserializedNumericalPredictionDriftMetricThreshold + = new NumericalPredictionDriftMetricThreshold(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("threshold".equals(fieldName)) { + deserializedNumericalPredictionDriftMetricThreshold + .withThreshold(MonitoringThreshold.fromJson(reader)); + } else if ("metric".equals(fieldName)) { + deserializedNumericalPredictionDriftMetricThreshold.metric + = NumericalPredictionDriftMetric.fromString(reader.getString()); + } else if ("dataType".equals(fieldName)) { + deserializedNumericalPredictionDriftMetricThreshold.dataType + = MonitoringFeatureDataType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedNumericalPredictionDriftMetricThreshold; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OAuth2AuthTypeWorkspaceConnectionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OAuth2AuthTypeWorkspaceConnectionProperties.java new file mode 100644 index 0000000000000..3cf0c81e54c45 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OAuth2AuthTypeWorkspaceConnectionProperties.java @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; + +/** + * The OAuth2AuthTypeWorkspaceConnectionProperties model. + */ +@Fluent +public final class OAuth2AuthTypeWorkspaceConnectionProperties extends WorkspaceConnectionPropertiesV2 { + /* + * Authentication type of the connection target + */ + private ConnectionAuthType authType = ConnectionAuthType.OAUTH2; + + /* + * ClientId and ClientSecret are required. Other properties are optional + * depending on each OAuth2 provider's implementation. + */ + private WorkspaceConnectionOAuth2 credentials; + + /* + * The createdByWorkspaceArmId property. + */ + private String createdByWorkspaceArmId; + + /* + * Group based on connection category + */ + private ConnectionGroup group; + + /** + * Creates an instance of OAuth2AuthTypeWorkspaceConnectionProperties class. + */ + public OAuth2AuthTypeWorkspaceConnectionProperties() { + } + + /** + * Get the authType property: Authentication type of the connection target. + * + * @return the authType value. + */ + @Override + public ConnectionAuthType authType() { + return this.authType; + } + + /** + * Get the credentials property: ClientId and ClientSecret are required. Other properties are optional + * depending on each OAuth2 provider's implementation. + * + * @return the credentials value. + */ + public WorkspaceConnectionOAuth2 credentials() { + return this.credentials; + } + + /** + * Set the credentials property: ClientId and ClientSecret are required. Other properties are optional + * depending on each OAuth2 provider's implementation. + * + * @param credentials the credentials value to set. + * @return the OAuth2AuthTypeWorkspaceConnectionProperties object itself. + */ + public OAuth2AuthTypeWorkspaceConnectionProperties withCredentials(WorkspaceConnectionOAuth2 credentials) { + this.credentials = credentials; + return this; + } + + /** + * Get the createdByWorkspaceArmId property: The createdByWorkspaceArmId property. + * + * @return the createdByWorkspaceArmId value. + */ + @Override + public String createdByWorkspaceArmId() { + return this.createdByWorkspaceArmId; + } + + /** + * Get the group property: Group based on connection category. + * + * @return the group value. + */ + @Override + public ConnectionGroup group() { + return this.group; + } + + /** + * {@inheritDoc} + */ + @Override + public OAuth2AuthTypeWorkspaceConnectionProperties withCategory(ConnectionCategory category) { + super.withCategory(category); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OAuth2AuthTypeWorkspaceConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { + super.withExpiryTime(expiryTime); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OAuth2AuthTypeWorkspaceConnectionProperties withIsSharedToAll(Boolean isSharedToAll) { + super.withIsSharedToAll(isSharedToAll); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OAuth2AuthTypeWorkspaceConnectionProperties withTarget(String target) { + super.withTarget(target); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OAuth2AuthTypeWorkspaceConnectionProperties withMetadata(Map metadata) { + super.withMetadata(metadata); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OAuth2AuthTypeWorkspaceConnectionProperties withSharedUserList(List sharedUserList) { + super.withSharedUserList(sharedUserList); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OAuth2AuthTypeWorkspaceConnectionProperties withValue(String value) { + super.withValue(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OAuth2AuthTypeWorkspaceConnectionProperties withValueFormat(ValueFormat valueFormat) { + super.withValueFormat(valueFormat); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (credentials() != null) { + credentials().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", category() == null ? null : category().toString()); + jsonWriter.writeStringField("expiryTime", + expiryTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expiryTime())); + jsonWriter.writeBooleanField("isSharedToAll", isSharedToAll()); + jsonWriter.writeStringField("target", target()); + jsonWriter.writeMapField("metadata", metadata(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("sharedUserList", sharedUserList(), + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("value", value()); + jsonWriter.writeStringField("valueFormat", valueFormat() == null ? null : valueFormat().toString()); + jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); + jsonWriter.writeJsonField("credentials", this.credentials); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OAuth2AuthTypeWorkspaceConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OAuth2AuthTypeWorkspaceConnectionProperties if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OAuth2AuthTypeWorkspaceConnectionProperties. + */ + public static OAuth2AuthTypeWorkspaceConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OAuth2AuthTypeWorkspaceConnectionProperties deserializedOAuth2AuthTypeWorkspaceConnectionProperties + = new OAuth2AuthTypeWorkspaceConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedOAuth2AuthTypeWorkspaceConnectionProperties + .withCategory(ConnectionCategory.fromString(reader.getString())); + } else if ("createdByWorkspaceArmId".equals(fieldName)) { + deserializedOAuth2AuthTypeWorkspaceConnectionProperties.createdByWorkspaceArmId + = reader.getString(); + } else if ("expiryTime".equals(fieldName)) { + deserializedOAuth2AuthTypeWorkspaceConnectionProperties.withExpiryTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("group".equals(fieldName)) { + deserializedOAuth2AuthTypeWorkspaceConnectionProperties.group + = ConnectionGroup.fromString(reader.getString()); + } else if ("isSharedToAll".equals(fieldName)) { + deserializedOAuth2AuthTypeWorkspaceConnectionProperties + .withIsSharedToAll(reader.getNullable(JsonReader::getBoolean)); + } else if ("target".equals(fieldName)) { + deserializedOAuth2AuthTypeWorkspaceConnectionProperties.withTarget(reader.getString()); + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedOAuth2AuthTypeWorkspaceConnectionProperties.withMetadata(metadata); + } else if ("sharedUserList".equals(fieldName)) { + List sharedUserList = reader.readArray(reader1 -> reader1.getString()); + deserializedOAuth2AuthTypeWorkspaceConnectionProperties.withSharedUserList(sharedUserList); + } else if ("value".equals(fieldName)) { + deserializedOAuth2AuthTypeWorkspaceConnectionProperties.withValue(reader.getString()); + } else if ("valueFormat".equals(fieldName)) { + deserializedOAuth2AuthTypeWorkspaceConnectionProperties + .withValueFormat(ValueFormat.fromString(reader.getString())); + } else if ("authType".equals(fieldName)) { + deserializedOAuth2AuthTypeWorkspaceConnectionProperties.authType + = ConnectionAuthType.fromString(reader.getString()); + } else if ("credentials".equals(fieldName)) { + deserializedOAuth2AuthTypeWorkspaceConnectionProperties.credentials + = WorkspaceConnectionOAuth2.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOAuth2AuthTypeWorkspaceConnectionProperties; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ObjectDetectionPrimaryMetrics.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ObjectDetectionPrimaryMetrics.java index 4bef9028bdad4..557f041b4d350 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ObjectDetectionPrimaryMetrics.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ObjectDetectionPrimaryMetrics.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Primary metrics for Image ObjectDetection task. */ +/** + * Primary metrics for Image ObjectDetection task. + */ public final class ObjectDetectionPrimaryMetrics extends ExpandableStringEnum { - /** Static value MeanAveragePrecision for ObjectDetectionPrimaryMetrics. */ + /** + * Static value MeanAveragePrecision for ObjectDetectionPrimaryMetrics. + */ public static final ObjectDetectionPrimaryMetrics MEAN_AVERAGE_PRECISION = fromString("MeanAveragePrecision"); /** * Creates a new instance of ObjectDetectionPrimaryMetrics value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -24,18 +27,17 @@ public ObjectDetectionPrimaryMetrics() { /** * Creates or finds a ObjectDetectionPrimaryMetrics from its string representation. - * + * * @param name a name to look for. * @return the corresponding ObjectDetectionPrimaryMetrics. */ - @JsonCreator public static ObjectDetectionPrimaryMetrics fromString(String name) { return fromString(name, ObjectDetectionPrimaryMetrics.class); } /** * Gets known ObjectDetectionPrimaryMetrics values. - * + * * @return known ObjectDetectionPrimaryMetrics values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Objective.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Objective.java index bd09112175ace..23883f1c833d7 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Objective.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Objective.java @@ -6,30 +6,36 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Optimization objective. */ +/** + * Optimization objective. + */ @Fluent -public final class Objective { +public final class Objective implements JsonSerializable { /* * [Required] Defines supported metric goals for hyperparameter tuning */ - @JsonProperty(value = "goal", required = true) private Goal goal; /* * [Required] Name of the metric to optimize. */ - @JsonProperty(value = "primaryMetric", required = true) private String primaryMetric; - /** Creates an instance of Objective class. */ + /** + * Creates an instance of Objective class. + */ public Objective() { } /** * Get the goal property: [Required] Defines supported metric goals for hyperparameter tuning. - * + * * @return the goal value. */ public Goal goal() { @@ -38,7 +44,7 @@ public Goal goal() { /** * Set the goal property: [Required] Defines supported metric goals for hyperparameter tuning. - * + * * @param goal the goal value to set. * @return the Objective object itself. */ @@ -49,7 +55,7 @@ public Objective withGoal(Goal goal) { /** * Get the primaryMetric property: [Required] Name of the metric to optimize. - * + * * @return the primaryMetric value. */ public String primaryMetric() { @@ -58,7 +64,7 @@ public String primaryMetric() { /** * Set the primaryMetric property: [Required] Name of the metric to optimize. - * + * * @param primaryMetric the primaryMetric value to set. * @return the Objective object itself. */ @@ -69,20 +75,59 @@ public Objective withPrimaryMetric(String primaryMetric) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (goal() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property goal in model Objective")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property goal in model Objective")); } if (primaryMetric() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property primaryMetric in model Objective")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property primaryMetric in model Objective")); } } private static final ClientLogger LOGGER = new ClientLogger(Objective.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("goal", this.goal == null ? null : this.goal.toString()); + jsonWriter.writeStringField("primaryMetric", this.primaryMetric); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Objective from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Objective if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Objective. + */ + public static Objective fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Objective deserializedObjective = new Objective(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("goal".equals(fieldName)) { + deserializedObjective.goal = Goal.fromString(reader.getString()); + } else if ("primaryMetric".equals(fieldName)) { + deserializedObjective.primaryMetric = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedObjective; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OneLakeArtifact.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OneLakeArtifact.java new file mode 100644 index 0000000000000..6fcf7216d7829 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OneLakeArtifact.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * OneLake artifact (data source) configuration. + */ +@Fluent +public class OneLakeArtifact implements JsonSerializable { + /* + * [Required] OneLake artifact type + */ + private OneLakeArtifactType artifactType = OneLakeArtifactType.fromString("OneLakeArtifact"); + + /* + * [Required] OneLake artifact name + */ + private String artifactName; + + /** + * Creates an instance of OneLakeArtifact class. + */ + public OneLakeArtifact() { + } + + /** + * Get the artifactType property: [Required] OneLake artifact type. + * + * @return the artifactType value. + */ + public OneLakeArtifactType artifactType() { + return this.artifactType; + } + + /** + * Get the artifactName property: [Required] OneLake artifact name. + * + * @return the artifactName value. + */ + public String artifactName() { + return this.artifactName; + } + + /** + * Set the artifactName property: [Required] OneLake artifact name. + * + * @param artifactName the artifactName value to set. + * @return the OneLakeArtifact object itself. + */ + public OneLakeArtifact withArtifactName(String artifactName) { + this.artifactName = artifactName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (artifactName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property artifactName in model OneLakeArtifact")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OneLakeArtifact.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("artifactName", this.artifactName); + jsonWriter.writeStringField("artifactType", this.artifactType == null ? null : this.artifactType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OneLakeArtifact from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OneLakeArtifact if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OneLakeArtifact. + */ + public static OneLakeArtifact fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("artifactType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("LakeHouse".equals(discriminatorValue)) { + return LakeHouseArtifact.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static OneLakeArtifact fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OneLakeArtifact deserializedOneLakeArtifact = new OneLakeArtifact(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("artifactName".equals(fieldName)) { + deserializedOneLakeArtifact.artifactName = reader.getString(); + } else if ("artifactType".equals(fieldName)) { + deserializedOneLakeArtifact.artifactType = OneLakeArtifactType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOneLakeArtifact; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OneLakeArtifactType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OneLakeArtifactType.java new file mode 100644 index 0000000000000..20461e8621f08 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OneLakeArtifactType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum to determine OneLake artifact type. + */ +public final class OneLakeArtifactType extends ExpandableStringEnum { + /** + * Static value LakeHouse for OneLakeArtifactType. + */ + public static final OneLakeArtifactType LAKE_HOUSE = fromString("LakeHouse"); + + /** + * Creates a new instance of OneLakeArtifactType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OneLakeArtifactType() { + } + + /** + * Creates or finds a OneLakeArtifactType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OneLakeArtifactType. + */ + public static OneLakeArtifactType fromString(String name) { + return fromString(name, OneLakeArtifactType.class); + } + + /** + * Gets known OneLakeArtifactType values. + * + * @return known OneLakeArtifactType values. + */ + public static Collection values() { + return values(OneLakeArtifactType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OneLakeDatastore.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OneLakeDatastore.java new file mode 100644 index 0000000000000..11a5f1b030200 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OneLakeDatastore.java @@ -0,0 +1,284 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * OneLake (Trident) datastore configuration. + */ +@Fluent +public final class OneLakeDatastore extends DatastoreProperties { + /* + * [Required] Storage type backing the datastore. + */ + private DatastoreType datastoreType = DatastoreType.ONE_LAKE; + + /* + * [Required] OneLake artifact backing the datastore. + */ + private OneLakeArtifact artifact; + + /* + * OneLake endpoint to use for the datastore. + */ + private String endpoint; + + /* + * [Required] OneLake workspace name. + */ + private String oneLakeWorkspaceName; + + /* + * Indicates which identity to use to authenticate service data access to customer's storage. + */ + private ServiceDataAccessAuthIdentity serviceDataAccessAuthIdentity; + + /* + * Readonly property to indicate if datastore is the workspace default datastore + */ + private Boolean isDefault; + + /** + * Creates an instance of OneLakeDatastore class. + */ + public OneLakeDatastore() { + } + + /** + * Get the datastoreType property: [Required] Storage type backing the datastore. + * + * @return the datastoreType value. + */ + @Override + public DatastoreType datastoreType() { + return this.datastoreType; + } + + /** + * Get the artifact property: [Required] OneLake artifact backing the datastore. + * + * @return the artifact value. + */ + public OneLakeArtifact artifact() { + return this.artifact; + } + + /** + * Set the artifact property: [Required] OneLake artifact backing the datastore. + * + * @param artifact the artifact value to set. + * @return the OneLakeDatastore object itself. + */ + public OneLakeDatastore withArtifact(OneLakeArtifact artifact) { + this.artifact = artifact; + return this; + } + + /** + * Get the endpoint property: OneLake endpoint to use for the datastore. + * + * @return the endpoint value. + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Set the endpoint property: OneLake endpoint to use for the datastore. + * + * @param endpoint the endpoint value to set. + * @return the OneLakeDatastore object itself. + */ + public OneLakeDatastore withEndpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /** + * Get the oneLakeWorkspaceName property: [Required] OneLake workspace name. + * + * @return the oneLakeWorkspaceName value. + */ + public String oneLakeWorkspaceName() { + return this.oneLakeWorkspaceName; + } + + /** + * Set the oneLakeWorkspaceName property: [Required] OneLake workspace name. + * + * @param oneLakeWorkspaceName the oneLakeWorkspaceName value to set. + * @return the OneLakeDatastore object itself. + */ + public OneLakeDatastore withOneLakeWorkspaceName(String oneLakeWorkspaceName) { + this.oneLakeWorkspaceName = oneLakeWorkspaceName; + return this; + } + + /** + * Get the serviceDataAccessAuthIdentity property: Indicates which identity to use to authenticate service data + * access to customer's storage. + * + * @return the serviceDataAccessAuthIdentity value. + */ + public ServiceDataAccessAuthIdentity serviceDataAccessAuthIdentity() { + return this.serviceDataAccessAuthIdentity; + } + + /** + * Set the serviceDataAccessAuthIdentity property: Indicates which identity to use to authenticate service data + * access to customer's storage. + * + * @param serviceDataAccessAuthIdentity the serviceDataAccessAuthIdentity value to set. + * @return the OneLakeDatastore object itself. + */ + public OneLakeDatastore + withServiceDataAccessAuthIdentity(ServiceDataAccessAuthIdentity serviceDataAccessAuthIdentity) { + this.serviceDataAccessAuthIdentity = serviceDataAccessAuthIdentity; + return this; + } + + /** + * Get the isDefault property: Readonly property to indicate if datastore is the workspace default datastore. + * + * @return the isDefault value. + */ + @Override + public Boolean isDefault() { + return this.isDefault; + } + + /** + * {@inheritDoc} + */ + @Override + public OneLakeDatastore withCredentials(DatastoreCredentials credentials) { + super.withCredentials(credentials); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OneLakeDatastore withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OneLakeDatastore withProperties(Map properties) { + super.withProperties(properties); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OneLakeDatastore withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (artifact() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property artifact in model OneLakeDatastore")); + } else { + artifact().validate(); + } + if (oneLakeWorkspaceName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property oneLakeWorkspaceName in model OneLakeDatastore")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OneLakeDatastore.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("credentials", credentials()); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("artifact", this.artifact); + jsonWriter.writeStringField("oneLakeWorkspaceName", this.oneLakeWorkspaceName); + jsonWriter.writeStringField("datastoreType", this.datastoreType == null ? null : this.datastoreType.toString()); + jsonWriter.writeStringField("endpoint", this.endpoint); + jsonWriter.writeStringField("serviceDataAccessAuthIdentity", + this.serviceDataAccessAuthIdentity == null ? null : this.serviceDataAccessAuthIdentity.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OneLakeDatastore from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OneLakeDatastore if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OneLakeDatastore. + */ + public static OneLakeDatastore fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OneLakeDatastore deserializedOneLakeDatastore = new OneLakeDatastore(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("credentials".equals(fieldName)) { + deserializedOneLakeDatastore.withCredentials(DatastoreCredentials.fromJson(reader)); + } else if ("description".equals(fieldName)) { + deserializedOneLakeDatastore.withDescription(reader.getString()); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedOneLakeDatastore.withProperties(properties); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedOneLakeDatastore.withTags(tags); + } else if ("isDefault".equals(fieldName)) { + deserializedOneLakeDatastore.isDefault = reader.getNullable(JsonReader::getBoolean); + } else if ("artifact".equals(fieldName)) { + deserializedOneLakeDatastore.artifact = OneLakeArtifact.fromJson(reader); + } else if ("oneLakeWorkspaceName".equals(fieldName)) { + deserializedOneLakeDatastore.oneLakeWorkspaceName = reader.getString(); + } else if ("datastoreType".equals(fieldName)) { + deserializedOneLakeDatastore.datastoreType = DatastoreType.fromString(reader.getString()); + } else if ("endpoint".equals(fieldName)) { + deserializedOneLakeDatastore.endpoint = reader.getString(); + } else if ("serviceDataAccessAuthIdentity".equals(fieldName)) { + deserializedOneLakeDatastore.serviceDataAccessAuthIdentity + = ServiceDataAccessAuthIdentity.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOneLakeDatastore; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineDeployment.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineDeployment.java index 2a4d9145dae6e..73190f6226a95 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineDeployment.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineDeployment.java @@ -11,46 +11,48 @@ import com.azure.resourcemanager.machinelearning.fluent.models.OnlineDeploymentInner; import java.util.Map; -/** An immutable client-side representation of OnlineDeployment. */ +/** + * An immutable client-side representation of OnlineDeployment. + */ public interface OnlineDeployment { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the location property: The geo-location where the resource lives. - * + * * @return the location value. */ String location(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); /** * Gets the identity property: Managed service identity (system assigned and/or user assigned identities). - * + * * @return the identity value. */ ManagedServiceIdentity identity(); @@ -58,78 +60,84 @@ public interface OnlineDeployment { /** * Gets the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of * the same type. - * + * * @return the kind value. */ String kind(); /** * Gets the properties property: [Required] Additional attributes of the entity. - * + * * @return the properties value. */ OnlineDeploymentProperties properties(); /** * Gets the sku property: Sku details required for ARM contract for Autoscaling. - * + * * @return the sku value. */ Sku sku(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.OnlineDeploymentInner object. - * + * * @return the inner object. */ OnlineDeploymentInner innerModel(); - /** The entirety of the OnlineDeployment definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithParentResource, - DefinitionStages.WithProperties, - DefinitionStages.WithCreate { + /** + * The entirety of the OnlineDeployment definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, DefinitionStages.WithProperties, DefinitionStages.WithCreate { } - /** The OnlineDeployment definition stages. */ + + /** + * The OnlineDeployment definition stages. + */ interface DefinitionStages { - /** The first stage of the OnlineDeployment definition. */ + /** + * The first stage of the OnlineDeployment definition. + */ interface Blank extends WithLocation { } - /** The stage of the OnlineDeployment definition allowing to specify location. */ + + /** + * The stage of the OnlineDeployment definition allowing to specify location. + */ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -137,160 +145,188 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithParentResource withRegion(String location); } - /** The stage of the OnlineDeployment definition allowing to specify parent resource. */ + + /** + * The stage of the OnlineDeployment definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, workspaceName, endpointName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. * @return the next definition stage. */ - WithProperties withExistingOnlineEndpoint( - String resourceGroupName, String workspaceName, String endpointName); + WithProperties withExistingOnlineEndpoint(String resourceGroupName, String workspaceName, + String endpointName); } - /** The stage of the OnlineDeployment definition allowing to specify properties. */ + + /** + * The stage of the OnlineDeployment definition allowing to specify properties. + */ interface WithProperties { /** * Specifies the properties property: [Required] Additional attributes of the entity.. - * + * * @param properties [Required] Additional attributes of the entity. * @return the next definition stage. */ WithCreate withProperties(OnlineDeploymentProperties properties); } + /** * The stage of the OnlineDeployment definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. */ - interface WithCreate - extends DefinitionStages.WithTags, - DefinitionStages.WithIdentity, - DefinitionStages.WithKind, - DefinitionStages.WithSku { + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, + DefinitionStages.WithKind, DefinitionStages.WithSku { /** * Executes the create request. - * + * * @return the created resource. */ OnlineDeployment create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ OnlineDeployment create(Context context); } - /** The stage of the OnlineDeployment definition allowing to specify tags. */ + + /** + * The stage of the OnlineDeployment definition allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ WithCreate withTags(Map tags); } - /** The stage of the OnlineDeployment definition allowing to specify identity. */ + + /** + * The stage of the OnlineDeployment definition allowing to specify identity. + */ interface WithIdentity { /** * Specifies the identity property: Managed service identity (system assigned and/or user assigned * identities). - * + * * @param identity Managed service identity (system assigned and/or user assigned identities). * @return the next definition stage. */ WithCreate withIdentity(ManagedServiceIdentity identity); } - /** The stage of the OnlineDeployment definition allowing to specify kind. */ + + /** + * The stage of the OnlineDeployment definition allowing to specify kind. + */ interface WithKind { /** * Specifies the kind property: Metadata used by portal/tooling/etc to render different UX experiences for * resources of the same type.. - * + * * @param kind Metadata used by portal/tooling/etc to render different UX experiences for resources of the - * same type. + * same type. * @return the next definition stage. */ WithCreate withKind(String kind); } - /** The stage of the OnlineDeployment definition allowing to specify sku. */ + + /** + * The stage of the OnlineDeployment definition allowing to specify sku. + */ interface WithSku { /** * Specifies the sku property: Sku details required for ARM contract for Autoscaling.. - * + * * @param sku Sku details required for ARM contract for Autoscaling. * @return the next definition stage. */ WithCreate withSku(Sku sku); } } + /** * Begins update for the OnlineDeployment resource. - * + * * @return the stage of resource update. */ OnlineDeployment.Update update(); - /** The template for OnlineDeployment update. */ + /** + * The template for OnlineDeployment update. + */ interface Update extends UpdateStages.WithTags, UpdateStages.WithSku { /** * Executes the update request. - * + * * @return the updated resource. */ OnlineDeployment apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ OnlineDeployment apply(Context context); } - /** The OnlineDeployment update stages. */ + + /** + * The OnlineDeployment update stages. + */ interface UpdateStages { - /** The stage of the OnlineDeployment update allowing to specify tags. */ + /** + * The stage of the OnlineDeployment update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ Update withTags(Map tags); } - /** The stage of the OnlineDeployment update allowing to specify sku. */ + + /** + * The stage of the OnlineDeployment update allowing to specify sku. + */ interface WithSku { /** * Specifies the sku property: Sku details required for ARM contract for Autoscaling.. - * + * * @param sku Sku details required for ARM contract for Autoscaling. * @return the next definition stage. */ Update withSku(PartialSku sku); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ OnlineDeployment refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ @@ -298,7 +334,7 @@ interface WithSku { /** * Polls an Endpoint operation. - * + * * @param body The request containing parameters for retrieving logs. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -310,7 +346,7 @@ interface WithSku { /** * Polls an Endpoint operation. - * + * * @param body The request containing parameters for retrieving logs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineDeploymentProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineDeploymentProperties.java index fff47cc6a83f4..2091a3f5a154e 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineDeploymentProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineDeploymentProperties.java @@ -5,78 +5,71 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** The OnlineDeploymentProperties model. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "endpointComputeType", - defaultImpl = OnlineDeploymentProperties.class) -@JsonTypeName("OnlineDeploymentProperties") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "Kubernetes", value = KubernetesOnlineDeployment.class), - @JsonSubTypes.Type(name = "Managed", value = ManagedOnlineDeployment.class) -}) +/** + * The OnlineDeploymentProperties model. + */ @Fluent public class OnlineDeploymentProperties extends EndpointDeploymentPropertiesBase { + /* + * [Required] The compute type of the endpoint. + */ + private EndpointComputeType endpointComputeType = EndpointComputeType.fromString("OnlineDeploymentProperties"); + /* * If true, enables Application Insights logging. */ - @JsonProperty(value = "appInsightsEnabled") private Boolean appInsightsEnabled; + /* + * The mdc configuration, we disable mdc when it's null. + */ + private DataCollector dataCollector; + /* * If Enabled, allow egress public network access. If Disabled, this will create secure egress. Default: Enabled. */ - @JsonProperty(value = "egressPublicNetworkAccess") private EgressPublicNetworkAccessType egressPublicNetworkAccess; /* * Compute instance type. */ - @JsonProperty(value = "instanceType") private String instanceType; /* * Liveness probe monitors the health of the container regularly. */ - @JsonProperty(value = "livenessProbe") private ProbeSettings livenessProbe; /* * The URI path to the model. */ - @JsonProperty(value = "model") private String model; /* * The path to mount the model in custom container. */ - @JsonProperty(value = "modelMountPath") private String modelMountPath; /* * Provisioning state for the endpoint deployment. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private DeploymentProvisioningState provisioningState; /* - * Readiness probe validates if the container is ready to serve traffic. The properties and defaults are the same - * as liveness probe. + * Readiness probe validates if the container is ready to serve traffic. The properties and defaults are the same as + * liveness probe. */ - @JsonProperty(value = "readinessProbe") private ProbeSettings readinessProbe; /* * Request settings for the deployment. */ - @JsonProperty(value = "requestSettings") private OnlineRequestSettings requestSettings; /* @@ -85,16 +78,26 @@ public class OnlineDeploymentProperties extends EndpointDeploymentPropertiesBase * it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment * and to DefaultScaleSettings for ManagedOnlineDeployment. */ - @JsonProperty(value = "scaleSettings") private OnlineScaleSettings scaleSettings; - /** Creates an instance of OnlineDeploymentProperties class. */ + /** + * Creates an instance of OnlineDeploymentProperties class. + */ public OnlineDeploymentProperties() { } + /** + * Get the endpointComputeType property: [Required] The compute type of the endpoint. + * + * @return the endpointComputeType value. + */ + public EndpointComputeType endpointComputeType() { + return this.endpointComputeType; + } + /** * Get the appInsightsEnabled property: If true, enables Application Insights logging. - * + * * @return the appInsightsEnabled value. */ public Boolean appInsightsEnabled() { @@ -103,7 +106,7 @@ public Boolean appInsightsEnabled() { /** * Set the appInsightsEnabled property: If true, enables Application Insights logging. - * + * * @param appInsightsEnabled the appInsightsEnabled value to set. * @return the OnlineDeploymentProperties object itself. */ @@ -112,10 +115,30 @@ public OnlineDeploymentProperties withAppInsightsEnabled(Boolean appInsightsEnab return this; } + /** + * Get the dataCollector property: The mdc configuration, we disable mdc when it's null. + * + * @return the dataCollector value. + */ + public DataCollector dataCollector() { + return this.dataCollector; + } + + /** + * Set the dataCollector property: The mdc configuration, we disable mdc when it's null. + * + * @param dataCollector the dataCollector value to set. + * @return the OnlineDeploymentProperties object itself. + */ + public OnlineDeploymentProperties withDataCollector(DataCollector dataCollector) { + this.dataCollector = dataCollector; + return this; + } + /** * Get the egressPublicNetworkAccess property: If Enabled, allow egress public network access. If Disabled, this * will create secure egress. Default: Enabled. - * + * * @return the egressPublicNetworkAccess value. */ public EgressPublicNetworkAccessType egressPublicNetworkAccess() { @@ -125,19 +148,19 @@ public EgressPublicNetworkAccessType egressPublicNetworkAccess() { /** * Set the egressPublicNetworkAccess property: If Enabled, allow egress public network access. If Disabled, this * will create secure egress. Default: Enabled. - * + * * @param egressPublicNetworkAccess the egressPublicNetworkAccess value to set. * @return the OnlineDeploymentProperties object itself. */ - public OnlineDeploymentProperties withEgressPublicNetworkAccess( - EgressPublicNetworkAccessType egressPublicNetworkAccess) { + public OnlineDeploymentProperties + withEgressPublicNetworkAccess(EgressPublicNetworkAccessType egressPublicNetworkAccess) { this.egressPublicNetworkAccess = egressPublicNetworkAccess; return this; } /** * Get the instanceType property: Compute instance type. - * + * * @return the instanceType value. */ public String instanceType() { @@ -146,7 +169,7 @@ public String instanceType() { /** * Set the instanceType property: Compute instance type. - * + * * @param instanceType the instanceType value to set. * @return the OnlineDeploymentProperties object itself. */ @@ -157,7 +180,7 @@ public OnlineDeploymentProperties withInstanceType(String instanceType) { /** * Get the livenessProbe property: Liveness probe monitors the health of the container regularly. - * + * * @return the livenessProbe value. */ public ProbeSettings livenessProbe() { @@ -166,7 +189,7 @@ public ProbeSettings livenessProbe() { /** * Set the livenessProbe property: Liveness probe monitors the health of the container regularly. - * + * * @param livenessProbe the livenessProbe value to set. * @return the OnlineDeploymentProperties object itself. */ @@ -177,7 +200,7 @@ public OnlineDeploymentProperties withLivenessProbe(ProbeSettings livenessProbe) /** * Get the model property: The URI path to the model. - * + * * @return the model value. */ public String model() { @@ -186,7 +209,7 @@ public String model() { /** * Set the model property: The URI path to the model. - * + * * @param model the model value to set. * @return the OnlineDeploymentProperties object itself. */ @@ -197,7 +220,7 @@ public OnlineDeploymentProperties withModel(String model) { /** * Get the modelMountPath property: The path to mount the model in custom container. - * + * * @return the modelMountPath value. */ public String modelMountPath() { @@ -206,7 +229,7 @@ public String modelMountPath() { /** * Set the modelMountPath property: The path to mount the model in custom container. - * + * * @param modelMountPath the modelMountPath value to set. * @return the OnlineDeploymentProperties object itself. */ @@ -217,17 +240,28 @@ public OnlineDeploymentProperties withModelMountPath(String modelMountPath) { /** * Get the provisioningState property: Provisioning state for the endpoint deployment. - * + * * @return the provisioningState value. */ public DeploymentProvisioningState provisioningState() { return this.provisioningState; } + /** + * Set the provisioningState property: Provisioning state for the endpoint deployment. + * + * @param provisioningState the provisioningState value to set. + * @return the OnlineDeploymentProperties object itself. + */ + OnlineDeploymentProperties withProvisioningState(DeploymentProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + /** * Get the readinessProbe property: Readiness probe validates if the container is ready to serve traffic. The * properties and defaults are the same as liveness probe. - * + * * @return the readinessProbe value. */ public ProbeSettings readinessProbe() { @@ -237,7 +271,7 @@ public ProbeSettings readinessProbe() { /** * Set the readinessProbe property: Readiness probe validates if the container is ready to serve traffic. The * properties and defaults are the same as liveness probe. - * + * * @param readinessProbe the readinessProbe value to set. * @return the OnlineDeploymentProperties object itself. */ @@ -248,7 +282,7 @@ public OnlineDeploymentProperties withReadinessProbe(ProbeSettings readinessProb /** * Get the requestSettings property: Request settings for the deployment. - * + * * @return the requestSettings value. */ public OnlineRequestSettings requestSettings() { @@ -257,7 +291,7 @@ public OnlineRequestSettings requestSettings() { /** * Set the requestSettings property: Request settings for the deployment. - * + * * @param requestSettings the requestSettings value to set. * @return the OnlineDeploymentProperties object itself. */ @@ -267,10 +301,11 @@ public OnlineDeploymentProperties withRequestSettings(OnlineRequestSettings requ } /** - * Get the scaleSettings property: Scale settings for the deployment. If it is null or not provided, it defaults to - * TargetUtilizationScaleSettings for KubernetesOnlineDeployment and to DefaultScaleSettings for - * ManagedOnlineDeployment. - * + * Get the scaleSettings property: Scale settings for the deployment. + * If it is null or not provided, + * it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment + * and to DefaultScaleSettings for ManagedOnlineDeployment. + * * @return the scaleSettings value. */ public OnlineScaleSettings scaleSettings() { @@ -278,10 +313,11 @@ public OnlineScaleSettings scaleSettings() { } /** - * Set the scaleSettings property: Scale settings for the deployment. If it is null or not provided, it defaults to - * TargetUtilizationScaleSettings for KubernetesOnlineDeployment and to DefaultScaleSettings for - * ManagedOnlineDeployment. - * + * Set the scaleSettings property: Scale settings for the deployment. + * If it is null or not provided, + * it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment + * and to DefaultScaleSettings for ManagedOnlineDeployment. + * * @param scaleSettings the scaleSettings value to set. * @return the OnlineDeploymentProperties object itself. */ @@ -290,35 +326,45 @@ public OnlineDeploymentProperties withScaleSettings(OnlineScaleSettings scaleSet return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public OnlineDeploymentProperties withCodeConfiguration(CodeConfiguration codeConfiguration) { super.withCodeConfiguration(codeConfiguration); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public OnlineDeploymentProperties withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public OnlineDeploymentProperties withEnvironmentId(String environmentId) { super.withEnvironmentId(environmentId); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public OnlineDeploymentProperties withEnvironmentVariables(Map environmentVariables) { super.withEnvironmentVariables(environmentVariables); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public OnlineDeploymentProperties withProperties(Map properties) { super.withProperties(properties); @@ -327,12 +373,15 @@ public OnlineDeploymentProperties withProperties(Map properties) /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); + if (dataCollector() != null) { + dataCollector().validate(); + } if (livenessProbe() != null) { livenessProbe().validate(); } @@ -346,4 +395,123 @@ public void validate() { scaleSettings().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("codeConfiguration", codeConfiguration()); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("environmentId", environmentId()); + jsonWriter.writeMapField("environmentVariables", environmentVariables(), + (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("endpointComputeType", + this.endpointComputeType == null ? null : this.endpointComputeType.toString()); + jsonWriter.writeBooleanField("appInsightsEnabled", this.appInsightsEnabled); + jsonWriter.writeJsonField("dataCollector", this.dataCollector); + jsonWriter.writeStringField("egressPublicNetworkAccess", + this.egressPublicNetworkAccess == null ? null : this.egressPublicNetworkAccess.toString()); + jsonWriter.writeStringField("instanceType", this.instanceType); + jsonWriter.writeJsonField("livenessProbe", this.livenessProbe); + jsonWriter.writeStringField("model", this.model); + jsonWriter.writeStringField("modelMountPath", this.modelMountPath); + jsonWriter.writeJsonField("readinessProbe", this.readinessProbe); + jsonWriter.writeJsonField("requestSettings", this.requestSettings); + jsonWriter.writeJsonField("scaleSettings", this.scaleSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OnlineDeploymentProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OnlineDeploymentProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OnlineDeploymentProperties. + */ + public static OnlineDeploymentProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("endpointComputeType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Kubernetes".equals(discriminatorValue)) { + return KubernetesOnlineDeployment.fromJson(readerToUse.reset()); + } else if ("Managed".equals(discriminatorValue)) { + return ManagedOnlineDeployment.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static OnlineDeploymentProperties fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OnlineDeploymentProperties deserializedOnlineDeploymentProperties = new OnlineDeploymentProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("codeConfiguration".equals(fieldName)) { + deserializedOnlineDeploymentProperties.withCodeConfiguration(CodeConfiguration.fromJson(reader)); + } else if ("description".equals(fieldName)) { + deserializedOnlineDeploymentProperties.withDescription(reader.getString()); + } else if ("environmentId".equals(fieldName)) { + deserializedOnlineDeploymentProperties.withEnvironmentId(reader.getString()); + } else if ("environmentVariables".equals(fieldName)) { + Map environmentVariables = reader.readMap(reader1 -> reader1.getString()); + deserializedOnlineDeploymentProperties.withEnvironmentVariables(environmentVariables); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedOnlineDeploymentProperties.withProperties(properties); + } else if ("endpointComputeType".equals(fieldName)) { + deserializedOnlineDeploymentProperties.endpointComputeType + = EndpointComputeType.fromString(reader.getString()); + } else if ("appInsightsEnabled".equals(fieldName)) { + deserializedOnlineDeploymentProperties.appInsightsEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("dataCollector".equals(fieldName)) { + deserializedOnlineDeploymentProperties.dataCollector = DataCollector.fromJson(reader); + } else if ("egressPublicNetworkAccess".equals(fieldName)) { + deserializedOnlineDeploymentProperties.egressPublicNetworkAccess + = EgressPublicNetworkAccessType.fromString(reader.getString()); + } else if ("instanceType".equals(fieldName)) { + deserializedOnlineDeploymentProperties.instanceType = reader.getString(); + } else if ("livenessProbe".equals(fieldName)) { + deserializedOnlineDeploymentProperties.livenessProbe = ProbeSettings.fromJson(reader); + } else if ("model".equals(fieldName)) { + deserializedOnlineDeploymentProperties.model = reader.getString(); + } else if ("modelMountPath".equals(fieldName)) { + deserializedOnlineDeploymentProperties.modelMountPath = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedOnlineDeploymentProperties.provisioningState + = DeploymentProvisioningState.fromString(reader.getString()); + } else if ("readinessProbe".equals(fieldName)) { + deserializedOnlineDeploymentProperties.readinessProbe = ProbeSettings.fromJson(reader); + } else if ("requestSettings".equals(fieldName)) { + deserializedOnlineDeploymentProperties.requestSettings = OnlineRequestSettings.fromJson(reader); + } else if ("scaleSettings".equals(fieldName)) { + deserializedOnlineDeploymentProperties.scaleSettings = OnlineScaleSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOnlineDeploymentProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineDeploymentTrackedResourceArmPaginatedResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineDeploymentTrackedResourceArmPaginatedResult.java index b9915874b1ca4..37c68eaddc1c9 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineDeploymentTrackedResourceArmPaginatedResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineDeploymentTrackedResourceArmPaginatedResult.java @@ -5,33 +5,40 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.fluent.models.OnlineDeploymentInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** A paginated list of OnlineDeployment entities. */ +/** + * A paginated list of OnlineDeployment entities. + */ @Fluent -public final class OnlineDeploymentTrackedResourceArmPaginatedResult { +public final class OnlineDeploymentTrackedResourceArmPaginatedResult + implements JsonSerializable { /* * The link to the next page of OnlineDeployment objects. If null, there are no additional pages. */ - @JsonProperty(value = "nextLink") private String nextLink; /* * An array of objects of type OnlineDeployment. */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of OnlineDeploymentTrackedResourceArmPaginatedResult class. */ + /** + * Creates an instance of OnlineDeploymentTrackedResourceArmPaginatedResult class. + */ public OnlineDeploymentTrackedResourceArmPaginatedResult() { } /** * Get the nextLink property: The link to the next page of OnlineDeployment objects. If null, there are no * additional pages. - * + * * @return the nextLink value. */ public String nextLink() { @@ -41,7 +48,7 @@ public String nextLink() { /** * Set the nextLink property: The link to the next page of OnlineDeployment objects. If null, there are no * additional pages. - * + * * @param nextLink the nextLink value to set. * @return the OnlineDeploymentTrackedResourceArmPaginatedResult object itself. */ @@ -52,7 +59,7 @@ public OnlineDeploymentTrackedResourceArmPaginatedResult withNextLink(String nex /** * Get the value property: An array of objects of type OnlineDeployment. - * + * * @return the value value. */ public List value() { @@ -61,7 +68,7 @@ public List value() { /** * Set the value property: An array of objects of type OnlineDeployment. - * + * * @param value the value value to set. * @return the OnlineDeploymentTrackedResourceArmPaginatedResult object itself. */ @@ -72,7 +79,7 @@ public OnlineDeploymentTrackedResourceArmPaginatedResult withValue(List e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OnlineDeploymentTrackedResourceArmPaginatedResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OnlineDeploymentTrackedResourceArmPaginatedResult if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OnlineDeploymentTrackedResourceArmPaginatedResult. + */ + public static OnlineDeploymentTrackedResourceArmPaginatedResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OnlineDeploymentTrackedResourceArmPaginatedResult deserializedOnlineDeploymentTrackedResourceArmPaginatedResult + = new OnlineDeploymentTrackedResourceArmPaginatedResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedOnlineDeploymentTrackedResourceArmPaginatedResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> OnlineDeploymentInner.fromJson(reader1)); + deserializedOnlineDeploymentTrackedResourceArmPaginatedResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedOnlineDeploymentTrackedResourceArmPaginatedResult; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineDeployments.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineDeployments.java index 4e07db5be0f8c..99cbd345a1aa2 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineDeployments.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineDeployments.java @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of OnlineDeployments. */ +/** + * Resource collection API of OnlineDeployments. + */ public interface OnlineDeployments { /** * List Inference Endpoint Deployments. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -25,7 +27,7 @@ public interface OnlineDeployments { /** * List Inference Endpoint Deployments. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -38,18 +40,12 @@ public interface OnlineDeployments { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of OnlineDeployment entities as paginated response with {@link PagedIterable}. */ - PagedIterable list( - String resourceGroupName, - String workspaceName, - String endpointName, - String orderBy, - Integer top, - String skip, - Context context); + PagedIterable list(String resourceGroupName, String workspaceName, String endpointName, + String orderBy, Integer top, String skip, Context context); /** * Delete Inference Endpoint Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -62,7 +58,7 @@ PagedIterable list( /** * Delete Inference Endpoint Deployment (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -72,12 +68,12 @@ PagedIterable list( * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void delete( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName, Context context); + void delete(String resourceGroupName, String workspaceName, String endpointName, String deploymentName, + Context context); /** * Get Inference Deployment Deployment. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -88,12 +84,12 @@ void delete( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return inference Deployment Deployment along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName, Context context); + Response getWithResponse(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName, Context context); /** * Get Inference Deployment Deployment. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -107,7 +103,7 @@ Response getWithResponse( /** * Polls an Endpoint operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -119,17 +115,12 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response body along with {@link Response}. */ - Response getLogsWithResponse( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - DeploymentLogsRequest body, - Context context); + Response getLogsWithResponse(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName, DeploymentLogsRequest body, Context context); /** * Polls an Endpoint operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -140,16 +131,12 @@ Response getLogsWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ - DeploymentLogs getLogs( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, + DeploymentLogs getLogs(String resourceGroupName, String workspaceName, String endpointName, String deploymentName, DeploymentLogsRequest body); /** * List Inference Endpoint Deployment Skus. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -159,12 +146,12 @@ DeploymentLogs getLogs( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of SkuResource entities as paginated response with {@link PagedIterable}. */ - PagedIterable listSkus( - String resourceGroupName, String workspaceName, String endpointName, String deploymentName); + PagedIterable listSkus(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName); /** * List Inference Endpoint Deployment Skus. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Inference endpoint name. @@ -177,18 +164,12 @@ PagedIterable listSkus( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of SkuResource entities as paginated response with {@link PagedIterable}. */ - PagedIterable listSkus( - String resourceGroupName, - String workspaceName, - String endpointName, - String deploymentName, - Integer count, - String skip, - Context context); + PagedIterable listSkus(String resourceGroupName, String workspaceName, String endpointName, + String deploymentName, Integer count, String skip, Context context); /** * Get Inference Deployment Deployment. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -199,7 +180,7 @@ PagedIterable listSkus( /** * Get Inference Deployment Deployment. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -211,7 +192,7 @@ PagedIterable listSkus( /** * Delete Inference Endpoint Deployment (asynchronous). - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -221,7 +202,7 @@ PagedIterable listSkus( /** * Delete Inference Endpoint Deployment (asynchronous). - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -232,7 +213,7 @@ PagedIterable listSkus( /** * Begins definition for a new OnlineDeployment resource. - * + * * @param name resource name. * @return the first stage of the new OnlineDeployment definition. */ diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineEndpoint.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineEndpoint.java index 45e3b1948649e..31ab142e3bb89 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineEndpoint.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineEndpoint.java @@ -11,46 +11,48 @@ import com.azure.resourcemanager.machinelearning.fluent.models.OnlineEndpointInner; import java.util.Map; -/** An immutable client-side representation of OnlineEndpoint. */ +/** + * An immutable client-side representation of OnlineEndpoint. + */ public interface OnlineEndpoint { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the location property: The geo-location where the resource lives. - * + * * @return the location value. */ String location(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); /** * Gets the identity property: Managed service identity (system assigned and/or user assigned identities). - * + * * @return the identity value. */ ManagedServiceIdentity identity(); @@ -58,78 +60,84 @@ public interface OnlineEndpoint { /** * Gets the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of * the same type. - * + * * @return the kind value. */ String kind(); /** * Gets the properties property: [Required] Additional attributes of the entity. - * + * * @return the properties value. */ OnlineEndpointProperties properties(); /** * Gets the sku property: Sku details required for ARM contract for Autoscaling. - * + * * @return the sku value. */ Sku sku(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.OnlineEndpointInner object. - * + * * @return the inner object. */ OnlineEndpointInner innerModel(); - /** The entirety of the OnlineEndpoint definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithParentResource, - DefinitionStages.WithProperties, - DefinitionStages.WithCreate { + /** + * The entirety of the OnlineEndpoint definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, DefinitionStages.WithProperties, DefinitionStages.WithCreate { } - /** The OnlineEndpoint definition stages. */ + + /** + * The OnlineEndpoint definition stages. + */ interface DefinitionStages { - /** The first stage of the OnlineEndpoint definition. */ + /** + * The first stage of the OnlineEndpoint definition. + */ interface Blank extends WithLocation { } - /** The stage of the OnlineEndpoint definition allowing to specify location. */ + + /** + * The stage of the OnlineEndpoint definition allowing to specify location. + */ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -137,159 +145,187 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithParentResource withRegion(String location); } - /** The stage of the OnlineEndpoint definition allowing to specify parent resource. */ + + /** + * The stage of the OnlineEndpoint definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, workspaceName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @return the next definition stage. */ WithProperties withExistingWorkspace(String resourceGroupName, String workspaceName); } - /** The stage of the OnlineEndpoint definition allowing to specify properties. */ + + /** + * The stage of the OnlineEndpoint definition allowing to specify properties. + */ interface WithProperties { /** * Specifies the properties property: [Required] Additional attributes of the entity.. - * + * * @param properties [Required] Additional attributes of the entity. * @return the next definition stage. */ WithCreate withProperties(OnlineEndpointProperties properties); } + /** * The stage of the OnlineEndpoint definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. */ - interface WithCreate - extends DefinitionStages.WithTags, - DefinitionStages.WithIdentity, - DefinitionStages.WithKind, - DefinitionStages.WithSku { + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, + DefinitionStages.WithKind, DefinitionStages.WithSku { /** * Executes the create request. - * + * * @return the created resource. */ OnlineEndpoint create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ OnlineEndpoint create(Context context); } - /** The stage of the OnlineEndpoint definition allowing to specify tags. */ + + /** + * The stage of the OnlineEndpoint definition allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ WithCreate withTags(Map tags); } - /** The stage of the OnlineEndpoint definition allowing to specify identity. */ + + /** + * The stage of the OnlineEndpoint definition allowing to specify identity. + */ interface WithIdentity { /** * Specifies the identity property: Managed service identity (system assigned and/or user assigned * identities). - * + * * @param identity Managed service identity (system assigned and/or user assigned identities). * @return the next definition stage. */ WithCreate withIdentity(ManagedServiceIdentity identity); } - /** The stage of the OnlineEndpoint definition allowing to specify kind. */ + + /** + * The stage of the OnlineEndpoint definition allowing to specify kind. + */ interface WithKind { /** * Specifies the kind property: Metadata used by portal/tooling/etc to render different UX experiences for * resources of the same type.. - * + * * @param kind Metadata used by portal/tooling/etc to render different UX experiences for resources of the - * same type. + * same type. * @return the next definition stage. */ WithCreate withKind(String kind); } - /** The stage of the OnlineEndpoint definition allowing to specify sku. */ + + /** + * The stage of the OnlineEndpoint definition allowing to specify sku. + */ interface WithSku { /** * Specifies the sku property: Sku details required for ARM contract for Autoscaling.. - * + * * @param sku Sku details required for ARM contract for Autoscaling. * @return the next definition stage. */ WithCreate withSku(Sku sku); } } + /** * Begins update for the OnlineEndpoint resource. - * + * * @return the stage of resource update. */ OnlineEndpoint.Update update(); - /** The template for OnlineEndpoint update. */ + /** + * The template for OnlineEndpoint update. + */ interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity { /** * Executes the update request. - * + * * @return the updated resource. */ OnlineEndpoint apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ OnlineEndpoint apply(Context context); } - /** The OnlineEndpoint update stages. */ + + /** + * The OnlineEndpoint update stages. + */ interface UpdateStages { - /** The stage of the OnlineEndpoint update allowing to specify tags. */ + /** + * The stage of the OnlineEndpoint update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ Update withTags(Map tags); } - /** The stage of the OnlineEndpoint update allowing to specify identity. */ + + /** + * The stage of the OnlineEndpoint update allowing to specify identity. + */ interface WithIdentity { /** * Specifies the identity property: Managed service identity (system assigned and/or user assigned * identities). - * + * * @param identity Managed service identity (system assigned and/or user assigned identities). * @return the next definition stage. */ Update withIdentity(PartialManagedServiceIdentity identity); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ OnlineEndpoint refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ @@ -297,7 +333,7 @@ interface WithIdentity { /** * List EndpointAuthKeys for an Endpoint using Key-based authentication. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -308,7 +344,7 @@ interface WithIdentity { /** * List EndpointAuthKeys for an Endpoint using Key-based authentication. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return keys for endpoint authentication. @@ -317,7 +353,7 @@ interface WithIdentity { /** * Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - * + * * @param body RegenerateKeys request . * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -327,7 +363,7 @@ interface WithIdentity { /** * Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - * + * * @param body RegenerateKeys request . * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -337,8 +373,8 @@ interface WithIdentity { void regenerateKeys(RegenerateEndpointKeysRequest body, Context context); /** - * Retrieve a valid AAD token for an Endpoint using AMLToken-based authentication. - * + * Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -348,8 +384,8 @@ interface WithIdentity { Response getTokenWithResponse(Context context); /** - * Retrieve a valid AAD token for an Endpoint using AMLToken-based authentication. - * + * Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return service Token. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineEndpointProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineEndpointProperties.java index ae7b1c483c58f..268dac7c73aae 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineEndpointProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineEndpointProperties.java @@ -5,48 +5,66 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.fluent.models.EndpointAuthKeysInner; import com.azure.resourcemanager.machinelearning.fluent.models.EndpointPropertiesBaseInner; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; -/** Online endpoint configuration. */ +/** + * Online endpoint configuration. + */ @Fluent public final class OnlineEndpointProperties extends EndpointPropertiesBaseInner { /* * ARM resource ID of the compute if it exists. * optional */ - @JsonProperty(value = "compute") private String compute; + /* + * Percentage of traffic to be mirrored to each deployment without using returned scoring. Traffic values need to + * sum to utmost 50. + */ + private Map mirrorTraffic; + /* * Provisioning state for the endpoint. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private EndpointProvisioningState provisioningState; /* * Set to "Enabled" for endpoints that should allow public access when Private Link is enabled. */ - @JsonProperty(value = "publicNetworkAccess") private PublicNetworkAccessType publicNetworkAccess; /* * Percentage of traffic from endpoint to divert to each deployment. Traffic values need to sum to 100. */ - @JsonProperty(value = "traffic") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map traffic; - /** Creates an instance of OnlineEndpointProperties class. */ + /* + * Endpoint URI. + */ + private String scoringUri; + + /* + * Endpoint Swagger URI. + */ + private String swaggerUri; + + /** + * Creates an instance of OnlineEndpointProperties class. + */ public OnlineEndpointProperties() { } /** - * Get the compute property: ARM resource ID of the compute if it exists. optional. - * + * Get the compute property: ARM resource ID of the compute if it exists. + * optional. + * * @return the compute value. */ public String compute() { @@ -54,8 +72,9 @@ public String compute() { } /** - * Set the compute property: ARM resource ID of the compute if it exists. optional. - * + * Set the compute property: ARM resource ID of the compute if it exists. + * optional. + * * @param compute the compute value to set. * @return the OnlineEndpointProperties object itself. */ @@ -64,9 +83,31 @@ public OnlineEndpointProperties withCompute(String compute) { return this; } + /** + * Get the mirrorTraffic property: Percentage of traffic to be mirrored to each deployment without using returned + * scoring. Traffic values need to sum to utmost 50. + * + * @return the mirrorTraffic value. + */ + public Map mirrorTraffic() { + return this.mirrorTraffic; + } + + /** + * Set the mirrorTraffic property: Percentage of traffic to be mirrored to each deployment without using returned + * scoring. Traffic values need to sum to utmost 50. + * + * @param mirrorTraffic the mirrorTraffic value to set. + * @return the OnlineEndpointProperties object itself. + */ + public OnlineEndpointProperties withMirrorTraffic(Map mirrorTraffic) { + this.mirrorTraffic = mirrorTraffic; + return this; + } + /** * Get the provisioningState property: Provisioning state for the endpoint. - * + * * @return the provisioningState value. */ public EndpointProvisioningState provisioningState() { @@ -76,7 +117,7 @@ public EndpointProvisioningState provisioningState() { /** * Get the publicNetworkAccess property: Set to "Enabled" for endpoints that should allow public access when Private * Link is enabled. - * + * * @return the publicNetworkAccess value. */ public PublicNetworkAccessType publicNetworkAccess() { @@ -86,7 +127,7 @@ public PublicNetworkAccessType publicNetworkAccess() { /** * Set the publicNetworkAccess property: Set to "Enabled" for endpoints that should allow public access when Private * Link is enabled. - * + * * @param publicNetworkAccess the publicNetworkAccess value to set. * @return the OnlineEndpointProperties object itself. */ @@ -98,7 +139,7 @@ public OnlineEndpointProperties withPublicNetworkAccess(PublicNetworkAccessType /** * Get the traffic property: Percentage of traffic from endpoint to divert to each deployment. Traffic values need * to sum to 100. - * + * * @return the traffic value. */ public Map traffic() { @@ -108,7 +149,7 @@ public Map traffic() { /** * Set the traffic property: Percentage of traffic from endpoint to divert to each deployment. Traffic values need * to sum to 100. - * + * * @param traffic the traffic value to set. * @return the OnlineEndpointProperties object itself. */ @@ -117,28 +158,56 @@ public OnlineEndpointProperties withTraffic(Map traffic) { return this; } - /** {@inheritDoc} */ + /** + * Get the scoringUri property: Endpoint URI. + * + * @return the scoringUri value. + */ + @Override + public String scoringUri() { + return this.scoringUri; + } + + /** + * Get the swaggerUri property: Endpoint Swagger URI. + * + * @return the swaggerUri value. + */ + @Override + public String swaggerUri() { + return this.swaggerUri; + } + + /** + * {@inheritDoc} + */ @Override public OnlineEndpointProperties withAuthMode(EndpointAuthMode authMode) { super.withAuthMode(authMode); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public OnlineEndpointProperties withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public OnlineEndpointProperties withKeys(EndpointAuthKeysInner keys) { super.withKeys(keys); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public OnlineEndpointProperties withProperties(Map properties) { super.withProperties(properties); @@ -147,11 +216,81 @@ public OnlineEndpointProperties withProperties(Map properties) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("authMode", authMode() == null ? null : authMode().toString()); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeJsonField("keys", keys()); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("compute", this.compute); + jsonWriter.writeMapField("mirrorTraffic", this.mirrorTraffic, (writer, element) -> writer.writeInt(element)); + jsonWriter.writeStringField("publicNetworkAccess", + this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); + jsonWriter.writeMapField("traffic", this.traffic, (writer, element) -> writer.writeInt(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OnlineEndpointProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OnlineEndpointProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OnlineEndpointProperties. + */ + public static OnlineEndpointProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OnlineEndpointProperties deserializedOnlineEndpointProperties = new OnlineEndpointProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("authMode".equals(fieldName)) { + deserializedOnlineEndpointProperties.withAuthMode(EndpointAuthMode.fromString(reader.getString())); + } else if ("description".equals(fieldName)) { + deserializedOnlineEndpointProperties.withDescription(reader.getString()); + } else if ("keys".equals(fieldName)) { + deserializedOnlineEndpointProperties.withKeys(EndpointAuthKeysInner.fromJson(reader)); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedOnlineEndpointProperties.withProperties(properties); + } else if ("scoringUri".equals(fieldName)) { + deserializedOnlineEndpointProperties.scoringUri = reader.getString(); + } else if ("swaggerUri".equals(fieldName)) { + deserializedOnlineEndpointProperties.swaggerUri = reader.getString(); + } else if ("compute".equals(fieldName)) { + deserializedOnlineEndpointProperties.compute = reader.getString(); + } else if ("mirrorTraffic".equals(fieldName)) { + Map mirrorTraffic = reader.readMap(reader1 -> reader1.getInt()); + deserializedOnlineEndpointProperties.mirrorTraffic = mirrorTraffic; + } else if ("provisioningState".equals(fieldName)) { + deserializedOnlineEndpointProperties.provisioningState + = EndpointProvisioningState.fromString(reader.getString()); + } else if ("publicNetworkAccess".equals(fieldName)) { + deserializedOnlineEndpointProperties.publicNetworkAccess + = PublicNetworkAccessType.fromString(reader.getString()); + } else if ("traffic".equals(fieldName)) { + Map traffic = reader.readMap(reader1 -> reader1.getInt()); + deserializedOnlineEndpointProperties.traffic = traffic; + } else { + reader.skipChildren(); + } + } + + return deserializedOnlineEndpointProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineEndpointTrackedResourceArmPaginatedResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineEndpointTrackedResourceArmPaginatedResult.java index d675ed3a44645..592c9c42b4358 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineEndpointTrackedResourceArmPaginatedResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineEndpointTrackedResourceArmPaginatedResult.java @@ -5,33 +5,40 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.fluent.models.OnlineEndpointInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** A paginated list of OnlineEndpoint entities. */ +/** + * A paginated list of OnlineEndpoint entities. + */ @Fluent -public final class OnlineEndpointTrackedResourceArmPaginatedResult { +public final class OnlineEndpointTrackedResourceArmPaginatedResult + implements JsonSerializable { /* * The link to the next page of OnlineEndpoint objects. If null, there are no additional pages. */ - @JsonProperty(value = "nextLink") private String nextLink; /* * An array of objects of type OnlineEndpoint. */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of OnlineEndpointTrackedResourceArmPaginatedResult class. */ + /** + * Creates an instance of OnlineEndpointTrackedResourceArmPaginatedResult class. + */ public OnlineEndpointTrackedResourceArmPaginatedResult() { } /** * Get the nextLink property: The link to the next page of OnlineEndpoint objects. If null, there are no additional * pages. - * + * * @return the nextLink value. */ public String nextLink() { @@ -41,7 +48,7 @@ public String nextLink() { /** * Set the nextLink property: The link to the next page of OnlineEndpoint objects. If null, there are no additional * pages. - * + * * @param nextLink the nextLink value to set. * @return the OnlineEndpointTrackedResourceArmPaginatedResult object itself. */ @@ -52,7 +59,7 @@ public OnlineEndpointTrackedResourceArmPaginatedResult withNextLink(String nextL /** * Get the value property: An array of objects of type OnlineEndpoint. - * + * * @return the value value. */ public List value() { @@ -61,7 +68,7 @@ public List value() { /** * Set the value property: An array of objects of type OnlineEndpoint. - * + * * @param value the value value to set. * @return the OnlineEndpointTrackedResourceArmPaginatedResult object itself. */ @@ -72,7 +79,7 @@ public OnlineEndpointTrackedResourceArmPaginatedResult withValue(List e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OnlineEndpointTrackedResourceArmPaginatedResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OnlineEndpointTrackedResourceArmPaginatedResult if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OnlineEndpointTrackedResourceArmPaginatedResult. + */ + public static OnlineEndpointTrackedResourceArmPaginatedResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OnlineEndpointTrackedResourceArmPaginatedResult deserializedOnlineEndpointTrackedResourceArmPaginatedResult + = new OnlineEndpointTrackedResourceArmPaginatedResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedOnlineEndpointTrackedResourceArmPaginatedResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> OnlineEndpointInner.fromJson(reader1)); + deserializedOnlineEndpointTrackedResourceArmPaginatedResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedOnlineEndpointTrackedResourceArmPaginatedResult; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineEndpoints.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineEndpoints.java index 44e3dd0a80699..43ae90a861938 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineEndpoints.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineEndpoints.java @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of OnlineEndpoints. */ +/** + * Resource collection API of OnlineEndpoints. + */ public interface OnlineEndpoints { /** * List Online Endpoints. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -24,7 +26,7 @@ public interface OnlineEndpoints { /** * List Online Endpoints. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Name of the endpoint. @@ -32,9 +34,9 @@ public interface OnlineEndpoints { * @param computeType EndpointComputeType to be filtered by. * @param skip Continuation token for pagination. * @param tags A set of tags with which to filter the returned models. It is a comma separated string of tags key or - * tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . + * tags key=value. Example: tagKey1,tagKey2,tagKey3=value3 . * @param properties A set of properties with which to filter the returned models. It is a comma separated string of - * properties key and/or properties key=value Example: propKey1,propKey2,propKey3=value3 . + * properties key and/or properties key=value Example: propKey1,propKey2,propKey3=value3 . * @param orderBy The option to order the response. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -42,21 +44,13 @@ public interface OnlineEndpoints { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of OnlineEndpoint entities as paginated response with {@link PagedIterable}. */ - PagedIterable list( - String resourceGroupName, - String workspaceName, - String name, - Integer count, - EndpointComputeType computeType, - String skip, - String tags, - String properties, - OrderString orderBy, + PagedIterable list(String resourceGroupName, String workspaceName, String name, Integer count, + EndpointComputeType computeType, String skip, String tags, String properties, OrderString orderBy, Context context); /** * Delete Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -68,7 +62,7 @@ PagedIterable list( /** * Delete Online Endpoint (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -81,7 +75,7 @@ PagedIterable list( /** * Get Online Endpoint. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -91,12 +85,12 @@ PagedIterable list( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return online Endpoint along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String endpointName, Context context); + Response getWithResponse(String resourceGroupName, String workspaceName, String endpointName, + Context context); /** * Get Online Endpoint. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -109,7 +103,7 @@ Response getWithResponse( /** * List EndpointAuthKeys for an Endpoint using Key-based authentication. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -119,12 +113,12 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return keys for endpoint authentication along with {@link Response}. */ - Response listKeysWithResponse( - String resourceGroupName, String workspaceName, String endpointName, Context context); + Response listKeysWithResponse(String resourceGroupName, String workspaceName, String endpointName, + Context context); /** * List EndpointAuthKeys for an Endpoint using Key-based authentication. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -137,7 +131,7 @@ Response listKeysWithResponse( /** * Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -146,12 +140,12 @@ Response listKeysWithResponse( * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void regenerateKeys( - String resourceGroupName, String workspaceName, String endpointName, RegenerateEndpointKeysRequest body); + void regenerateKeys(String resourceGroupName, String workspaceName, String endpointName, + RegenerateEndpointKeysRequest body); /** * Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -161,16 +155,12 @@ void regenerateKeys( * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void regenerateKeys( - String resourceGroupName, - String workspaceName, - String endpointName, - RegenerateEndpointKeysRequest body, - Context context); + void regenerateKeys(String resourceGroupName, String workspaceName, String endpointName, + RegenerateEndpointKeysRequest body, Context context); /** - * Retrieve a valid AAD token for an Endpoint using AMLToken-based authentication. - * + * Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -180,12 +170,12 @@ void regenerateKeys( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return service Token along with {@link Response}. */ - Response getTokenWithResponse( - String resourceGroupName, String workspaceName, String endpointName, Context context); + Response getTokenWithResponse(String resourceGroupName, String workspaceName, + String endpointName, Context context); /** - * Retrieve a valid AAD token for an Endpoint using AMLToken-based authentication. - * + * Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param endpointName Online Endpoint name. @@ -198,7 +188,7 @@ Response getTokenWithResponse( /** * Get Online Endpoint. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -209,7 +199,7 @@ Response getTokenWithResponse( /** * Get Online Endpoint. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -221,7 +211,7 @@ Response getTokenWithResponse( /** * Delete Online Endpoint (asynchronous). - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -231,7 +221,7 @@ Response getTokenWithResponse( /** * Delete Online Endpoint (asynchronous). - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -242,7 +232,7 @@ Response getTokenWithResponse( /** * Begins definition for a new OnlineEndpoint resource. - * + * * @param name resource name. * @return the first stage of the new OnlineEndpoint definition. */ diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineRequestSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineRequestSettings.java index a6f6c9d9ee8d8..eab57900b1dd4 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineRequestSettings.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineRequestSettings.java @@ -5,40 +5,48 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.Duration; -/** Online deployment scoring requests configuration. */ +/** + * Online deployment scoring requests configuration. + */ @Fluent -public final class OnlineRequestSettings { +public final class OnlineRequestSettings implements JsonSerializable { /* * The number of maximum concurrent requests per node allowed per deployment. Defaults to 1. */ - @JsonProperty(value = "maxConcurrentRequestsPerInstance") private Integer maxConcurrentRequestsPerInstance; /* - * The maximum amount of time a request will stay in the queue in ISO 8601 format. + * (Deprecated for Managed Online Endpoints) The maximum amount of time a request will stay in the queue in ISO 8601 + * format. * Defaults to 500ms. + * (Now increase `request_timeout_ms` to account for any networking/queue delays) */ - @JsonProperty(value = "maxQueueWait") private Duration maxQueueWait; /* * The scoring timeout in ISO 8601 format. * Defaults to 5000ms. */ - @JsonProperty(value = "requestTimeout") private Duration requestTimeout; - /** Creates an instance of OnlineRequestSettings class. */ + /** + * Creates an instance of OnlineRequestSettings class. + */ public OnlineRequestSettings() { } /** * Get the maxConcurrentRequestsPerInstance property: The number of maximum concurrent requests per node allowed per * deployment. Defaults to 1. - * + * * @return the maxConcurrentRequestsPerInstance value. */ public Integer maxConcurrentRequestsPerInstance() { @@ -48,7 +56,7 @@ public Integer maxConcurrentRequestsPerInstance() { /** * Set the maxConcurrentRequestsPerInstance property: The number of maximum concurrent requests per node allowed per * deployment. Defaults to 1. - * + * * @param maxConcurrentRequestsPerInstance the maxConcurrentRequestsPerInstance value to set. * @return the OnlineRequestSettings object itself. */ @@ -58,9 +66,11 @@ public OnlineRequestSettings withMaxConcurrentRequestsPerInstance(Integer maxCon } /** - * Get the maxQueueWait property: The maximum amount of time a request will stay in the queue in ISO 8601 format. + * Get the maxQueueWait property: (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). + * * @return the maxQueueWait value. */ public Duration maxQueueWait() { @@ -68,9 +78,11 @@ public Duration maxQueueWait() { } /** - * Set the maxQueueWait property: The maximum amount of time a request will stay in the queue in ISO 8601 format. + * Set the maxQueueWait property: (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). + * * @param maxQueueWait the maxQueueWait value to set. * @return the OnlineRequestSettings object itself. */ @@ -80,8 +92,9 @@ public OnlineRequestSettings withMaxQueueWait(Duration maxQueueWait) { } /** - * Get the requestTimeout property: The scoring timeout in ISO 8601 format. Defaults to 5000ms. - * + * Get the requestTimeout property: The scoring timeout in ISO 8601 format. + * Defaults to 5000ms. + * * @return the requestTimeout value. */ public Duration requestTimeout() { @@ -89,8 +102,9 @@ public Duration requestTimeout() { } /** - * Set the requestTimeout property: The scoring timeout in ISO 8601 format. Defaults to 5000ms. - * + * Set the requestTimeout property: The scoring timeout in ISO 8601 format. + * Defaults to 5000ms. + * * @param requestTimeout the requestTimeout value to set. * @return the OnlineRequestSettings object itself. */ @@ -101,9 +115,54 @@ public OnlineRequestSettings withRequestTimeout(Duration requestTimeout) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("maxConcurrentRequestsPerInstance", this.maxConcurrentRequestsPerInstance); + jsonWriter.writeStringField("maxQueueWait", CoreUtils.durationToStringWithDays(this.maxQueueWait)); + jsonWriter.writeStringField("requestTimeout", CoreUtils.durationToStringWithDays(this.requestTimeout)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OnlineRequestSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OnlineRequestSettings if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the OnlineRequestSettings. + */ + public static OnlineRequestSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OnlineRequestSettings deserializedOnlineRequestSettings = new OnlineRequestSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("maxConcurrentRequestsPerInstance".equals(fieldName)) { + deserializedOnlineRequestSettings.maxConcurrentRequestsPerInstance + = reader.getNullable(JsonReader::getInt); + } else if ("maxQueueWait".equals(fieldName)) { + deserializedOnlineRequestSettings.maxQueueWait + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else if ("requestTimeout".equals(fieldName)) { + deserializedOnlineRequestSettings.requestTimeout + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedOnlineRequestSettings; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineScaleSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineScaleSettings.java index e8acef5593209..59fe3ca0ddebe 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineScaleSettings.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OnlineScaleSettings.java @@ -5,32 +5,105 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Online deployment scaling configuration. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "scaleType", - defaultImpl = OnlineScaleSettings.class) -@JsonTypeName("OnlineScaleSettings") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "Default", value = DefaultScaleSettings.class), - @JsonSubTypes.Type(name = "TargetUtilization", value = TargetUtilizationScaleSettings.class) -}) +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Online deployment scaling configuration. + */ @Immutable -public class OnlineScaleSettings { - /** Creates an instance of OnlineScaleSettings class. */ +public class OnlineScaleSettings implements JsonSerializable { + /* + * [Required] Type of deployment scaling algorithm + */ + private ScaleType scaleType = ScaleType.fromString("OnlineScaleSettings"); + + /** + * Creates an instance of OnlineScaleSettings class. + */ public OnlineScaleSettings() { } + /** + * Get the scaleType property: [Required] Type of deployment scaling algorithm. + * + * @return the scaleType value. + */ + public ScaleType scaleType() { + return this.scaleType; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("scaleType", this.scaleType == null ? null : this.scaleType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OnlineScaleSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OnlineScaleSettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OnlineScaleSettings. + */ + public static OnlineScaleSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("scaleType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Default".equals(discriminatorValue)) { + return DefaultScaleSettings.fromJson(readerToUse.reset()); + } else if ("TargetUtilization".equals(discriminatorValue)) { + return TargetUtilizationScaleSettings.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static OnlineScaleSettings fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OnlineScaleSettings deserializedOnlineScaleSettings = new OnlineScaleSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("scaleType".equals(fieldName)) { + deserializedOnlineScaleSettings.scaleType = ScaleType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOnlineScaleSettings; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OperatingSystemType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OperatingSystemType.java index f976eb401acb4..9d7e4d92a45b9 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OperatingSystemType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OperatingSystemType.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The type of operating system. */ +/** + * The type of operating system. + */ public final class OperatingSystemType extends ExpandableStringEnum { - /** Static value Linux for OperatingSystemType. */ + /** + * Static value Linux for OperatingSystemType. + */ public static final OperatingSystemType LINUX = fromString("Linux"); - /** Static value Windows for OperatingSystemType. */ + /** + * Static value Windows for OperatingSystemType. + */ public static final OperatingSystemType WINDOWS = fromString("Windows"); /** * Creates a new instance of OperatingSystemType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public OperatingSystemType() { /** * Creates or finds a OperatingSystemType from its string representation. - * + * * @param name a name to look for. * @return the corresponding OperatingSystemType. */ - @JsonCreator public static OperatingSystemType fromString(String name) { return fromString(name, OperatingSystemType.class); } /** * Gets known OperatingSystemType values. - * + * * @return known OperatingSystemType values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Operation.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Operation.java new file mode 100644 index 0000000000000..adf592c09634a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Operation.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.resourcemanager.machinelearning.fluent.models.OperationInner; + +/** + * An immutable client-side representation of Operation. + */ +public interface Operation { + /** + * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + Origin origin(); + + /** + * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + ActionType actionType(); + + /** + * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OperationDisplay.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OperationDisplay.java new file mode 100644 index 0000000000000..b5cf5cbe0e0fa --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OperationDisplay.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Localized display information for this particular operation. + */ +@Immutable +public final class OperationDisplay implements JsonSerializable { + /* + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or + * "Microsoft Compute". + */ + private String provider; + + /* + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or + * "Job Schedule Collections". + */ + private String resource; + + /* + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + */ + private String operation; + + /* + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + */ + private String description; + + /** + * Creates an instance of OperationDisplay class. + */ + public OperationDisplay() { + } + + /** + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationDisplay from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationDisplay if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationDisplay. + */ + public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationDisplay deserializedOperationDisplay = new OperationDisplay(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedOperationDisplay.provider = reader.getString(); + } else if ("resource".equals(fieldName)) { + deserializedOperationDisplay.resource = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedOperationDisplay.operation = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedOperationDisplay.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationDisplay; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OperationListResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OperationListResult.java new file mode 100644 index 0000000000000..8e69909cfe76b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OperationListResult.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.machinelearning.fluent.models.OperationInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. + */ +@Immutable +public final class OperationListResult implements JsonSerializable { + /* + * List of operations supported by the resource provider + */ + private List value; + + /* + * URL to get the next set of operation list results (if there are any). + */ + private String nextLink; + + /** + * Creates an instance of OperationListResult class. + */ + public OperationListResult() { + } + + /** + * Get the value property: List of operations supported by the resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results (if there are any). + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationListResult. + */ + public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationListResult deserializedOperationListResult = new OperationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); + deserializedOperationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOperationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationListResult; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OperationName.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OperationName.java index 1b428d2aeefde..94745214e55d9 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OperationName.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OperationName.java @@ -5,32 +5,45 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Name of the last operation. */ +/** + * Name of the last operation. + */ public final class OperationName extends ExpandableStringEnum { - /** Static value Create for OperationName. */ + /** + * Static value Create for OperationName. + */ public static final OperationName CREATE = fromString("Create"); - /** Static value Start for OperationName. */ + /** + * Static value Start for OperationName. + */ public static final OperationName START = fromString("Start"); - /** Static value Stop for OperationName. */ + /** + * Static value Stop for OperationName. + */ public static final OperationName STOP = fromString("Stop"); - /** Static value Restart for OperationName. */ + /** + * Static value Restart for OperationName. + */ public static final OperationName RESTART = fromString("Restart"); - /** Static value Reimage for OperationName. */ + /** + * Static value Reimage for OperationName. + */ public static final OperationName REIMAGE = fromString("Reimage"); - /** Static value Delete for OperationName. */ + /** + * Static value Delete for OperationName. + */ public static final OperationName DELETE = fromString("Delete"); /** * Creates a new instance of OperationName value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -39,18 +52,17 @@ public OperationName() { /** * Creates or finds a OperationName from its string representation. - * + * * @param name a name to look for. * @return the corresponding OperationName. */ - @JsonCreator public static OperationName fromString(String name) { return fromString(name, OperationName.class); } /** * Gets known OperationName values. - * + * * @return known OperationName values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OperationStatus.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OperationStatus.java index af28ce807caaf..a5196eb5cb804 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OperationStatus.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OperationStatus.java @@ -5,38 +5,55 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Operation status. */ +/** + * Operation status. + */ public final class OperationStatus extends ExpandableStringEnum { - /** Static value InProgress for OperationStatus. */ + /** + * Static value InProgress for OperationStatus. + */ public static final OperationStatus IN_PROGRESS = fromString("InProgress"); - /** Static value Succeeded for OperationStatus. */ + /** + * Static value Succeeded for OperationStatus. + */ public static final OperationStatus SUCCEEDED = fromString("Succeeded"); - /** Static value CreateFailed for OperationStatus. */ + /** + * Static value CreateFailed for OperationStatus. + */ public static final OperationStatus CREATE_FAILED = fromString("CreateFailed"); - /** Static value StartFailed for OperationStatus. */ + /** + * Static value StartFailed for OperationStatus. + */ public static final OperationStatus START_FAILED = fromString("StartFailed"); - /** Static value StopFailed for OperationStatus. */ + /** + * Static value StopFailed for OperationStatus. + */ public static final OperationStatus STOP_FAILED = fromString("StopFailed"); - /** Static value RestartFailed for OperationStatus. */ + /** + * Static value RestartFailed for OperationStatus. + */ public static final OperationStatus RESTART_FAILED = fromString("RestartFailed"); - /** Static value ReimageFailed for OperationStatus. */ + /** + * Static value ReimageFailed for OperationStatus. + */ public static final OperationStatus REIMAGE_FAILED = fromString("ReimageFailed"); - /** Static value DeleteFailed for OperationStatus. */ + /** + * Static value DeleteFailed for OperationStatus. + */ public static final OperationStatus DELETE_FAILED = fromString("DeleteFailed"); /** * Creates a new instance of OperationStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -45,18 +62,17 @@ public OperationStatus() { /** * Creates or finds a OperationStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding OperationStatus. */ - @JsonCreator public static OperationStatus fromString(String name) { return fromString(name, OperationStatus.class); } /** * Gets known OperationStatus values. - * + * * @return known OperationStatus values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OperationTrigger.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OperationTrigger.java index f4ea809c45426..1b8725426acad 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OperationTrigger.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OperationTrigger.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Trigger of operation. */ +/** + * Trigger of operation. + */ public final class OperationTrigger extends ExpandableStringEnum { - /** Static value User for OperationTrigger. */ + /** + * Static value User for OperationTrigger. + */ public static final OperationTrigger USER = fromString("User"); - /** Static value Schedule for OperationTrigger. */ + /** + * Static value Schedule for OperationTrigger. + */ public static final OperationTrigger SCHEDULE = fromString("Schedule"); - /** Static value IdleShutdown for OperationTrigger. */ + /** + * Static value IdleShutdown for OperationTrigger. + */ public static final OperationTrigger IDLE_SHUTDOWN = fromString("IdleShutdown"); /** * Creates a new instance of OperationTrigger value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public OperationTrigger() { /** * Creates or finds a OperationTrigger from its string representation. - * + * * @param name a name to look for. * @return the corresponding OperationTrigger. */ - @JsonCreator public static OperationTrigger fromString(String name) { return fromString(name, OperationTrigger.class); } /** * Gets known OperationTrigger values. - * + * * @return known OperationTrigger values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Operations.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Operations.java index d718ecc7e6d5b..adf5d02799a06 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Operations.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Operations.java @@ -7,27 +7,29 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -/** Resource collection API of Operations. */ +/** + * Resource collection API of Operations. + */ public interface Operations { /** * Lists all of the available Azure Machine Learning Workspaces REST API operations. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an array of operations supported by the resource provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ - PagedIterable list(); + PagedIterable list(); /** * Lists all of the available Azure Machine Learning Workspaces REST API operations. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an array of operations supported by the resource provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ - PagedIterable list(Context context); + PagedIterable list(Context context); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OrderString.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OrderString.java index 5bf732b45abf5..40a3205e420a0 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OrderString.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OrderString.java @@ -5,26 +5,35 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for OrderString. */ +/** + * Defines values for OrderString. + */ public final class OrderString extends ExpandableStringEnum { - /** Static value CreatedAtDesc for OrderString. */ + /** + * Static value CreatedAtDesc for OrderString. + */ public static final OrderString CREATED_AT_DESC = fromString("CreatedAtDesc"); - /** Static value CreatedAtAsc for OrderString. */ + /** + * Static value CreatedAtAsc for OrderString. + */ public static final OrderString CREATED_AT_ASC = fromString("CreatedAtAsc"); - /** Static value UpdatedAtDesc for OrderString. */ + /** + * Static value UpdatedAtDesc for OrderString. + */ public static final OrderString UPDATED_AT_DESC = fromString("UpdatedAtDesc"); - /** Static value UpdatedAtAsc for OrderString. */ + /** + * Static value UpdatedAtAsc for OrderString. + */ public static final OrderString UPDATED_AT_ASC = fromString("UpdatedAtAsc"); /** * Creates a new instance of OrderString value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,18 +42,17 @@ public OrderString() { /** * Creates or finds a OrderString from its string representation. - * + * * @param name a name to look for. * @return the corresponding OrderString. */ - @JsonCreator public static OrderString fromString(String name) { return fromString(name, OrderString.class); } /** * Gets known OrderString values. - * + * * @return known OrderString values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Origin.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Origin.java new file mode 100644 index 0000000000000..03891a10841e5 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Origin.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value + * is "user,system". + */ +public final class Origin extends ExpandableStringEnum { + /** + * Static value user for Origin. + */ + public static final Origin USER = fromString("user"); + + /** + * Static value system for Origin. + */ + public static final Origin SYSTEM = fromString("system"); + + /** + * Static value user,system for Origin. + */ + public static final Origin USER_SYSTEM = fromString("user,system"); + + /** + * Creates a new instance of Origin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Origin() { + } + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** + * Gets known Origin values. + * + * @return known Origin values. + */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OsType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OsType.java index bbb3fd3a428db..582075077ad6a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OsType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OsType.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Compute OS Type. */ +/** + * Compute OS Type. + */ public final class OsType extends ExpandableStringEnum { - /** Static value Linux for OsType. */ + /** + * Static value Linux for OsType. + */ public static final OsType LINUX = fromString("Linux"); - /** Static value Windows for OsType. */ + /** + * Static value Windows for OsType. + */ public static final OsType WINDOWS = fromString("Windows"); /** * Creates a new instance of OsType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public OsType() { /** * Creates or finds a OsType from its string representation. - * + * * @param name a name to look for. * @return the corresponding OsType. */ - @JsonCreator public static OsType fromString(String name) { return fromString(name, OsType.class); } /** * Gets known OsType values. - * + * * @return known OsType values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OutboundRule.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OutboundRule.java new file mode 100644 index 0000000000000..35b2832512cc6 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OutboundRule.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Outbound Rule for the managed network of a machine learning workspace. + */ +@Fluent +public class OutboundRule implements JsonSerializable { + /* + * Type of a managed network Outbound Rule of a machine learning workspace. + */ + private RuleType type = RuleType.fromString("OutboundRule"); + + /* + * Category of a managed network Outbound Rule of a machine learning workspace. + */ + private RuleCategory category; + + /* + * Type of a managed network Outbound Rule of a machine learning workspace. + */ + private RuleStatus status; + + /** + * Creates an instance of OutboundRule class. + */ + public OutboundRule() { + } + + /** + * Get the type property: Type of a managed network Outbound Rule of a machine learning workspace. + * + * @return the type value. + */ + public RuleType type() { + return this.type; + } + + /** + * Get the category property: Category of a managed network Outbound Rule of a machine learning workspace. + * + * @return the category value. + */ + public RuleCategory category() { + return this.category; + } + + /** + * Set the category property: Category of a managed network Outbound Rule of a machine learning workspace. + * + * @param category the category value to set. + * @return the OutboundRule object itself. + */ + public OutboundRule withCategory(RuleCategory category) { + this.category = category; + return this; + } + + /** + * Get the status property: Type of a managed network Outbound Rule of a machine learning workspace. + * + * @return the status value. + */ + public RuleStatus status() { + return this.status; + } + + /** + * Set the status property: Type of a managed network Outbound Rule of a machine learning workspace. + * + * @param status the status value to set. + * @return the OutboundRule object itself. + */ + public OutboundRule withStatus(RuleStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("category", this.category == null ? null : this.category.toString()); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OutboundRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OutboundRule if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OutboundRule. + */ + public static OutboundRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("type".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("PrivateEndpoint".equals(discriminatorValue)) { + return PrivateEndpointOutboundRule.fromJson(readerToUse.reset()); + } else if ("ServiceTag".equals(discriminatorValue)) { + return ServiceTagOutboundRule.fromJson(readerToUse.reset()); + } else if ("FQDN".equals(discriminatorValue)) { + return FqdnOutboundRule.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static OutboundRule fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OutboundRule deserializedOutboundRule = new OutboundRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedOutboundRule.type = RuleType.fromString(reader.getString()); + } else if ("category".equals(fieldName)) { + deserializedOutboundRule.category = RuleCategory.fromString(reader.getString()); + } else if ("status".equals(fieldName)) { + deserializedOutboundRule.status = RuleStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOutboundRule; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OutboundRuleBasicResource.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OutboundRuleBasicResource.java new file mode 100644 index 0000000000000..9ffd9fc14c5f8 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OutboundRuleBasicResource.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.OutboundRuleBasicResourceInner; + +/** + * An immutable client-side representation of OutboundRuleBasicResource. + */ +public interface OutboundRuleBasicResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: Outbound Rule for the managed network of a machine learning workspace. + * + * @return the properties value. + */ + OutboundRule properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.OutboundRuleBasicResourceInner object. + * + * @return the inner object. + */ + OutboundRuleBasicResourceInner innerModel(); + + /** + * The entirety of the OutboundRuleBasicResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * The OutboundRuleBasicResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the OutboundRuleBasicResource definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the OutboundRuleBasicResource definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, workspaceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @return the next definition stage. + */ + WithProperties withExistingWorkspace(String resourceGroupName, String workspaceName); + } + + /** + * The stage of the OutboundRuleBasicResource definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Outbound Rule for the managed network of a machine learning + * workspace.. + * + * @param properties Outbound Rule for the managed network of a machine learning workspace. + * @return the next definition stage. + */ + WithCreate withProperties(OutboundRule properties); + } + + /** + * The stage of the OutboundRuleBasicResource definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate { + /** + * Executes the create request. + * + * @return the created resource. + */ + OutboundRuleBasicResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + OutboundRuleBasicResource create(Context context); + } + } + + /** + * Begins update for the OutboundRuleBasicResource resource. + * + * @return the stage of resource update. + */ + OutboundRuleBasicResource.Update update(); + + /** + * The template for OutboundRuleBasicResource update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + OutboundRuleBasicResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + OutboundRuleBasicResource apply(Context context); + } + + /** + * The OutboundRuleBasicResource update stages. + */ + interface UpdateStages { + /** + * The stage of the OutboundRuleBasicResource update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Outbound Rule for the managed network of a machine learning + * workspace.. + * + * @param properties Outbound Rule for the managed network of a machine learning workspace. + * @return the next definition stage. + */ + Update withProperties(OutboundRule properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + OutboundRuleBasicResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + OutboundRuleBasicResource refresh(Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OutboundRuleListResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OutboundRuleListResult.java new file mode 100644 index 0000000000000..abc453a3a3ff0 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OutboundRuleListResult.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.machinelearning.fluent.models.OutboundRuleBasicResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * List of outbound rules for the managed network of a machine learning workspace. + */ +@Fluent +public final class OutboundRuleListResult implements JsonSerializable { + /* + * The link to the next page constructed using the continuationToken. If null, there are no additional pages. + */ + private String nextLink; + + /* + * 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. + */ + private List value; + + /** + * Creates an instance of OutboundRuleListResult class. + */ + public OutboundRuleListResult() { + } + + /** + * Get the nextLink property: The link to the next page constructed using the continuationToken. If null, there are + * no additional pages. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page constructed using the continuationToken. If null, there are + * no additional pages. + * + * @param nextLink the nextLink value to set. + * @return the OutboundRuleListResult object itself. + */ + public OutboundRuleListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: 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. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: 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. + * + * @param value the value value to set. + * @return the OutboundRuleListResult object itself. + */ + public OutboundRuleListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OutboundRuleListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OutboundRuleListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the OutboundRuleListResult. + */ + public static OutboundRuleListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OutboundRuleListResult deserializedOutboundRuleListResult = new OutboundRuleListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedOutboundRuleListResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> OutboundRuleBasicResourceInner.fromJson(reader1)); + deserializedOutboundRuleListResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedOutboundRuleListResult; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OutputDeliveryMode.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OutputDeliveryMode.java index dc75b9e54bee0..930eb55f0a0b5 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OutputDeliveryMode.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OutputDeliveryMode.java @@ -5,20 +5,30 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Output data delivery mode enums. */ +/** + * Output data delivery mode enums. + */ public final class OutputDeliveryMode extends ExpandableStringEnum { - /** Static value ReadWriteMount for OutputDeliveryMode. */ + /** + * Static value ReadWriteMount for OutputDeliveryMode. + */ public static final OutputDeliveryMode READ_WRITE_MOUNT = fromString("ReadWriteMount"); - /** Static value Upload for OutputDeliveryMode. */ + /** + * Static value Upload for OutputDeliveryMode. + */ public static final OutputDeliveryMode UPLOAD = fromString("Upload"); + /** + * Static value Direct for OutputDeliveryMode. + */ + public static final OutputDeliveryMode DIRECT = fromString("Direct"); + /** * Creates a new instance of OutputDeliveryMode value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +37,17 @@ public OutputDeliveryMode() { /** * Creates or finds a OutputDeliveryMode from its string representation. - * + * * @param name a name to look for. * @return the corresponding OutputDeliveryMode. */ - @JsonCreator public static OutputDeliveryMode fromString(String name) { return fromString(name, OutputDeliveryMode.class); } /** * Gets known OutputDeliveryMode values. - * + * * @return known OutputDeliveryMode values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OutputPathAssetReference.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OutputPathAssetReference.java index c265ff06432d5..4ce85b134c7a9 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OutputPathAssetReference.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/OutputPathAssetReference.java @@ -5,34 +5,50 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Reference to an asset via its path in a job output. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "referenceType") -@JsonTypeName("OutputPath") +/** + * Reference to an asset via its path in a job output. + */ @Fluent public final class OutputPathAssetReference extends AssetReferenceBase { + /* + * [Required] Specifies the type of asset reference. + */ + private ReferenceType referenceType = ReferenceType.OUTPUT_PATH; + /* * ARM resource ID of the job. */ - @JsonProperty(value = "jobId") private String jobId; /* * The path of the file/directory in the job output. */ - @JsonProperty(value = "path") private String path; - /** Creates an instance of OutputPathAssetReference class. */ + /** + * Creates an instance of OutputPathAssetReference class. + */ public OutputPathAssetReference() { } + /** + * Get the referenceType property: [Required] Specifies the type of asset reference. + * + * @return the referenceType value. + */ + @Override + public ReferenceType referenceType() { + return this.referenceType; + } + /** * Get the jobId property: ARM resource ID of the job. - * + * * @return the jobId value. */ public String jobId() { @@ -41,7 +57,7 @@ public String jobId() { /** * Set the jobId property: ARM resource ID of the job. - * + * * @param jobId the jobId value to set. * @return the OutputPathAssetReference object itself. */ @@ -52,7 +68,7 @@ public OutputPathAssetReference withJobId(String jobId) { /** * Get the path property: The path of the file/directory in the job output. - * + * * @return the path value. */ public String path() { @@ -61,7 +77,7 @@ public String path() { /** * Set the path property: The path of the file/directory in the job output. - * + * * @param path the path value to set. * @return the OutputPathAssetReference object itself. */ @@ -72,11 +88,53 @@ public OutputPathAssetReference withPath(String path) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("referenceType", this.referenceType == null ? null : this.referenceType.toString()); + jsonWriter.writeStringField("jobId", this.jobId); + jsonWriter.writeStringField("path", this.path); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OutputPathAssetReference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OutputPathAssetReference if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OutputPathAssetReference. + */ + public static OutputPathAssetReference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OutputPathAssetReference deserializedOutputPathAssetReference = new OutputPathAssetReference(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("referenceType".equals(fieldName)) { + deserializedOutputPathAssetReference.referenceType = ReferenceType.fromString(reader.getString()); + } else if ("jobId".equals(fieldName)) { + deserializedOutputPathAssetReference.jobId = reader.getString(); + } else if ("path".equals(fieldName)) { + deserializedOutputPathAssetReference.path = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOutputPathAssetReference; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PaginatedComputeResourcesList.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PaginatedComputeResourcesList.java index 00d74767a9e8f..55620a1a65469 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PaginatedComputeResourcesList.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PaginatedComputeResourcesList.java @@ -5,32 +5,38 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.fluent.models.ComputeResourceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** Paginated list of Machine Learning compute objects wrapped in ARM resource envelope. */ +/** + * Paginated list of Machine Learning compute objects wrapped in ARM resource envelope. + */ @Fluent -public final class PaginatedComputeResourcesList { +public final class PaginatedComputeResourcesList implements JsonSerializable { /* * An array of Machine Learning compute objects wrapped in ARM resource envelope. */ - @JsonProperty(value = "value") private List value; /* * A continuation link (absolute URI) to the next page of results in the list. */ - @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of PaginatedComputeResourcesList class. */ + /** + * Creates an instance of PaginatedComputeResourcesList class. + */ public PaginatedComputeResourcesList() { } /** * Get the value property: An array of Machine Learning compute objects wrapped in ARM resource envelope. - * + * * @return the value value. */ public List value() { @@ -39,7 +45,7 @@ public List value() { /** * Set the value property: An array of Machine Learning compute objects wrapped in ARM resource envelope. - * + * * @param value the value value to set. * @return the PaginatedComputeResourcesList object itself. */ @@ -50,7 +56,7 @@ public PaginatedComputeResourcesList withValue(List value) /** * Get the nextLink property: A continuation link (absolute URI) to the next page of results in the list. - * + * * @return the nextLink value. */ public String nextLink() { @@ -59,7 +65,7 @@ public String nextLink() { /** * Set the nextLink property: A continuation link (absolute URI) to the next page of results in the list. - * + * * @param nextLink the nextLink value to set. * @return the PaginatedComputeResourcesList object itself. */ @@ -70,7 +76,7 @@ public PaginatedComputeResourcesList withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +84,46 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PaginatedComputeResourcesList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PaginatedComputeResourcesList if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PaginatedComputeResourcesList. + */ + public static PaginatedComputeResourcesList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PaginatedComputeResourcesList deserializedPaginatedComputeResourcesList + = new PaginatedComputeResourcesList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ComputeResourceInner.fromJson(reader1)); + deserializedPaginatedComputeResourcesList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPaginatedComputeResourcesList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPaginatedComputeResourcesList; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialBatchDeployment.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialBatchDeployment.java index 0be11f6793e1f..c33566e64b1ac 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialBatchDeployment.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialBatchDeployment.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Mutable batch inference settings per deployment. */ +/** + * Mutable batch inference settings per deployment. + */ @Fluent -public final class PartialBatchDeployment { +public final class PartialBatchDeployment implements JsonSerializable { /* * Description of the endpoint deployment. */ - @JsonProperty(value = "description") private String description; - /** Creates an instance of PartialBatchDeployment class. */ + /** + * Creates an instance of PartialBatchDeployment class. + */ public PartialBatchDeployment() { } /** * Get the description property: Description of the endpoint deployment. - * + * * @return the description value. */ public String description() { @@ -31,7 +38,7 @@ public String description() { /** * Set the description property: Description of the endpoint deployment. - * + * * @param description the description value to set. * @return the PartialBatchDeployment object itself. */ @@ -42,9 +49,45 @@ public PartialBatchDeployment withDescription(String description) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PartialBatchDeployment from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PartialBatchDeployment if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the PartialBatchDeployment. + */ + public static PartialBatchDeployment fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PartialBatchDeployment deserializedPartialBatchDeployment = new PartialBatchDeployment(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedPartialBatchDeployment.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPartialBatchDeployment; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties.java index aaef569773303..8be8f3b97dd98 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties.java @@ -5,33 +5,38 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Strictly used in update requests. */ +/** + * Strictly used in update requests. + */ @Fluent -public final class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties { +public final class PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties + implements JsonSerializable { /* * Additional attributes of the entity. */ - @JsonProperty(value = "properties") private PartialBatchDeployment properties; /* * Resource tags. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /** Creates an instance of PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties class. */ + /** + * Creates an instance of PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties class. + */ public PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties() { } /** * Get the properties property: Additional attributes of the entity. - * + * * @return the properties value. */ public PartialBatchDeployment properties() { @@ -40,19 +45,19 @@ public PartialBatchDeployment properties() { /** * Set the properties property: Additional attributes of the entity. - * + * * @param properties the properties value to set. * @return the PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties object itself. */ - public PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties withProperties( - PartialBatchDeployment properties) { + public PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties + withProperties(PartialBatchDeployment properties) { this.properties = properties; return this; } /** * Get the tags property: Resource tags. - * + * * @return the tags value. */ public Map tags() { @@ -61,7 +66,7 @@ public Map tags() { /** * Set the tags property: Resource tags. - * + * * @param tags the tags value to set. * @return the PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties object itself. */ @@ -72,7 +77,7 @@ public PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties withTag /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -80,4 +85,48 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties if the JsonReader was + * pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties. + */ + public static PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties deserializedPartialBatchDeploymentPartialMinimalTrackedResourceWithProperties + = new PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedPartialBatchDeploymentPartialMinimalTrackedResourceWithProperties.properties + = PartialBatchDeployment.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedPartialBatchDeploymentPartialMinimalTrackedResourceWithProperties.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedPartialBatchDeploymentPartialMinimalTrackedResourceWithProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialManagedServiceIdentity.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialManagedServiceIdentity.java index 1939e23433ba5..b5a4c734015b8 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialManagedServiceIdentity.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialManagedServiceIdentity.java @@ -5,36 +5,40 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Managed service identity (system assigned and/or user assigned identities). */ +/** + * Managed service identity (system assigned and/or user assigned identities). + */ @Fluent -public class PartialManagedServiceIdentity { +public final class PartialManagedServiceIdentity implements JsonSerializable { /* * Managed service identity (system assigned and/or user assigned identities) */ - @JsonProperty(value = "type") private ManagedServiceIdentityType type; /* - * 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. + * 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. */ - @JsonProperty(value = "userAssignedIdentities") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map userAssignedIdentities; - /** Creates an instance of PartialManagedServiceIdentity class. */ + /** + * Creates an instance of PartialManagedServiceIdentity class. + */ public PartialManagedServiceIdentity() { } /** * Get the type property: Managed service identity (system assigned and/or user assigned identities). - * + * * @return the type value. */ public ManagedServiceIdentityType type() { @@ -43,7 +47,7 @@ public ManagedServiceIdentityType type() { /** * Set the type property: Managed service identity (system assigned and/or user assigned identities). - * + * * @param type the type value to set. * @return the PartialManagedServiceIdentity object itself. */ @@ -57,7 +61,7 @@ public PartialManagedServiceIdentity withType(ManagedServiceIdentityType type) { * 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. - * + * * @return the userAssignedIdentities value. */ public Map userAssignedIdentities() { @@ -69,7 +73,7 @@ public Map userAssignedIdentities() { * 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. - * + * * @param userAssignedIdentities the userAssignedIdentities value to set. * @return the PartialManagedServiceIdentity object itself. */ @@ -80,9 +84,52 @@ public PartialManagedServiceIdentity withUserAssignedIdentities(Map writer.writeUntyped(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PartialManagedServiceIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PartialManagedServiceIdentity if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PartialManagedServiceIdentity. + */ + public static PartialManagedServiceIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PartialManagedServiceIdentity deserializedPartialManagedServiceIdentity + = new PartialManagedServiceIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedPartialManagedServiceIdentity.type + = ManagedServiceIdentityType.fromString(reader.getString()); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedPartialManagedServiceIdentity.userAssignedIdentities = userAssignedIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedPartialManagedServiceIdentity; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialMinimalTrackedResource.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialMinimalTrackedResource.java index 81b9958b58d17..deda7ce22ba4e 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialMinimalTrackedResource.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialMinimalTrackedResource.java @@ -5,27 +5,32 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Strictly used in update requests. */ +/** + * Strictly used in update requests. + */ @Fluent -public class PartialMinimalTrackedResource { +public class PartialMinimalTrackedResource implements JsonSerializable { /* * Resource tags. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /** Creates an instance of PartialMinimalTrackedResource class. */ + /** + * Creates an instance of PartialMinimalTrackedResource class. + */ public PartialMinimalTrackedResource() { } /** * Get the tags property: Resource tags. - * + * * @return the tags value. */ public Map tags() { @@ -34,7 +39,7 @@ public Map tags() { /** * Set the tags property: Resource tags. - * + * * @param tags the tags value to set. * @return the PartialMinimalTrackedResource object itself. */ @@ -45,9 +50,47 @@ public PartialMinimalTrackedResource withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PartialMinimalTrackedResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PartialMinimalTrackedResource if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PartialMinimalTrackedResource. + */ + public static PartialMinimalTrackedResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PartialMinimalTrackedResource deserializedPartialMinimalTrackedResource + = new PartialMinimalTrackedResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedPartialMinimalTrackedResource.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedPartialMinimalTrackedResource; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialMinimalTrackedResourceWithIdentity.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialMinimalTrackedResourceWithIdentity.java index 7187063fa6cc7..94621ebcbc369 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialMinimalTrackedResourceWithIdentity.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialMinimalTrackedResourceWithIdentity.java @@ -5,25 +5,31 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Strictly used in update requests. */ +/** + * Strictly used in update requests. + */ @Fluent -public class PartialMinimalTrackedResourceWithIdentity extends PartialMinimalTrackedResource { +public final class PartialMinimalTrackedResourceWithIdentity extends PartialMinimalTrackedResource { /* * Managed service identity (system assigned and/or user assigned identities) */ - @JsonProperty(value = "identity") private PartialManagedServiceIdentity identity; - /** Creates an instance of PartialMinimalTrackedResourceWithIdentity class. */ + /** + * Creates an instance of PartialMinimalTrackedResourceWithIdentity class. + */ public PartialMinimalTrackedResourceWithIdentity() { } /** * Get the identity property: Managed service identity (system assigned and/or user assigned identities). - * + * * @return the identity value. */ public PartialManagedServiceIdentity identity() { @@ -32,7 +38,7 @@ public PartialManagedServiceIdentity identity() { /** * Set the identity property: Managed service identity (system assigned and/or user assigned identities). - * + * * @param identity the identity value to set. * @return the PartialMinimalTrackedResourceWithIdentity object itself. */ @@ -41,7 +47,9 @@ public PartialMinimalTrackedResourceWithIdentity withIdentity(PartialManagedServ return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public PartialMinimalTrackedResourceWithIdentity withTags(Map tags) { super.withTags(tags); @@ -50,7 +58,7 @@ public PartialMinimalTrackedResourceWithIdentity withTags(Map ta /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -60,4 +68,46 @@ public void validate() { identity().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PartialMinimalTrackedResourceWithIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PartialMinimalTrackedResourceWithIdentity if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PartialMinimalTrackedResourceWithIdentity. + */ + public static PartialMinimalTrackedResourceWithIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PartialMinimalTrackedResourceWithIdentity deserializedPartialMinimalTrackedResourceWithIdentity + = new PartialMinimalTrackedResourceWithIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedPartialMinimalTrackedResourceWithIdentity.withTags(tags); + } else if ("identity".equals(fieldName)) { + deserializedPartialMinimalTrackedResourceWithIdentity.identity + = PartialManagedServiceIdentity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPartialMinimalTrackedResourceWithIdentity; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialMinimalTrackedResourceWithSku.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialMinimalTrackedResourceWithSku.java index fd014366f4110..16db7a27cf84c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialMinimalTrackedResourceWithSku.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialMinimalTrackedResourceWithSku.java @@ -5,25 +5,31 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Strictly used in update requests. */ +/** + * Strictly used in update requests. + */ @Fluent public final class PartialMinimalTrackedResourceWithSku extends PartialMinimalTrackedResource { /* * Sku details required for ARM contract for Autoscaling. */ - @JsonProperty(value = "sku") private PartialSku sku; - /** Creates an instance of PartialMinimalTrackedResourceWithSku class. */ + /** + * Creates an instance of PartialMinimalTrackedResourceWithSku class. + */ public PartialMinimalTrackedResourceWithSku() { } /** * Get the sku property: Sku details required for ARM contract for Autoscaling. - * + * * @return the sku value. */ public PartialSku sku() { @@ -32,7 +38,7 @@ public PartialSku sku() { /** * Set the sku property: Sku details required for ARM contract for Autoscaling. - * + * * @param sku the sku value to set. * @return the PartialMinimalTrackedResourceWithSku object itself. */ @@ -41,7 +47,9 @@ public PartialMinimalTrackedResourceWithSku withSku(PartialSku sku) { return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public PartialMinimalTrackedResourceWithSku withTags(Map tags) { super.withTags(tags); @@ -50,7 +58,7 @@ public PartialMinimalTrackedResourceWithSku withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -60,4 +68,45 @@ public void validate() { sku().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("sku", this.sku); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PartialMinimalTrackedResourceWithSku from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PartialMinimalTrackedResourceWithSku if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PartialMinimalTrackedResourceWithSku. + */ + public static PartialMinimalTrackedResourceWithSku fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PartialMinimalTrackedResourceWithSku deserializedPartialMinimalTrackedResourceWithSku + = new PartialMinimalTrackedResourceWithSku(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedPartialMinimalTrackedResourceWithSku.withTags(tags); + } else if ("sku".equals(fieldName)) { + deserializedPartialMinimalTrackedResourceWithSku.sku = PartialSku.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPartialMinimalTrackedResourceWithSku; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialMinimalTrackedResourceWithSkuAndIdentity.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialMinimalTrackedResourceWithSkuAndIdentity.java new file mode 100644 index 0000000000000..76d2e466568b1 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialMinimalTrackedResourceWithSkuAndIdentity.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Strictly used in update requests. + */ +@Fluent +public final class PartialMinimalTrackedResourceWithSkuAndIdentity extends PartialMinimalTrackedResource { + /* + * Managed service identity (system assigned and/or user assigned identities) + */ + private PartialManagedServiceIdentity identity; + + /* + * Sku details required for ARM contract for Autoscaling. + */ + private PartialSku sku; + + /** + * Creates an instance of PartialMinimalTrackedResourceWithSkuAndIdentity class. + */ + public PartialMinimalTrackedResourceWithSkuAndIdentity() { + } + + /** + * Get the identity property: Managed service identity (system assigned and/or user assigned identities). + * + * @return the identity value. + */ + public PartialManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Managed service identity (system assigned and/or user assigned identities). + * + * @param identity the identity value to set. + * @return the PartialMinimalTrackedResourceWithSkuAndIdentity object itself. + */ + public PartialMinimalTrackedResourceWithSkuAndIdentity withIdentity(PartialManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the sku property: Sku details required for ARM contract for Autoscaling. + * + * @return the sku value. + */ + public PartialSku sku() { + return this.sku; + } + + /** + * Set the sku property: Sku details required for ARM contract for Autoscaling. + * + * @param sku the sku value to set. + * @return the PartialMinimalTrackedResourceWithSkuAndIdentity object itself. + */ + public PartialMinimalTrackedResourceWithSkuAndIdentity withSku(PartialSku sku) { + this.sku = sku; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PartialMinimalTrackedResourceWithSkuAndIdentity withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (identity() != null) { + identity().validate(); + } + if (sku() != null) { + sku().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeJsonField("sku", this.sku); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PartialMinimalTrackedResourceWithSkuAndIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PartialMinimalTrackedResourceWithSkuAndIdentity if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PartialMinimalTrackedResourceWithSkuAndIdentity. + */ + public static PartialMinimalTrackedResourceWithSkuAndIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PartialMinimalTrackedResourceWithSkuAndIdentity deserializedPartialMinimalTrackedResourceWithSkuAndIdentity + = new PartialMinimalTrackedResourceWithSkuAndIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedPartialMinimalTrackedResourceWithSkuAndIdentity.withTags(tags); + } else if ("identity".equals(fieldName)) { + deserializedPartialMinimalTrackedResourceWithSkuAndIdentity.identity + = PartialManagedServiceIdentity.fromJson(reader); + } else if ("sku".equals(fieldName)) { + deserializedPartialMinimalTrackedResourceWithSkuAndIdentity.sku = PartialSku.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPartialMinimalTrackedResourceWithSkuAndIdentity; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialRegistryPartialTrackedResource.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialRegistryPartialTrackedResource.java new file mode 100644 index 0000000000000..d5739dbf1a57a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialRegistryPartialTrackedResource.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Strictly used in update requests. + */ +@Fluent +public final class PartialRegistryPartialTrackedResource + implements JsonSerializable { + /* + * Managed service identity (system assigned and/or user assigned identities) + */ + private RegistryPartialManagedServiceIdentity identity; + + /* + * Sku details required for ARM contract for Autoscaling. + */ + private PartialSku sku; + + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of PartialRegistryPartialTrackedResource class. + */ + public PartialRegistryPartialTrackedResource() { + } + + /** + * Get the identity property: Managed service identity (system assigned and/or user assigned identities). + * + * @return the identity value. + */ + public RegistryPartialManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Managed service identity (system assigned and/or user assigned identities). + * + * @param identity the identity value to set. + * @return the PartialRegistryPartialTrackedResource object itself. + */ + public PartialRegistryPartialTrackedResource withIdentity(RegistryPartialManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the sku property: Sku details required for ARM contract for Autoscaling. + * + * @return the sku value. + */ + public PartialSku sku() { + return this.sku; + } + + /** + * Set the sku property: Sku details required for ARM contract for Autoscaling. + * + * @param sku the sku value to set. + * @return the PartialRegistryPartialTrackedResource object itself. + */ + public PartialRegistryPartialTrackedResource withSku(PartialSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the PartialRegistryPartialTrackedResource object itself. + */ + public PartialRegistryPartialTrackedResource withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (sku() != null) { + sku().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PartialRegistryPartialTrackedResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PartialRegistryPartialTrackedResource if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PartialRegistryPartialTrackedResource. + */ + public static PartialRegistryPartialTrackedResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PartialRegistryPartialTrackedResource deserializedPartialRegistryPartialTrackedResource + = new PartialRegistryPartialTrackedResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("identity".equals(fieldName)) { + deserializedPartialRegistryPartialTrackedResource.identity + = RegistryPartialManagedServiceIdentity.fromJson(reader); + } else if ("sku".equals(fieldName)) { + deserializedPartialRegistryPartialTrackedResource.sku = PartialSku.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedPartialRegistryPartialTrackedResource.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedPartialRegistryPartialTrackedResource; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialSku.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialSku.java index a5220a7d82079..5f7040a3ac323 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialSku.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PartialSku.java @@ -5,52 +5,55 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Common SKU definition. */ +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Common SKU definition. + */ @Fluent -public final class PartialSku { +public final class PartialSku implements JsonSerializable { /* * If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible * for the resource this may be omitted. */ - @JsonProperty(value = "capacity") private Integer capacity; /* * If the service has different generations of hardware, for the same SKU, then that can be captured here. */ - @JsonProperty(value = "family") private String family; /* * The name of the SKU. Ex - P3. It is typically a letter+number code. */ - @JsonProperty(value = "name") private String name; /* * The SKU size. When the name field is the combination of tier and some other value, this would be the standalone * code. */ - @JsonProperty(value = "size") private String size; /* * This field is required to be implemented by the Resource Provider if the service has more than one tier, but is * not required on a PUT. */ - @JsonProperty(value = "tier") private SkuTier tier; - /** Creates an instance of PartialSku class. */ + /** + * Creates an instance of PartialSku class. + */ public PartialSku() { } /** * Get the capacity property: If the SKU supports scale out/in then the capacity integer should be included. If * scale out/in is not possible for the resource this may be omitted. - * + * * @return the capacity value. */ public Integer capacity() { @@ -60,7 +63,7 @@ public Integer capacity() { /** * Set the capacity property: If the SKU supports scale out/in then the capacity integer should be included. If * scale out/in is not possible for the resource this may be omitted. - * + * * @param capacity the capacity value to set. * @return the PartialSku object itself. */ @@ -72,7 +75,7 @@ public PartialSku withCapacity(Integer capacity) { /** * Get the family property: If the service has different generations of hardware, for the same SKU, then that can be * captured here. - * + * * @return the family value. */ public String family() { @@ -82,7 +85,7 @@ public String family() { /** * Set the family property: If the service has different generations of hardware, for the same SKU, then that can be * captured here. - * + * * @param family the family value to set. * @return the PartialSku object itself. */ @@ -93,7 +96,7 @@ public PartialSku withFamily(String family) { /** * Get the name property: The name of the SKU. Ex - P3. It is typically a letter+number code. - * + * * @return the name value. */ public String name() { @@ -102,7 +105,7 @@ public String name() { /** * Set the name property: The name of the SKU. Ex - P3. It is typically a letter+number code. - * + * * @param name the name value to set. * @return the PartialSku object itself. */ @@ -114,7 +117,7 @@ public PartialSku withName(String name) { /** * Get the size property: The SKU size. When the name field is the combination of tier and some other value, this * would be the standalone code. - * + * * @return the size value. */ public String size() { @@ -124,7 +127,7 @@ public String size() { /** * Set the size property: The SKU size. When the name field is the combination of tier and some other value, this * would be the standalone code. - * + * * @param size the size value to set. * @return the PartialSku object itself. */ @@ -136,7 +139,7 @@ public PartialSku withSize(String size) { /** * Get the tier property: This field is required to be implemented by the Resource Provider if the service has more * than one tier, but is not required on a PUT. - * + * * @return the tier value. */ public SkuTier tier() { @@ -146,7 +149,7 @@ public SkuTier tier() { /** * Set the tier property: This field is required to be implemented by the Resource Provider if the service has more * than one tier, but is not required on a PUT. - * + * * @param tier the tier value to set. * @return the PartialSku object itself. */ @@ -157,9 +160,57 @@ public PartialSku withTier(SkuTier tier) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("capacity", this.capacity); + jsonWriter.writeStringField("family", this.family); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("size", this.size); + jsonWriter.writeStringField("tier", this.tier == null ? null : this.tier.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PartialSku from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PartialSku if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the PartialSku. + */ + public static PartialSku fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PartialSku deserializedPartialSku = new PartialSku(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("capacity".equals(fieldName)) { + deserializedPartialSku.capacity = reader.getNullable(JsonReader::getInt); + } else if ("family".equals(fieldName)) { + deserializedPartialSku.family = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPartialSku.name = reader.getString(); + } else if ("size".equals(fieldName)) { + deserializedPartialSku.size = reader.getString(); + } else if ("tier".equals(fieldName)) { + deserializedPartialSku.tier = SkuTier.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPartialSku; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Password.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Password.java index 2b2e387338f8b..a91cd1af69ca6 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Password.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Password.java @@ -5,30 +5,36 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The Password model. */ +/** + * The Password model. + */ @Immutable -public final class Password { +public final class Password implements JsonSerializable { /* * The name property. */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* * The value property. */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private String value; - /** Creates an instance of Password class. */ + /** + * Creates an instance of Password class. + */ public Password() { } /** * Get the name property: The name property. - * + * * @return the name value. */ public String name() { @@ -37,7 +43,7 @@ public String name() { /** * Get the value property: The value property. - * + * * @return the value value. */ public String value() { @@ -46,9 +52,46 @@ public String value() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Password from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Password if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Password. + */ + public static Password fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Password deserializedPassword = new Password(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedPassword.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedPassword.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPassword; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PatAuthTypeWorkspaceConnectionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PatAuthTypeWorkspaceConnectionProperties.java index 068f4b6b123a3..839f1fae0ee7f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PatAuthTypeWorkspaceConnectionProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PatAuthTypeWorkspaceConnectionProperties.java @@ -5,28 +5,60 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; -/** The PatAuthTypeWorkspaceConnectionProperties model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "authType") -@JsonTypeName("PAT") +/** + * The PatAuthTypeWorkspaceConnectionProperties model. + */ @Fluent public final class PatAuthTypeWorkspaceConnectionProperties extends WorkspaceConnectionPropertiesV2 { + /* + * Authentication type of the connection target + */ + private ConnectionAuthType authType = ConnectionAuthType.PAT; + /* * The credentials property. */ - @JsonProperty(value = "credentials") private WorkspaceConnectionPersonalAccessToken credentials; - /** Creates an instance of PatAuthTypeWorkspaceConnectionProperties class. */ + /* + * The createdByWorkspaceArmId property. + */ + private String createdByWorkspaceArmId; + + /* + * Group based on connection category + */ + private ConnectionGroup group; + + /** + * Creates an instance of PatAuthTypeWorkspaceConnectionProperties class. + */ public PatAuthTypeWorkspaceConnectionProperties() { } + /** + * Get the authType property: Authentication type of the connection target. + * + * @return the authType value. + */ + @Override + public ConnectionAuthType authType() { + return this.authType; + } + /** * Get the credentials property: The credentials property. - * + * * @return the credentials value. */ public WorkspaceConnectionPersonalAccessToken credentials() { @@ -35,38 +67,102 @@ public WorkspaceConnectionPersonalAccessToken credentials() { /** * Set the credentials property: The credentials property. - * + * * @param credentials the credentials value to set. * @return the PatAuthTypeWorkspaceConnectionProperties object itself. */ - public PatAuthTypeWorkspaceConnectionProperties withCredentials( - WorkspaceConnectionPersonalAccessToken credentials) { + public PatAuthTypeWorkspaceConnectionProperties + withCredentials(WorkspaceConnectionPersonalAccessToken credentials) { this.credentials = credentials; return this; } - /** {@inheritDoc} */ + /** + * Get the createdByWorkspaceArmId property: The createdByWorkspaceArmId property. + * + * @return the createdByWorkspaceArmId value. + */ + @Override + public String createdByWorkspaceArmId() { + return this.createdByWorkspaceArmId; + } + + /** + * Get the group property: Group based on connection category. + * + * @return the group value. + */ + @Override + public ConnectionGroup group() { + return this.group; + } + + /** + * {@inheritDoc} + */ @Override public PatAuthTypeWorkspaceConnectionProperties withCategory(ConnectionCategory category) { super.withCategory(category); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ + @Override + public PatAuthTypeWorkspaceConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { + super.withExpiryTime(expiryTime); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PatAuthTypeWorkspaceConnectionProperties withIsSharedToAll(Boolean isSharedToAll) { + super.withIsSharedToAll(isSharedToAll); + return this; + } + + /** + * {@inheritDoc} + */ @Override public PatAuthTypeWorkspaceConnectionProperties withTarget(String target) { super.withTarget(target); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ + @Override + public PatAuthTypeWorkspaceConnectionProperties withMetadata(Map metadata) { + super.withMetadata(metadata); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PatAuthTypeWorkspaceConnectionProperties withSharedUserList(List sharedUserList) { + super.withSharedUserList(sharedUserList); + return this; + } + + /** + * {@inheritDoc} + */ @Override public PatAuthTypeWorkspaceConnectionProperties withValue(String value) { super.withValue(value); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public PatAuthTypeWorkspaceConnectionProperties withValueFormat(ValueFormat valueFormat) { super.withValueFormat(valueFormat); @@ -75,7 +171,7 @@ public PatAuthTypeWorkspaceConnectionProperties withValueFormat(ValueFormat valu /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -85,4 +181,83 @@ public void validate() { credentials().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", category() == null ? null : category().toString()); + jsonWriter.writeStringField("expiryTime", + expiryTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expiryTime())); + jsonWriter.writeBooleanField("isSharedToAll", isSharedToAll()); + jsonWriter.writeStringField("target", target()); + jsonWriter.writeMapField("metadata", metadata(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("sharedUserList", sharedUserList(), + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("value", value()); + jsonWriter.writeStringField("valueFormat", valueFormat() == null ? null : valueFormat().toString()); + jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); + jsonWriter.writeJsonField("credentials", this.credentials); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PatAuthTypeWorkspaceConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PatAuthTypeWorkspaceConnectionProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PatAuthTypeWorkspaceConnectionProperties. + */ + public static PatAuthTypeWorkspaceConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PatAuthTypeWorkspaceConnectionProperties deserializedPatAuthTypeWorkspaceConnectionProperties + = new PatAuthTypeWorkspaceConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedPatAuthTypeWorkspaceConnectionProperties + .withCategory(ConnectionCategory.fromString(reader.getString())); + } else if ("createdByWorkspaceArmId".equals(fieldName)) { + deserializedPatAuthTypeWorkspaceConnectionProperties.createdByWorkspaceArmId = reader.getString(); + } else if ("expiryTime".equals(fieldName)) { + deserializedPatAuthTypeWorkspaceConnectionProperties.withExpiryTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("group".equals(fieldName)) { + deserializedPatAuthTypeWorkspaceConnectionProperties.group + = ConnectionGroup.fromString(reader.getString()); + } else if ("isSharedToAll".equals(fieldName)) { + deserializedPatAuthTypeWorkspaceConnectionProperties + .withIsSharedToAll(reader.getNullable(JsonReader::getBoolean)); + } else if ("target".equals(fieldName)) { + deserializedPatAuthTypeWorkspaceConnectionProperties.withTarget(reader.getString()); + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedPatAuthTypeWorkspaceConnectionProperties.withMetadata(metadata); + } else if ("sharedUserList".equals(fieldName)) { + List sharedUserList = reader.readArray(reader1 -> reader1.getString()); + deserializedPatAuthTypeWorkspaceConnectionProperties.withSharedUserList(sharedUserList); + } else if ("value".equals(fieldName)) { + deserializedPatAuthTypeWorkspaceConnectionProperties.withValue(reader.getString()); + } else if ("valueFormat".equals(fieldName)) { + deserializedPatAuthTypeWorkspaceConnectionProperties + .withValueFormat(ValueFormat.fromString(reader.getString())); + } else if ("authType".equals(fieldName)) { + deserializedPatAuthTypeWorkspaceConnectionProperties.authType + = ConnectionAuthType.fromString(reader.getString()); + } else if ("credentials".equals(fieldName)) { + deserializedPatAuthTypeWorkspaceConnectionProperties.credentials + = WorkspaceConnectionPersonalAccessToken.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPatAuthTypeWorkspaceConnectionProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PendingUploadCredentialDto.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PendingUploadCredentialDto.java new file mode 100644 index 0000000000000..92e9b1628d91c --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PendingUploadCredentialDto.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The PendingUploadCredentialDto model. + */ +@Immutable +public class PendingUploadCredentialDto implements JsonSerializable { + /* + * [Required] Credential type used to authentication with storage. + */ + private PendingUploadCredentialType credentialType + = PendingUploadCredentialType.fromString("PendingUploadCredentialDto"); + + /** + * Creates an instance of PendingUploadCredentialDto class. + */ + public PendingUploadCredentialDto() { + } + + /** + * Get the credentialType property: [Required] Credential type used to authentication with storage. + * + * @return the credentialType value. + */ + public PendingUploadCredentialType credentialType() { + return this.credentialType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("credentialType", + this.credentialType == null ? null : this.credentialType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PendingUploadCredentialDto from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PendingUploadCredentialDto if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PendingUploadCredentialDto. + */ + public static PendingUploadCredentialDto fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("credentialType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("SAS".equals(discriminatorValue)) { + return SasCredentialDto.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static PendingUploadCredentialDto fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PendingUploadCredentialDto deserializedPendingUploadCredentialDto = new PendingUploadCredentialDto(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("credentialType".equals(fieldName)) { + deserializedPendingUploadCredentialDto.credentialType + = PendingUploadCredentialType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPendingUploadCredentialDto; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PendingUploadCredentialType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PendingUploadCredentialType.java new file mode 100644 index 0000000000000..9f445de557724 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PendingUploadCredentialType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum to determine the PendingUpload credentials type. + */ +public final class PendingUploadCredentialType extends ExpandableStringEnum { + /** + * Static value SAS for PendingUploadCredentialType. + */ + public static final PendingUploadCredentialType SAS = fromString("SAS"); + + /** + * Creates a new instance of PendingUploadCredentialType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PendingUploadCredentialType() { + } + + /** + * Creates or finds a PendingUploadCredentialType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PendingUploadCredentialType. + */ + public static PendingUploadCredentialType fromString(String name) { + return fromString(name, PendingUploadCredentialType.class); + } + + /** + * Gets known PendingUploadCredentialType values. + * + * @return known PendingUploadCredentialType values. + */ + public static Collection values() { + return values(PendingUploadCredentialType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PendingUploadRequestDto.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PendingUploadRequestDto.java new file mode 100644 index 0000000000000..f2e2dc9ad18aa --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PendingUploadRequestDto.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The PendingUploadRequestDto model. + */ +@Fluent +public final class PendingUploadRequestDto implements JsonSerializable { + /* + * If PendingUploadId = null then random guid will be used. + */ + private String pendingUploadId; + + /* + * TemporaryBlobReference is the only supported type + */ + private PendingUploadType pendingUploadType; + + /** + * Creates an instance of PendingUploadRequestDto class. + */ + public PendingUploadRequestDto() { + } + + /** + * Get the pendingUploadId property: If PendingUploadId = null then random guid will be used. + * + * @return the pendingUploadId value. + */ + public String pendingUploadId() { + return this.pendingUploadId; + } + + /** + * Set the pendingUploadId property: If PendingUploadId = null then random guid will be used. + * + * @param pendingUploadId the pendingUploadId value to set. + * @return the PendingUploadRequestDto object itself. + */ + public PendingUploadRequestDto withPendingUploadId(String pendingUploadId) { + this.pendingUploadId = pendingUploadId; + return this; + } + + /** + * Get the pendingUploadType property: TemporaryBlobReference is the only supported type. + * + * @return the pendingUploadType value. + */ + public PendingUploadType pendingUploadType() { + return this.pendingUploadType; + } + + /** + * Set the pendingUploadType property: TemporaryBlobReference is the only supported type. + * + * @param pendingUploadType the pendingUploadType value to set. + * @return the PendingUploadRequestDto object itself. + */ + public PendingUploadRequestDto withPendingUploadType(PendingUploadType pendingUploadType) { + this.pendingUploadType = pendingUploadType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("pendingUploadId", this.pendingUploadId); + jsonWriter.writeStringField("pendingUploadType", + this.pendingUploadType == null ? null : this.pendingUploadType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PendingUploadRequestDto from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PendingUploadRequestDto if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the PendingUploadRequestDto. + */ + public static PendingUploadRequestDto fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PendingUploadRequestDto deserializedPendingUploadRequestDto = new PendingUploadRequestDto(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("pendingUploadId".equals(fieldName)) { + deserializedPendingUploadRequestDto.pendingUploadId = reader.getString(); + } else if ("pendingUploadType".equals(fieldName)) { + deserializedPendingUploadRequestDto.pendingUploadType + = PendingUploadType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPendingUploadRequestDto; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PendingUploadResponseDto.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PendingUploadResponseDto.java new file mode 100644 index 0000000000000..83a3ed2894908 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PendingUploadResponseDto.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.resourcemanager.machinelearning.fluent.models.PendingUploadResponseDtoInner; + +/** + * An immutable client-side representation of PendingUploadResponseDto. + */ +public interface PendingUploadResponseDto { + /** + * Gets the blobReferenceForConsumption property: Container level read, write, list SAS. + * + * @return the blobReferenceForConsumption value. + */ + BlobReferenceForConsumptionDto blobReferenceForConsumption(); + + /** + * Gets the pendingUploadId property: ID for this upload request. + * + * @return the pendingUploadId value. + */ + String pendingUploadId(); + + /** + * Gets the pendingUploadType property: TemporaryBlobReference is the only supported type. + * + * @return the pendingUploadType value. + */ + PendingUploadType pendingUploadType(); + + /** + * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.PendingUploadResponseDtoInner object. + * + * @return the inner object. + */ + PendingUploadResponseDtoInner innerModel(); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PendingUploadType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PendingUploadType.java new file mode 100644 index 0000000000000..4573c34feb3a6 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PendingUploadType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of storage to use for the pending upload location. + */ +public final class PendingUploadType extends ExpandableStringEnum { + /** + * Static value None for PendingUploadType. + */ + public static final PendingUploadType NONE = fromString("None"); + + /** + * Static value TemporaryBlobReference for PendingUploadType. + */ + public static final PendingUploadType TEMPORARY_BLOB_REFERENCE = fromString("TemporaryBlobReference"); + + /** + * Creates a new instance of PendingUploadType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PendingUploadType() { + } + + /** + * Creates or finds a PendingUploadType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PendingUploadType. + */ + public static PendingUploadType fromString(String name) { + return fromString(name, PendingUploadType.class); + } + + /** + * Gets known PendingUploadType values. + * + * @return known PendingUploadType values. + */ + public static Collection values() { + return values(PendingUploadType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PersonalComputeInstanceSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PersonalComputeInstanceSettings.java index acf0346afd9dd..18891a1e73c8b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PersonalComputeInstanceSettings.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PersonalComputeInstanceSettings.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Settings for a personal compute instance. */ +/** + * Settings for a personal compute instance. + */ @Fluent -public final class PersonalComputeInstanceSettings { +public final class PersonalComputeInstanceSettings implements JsonSerializable { /* * A user explicitly assigned to a personal compute instance. */ - @JsonProperty(value = "assignedUser") private AssignedUser assignedUser; - /** Creates an instance of PersonalComputeInstanceSettings class. */ + /** + * Creates an instance of PersonalComputeInstanceSettings class. + */ public PersonalComputeInstanceSettings() { } /** * Get the assignedUser property: A user explicitly assigned to a personal compute instance. - * + * * @return the assignedUser value. */ public AssignedUser assignedUser() { @@ -31,7 +38,7 @@ public AssignedUser assignedUser() { /** * Set the assignedUser property: A user explicitly assigned to a personal compute instance. - * + * * @param assignedUser the assignedUser value to set. * @return the PersonalComputeInstanceSettings object itself. */ @@ -42,7 +49,7 @@ public PersonalComputeInstanceSettings withAssignedUser(AssignedUser assignedUse /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -50,4 +57,41 @@ public void validate() { assignedUser().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("assignedUser", this.assignedUser); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PersonalComputeInstanceSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PersonalComputeInstanceSettings if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PersonalComputeInstanceSettings. + */ + public static PersonalComputeInstanceSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PersonalComputeInstanceSettings deserializedPersonalComputeInstanceSettings + = new PersonalComputeInstanceSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("assignedUser".equals(fieldName)) { + deserializedPersonalComputeInstanceSettings.assignedUser = AssignedUser.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPersonalComputeInstanceSettings; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PipelineJob.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PipelineJob.java index 38dd2499a528a..5c5c80c56a94f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PipelineJob.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PipelineJob.java @@ -5,57 +5,71 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Pipeline Job definition: defines generic to MFE attributes. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobType") -@JsonTypeName("Pipeline") +/** + * Pipeline Job definition: defines generic to MFE attributes. + */ @Fluent public final class PipelineJob extends JobBaseProperties { + /* + * [Required] Specifies the type of job. + */ + private JobType jobType = JobType.PIPELINE; + /* * Inputs for the pipeline job. */ - @JsonProperty(value = "inputs") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map inputs; /* * Jobs construct the Pipeline Job. */ - @JsonProperty(value = "jobs") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map jobs; /* * Outputs for the pipeline job */ - @JsonProperty(value = "outputs") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map outputs; /* * Pipeline settings, for things like ContinueRunOnStepFailure etc. */ - @JsonProperty(value = "settings") private Object settings; /* * ARM resource ID of source job. */ - @JsonProperty(value = "sourceJobId") private String sourceJobId; - /** Creates an instance of PipelineJob class. */ + /* + * Status of the job. + */ + private JobStatus status; + + /** + * Creates an instance of PipelineJob class. + */ public PipelineJob() { } + /** + * Get the jobType property: [Required] Specifies the type of job. + * + * @return the jobType value. + */ + @Override + public JobType jobType() { + return this.jobType; + } + /** * Get the inputs property: Inputs for the pipeline job. - * + * * @return the inputs value. */ public Map inputs() { @@ -64,7 +78,7 @@ public Map inputs() { /** * Set the inputs property: Inputs for the pipeline job. - * + * * @param inputs the inputs value to set. * @return the PipelineJob object itself. */ @@ -75,7 +89,7 @@ public PipelineJob withInputs(Map inputs) { /** * Get the jobs property: Jobs construct the Pipeline Job. - * + * * @return the jobs value. */ public Map jobs() { @@ -84,7 +98,7 @@ public Map jobs() { /** * Set the jobs property: Jobs construct the Pipeline Job. - * + * * @param jobs the jobs value to set. * @return the PipelineJob object itself. */ @@ -95,7 +109,7 @@ public PipelineJob withJobs(Map jobs) { /** * Get the outputs property: Outputs for the pipeline job. - * + * * @return the outputs value. */ public Map outputs() { @@ -104,7 +118,7 @@ public Map outputs() { /** * Set the outputs property: Outputs for the pipeline job. - * + * * @param outputs the outputs value to set. * @return the PipelineJob object itself. */ @@ -115,7 +129,7 @@ public PipelineJob withOutputs(Map outputs) { /** * Get the settings property: Pipeline settings, for things like ContinueRunOnStepFailure etc. - * + * * @return the settings value. */ public Object settings() { @@ -124,7 +138,7 @@ public Object settings() { /** * Set the settings property: Pipeline settings, for things like ContinueRunOnStepFailure etc. - * + * * @param settings the settings value to set. * @return the PipelineJob object itself. */ @@ -135,7 +149,7 @@ public PipelineJob withSettings(Object settings) { /** * Get the sourceJobId property: ARM resource ID of source job. - * + * * @return the sourceJobId value. */ public String sourceJobId() { @@ -144,7 +158,7 @@ public String sourceJobId() { /** * Set the sourceJobId property: ARM resource ID of source job. - * + * * @param sourceJobId the sourceJobId value to set. * @return the PipelineJob object itself. */ @@ -153,70 +167,109 @@ public PipelineJob withSourceJobId(String sourceJobId) { return this; } - /** {@inheritDoc} */ + /** + * Get the status property: Status of the job. + * + * @return the status value. + */ + @Override + public JobStatus status() { + return this.status; + } + + /** + * {@inheritDoc} + */ @Override public PipelineJob withComponentId(String componentId) { super.withComponentId(componentId); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public PipelineJob withComputeId(String computeId) { super.withComputeId(computeId); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public PipelineJob withDisplayName(String displayName) { super.withDisplayName(displayName); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public PipelineJob withExperimentName(String experimentName) { super.withExperimentName(experimentName); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public PipelineJob withIdentity(IdentityConfiguration identity) { super.withIdentity(identity); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public PipelineJob withIsArchived(Boolean isArchived) { super.withIsArchived(isArchived); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ + @Override + public PipelineJob withNotificationSetting(NotificationSetting notificationSetting) { + super.withNotificationSetting(notificationSetting); + return this; + } + + /** + * {@inheritDoc} + */ @Override public PipelineJob withServices(Map services) { super.withServices(services); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public PipelineJob withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public PipelineJob withProperties(Map properties) { super.withProperties(properties); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public PipelineJob withTags(Map tags) { super.withTags(tags); @@ -225,31 +278,117 @@ public PipelineJob withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (inputs() != null) { - inputs() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); + inputs().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); } if (outputs() != null) { - outputs() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); + outputs().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("componentId", componentId()); + jsonWriter.writeStringField("computeId", computeId()); + jsonWriter.writeStringField("displayName", displayName()); + jsonWriter.writeStringField("experimentName", experimentName()); + jsonWriter.writeJsonField("identity", identity()); + jsonWriter.writeBooleanField("isArchived", isArchived()); + jsonWriter.writeJsonField("notificationSetting", notificationSetting()); + jsonWriter.writeMapField("services", services(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("jobType", this.jobType == null ? null : this.jobType.toString()); + jsonWriter.writeMapField("inputs", this.inputs, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeMapField("jobs", this.jobs, (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeMapField("outputs", this.outputs, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeUntypedField("settings", this.settings); + jsonWriter.writeStringField("sourceJobId", this.sourceJobId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PipelineJob from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PipelineJob if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PipelineJob. + */ + public static PipelineJob fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PipelineJob deserializedPipelineJob = new PipelineJob(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedPipelineJob.withDescription(reader.getString()); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedPipelineJob.withProperties(properties); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedPipelineJob.withTags(tags); + } else if ("componentId".equals(fieldName)) { + deserializedPipelineJob.withComponentId(reader.getString()); + } else if ("computeId".equals(fieldName)) { + deserializedPipelineJob.withComputeId(reader.getString()); + } else if ("displayName".equals(fieldName)) { + deserializedPipelineJob.withDisplayName(reader.getString()); + } else if ("experimentName".equals(fieldName)) { + deserializedPipelineJob.withExperimentName(reader.getString()); + } else if ("identity".equals(fieldName)) { + deserializedPipelineJob.withIdentity(IdentityConfiguration.fromJson(reader)); + } else if ("isArchived".equals(fieldName)) { + deserializedPipelineJob.withIsArchived(reader.getNullable(JsonReader::getBoolean)); + } else if ("notificationSetting".equals(fieldName)) { + deserializedPipelineJob.withNotificationSetting(NotificationSetting.fromJson(reader)); + } else if ("services".equals(fieldName)) { + Map services = reader.readMap(reader1 -> JobService.fromJson(reader1)); + deserializedPipelineJob.withServices(services); + } else if ("status".equals(fieldName)) { + deserializedPipelineJob.status = JobStatus.fromString(reader.getString()); + } else if ("jobType".equals(fieldName)) { + deserializedPipelineJob.jobType = JobType.fromString(reader.getString()); + } else if ("inputs".equals(fieldName)) { + Map inputs = reader.readMap(reader1 -> JobInput.fromJson(reader1)); + deserializedPipelineJob.inputs = inputs; + } else if ("jobs".equals(fieldName)) { + Map jobs = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedPipelineJob.jobs = jobs; + } else if ("outputs".equals(fieldName)) { + Map outputs = reader.readMap(reader1 -> JobOutput.fromJson(reader1)); + deserializedPipelineJob.outputs = outputs; + } else if ("settings".equals(fieldName)) { + deserializedPipelineJob.settings = reader.readUntyped(); + } else if ("sourceJobId".equals(fieldName)) { + deserializedPipelineJob.sourceJobId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPipelineJob; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PredictionDriftMetricThresholdBase.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PredictionDriftMetricThresholdBase.java new file mode 100644 index 0000000000000..a1108385b3110 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PredictionDriftMetricThresholdBase.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The PredictionDriftMetricThresholdBase model. + */ +@Fluent +public class PredictionDriftMetricThresholdBase implements JsonSerializable { + /* + * [Required] Specifies the data type of the metric threshold. + */ + private MonitoringFeatureDataType dataType + = MonitoringFeatureDataType.fromString("PredictionDriftMetricThresholdBase"); + + /* + * The threshold value. If null, a default value will be set depending on the selected metric. + */ + private MonitoringThreshold threshold; + + /** + * Creates an instance of PredictionDriftMetricThresholdBase class. + */ + public PredictionDriftMetricThresholdBase() { + } + + /** + * Get the dataType property: [Required] Specifies the data type of the metric threshold. + * + * @return the dataType value. + */ + public MonitoringFeatureDataType dataType() { + return this.dataType; + } + + /** + * Get the threshold property: The threshold value. If null, a default value will be set depending on the selected + * metric. + * + * @return the threshold value. + */ + public MonitoringThreshold threshold() { + return this.threshold; + } + + /** + * Set the threshold property: The threshold value. If null, a default value will be set depending on the selected + * metric. + * + * @param threshold the threshold value to set. + * @return the PredictionDriftMetricThresholdBase object itself. + */ + public PredictionDriftMetricThresholdBase withThreshold(MonitoringThreshold threshold) { + this.threshold = threshold; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (threshold() != null) { + threshold().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("dataType", this.dataType == null ? null : this.dataType.toString()); + jsonWriter.writeJsonField("threshold", this.threshold); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PredictionDriftMetricThresholdBase from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PredictionDriftMetricThresholdBase if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PredictionDriftMetricThresholdBase. + */ + public static PredictionDriftMetricThresholdBase fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("dataType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Categorical".equals(discriminatorValue)) { + return CategoricalPredictionDriftMetricThreshold.fromJson(readerToUse.reset()); + } else if ("Numerical".equals(discriminatorValue)) { + return NumericalPredictionDriftMetricThreshold.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static PredictionDriftMetricThresholdBase fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PredictionDriftMetricThresholdBase deserializedPredictionDriftMetricThresholdBase + = new PredictionDriftMetricThresholdBase(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dataType".equals(fieldName)) { + deserializedPredictionDriftMetricThresholdBase.dataType + = MonitoringFeatureDataType.fromString(reader.getString()); + } else if ("threshold".equals(fieldName)) { + deserializedPredictionDriftMetricThresholdBase.threshold = MonitoringThreshold.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPredictionDriftMetricThresholdBase; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PredictionDriftMonitoringSignal.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PredictionDriftMonitoringSignal.java new file mode 100644 index 0000000000000..07b37a8a53b4f --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PredictionDriftMonitoringSignal.java @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * The PredictionDriftMonitoringSignal model. + */ +@Fluent +public final class PredictionDriftMonitoringSignal extends MonitoringSignalBase { + /* + * [Required] Specifies the type of signal to monitor. + */ + private MonitoringSignalType signalType = MonitoringSignalType.PREDICTION_DRIFT; + + /* + * A dictionary that maps feature names to their respective data types. + */ + private Map featureDataTypeOverride; + + /* + * [Required] A list of metrics to calculate and their associated thresholds. + */ + private List metricThresholds; + + /* + * [Required] The data which drift will be calculated for. + */ + private MonitoringInputDataBase productionData; + + /* + * [Required] The data to calculate drift against. + */ + private MonitoringInputDataBase referenceData; + + /** + * Creates an instance of PredictionDriftMonitoringSignal class. + */ + public PredictionDriftMonitoringSignal() { + } + + /** + * Get the signalType property: [Required] Specifies the type of signal to monitor. + * + * @return the signalType value. + */ + @Override + public MonitoringSignalType signalType() { + return this.signalType; + } + + /** + * Get the featureDataTypeOverride property: A dictionary that maps feature names to their respective data types. + * + * @return the featureDataTypeOverride value. + */ + public Map featureDataTypeOverride() { + return this.featureDataTypeOverride; + } + + /** + * Set the featureDataTypeOverride property: A dictionary that maps feature names to their respective data types. + * + * @param featureDataTypeOverride the featureDataTypeOverride value to set. + * @return the PredictionDriftMonitoringSignal object itself. + */ + public PredictionDriftMonitoringSignal + withFeatureDataTypeOverride(Map featureDataTypeOverride) { + this.featureDataTypeOverride = featureDataTypeOverride; + return this; + } + + /** + * Get the metricThresholds property: [Required] A list of metrics to calculate and their associated thresholds. + * + * @return the metricThresholds value. + */ + public List metricThresholds() { + return this.metricThresholds; + } + + /** + * Set the metricThresholds property: [Required] A list of metrics to calculate and their associated thresholds. + * + * @param metricThresholds the metricThresholds value to set. + * @return the PredictionDriftMonitoringSignal object itself. + */ + public PredictionDriftMonitoringSignal + withMetricThresholds(List metricThresholds) { + this.metricThresholds = metricThresholds; + return this; + } + + /** + * Get the productionData property: [Required] The data which drift will be calculated for. + * + * @return the productionData value. + */ + public MonitoringInputDataBase productionData() { + return this.productionData; + } + + /** + * Set the productionData property: [Required] The data which drift will be calculated for. + * + * @param productionData the productionData value to set. + * @return the PredictionDriftMonitoringSignal object itself. + */ + public PredictionDriftMonitoringSignal withProductionData(MonitoringInputDataBase productionData) { + this.productionData = productionData; + return this; + } + + /** + * Get the referenceData property: [Required] The data to calculate drift against. + * + * @return the referenceData value. + */ + public MonitoringInputDataBase referenceData() { + return this.referenceData; + } + + /** + * Set the referenceData property: [Required] The data to calculate drift against. + * + * @param referenceData the referenceData value to set. + * @return the PredictionDriftMonitoringSignal object itself. + */ + public PredictionDriftMonitoringSignal withReferenceData(MonitoringInputDataBase referenceData) { + this.referenceData = referenceData; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PredictionDriftMonitoringSignal withNotificationTypes(List notificationTypes) { + super.withNotificationTypes(notificationTypes); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PredictionDriftMonitoringSignal withProperties(Map properties) { + super.withProperties(properties); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (metricThresholds() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property metricThresholds in model PredictionDriftMonitoringSignal")); + } else { + metricThresholds().forEach(e -> e.validate()); + } + if (productionData() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property productionData in model PredictionDriftMonitoringSignal")); + } else { + productionData().validate(); + } + if (referenceData() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property referenceData in model PredictionDriftMonitoringSignal")); + } else { + referenceData().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PredictionDriftMonitoringSignal.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("notificationTypes", notificationTypes(), + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("metricThresholds", this.metricThresholds, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("productionData", this.productionData); + jsonWriter.writeJsonField("referenceData", this.referenceData); + jsonWriter.writeStringField("signalType", this.signalType == null ? null : this.signalType.toString()); + jsonWriter.writeMapField("featureDataTypeOverride", this.featureDataTypeOverride, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PredictionDriftMonitoringSignal from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PredictionDriftMonitoringSignal if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PredictionDriftMonitoringSignal. + */ + public static PredictionDriftMonitoringSignal fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PredictionDriftMonitoringSignal deserializedPredictionDriftMonitoringSignal + = new PredictionDriftMonitoringSignal(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("notificationTypes".equals(fieldName)) { + List notificationTypes + = reader.readArray(reader1 -> MonitoringNotificationType.fromString(reader1.getString())); + deserializedPredictionDriftMonitoringSignal.withNotificationTypes(notificationTypes); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedPredictionDriftMonitoringSignal.withProperties(properties); + } else if ("metricThresholds".equals(fieldName)) { + List metricThresholds + = reader.readArray(reader1 -> PredictionDriftMetricThresholdBase.fromJson(reader1)); + deserializedPredictionDriftMonitoringSignal.metricThresholds = metricThresholds; + } else if ("productionData".equals(fieldName)) { + deserializedPredictionDriftMonitoringSignal.productionData + = MonitoringInputDataBase.fromJson(reader); + } else if ("referenceData".equals(fieldName)) { + deserializedPredictionDriftMonitoringSignal.referenceData + = MonitoringInputDataBase.fromJson(reader); + } else if ("signalType".equals(fieldName)) { + deserializedPredictionDriftMonitoringSignal.signalType + = MonitoringSignalType.fromString(reader.getString()); + } else if ("featureDataTypeOverride".equals(fieldName)) { + Map featureDataTypeOverride + = reader.readMap(reader1 -> MonitoringFeatureDataType.fromString(reader1.getString())); + deserializedPredictionDriftMonitoringSignal.featureDataTypeOverride = featureDataTypeOverride; + } else { + reader.skipChildren(); + } + } + + return deserializedPredictionDriftMonitoringSignal; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpoint.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpoint.java index 7d3cdfb6741b6..2ba502e24e8c8 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpoint.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpoint.java @@ -5,30 +5,31 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The Private Endpoint resource. */ +/** + * The Private Endpoint resource. + */ @Immutable -public final class PrivateEndpoint { +public class PrivateEndpoint implements JsonSerializable { /* * The ARM identifier for Private Endpoint */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; - /* - * The ARM identifier for Subnet resource that private endpoint links to + /** + * Creates an instance of PrivateEndpoint class. */ - @JsonProperty(value = "subnetArmId", access = JsonProperty.Access.WRITE_ONLY) - private String subnetArmId; - - /** Creates an instance of PrivateEndpoint class. */ public PrivateEndpoint() { } /** * Get the id property: The ARM identifier for Private Endpoint. - * + * * @return the id value. */ public String id() { @@ -36,19 +37,56 @@ public String id() { } /** - * Get the subnetArmId property: The ARM identifier for Subnet resource that private endpoint links to. - * - * @return the subnetArmId value. + * Set the id property: The ARM identifier for Private Endpoint. + * + * @param id the id value to set. + * @return the PrivateEndpoint object itself. */ - public String subnetArmId() { - return this.subnetArmId; + PrivateEndpoint withId(String id) { + this.id = id; + return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpoint if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateEndpoint. + */ + public static PrivateEndpoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpoint deserializedPrivateEndpoint = new PrivateEndpoint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateEndpoint.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpoint; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointConnection.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointConnection.java index 18d85548f8cb2..af1b0ca198b45 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointConnection.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointConnection.java @@ -10,67 +10,69 @@ import com.azure.resourcemanager.machinelearning.fluent.models.PrivateEndpointConnectionInner; import java.util.Map; -/** An immutable client-side representation of PrivateEndpointConnection. */ +/** + * An immutable client-side representation of PrivateEndpointConnection. + */ public interface PrivateEndpointConnection { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the identity property: The identity of the resource. - * + * * @return the identity value. */ ManagedServiceIdentity identity(); /** * Gets the location property: Specifies the location of the resource. - * + * * @return the location value. */ String location(); /** * Gets the tags property: Contains resource tags defined as key/value pairs. - * + * * @return the tags value. */ Map tags(); /** * Gets the sku property: The sku of the workspace. - * + * * @return the sku value. */ Sku sku(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the privateEndpoint property: The resource of private end point. - * + * * @return the privateEndpoint value. */ PrivateEndpoint privateEndpoint(); @@ -78,97 +80,107 @@ public interface PrivateEndpointConnection { /** * Gets the privateLinkServiceConnectionState property: A collection of information about the state of the * connection between service consumer and provider. - * + * * @return the privateLinkServiceConnectionState value. */ PrivateLinkServiceConnectionState privateLinkServiceConnectionState(); /** * Gets the provisioningState property: The provisioning state of the private endpoint connection resource. - * + * * @return the provisioningState value. */ PrivateEndpointConnectionProvisioningState provisioningState(); /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.PrivateEndpointConnectionInner object. - * + * * @return the inner object. */ PrivateEndpointConnectionInner innerModel(); - /** The entirety of the PrivateEndpointConnection definition. */ + /** + * The entirety of the PrivateEndpointConnection definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } - /** The PrivateEndpointConnection definition stages. */ + + /** + * The PrivateEndpointConnection definition stages. + */ interface DefinitionStages { - /** The first stage of the PrivateEndpointConnection definition. */ + /** + * The first stage of the PrivateEndpointConnection definition. + */ interface Blank extends WithParentResource { } - /** The stage of the PrivateEndpointConnection definition allowing to specify parent resource. */ + + /** + * The stage of the PrivateEndpointConnection definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, workspaceName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @return the next definition stage. */ WithCreate withExistingWorkspace(String resourceGroupName, String workspaceName); } + /** * The stage of the PrivateEndpointConnection definition which contains all the minimum required properties for * the resource to be created, but also allows for any other optional properties to be specified. */ - interface WithCreate - extends DefinitionStages.WithLocation, - DefinitionStages.WithTags, - DefinitionStages.WithIdentity, - DefinitionStages.WithSku, - DefinitionStages.WithPrivateEndpoint, - DefinitionStages.WithPrivateLinkServiceConnectionState { + interface WithCreate extends DefinitionStages.WithLocation, DefinitionStages.WithTags, + DefinitionStages.WithIdentity, DefinitionStages.WithSku, DefinitionStages.WithPrivateEndpoint, + DefinitionStages.WithPrivateLinkServiceConnectionState { /** * Executes the create request. - * + * * @return the created resource. */ PrivateEndpointConnection create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ PrivateEndpointConnection create(Context context); } - /** The stage of the PrivateEndpointConnection definition allowing to specify location. */ + + /** + * The stage of the PrivateEndpointConnection definition allowing to specify location. + */ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location Specifies the location of the resource. * @return the next definition stage. */ @@ -176,52 +188,65 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location Specifies the location of the resource. * @return the next definition stage. */ WithCreate withRegion(String location); } - /** The stage of the PrivateEndpointConnection definition allowing to specify tags. */ + + /** + * The stage of the PrivateEndpointConnection definition allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Contains resource tags defined as key/value pairs.. - * + * * @param tags Contains resource tags defined as key/value pairs. * @return the next definition stage. */ WithCreate withTags(Map tags); } - /** The stage of the PrivateEndpointConnection definition allowing to specify identity. */ + + /** + * The stage of the PrivateEndpointConnection definition allowing to specify identity. + */ interface WithIdentity { /** * Specifies the identity property: The identity of the resource.. - * + * * @param identity The identity of the resource. * @return the next definition stage. */ WithCreate withIdentity(ManagedServiceIdentity identity); } - /** The stage of the PrivateEndpointConnection definition allowing to specify sku. */ + + /** + * The stage of the PrivateEndpointConnection definition allowing to specify sku. + */ interface WithSku { /** * Specifies the sku property: The sku of the workspace.. - * + * * @param sku The sku of the workspace. * @return the next definition stage. */ WithCreate withSku(Sku sku); } - /** The stage of the PrivateEndpointConnection definition allowing to specify privateEndpoint. */ + + /** + * The stage of the PrivateEndpointConnection definition allowing to specify privateEndpoint. + */ interface WithPrivateEndpoint { /** * Specifies the privateEndpoint property: The resource of private end point.. - * + * * @param privateEndpoint The resource of private end point. * @return the next definition stage. */ WithCreate withPrivateEndpoint(PrivateEndpoint privateEndpoint); } + /** * The stage of the PrivateEndpointConnection definition allowing to specify privateLinkServiceConnectionState. */ @@ -229,110 +254,127 @@ interface WithPrivateLinkServiceConnectionState { /** * Specifies the privateLinkServiceConnectionState property: A collection of information about the state of * the connection between service consumer and provider.. - * + * * @param privateLinkServiceConnectionState A collection of information about the state of the connection - * between service consumer and provider. + * between service consumer and provider. * @return the next definition stage. */ WithCreate withPrivateLinkServiceConnectionState( PrivateLinkServiceConnectionState privateLinkServiceConnectionState); } } + /** * Begins update for the PrivateEndpointConnection resource. - * + * * @return the stage of resource update. */ PrivateEndpointConnection.Update update(); - /** The template for PrivateEndpointConnection update. */ - interface Update - extends UpdateStages.WithTags, - UpdateStages.WithIdentity, - UpdateStages.WithSku, - UpdateStages.WithPrivateEndpoint, - UpdateStages.WithPrivateLinkServiceConnectionState { + /** + * The template for PrivateEndpointConnection update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithSku, + UpdateStages.WithPrivateEndpoint, UpdateStages.WithPrivateLinkServiceConnectionState { /** * Executes the update request. - * + * * @return the updated resource. */ PrivateEndpointConnection apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ PrivateEndpointConnection apply(Context context); } - /** The PrivateEndpointConnection update stages. */ + + /** + * The PrivateEndpointConnection update stages. + */ interface UpdateStages { - /** The stage of the PrivateEndpointConnection update allowing to specify tags. */ + /** + * The stage of the PrivateEndpointConnection update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Contains resource tags defined as key/value pairs.. - * + * * @param tags Contains resource tags defined as key/value pairs. * @return the next definition stage. */ Update withTags(Map tags); } - /** The stage of the PrivateEndpointConnection update allowing to specify identity. */ + + /** + * The stage of the PrivateEndpointConnection update allowing to specify identity. + */ interface WithIdentity { /** * Specifies the identity property: The identity of the resource.. - * + * * @param identity The identity of the resource. * @return the next definition stage. */ Update withIdentity(ManagedServiceIdentity identity); } - /** The stage of the PrivateEndpointConnection update allowing to specify sku. */ + + /** + * The stage of the PrivateEndpointConnection update allowing to specify sku. + */ interface WithSku { /** * Specifies the sku property: The sku of the workspace.. - * + * * @param sku The sku of the workspace. * @return the next definition stage. */ Update withSku(Sku sku); } - /** The stage of the PrivateEndpointConnection update allowing to specify privateEndpoint. */ + + /** + * The stage of the PrivateEndpointConnection update allowing to specify privateEndpoint. + */ interface WithPrivateEndpoint { /** * Specifies the privateEndpoint property: The resource of private end point.. - * + * * @param privateEndpoint The resource of private end point. * @return the next definition stage. */ Update withPrivateEndpoint(PrivateEndpoint privateEndpoint); } - /** The stage of the PrivateEndpointConnection update allowing to specify privateLinkServiceConnectionState. */ + + /** + * The stage of the PrivateEndpointConnection update allowing to specify privateLinkServiceConnectionState. + */ interface WithPrivateLinkServiceConnectionState { /** * Specifies the privateLinkServiceConnectionState property: A collection of information about the state of * the connection between service consumer and provider.. - * + * * @param privateLinkServiceConnectionState A collection of information about the state of the connection - * between service consumer and provider. + * between service consumer and provider. * @return the next definition stage. */ Update withPrivateLinkServiceConnectionState( PrivateLinkServiceConnectionState privateLinkServiceConnectionState); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ PrivateEndpointConnection refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointConnectionListResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointConnectionListResult.java index b6f3c0c8b9b1d..fa1adc25e986a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointConnectionListResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointConnectionListResult.java @@ -5,26 +5,34 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.fluent.models.PrivateEndpointConnectionInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** List of private endpoint connection associated with the specified workspace. */ +/** + * List of private endpoint connection associated with the specified workspace. + */ @Fluent -public final class PrivateEndpointConnectionListResult { +public final class PrivateEndpointConnectionListResult + implements JsonSerializable { /* * Array of private endpoint connections */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of PrivateEndpointConnectionListResult class. */ + /** + * Creates an instance of PrivateEndpointConnectionListResult class. + */ public PrivateEndpointConnectionListResult() { } /** * Get the value property: Array of private endpoint connections. - * + * * @return the value value. */ public List value() { @@ -33,7 +41,7 @@ public List value() { /** * Set the value property: Array of private endpoint connections. - * + * * @param value the value value to set. * @return the PrivateEndpointConnectionListResult object itself. */ @@ -44,7 +52,7 @@ public PrivateEndpointConnectionListResult withValue(List e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionListResult if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateEndpointConnectionListResult. + */ + public static PrivateEndpointConnectionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionListResult deserializedPrivateEndpointConnectionListResult + = new PrivateEndpointConnectionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); + deserializedPrivateEndpointConnectionListResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionListResult; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointConnectionProvisioningState.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointConnectionProvisioningState.java index 1caa6c114b4fb..b0390745bc2df 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointConnectionProvisioningState.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointConnectionProvisioningState.java @@ -5,27 +5,36 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The current provisioning state. */ +/** + * The current provisioning state. + */ public final class PrivateEndpointConnectionProvisioningState extends ExpandableStringEnum { - /** Static value Succeeded for PrivateEndpointConnectionProvisioningState. */ + /** + * Static value Succeeded for PrivateEndpointConnectionProvisioningState. + */ public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); - /** Static value Creating for PrivateEndpointConnectionProvisioningState. */ + /** + * Static value Creating for PrivateEndpointConnectionProvisioningState. + */ public static final PrivateEndpointConnectionProvisioningState CREATING = fromString("Creating"); - /** Static value Deleting for PrivateEndpointConnectionProvisioningState. */ + /** + * Static value Deleting for PrivateEndpointConnectionProvisioningState. + */ public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); - /** Static value Failed for PrivateEndpointConnectionProvisioningState. */ + /** + * Static value Failed for PrivateEndpointConnectionProvisioningState. + */ public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); /** * Creates a new instance of PrivateEndpointConnectionProvisioningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -34,18 +43,17 @@ public PrivateEndpointConnectionProvisioningState() { /** * Creates or finds a PrivateEndpointConnectionProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding PrivateEndpointConnectionProvisioningState. */ - @JsonCreator public static PrivateEndpointConnectionProvisioningState fromString(String name) { return fromString(name, PrivateEndpointConnectionProvisioningState.class); } /** * Gets known PrivateEndpointConnectionProvisioningState values. - * + * * @return known PrivateEndpointConnectionProvisioningState values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointConnections.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointConnections.java index c660b6ad5ca1b..a451262c1dd8e 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointConnections.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointConnections.java @@ -8,24 +8,26 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of PrivateEndpointConnections. */ +/** + * Resource collection API of PrivateEndpointConnections. + */ public interface PrivateEndpointConnections { /** * List all the private endpoint connections associated with the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of private endpoint connection associated with the specified workspace as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String workspaceName); /** * List all the private endpoint connections associated with the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -33,13 +35,13 @@ public interface PrivateEndpointConnections { * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of private endpoint connection associated with the specified workspace as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String workspaceName, Context context); /** * Gets the specified private endpoint connection associated with the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. @@ -49,12 +51,12 @@ public interface PrivateEndpointConnections { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the specified private endpoint connection associated with the workspace along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context); + Response getWithResponse(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName, Context context); /** * Gets the specified private endpoint connection associated with the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. @@ -67,7 +69,7 @@ Response getWithResponse( /** * Deletes the specified private endpoint connection associated with the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. @@ -77,12 +79,12 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ - Response deleteWithResponse( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context); + Response deleteWithResponse(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName, Context context); /** * Deletes the specified private endpoint connection associated with the workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the workspace. @@ -94,7 +96,7 @@ Response deleteWithResponse( /** * Gets the specified private endpoint connection associated with the workspace. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -105,7 +107,7 @@ Response deleteWithResponse( /** * Gets the specified private endpoint connection associated with the workspace. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -117,7 +119,7 @@ Response deleteWithResponse( /** * Deletes the specified private endpoint connection associated with the workspace. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -127,7 +129,7 @@ Response deleteWithResponse( /** * Deletes the specified private endpoint connection associated with the workspace. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -139,7 +141,7 @@ Response deleteWithResponse( /** * Begins definition for a new PrivateEndpointConnection resource. - * + * * @param name resource name. * @return the first stage of the new PrivateEndpointConnection definition. */ diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointDestination.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointDestination.java new file mode 100644 index 0000000000000..b76a001a93451 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointDestination.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Private Endpoint destination for a Private Endpoint Outbound Rule for the managed network of a machine learning + * workspace. + */ +@Fluent +public final class PrivateEndpointDestination implements JsonSerializable { + /* + * The serviceResourceId property. + */ + private String serviceResourceId; + + /* + * The sparkEnabled property. + */ + private Boolean sparkEnabled; + + /* + * Type of a managed network Outbound Rule of a machine learning workspace. + */ + private RuleStatus sparkStatus; + + /* + * The subresourceTarget property. + */ + private String subresourceTarget; + + /** + * Creates an instance of PrivateEndpointDestination class. + */ + public PrivateEndpointDestination() { + } + + /** + * Get the serviceResourceId property: The serviceResourceId property. + * + * @return the serviceResourceId value. + */ + public String serviceResourceId() { + return this.serviceResourceId; + } + + /** + * Set the serviceResourceId property: The serviceResourceId property. + * + * @param serviceResourceId the serviceResourceId value to set. + * @return the PrivateEndpointDestination object itself. + */ + public PrivateEndpointDestination withServiceResourceId(String serviceResourceId) { + this.serviceResourceId = serviceResourceId; + return this; + } + + /** + * Get the sparkEnabled property: The sparkEnabled property. + * + * @return the sparkEnabled value. + */ + public Boolean sparkEnabled() { + return this.sparkEnabled; + } + + /** + * Set the sparkEnabled property: The sparkEnabled property. + * + * @param sparkEnabled the sparkEnabled value to set. + * @return the PrivateEndpointDestination object itself. + */ + public PrivateEndpointDestination withSparkEnabled(Boolean sparkEnabled) { + this.sparkEnabled = sparkEnabled; + return this; + } + + /** + * Get the sparkStatus property: Type of a managed network Outbound Rule of a machine learning workspace. + * + * @return the sparkStatus value. + */ + public RuleStatus sparkStatus() { + return this.sparkStatus; + } + + /** + * Set the sparkStatus property: Type of a managed network Outbound Rule of a machine learning workspace. + * + * @param sparkStatus the sparkStatus value to set. + * @return the PrivateEndpointDestination object itself. + */ + public PrivateEndpointDestination withSparkStatus(RuleStatus sparkStatus) { + this.sparkStatus = sparkStatus; + return this; + } + + /** + * Get the subresourceTarget property: The subresourceTarget property. + * + * @return the subresourceTarget value. + */ + public String subresourceTarget() { + return this.subresourceTarget; + } + + /** + * Set the subresourceTarget property: The subresourceTarget property. + * + * @param subresourceTarget the subresourceTarget value to set. + * @return the PrivateEndpointDestination object itself. + */ + public PrivateEndpointDestination withSubresourceTarget(String subresourceTarget) { + this.subresourceTarget = subresourceTarget; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("serviceResourceId", this.serviceResourceId); + jsonWriter.writeBooleanField("sparkEnabled", this.sparkEnabled); + jsonWriter.writeStringField("sparkStatus", this.sparkStatus == null ? null : this.sparkStatus.toString()); + jsonWriter.writeStringField("subresourceTarget", this.subresourceTarget); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointDestination from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointDestination if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateEndpointDestination. + */ + public static PrivateEndpointDestination fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointDestination deserializedPrivateEndpointDestination = new PrivateEndpointDestination(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serviceResourceId".equals(fieldName)) { + deserializedPrivateEndpointDestination.serviceResourceId = reader.getString(); + } else if ("sparkEnabled".equals(fieldName)) { + deserializedPrivateEndpointDestination.sparkEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("sparkStatus".equals(fieldName)) { + deserializedPrivateEndpointDestination.sparkStatus = RuleStatus.fromString(reader.getString()); + } else if ("subresourceTarget".equals(fieldName)) { + deserializedPrivateEndpointDestination.subresourceTarget = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointDestination; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointOutboundRule.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointOutboundRule.java new file mode 100644 index 0000000000000..f1f9fd565f37c --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointOutboundRule.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Private Endpoint Outbound Rule for the managed network of a machine learning workspace. + */ +@Fluent +public final class PrivateEndpointOutboundRule extends OutboundRule { + /* + * Type of a managed network Outbound Rule of a machine learning workspace. + */ + private RuleType type = RuleType.PRIVATE_ENDPOINT; + + /* + * Private Endpoint destination for a Private Endpoint Outbound Rule for the managed network of a machine learning + * workspace. + */ + private PrivateEndpointDestination destination; + + /** + * Creates an instance of PrivateEndpointOutboundRule class. + */ + public PrivateEndpointOutboundRule() { + } + + /** + * Get the type property: Type of a managed network Outbound Rule of a machine learning workspace. + * + * @return the type value. + */ + @Override + public RuleType type() { + return this.type; + } + + /** + * Get the destination property: Private Endpoint destination for a Private Endpoint Outbound Rule for the managed + * network of a machine learning workspace. + * + * @return the destination value. + */ + public PrivateEndpointDestination destination() { + return this.destination; + } + + /** + * Set the destination property: Private Endpoint destination for a Private Endpoint Outbound Rule for the managed + * network of a machine learning workspace. + * + * @param destination the destination value to set. + * @return the PrivateEndpointOutboundRule object itself. + */ + public PrivateEndpointOutboundRule withDestination(PrivateEndpointDestination destination) { + this.destination = destination; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PrivateEndpointOutboundRule withCategory(RuleCategory category) { + super.withCategory(category); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PrivateEndpointOutboundRule withStatus(RuleStatus status) { + super.withStatus(status); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (destination() != null) { + destination().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", category() == null ? null : category().toString()); + jsonWriter.writeStringField("status", status() == null ? null : status().toString()); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeJsonField("destination", this.destination); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointOutboundRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointOutboundRule if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateEndpointOutboundRule. + */ + public static PrivateEndpointOutboundRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointOutboundRule deserializedPrivateEndpointOutboundRule = new PrivateEndpointOutboundRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedPrivateEndpointOutboundRule.withCategory(RuleCategory.fromString(reader.getString())); + } else if ("status".equals(fieldName)) { + deserializedPrivateEndpointOutboundRule.withStatus(RuleStatus.fromString(reader.getString())); + } else if ("type".equals(fieldName)) { + deserializedPrivateEndpointOutboundRule.type = RuleType.fromString(reader.getString()); + } else if ("destination".equals(fieldName)) { + deserializedPrivateEndpointOutboundRule.destination = PrivateEndpointDestination.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointOutboundRule; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointResource.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointResource.java new file mode 100644 index 0000000000000..d6cf70a8406bf --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointResource.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The PE network resource that is linked to this PE connection. + */ +@Fluent +public final class PrivateEndpointResource extends PrivateEndpoint { + /* + * The subnetId that the private endpoint is connected to. + */ + private String subnetArmId; + + /* + * The ARM identifier for Private Endpoint + */ + private String id; + + /** + * Creates an instance of PrivateEndpointResource class. + */ + public PrivateEndpointResource() { + } + + /** + * Get the subnetArmId property: The subnetId that the private endpoint is connected to. + * + * @return the subnetArmId value. + */ + public String subnetArmId() { + return this.subnetArmId; + } + + /** + * Set the subnetArmId property: The subnetId that the private endpoint is connected to. + * + * @param subnetArmId the subnetArmId value to set. + * @return the PrivateEndpointResource object itself. + */ + public PrivateEndpointResource withSubnetArmId(String subnetArmId) { + this.subnetArmId = subnetArmId; + return this; + } + + /** + * Get the id property: The ARM identifier for Private Endpoint. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("subnetArmId", this.subnetArmId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointResource if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateEndpointResource. + */ + public static PrivateEndpointResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointResource deserializedPrivateEndpointResource = new PrivateEndpointResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateEndpointResource.id = reader.getString(); + } else if ("subnetArmId".equals(fieldName)) { + deserializedPrivateEndpointResource.subnetArmId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointResource; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointServiceConnectionStatus.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointServiceConnectionStatus.java index 0173735ec3571..3b384798802f2 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointServiceConnectionStatus.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateEndpointServiceConnectionStatus.java @@ -5,30 +5,41 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The private endpoint connection status. */ +/** + * The private endpoint connection status. + */ public final class PrivateEndpointServiceConnectionStatus extends ExpandableStringEnum { - /** Static value Pending for PrivateEndpointServiceConnectionStatus. */ + /** + * Static value Pending for PrivateEndpointServiceConnectionStatus. + */ public static final PrivateEndpointServiceConnectionStatus PENDING = fromString("Pending"); - /** Static value Approved for PrivateEndpointServiceConnectionStatus. */ + /** + * Static value Approved for PrivateEndpointServiceConnectionStatus. + */ public static final PrivateEndpointServiceConnectionStatus APPROVED = fromString("Approved"); - /** Static value Rejected for PrivateEndpointServiceConnectionStatus. */ + /** + * Static value Rejected for PrivateEndpointServiceConnectionStatus. + */ public static final PrivateEndpointServiceConnectionStatus REJECTED = fromString("Rejected"); - /** Static value Disconnected for PrivateEndpointServiceConnectionStatus. */ + /** + * Static value Disconnected for PrivateEndpointServiceConnectionStatus. + */ public static final PrivateEndpointServiceConnectionStatus DISCONNECTED = fromString("Disconnected"); - /** Static value Timeout for PrivateEndpointServiceConnectionStatus. */ + /** + * Static value Timeout for PrivateEndpointServiceConnectionStatus. + */ public static final PrivateEndpointServiceConnectionStatus TIMEOUT = fromString("Timeout"); /** * Creates a new instance of PrivateEndpointServiceConnectionStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -37,18 +48,17 @@ public PrivateEndpointServiceConnectionStatus() { /** * Creates or finds a PrivateEndpointServiceConnectionStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding PrivateEndpointServiceConnectionStatus. */ - @JsonCreator public static PrivateEndpointServiceConnectionStatus fromString(String name) { return fromString(name, PrivateEndpointServiceConnectionStatus.class); } /** * Gets known PrivateEndpointServiceConnectionStatus values. - * + * * @return known PrivateEndpointServiceConnectionStatus values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateLinkResource.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateLinkResource.java index a98acd180051b..415c63c8ae507 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateLinkResource.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateLinkResource.java @@ -7,59 +7,73 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.fluent.models.PrivateLinkResourceProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; import java.util.Map; -/** A private link resource. */ +/** + * A private link resource. + */ @Fluent public final class PrivateLinkResource extends ProxyResource { /* * Resource properties. */ - @JsonProperty(value = "properties") private PrivateLinkResourceProperties innerProperties; /* * The identity of the resource. */ - @JsonProperty(value = "identity") private ManagedServiceIdentity identity; /* * Specifies the location of the resource. */ - @JsonProperty(value = "location") private String location; /* * Contains resource tags defined as key/value pairs. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* * The sku of the workspace. */ - @JsonProperty(value = "sku") private Sku sku; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of PrivateLinkResource class. */ + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of PrivateLinkResource class. + */ public PrivateLinkResource() { } /** * Get the innerProperties property: Resource properties. - * + * * @return the innerProperties value. */ private PrivateLinkResourceProperties innerProperties() { @@ -68,7 +82,7 @@ private PrivateLinkResourceProperties innerProperties() { /** * Get the identity property: The identity of the resource. - * + * * @return the identity value. */ public ManagedServiceIdentity identity() { @@ -77,7 +91,7 @@ public ManagedServiceIdentity identity() { /** * Set the identity property: The identity of the resource. - * + * * @param identity the identity value to set. * @return the PrivateLinkResource object itself. */ @@ -88,7 +102,7 @@ public PrivateLinkResource withIdentity(ManagedServiceIdentity identity) { /** * Get the location property: Specifies the location of the resource. - * + * * @return the location value. */ public String location() { @@ -97,7 +111,7 @@ public String location() { /** * Set the location property: Specifies the location of the resource. - * + * * @param location the location value to set. * @return the PrivateLinkResource object itself. */ @@ -108,7 +122,7 @@ public PrivateLinkResource withLocation(String location) { /** * Get the tags property: Contains resource tags defined as key/value pairs. - * + * * @return the tags value. */ public Map tags() { @@ -117,7 +131,7 @@ public Map tags() { /** * Set the tags property: Contains resource tags defined as key/value pairs. - * + * * @param tags the tags value to set. * @return the PrivateLinkResource object itself. */ @@ -128,7 +142,7 @@ public PrivateLinkResource withTags(Map tags) { /** * Get the sku property: The sku of the workspace. - * + * * @return the sku value. */ public Sku sku() { @@ -137,7 +151,7 @@ public Sku sku() { /** * Set the sku property: The sku of the workspace. - * + * * @param sku the sku value to set. * @return the PrivateLinkResource object itself. */ @@ -148,16 +162,46 @@ public PrivateLinkResource withSku(Sku sku) { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Get the groupId property: The private link resource group id. - * + * * @return the groupId value. */ public String groupId() { @@ -166,7 +210,7 @@ public String groupId() { /** * Get the requiredMembers property: The private link resource required member names. - * + * * @return the requiredMembers value. */ public List requiredMembers() { @@ -175,7 +219,7 @@ public List requiredMembers() { /** * Get the requiredZoneNames property: The private link resource Private link DNS zone name. - * + * * @return the requiredZoneNames value. */ public List requiredZoneNames() { @@ -184,7 +228,7 @@ public List requiredZoneNames() { /** * Set the requiredZoneNames property: The private link resource Private link DNS zone name. - * + * * @param requiredZoneNames the requiredZoneNames value to set. * @return the PrivateLinkResource object itself. */ @@ -198,7 +242,7 @@ public PrivateLinkResource withRequiredZoneNames(List requiredZoneNames) /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -212,4 +256,62 @@ public void validate() { sku().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("sku", this.sku); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResource if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PrivateLinkResource. + */ + public static PrivateLinkResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResource deserializedPrivateLinkResource = new PrivateLinkResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateLinkResource.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPrivateLinkResource.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateLinkResource.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPrivateLinkResource.innerProperties = PrivateLinkResourceProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedPrivateLinkResource.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("location".equals(fieldName)) { + deserializedPrivateLinkResource.location = reader.getString(); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedPrivateLinkResource.tags = tags; + } else if ("sku".equals(fieldName)) { + deserializedPrivateLinkResource.sku = Sku.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedPrivateLinkResource.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResource; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateLinkResourceListResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateLinkResourceListResult.java index a2e329b0c1adf..b160ef185afd4 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateLinkResourceListResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateLinkResourceListResult.java @@ -7,18 +7,20 @@ import com.azure.resourcemanager.machinelearning.fluent.models.PrivateLinkResourceListResultInner; import java.util.List; -/** An immutable client-side representation of PrivateLinkResourceListResult. */ +/** + * An immutable client-side representation of PrivateLinkResourceListResult. + */ public interface PrivateLinkResourceListResult { /** * Gets the value property: Array of private link resources. - * + * * @return the value value. */ List value(); /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.PrivateLinkResourceListResultInner object. - * + * * @return the inner object. */ PrivateLinkResourceListResultInner innerModel(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateLinkResources.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateLinkResources.java index 76dbb0e8e76eb..2ea81b90bfc3f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateLinkResources.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateLinkResources.java @@ -7,11 +7,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of PrivateLinkResources. */ +/** + * Resource collection API of PrivateLinkResources. + */ public interface PrivateLinkResources { /** * Gets the private link resources that need to be created for a workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -20,12 +22,12 @@ public interface PrivateLinkResources { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private link resources that need to be created for a workspace along with {@link Response}. */ - Response listWithResponse( - String resourceGroupName, String workspaceName, Context context); + Response listWithResponse(String resourceGroupName, String workspaceName, + Context context); /** * Gets the private link resources that need to be created for a workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateLinkServiceConnectionState.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateLinkServiceConnectionState.java index bd4774e9026c0..d1c7df0093f0d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateLinkServiceConnectionState.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PrivateLinkServiceConnectionState.java @@ -5,37 +5,42 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** A collection of information about the state of the connection between service consumer and provider. */ +/** + * A collection of information about the state of the connection between service consumer and provider. + */ @Fluent -public final class PrivateLinkServiceConnectionState { +public final class PrivateLinkServiceConnectionState implements JsonSerializable { /* * Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. */ - @JsonProperty(value = "status") private PrivateEndpointServiceConnectionStatus status; /* * The reason for approval/rejection of the connection. */ - @JsonProperty(value = "description") private String description; /* * A message indicating if changes on the service provider require any updates on the consumer. */ - @JsonProperty(value = "actionsRequired") private String actionsRequired; - /** Creates an instance of PrivateLinkServiceConnectionState class. */ + /** + * Creates an instance of PrivateLinkServiceConnectionState class. + */ public PrivateLinkServiceConnectionState() { } /** * Get the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the * service. - * + * * @return the status value. */ public PrivateEndpointServiceConnectionStatus status() { @@ -45,7 +50,7 @@ public PrivateEndpointServiceConnectionStatus status() { /** * Set the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the * service. - * + * * @param status the status value to set. * @return the PrivateLinkServiceConnectionState object itself. */ @@ -56,7 +61,7 @@ public PrivateLinkServiceConnectionState withStatus(PrivateEndpointServiceConnec /** * Get the description property: The reason for approval/rejection of the connection. - * + * * @return the description value. */ public String description() { @@ -65,7 +70,7 @@ public String description() { /** * Set the description property: The reason for approval/rejection of the connection. - * + * * @param description the description value to set. * @return the PrivateLinkServiceConnectionState object itself. */ @@ -77,7 +82,7 @@ public PrivateLinkServiceConnectionState withDescription(String description) { /** * Get the actionsRequired property: A message indicating if changes on the service provider require any updates on * the consumer. - * + * * @return the actionsRequired value. */ public String actionsRequired() { @@ -87,7 +92,7 @@ public String actionsRequired() { /** * Set the actionsRequired property: A message indicating if changes on the service provider require any updates on * the consumer. - * + * * @param actionsRequired the actionsRequired value to set. * @return the PrivateLinkServiceConnectionState object itself. */ @@ -98,9 +103,53 @@ public PrivateLinkServiceConnectionState withActionsRequired(String actionsRequi /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("actionsRequired", this.actionsRequired); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkServiceConnectionState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkServiceConnectionState if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkServiceConnectionState. + */ + public static PrivateLinkServiceConnectionState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkServiceConnectionState deserializedPrivateLinkServiceConnectionState + = new PrivateLinkServiceConnectionState(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.status + = PrivateEndpointServiceConnectionStatus.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.description = reader.getString(); + } else if ("actionsRequired".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.actionsRequired = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkServiceConnectionState; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ProbeSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ProbeSettings.java index 3827d5bdb2061..f61a901ac6cdf 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ProbeSettings.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ProbeSettings.java @@ -5,49 +5,53 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.Duration; -/** Deployment container liveness/readiness probe configuration. */ +/** + * Deployment container liveness/readiness probe configuration. + */ @Fluent -public final class ProbeSettings { +public final class ProbeSettings implements JsonSerializable { /* * The number of failures to allow before returning an unhealthy status. */ - @JsonProperty(value = "failureThreshold") private Integer failureThreshold; /* * The delay before the first probe in ISO 8601 format. */ - @JsonProperty(value = "initialDelay") private Duration initialDelay; /* * The length of time between probes in ISO 8601 format. */ - @JsonProperty(value = "period") private Duration period; /* * The number of successful probes before returning a healthy status. */ - @JsonProperty(value = "successThreshold") private Integer successThreshold; /* * The probe timeout in ISO 8601 format. */ - @JsonProperty(value = "timeout") private Duration timeout; - /** Creates an instance of ProbeSettings class. */ + /** + * Creates an instance of ProbeSettings class. + */ public ProbeSettings() { } /** * Get the failureThreshold property: The number of failures to allow before returning an unhealthy status. - * + * * @return the failureThreshold value. */ public Integer failureThreshold() { @@ -56,7 +60,7 @@ public Integer failureThreshold() { /** * Set the failureThreshold property: The number of failures to allow before returning an unhealthy status. - * + * * @param failureThreshold the failureThreshold value to set. * @return the ProbeSettings object itself. */ @@ -67,7 +71,7 @@ public ProbeSettings withFailureThreshold(Integer failureThreshold) { /** * Get the initialDelay property: The delay before the first probe in ISO 8601 format. - * + * * @return the initialDelay value. */ public Duration initialDelay() { @@ -76,7 +80,7 @@ public Duration initialDelay() { /** * Set the initialDelay property: The delay before the first probe in ISO 8601 format. - * + * * @param initialDelay the initialDelay value to set. * @return the ProbeSettings object itself. */ @@ -87,7 +91,7 @@ public ProbeSettings withInitialDelay(Duration initialDelay) { /** * Get the period property: The length of time between probes in ISO 8601 format. - * + * * @return the period value. */ public Duration period() { @@ -96,7 +100,7 @@ public Duration period() { /** * Set the period property: The length of time between probes in ISO 8601 format. - * + * * @param period the period value to set. * @return the ProbeSettings object itself. */ @@ -107,7 +111,7 @@ public ProbeSettings withPeriod(Duration period) { /** * Get the successThreshold property: The number of successful probes before returning a healthy status. - * + * * @return the successThreshold value. */ public Integer successThreshold() { @@ -116,7 +120,7 @@ public Integer successThreshold() { /** * Set the successThreshold property: The number of successful probes before returning a healthy status. - * + * * @param successThreshold the successThreshold value to set. * @return the ProbeSettings object itself. */ @@ -127,7 +131,7 @@ public ProbeSettings withSuccessThreshold(Integer successThreshold) { /** * Get the timeout property: The probe timeout in ISO 8601 format. - * + * * @return the timeout value. */ public Duration timeout() { @@ -136,7 +140,7 @@ public Duration timeout() { /** * Set the timeout property: The probe timeout in ISO 8601 format. - * + * * @param timeout the timeout value to set. * @return the ProbeSettings object itself. */ @@ -147,9 +151,60 @@ public ProbeSettings withTimeout(Duration timeout) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("failureThreshold", this.failureThreshold); + jsonWriter.writeStringField("initialDelay", CoreUtils.durationToStringWithDays(this.initialDelay)); + jsonWriter.writeStringField("period", CoreUtils.durationToStringWithDays(this.period)); + jsonWriter.writeNumberField("successThreshold", this.successThreshold); + jsonWriter.writeStringField("timeout", CoreUtils.durationToStringWithDays(this.timeout)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProbeSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProbeSettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ProbeSettings. + */ + public static ProbeSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProbeSettings deserializedProbeSettings = new ProbeSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("failureThreshold".equals(fieldName)) { + deserializedProbeSettings.failureThreshold = reader.getNullable(JsonReader::getInt); + } else if ("initialDelay".equals(fieldName)) { + deserializedProbeSettings.initialDelay + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else if ("period".equals(fieldName)) { + deserializedProbeSettings.period + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else if ("successThreshold".equals(fieldName)) { + deserializedProbeSettings.successThreshold = reader.getNullable(JsonReader::getInt); + } else if ("timeout".equals(fieldName)) { + deserializedProbeSettings.timeout + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedProbeSettings; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Protocol.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Protocol.java new file mode 100644 index 0000000000000..f7acb88277589 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Protocol.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Endpoint Communication Protocol + * + * Protocol over which communication will happen over this endpoint. + */ +public final class Protocol extends ExpandableStringEnum { + /** + * Static value tcp for Protocol. + */ + public static final Protocol TCP = fromString("tcp"); + + /** + * Static value udp for Protocol. + */ + public static final Protocol UDP = fromString("udp"); + + /** + * Static value http for Protocol. + */ + public static final Protocol HTTP = fromString("http"); + + /** + * Creates a new instance of Protocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Protocol() { + } + + /** + * Creates or finds a Protocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding Protocol. + */ + public static Protocol fromString(String name) { + return fromString(name, Protocol.class); + } + + /** + * Gets known Protocol values. + * + * @return known Protocol values. + */ + public static Collection values() { + return values(Protocol.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ProvisioningState.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ProvisioningState.java index 0c3c664d77498..8b9f3f919d3da 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ProvisioningState.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ProvisioningState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -13,30 +12,44 @@ * provisioning. */ public final class ProvisioningState extends ExpandableStringEnum { - /** Static value Unknown for ProvisioningState. */ + /** + * Static value Unknown for ProvisioningState. + */ public static final ProvisioningState UNKNOWN = fromString("Unknown"); - /** Static value Updating for ProvisioningState. */ + /** + * Static value Updating for ProvisioningState. + */ public static final ProvisioningState UPDATING = fromString("Updating"); - /** Static value Creating for ProvisioningState. */ + /** + * Static value Creating for ProvisioningState. + */ public static final ProvisioningState CREATING = fromString("Creating"); - /** Static value Deleting for ProvisioningState. */ + /** + * Static value Deleting for ProvisioningState. + */ public static final ProvisioningState DELETING = fromString("Deleting"); - /** Static value Succeeded for ProvisioningState. */ + /** + * Static value Succeeded for ProvisioningState. + */ public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); - /** Static value Failed for ProvisioningState. */ + /** + * Static value Failed for ProvisioningState. + */ public static final ProvisioningState FAILED = fromString("Failed"); - /** Static value Canceled for ProvisioningState. */ + /** + * Static value Canceled for ProvisioningState. + */ public static final ProvisioningState CANCELED = fromString("Canceled"); /** * Creates a new instance of ProvisioningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -45,18 +58,17 @@ public ProvisioningState() { /** * Creates or finds a ProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding ProvisioningState. */ - @JsonCreator public static ProvisioningState fromString(String name) { return fromString(name, ProvisioningState.class); } /** * Gets known ProvisioningState values. - * + * * @return known ProvisioningState values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ProvisioningStatus.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ProvisioningStatus.java index 55ec63e378b1c..7f648d1e4ef53 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ProvisioningStatus.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ProvisioningStatus.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The current deployment state of schedule. */ +/** + * The current deployment state of schedule. + */ public final class ProvisioningStatus extends ExpandableStringEnum { - /** Static value Completed for ProvisioningStatus. */ + /** + * Static value Completed for ProvisioningStatus. + */ public static final ProvisioningStatus COMPLETED = fromString("Completed"); - /** Static value Provisioning for ProvisioningStatus. */ + /** + * Static value Provisioning for ProvisioningStatus. + */ public static final ProvisioningStatus PROVISIONING = fromString("Provisioning"); - /** Static value Failed for ProvisioningStatus. */ + /** + * Static value Failed for ProvisioningStatus. + */ public static final ProvisioningStatus FAILED = fromString("Failed"); /** * Creates a new instance of ProvisioningStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public ProvisioningStatus() { /** * Creates or finds a ProvisioningStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding ProvisioningStatus. */ - @JsonCreator public static ProvisioningStatus fromString(String name) { return fromString(name, ProvisioningStatus.class); } /** * Gets known ProvisioningStatus values. - * + * * @return known ProvisioningStatus values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PublicNetworkAccess.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PublicNetworkAccess.java index c18df6cfe6886..fc4f3647534ed 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PublicNetworkAccess.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PublicNetworkAccess.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Whether requests from Public Network are allowed. */ +/** + * Whether requests from Public Network are allowed. + */ public final class PublicNetworkAccess extends ExpandableStringEnum { - /** Static value Enabled for PublicNetworkAccess. */ + /** + * Static value Enabled for PublicNetworkAccess. + */ public static final PublicNetworkAccess ENABLED = fromString("Enabled"); - /** Static value Disabled for PublicNetworkAccess. */ + /** + * Static value Disabled for PublicNetworkAccess. + */ public static final PublicNetworkAccess DISABLED = fromString("Disabled"); /** * Creates a new instance of PublicNetworkAccess value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public PublicNetworkAccess() { /** * Creates or finds a PublicNetworkAccess from its string representation. - * + * * @param name a name to look for. * @return the corresponding PublicNetworkAccess. */ - @JsonCreator public static PublicNetworkAccess fromString(String name) { return fromString(name, PublicNetworkAccess.class); } /** * Gets known PublicNetworkAccess values. - * + * * @return known PublicNetworkAccess values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PublicNetworkAccessType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PublicNetworkAccessType.java index 93629faaf07d5..631d09e2877ee 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PublicNetworkAccessType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PublicNetworkAccessType.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Enum to determine whether PublicNetworkAccess is Enabled or Disabled. */ +/** + * Enum to determine whether PublicNetworkAccess is Enabled or Disabled. + */ public final class PublicNetworkAccessType extends ExpandableStringEnum { - /** Static value Enabled for PublicNetworkAccessType. */ + /** + * Static value Enabled for PublicNetworkAccessType. + */ public static final PublicNetworkAccessType ENABLED = fromString("Enabled"); - /** Static value Disabled for PublicNetworkAccessType. */ + /** + * Static value Disabled for PublicNetworkAccessType. + */ public static final PublicNetworkAccessType DISABLED = fromString("Disabled"); /** * Creates a new instance of PublicNetworkAccessType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public PublicNetworkAccessType() { /** * Creates or finds a PublicNetworkAccessType from its string representation. - * + * * @param name a name to look for. * @return the corresponding PublicNetworkAccessType. */ - @JsonCreator public static PublicNetworkAccessType fromString(String name) { return fromString(name, PublicNetworkAccessType.class); } /** * Gets known PublicNetworkAccessType values. - * + * * @return known PublicNetworkAccessType values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PyTorch.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PyTorch.java index c172265d0b929..6f0ada746ac77 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PyTorch.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/PyTorch.java @@ -5,28 +5,45 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** PyTorch distribution configuration. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "distributionType") -@JsonTypeName("PyTorch") +/** + * PyTorch distribution configuration. + */ @Fluent public final class PyTorch extends DistributionConfiguration { + /* + * [Required] Specifies the type of distribution framework. + */ + private DistributionType distributionType = DistributionType.PY_TORCH; + /* * Number of processes per node. */ - @JsonProperty(value = "processCountPerInstance") private Integer processCountPerInstance; - /** Creates an instance of PyTorch class. */ + /** + * Creates an instance of PyTorch class. + */ public PyTorch() { } + /** + * Get the distributionType property: [Required] Specifies the type of distribution framework. + * + * @return the distributionType value. + */ + @Override + public DistributionType distributionType() { + return this.distributionType; + } + /** * Get the processCountPerInstance property: Number of processes per node. - * + * * @return the processCountPerInstance value. */ public Integer processCountPerInstance() { @@ -35,7 +52,7 @@ public Integer processCountPerInstance() { /** * Set the processCountPerInstance property: Number of processes per node. - * + * * @param processCountPerInstance the processCountPerInstance value to set. * @return the PyTorch object itself. */ @@ -46,11 +63,51 @@ public PyTorch withProcessCountPerInstance(Integer processCountPerInstance) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("distributionType", + this.distributionType == null ? null : this.distributionType.toString()); + jsonWriter.writeNumberField("processCountPerInstance", this.processCountPerInstance); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PyTorch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PyTorch if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the PyTorch. + */ + public static PyTorch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PyTorch deserializedPyTorch = new PyTorch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("distributionType".equals(fieldName)) { + deserializedPyTorch.distributionType = DistributionType.fromString(reader.getString()); + } else if ("processCountPerInstance".equals(fieldName)) { + deserializedPyTorch.processCountPerInstance = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedPyTorch; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/QueueSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/QueueSettings.java new file mode 100644 index 0000000000000..5bd3b4d276fb9 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/QueueSettings.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The QueueSettings model. + */ +@Fluent +public final class QueueSettings implements JsonSerializable { + /* + * Controls the compute job tier + */ + private JobTier jobTier; + + /** + * Creates an instance of QueueSettings class. + */ + public QueueSettings() { + } + + /** + * Get the jobTier property: Controls the compute job tier. + * + * @return the jobTier value. + */ + public JobTier jobTier() { + return this.jobTier; + } + + /** + * Set the jobTier property: Controls the compute job tier. + * + * @param jobTier the jobTier value to set. + * @return the QueueSettings object itself. + */ + public QueueSettings withJobTier(JobTier jobTier) { + this.jobTier = jobTier; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("jobTier", this.jobTier == null ? null : this.jobTier.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QueueSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QueueSettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the QueueSettings. + */ + public static QueueSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QueueSettings deserializedQueueSettings = new QueueSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("jobTier".equals(fieldName)) { + deserializedQueueSettings.jobTier = JobTier.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedQueueSettings; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/QuotaBaseProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/QuotaBaseProperties.java index 3a3c3836c0680..7d81d8d5435b6 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/QuotaBaseProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/QuotaBaseProperties.java @@ -5,44 +5,46 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties for Quota update or retrieval. */ +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties for Quota update or retrieval. + */ @Fluent -public final class QuotaBaseProperties { +public final class QuotaBaseProperties implements JsonSerializable { /* * Specifies the resource ID. */ - @JsonProperty(value = "id") private String id; /* * Specifies the resource type. */ - @JsonProperty(value = "type") private String type; /* - * Limit. - * * The maximum permitted quota of the resource. */ - @JsonProperty(value = "limit") private Long limit; /* * An enum describing the unit of quota measurement. */ - @JsonProperty(value = "unit") private QuotaUnit unit; - /** Creates an instance of QuotaBaseProperties class. */ + /** + * Creates an instance of QuotaBaseProperties class. + */ public QuotaBaseProperties() { } /** * Get the id property: Specifies the resource ID. - * + * * @return the id value. */ public String id() { @@ -51,7 +53,7 @@ public String id() { /** * Set the id property: Specifies the resource ID. - * + * * @param id the id value to set. * @return the QuotaBaseProperties object itself. */ @@ -62,7 +64,7 @@ public QuotaBaseProperties withId(String id) { /** * Get the type property: Specifies the resource type. - * + * * @return the type value. */ public String type() { @@ -71,7 +73,7 @@ public String type() { /** * Set the type property: Specifies the resource type. - * + * * @param type the type value to set. * @return the QuotaBaseProperties object itself. */ @@ -81,10 +83,8 @@ public QuotaBaseProperties withType(String type) { } /** - * Get the limit property: Limit. - * - *

The maximum permitted quota of the resource. - * + * Get the limit property: The maximum permitted quota of the resource. + * * @return the limit value. */ public Long limit() { @@ -92,10 +92,8 @@ public Long limit() { } /** - * Set the limit property: Limit. - * - *

The maximum permitted quota of the resource. - * + * Set the limit property: The maximum permitted quota of the resource. + * * @param limit the limit value to set. * @return the QuotaBaseProperties object itself. */ @@ -106,7 +104,7 @@ public QuotaBaseProperties withLimit(Long limit) { /** * Get the unit property: An enum describing the unit of quota measurement. - * + * * @return the unit value. */ public QuotaUnit unit() { @@ -115,7 +113,7 @@ public QuotaUnit unit() { /** * Set the unit property: An enum describing the unit of quota measurement. - * + * * @param unit the unit value to set. * @return the QuotaBaseProperties object itself. */ @@ -126,9 +124,54 @@ public QuotaBaseProperties withUnit(QuotaUnit unit) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeNumberField("limit", this.limit); + jsonWriter.writeStringField("unit", this.unit == null ? null : this.unit.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QuotaBaseProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QuotaBaseProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the QuotaBaseProperties. + */ + public static QuotaBaseProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QuotaBaseProperties deserializedQuotaBaseProperties = new QuotaBaseProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedQuotaBaseProperties.id = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedQuotaBaseProperties.type = reader.getString(); + } else if ("limit".equals(fieldName)) { + deserializedQuotaBaseProperties.limit = reader.getNullable(JsonReader::getLong); + } else if ("unit".equals(fieldName)) { + deserializedQuotaBaseProperties.unit = QuotaUnit.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedQuotaBaseProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/QuotaUnit.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/QuotaUnit.java index af950e89ade05..50e13f334ad54 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/QuotaUnit.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/QuotaUnit.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** An enum describing the unit of quota measurement. */ +/** + * An enum describing the unit of quota measurement. + */ public final class QuotaUnit extends ExpandableStringEnum { - /** Static value Count for QuotaUnit. */ + /** + * Static value Count for QuotaUnit. + */ public static final QuotaUnit COUNT = fromString("Count"); /** * Creates a new instance of QuotaUnit value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -24,18 +27,17 @@ public QuotaUnit() { /** * Creates or finds a QuotaUnit from its string representation. - * + * * @param name a name to look for. * @return the corresponding QuotaUnit. */ - @JsonCreator public static QuotaUnit fromString(String name) { return fromString(name, QuotaUnit.class); } /** * Gets known QuotaUnit values. - * + * * @return known QuotaUnit values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/QuotaUpdateParameters.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/QuotaUpdateParameters.java index 38d413ef636e6..b09e708f46766 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/QuotaUpdateParameters.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/QuotaUpdateParameters.java @@ -5,31 +5,37 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** Quota update parameters. */ +/** + * Quota update parameters. + */ @Fluent -public final class QuotaUpdateParameters { +public final class QuotaUpdateParameters implements JsonSerializable { /* * The list for update quota. */ - @JsonProperty(value = "value") private List value; /* * Region of workspace quota to be updated. */ - @JsonProperty(value = "location") private String location; - /** Creates an instance of QuotaUpdateParameters class. */ + /** + * Creates an instance of QuotaUpdateParameters class. + */ public QuotaUpdateParameters() { } /** * Get the value property: The list for update quota. - * + * * @return the value value. */ public List value() { @@ -38,7 +44,7 @@ public List value() { /** * Set the value property: The list for update quota. - * + * * @param value the value value to set. * @return the QuotaUpdateParameters object itself. */ @@ -49,7 +55,7 @@ public QuotaUpdateParameters withValue(List value) { /** * Get the location property: Region of workspace quota to be updated. - * + * * @return the location value. */ public String location() { @@ -58,7 +64,7 @@ public String location() { /** * Set the location property: Region of workspace quota to be updated. - * + * * @param location the location value to set. * @return the QuotaUpdateParameters object itself. */ @@ -69,7 +75,7 @@ public QuotaUpdateParameters withLocation(String location) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -77,4 +83,45 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("location", this.location); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QuotaUpdateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QuotaUpdateParameters if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the QuotaUpdateParameters. + */ + public static QuotaUpdateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QuotaUpdateParameters deserializedQuotaUpdateParameters = new QuotaUpdateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> QuotaBaseProperties.fromJson(reader1)); + deserializedQuotaUpdateParameters.value = value; + } else if ("location".equals(fieldName)) { + deserializedQuotaUpdateParameters.location = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedQuotaUpdateParameters; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Quotas.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Quotas.java index aa2c3e0fc4116..e8d4b6a08c8ce 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Quotas.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Quotas.java @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Quotas. */ +/** + * Resource collection API of Quotas. + */ public interface Quotas { /** * Update quota for each VM family in workspace. - * + * * @param location The location for update quota is queried. * @param parameters Quota update parameters. * @param context The context to associate with this operation. @@ -21,12 +23,12 @@ public interface Quotas { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the result of update workspace quota along with {@link Response}. */ - Response updateWithResponse( - String location, QuotaUpdateParameters parameters, Context context); + Response updateWithResponse(String location, QuotaUpdateParameters parameters, + Context context); /** * Update quota for each VM family in workspace. - * + * * @param location The location for update quota is queried. * @param parameters Quota update parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -38,26 +40,26 @@ Response updateWithResponse( /** * Gets the currently assigned Workspace Quotas based on VMFamily. - * + * * @param location The location for which resource usage is queried. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently assigned Workspace Quotas based on VMFamily as paginated response with {@link - * PagedIterable}. + * @return the currently assigned Workspace Quotas based on VMFamily as paginated response with + * {@link PagedIterable}. */ PagedIterable list(String location); /** * Gets the currently assigned Workspace Quotas based on VMFamily. - * + * * @param location The location for which resource usage is queried. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the currently assigned Workspace Quotas based on VMFamily as paginated response with {@link - * PagedIterable}. + * @return the currently assigned Workspace Quotas based on VMFamily as paginated response with + * {@link PagedIterable}. */ PagedIterable list(String location, Context context); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RandomSamplingAlgorithm.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RandomSamplingAlgorithm.java index cdb0b372a2445..fcfb02fc331a0 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RandomSamplingAlgorithm.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RandomSamplingAlgorithm.java @@ -5,34 +5,51 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Defines a Sampling Algorithm that generates values randomly. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "samplingAlgorithmType") -@JsonTypeName("Random") +/** + * Defines a Sampling Algorithm that generates values randomly. + */ @Fluent public final class RandomSamplingAlgorithm extends SamplingAlgorithm { + /* + * [Required] The algorithm used for generating hyperparameter values, along with configuration properties + */ + private SamplingAlgorithmType samplingAlgorithmType = SamplingAlgorithmType.RANDOM; + /* * The specific type of random algorithm */ - @JsonProperty(value = "rule") private RandomSamplingAlgorithmRule rule; /* * An optional integer to use as the seed for random number generation */ - @JsonProperty(value = "seed") private Integer seed; - /** Creates an instance of RandomSamplingAlgorithm class. */ + /** + * Creates an instance of RandomSamplingAlgorithm class. + */ public RandomSamplingAlgorithm() { } + /** + * Get the samplingAlgorithmType property: [Required] The algorithm used for generating hyperparameter values, along + * with configuration properties. + * + * @return the samplingAlgorithmType value. + */ + @Override + public SamplingAlgorithmType samplingAlgorithmType() { + return this.samplingAlgorithmType; + } + /** * Get the rule property: The specific type of random algorithm. - * + * * @return the rule value. */ public RandomSamplingAlgorithmRule rule() { @@ -41,7 +58,7 @@ public RandomSamplingAlgorithmRule rule() { /** * Set the rule property: The specific type of random algorithm. - * + * * @param rule the rule value to set. * @return the RandomSamplingAlgorithm object itself. */ @@ -52,7 +69,7 @@ public RandomSamplingAlgorithm withRule(RandomSamplingAlgorithmRule rule) { /** * Get the seed property: An optional integer to use as the seed for random number generation. - * + * * @return the seed value. */ public Integer seed() { @@ -61,7 +78,7 @@ public Integer seed() { /** * Set the seed property: An optional integer to use as the seed for random number generation. - * + * * @param seed the seed value to set. * @return the RandomSamplingAlgorithm object itself. */ @@ -72,11 +89,56 @@ public RandomSamplingAlgorithm withSeed(Integer seed) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("samplingAlgorithmType", + this.samplingAlgorithmType == null ? null : this.samplingAlgorithmType.toString()); + jsonWriter.writeStringField("rule", this.rule == null ? null : this.rule.toString()); + jsonWriter.writeNumberField("seed", this.seed); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RandomSamplingAlgorithm from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RandomSamplingAlgorithm if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RandomSamplingAlgorithm. + */ + public static RandomSamplingAlgorithm fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RandomSamplingAlgorithm deserializedRandomSamplingAlgorithm = new RandomSamplingAlgorithm(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("samplingAlgorithmType".equals(fieldName)) { + deserializedRandomSamplingAlgorithm.samplingAlgorithmType + = SamplingAlgorithmType.fromString(reader.getString()); + } else if ("rule".equals(fieldName)) { + deserializedRandomSamplingAlgorithm.rule + = RandomSamplingAlgorithmRule.fromString(reader.getString()); + } else if ("seed".equals(fieldName)) { + deserializedRandomSamplingAlgorithm.seed = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedRandomSamplingAlgorithm; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RandomSamplingAlgorithmRule.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RandomSamplingAlgorithmRule.java index c545105fa8ffa..6cce58bfa30c7 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RandomSamplingAlgorithmRule.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RandomSamplingAlgorithmRule.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The specific type of random algorithm. */ +/** + * The specific type of random algorithm. + */ public final class RandomSamplingAlgorithmRule extends ExpandableStringEnum { - /** Static value Random for RandomSamplingAlgorithmRule. */ + /** + * Static value Random for RandomSamplingAlgorithmRule. + */ public static final RandomSamplingAlgorithmRule RANDOM = fromString("Random"); - /** Static value Sobol for RandomSamplingAlgorithmRule. */ + /** + * Static value Sobol for RandomSamplingAlgorithmRule. + */ public static final RandomSamplingAlgorithmRule SOBOL = fromString("Sobol"); /** * Creates a new instance of RandomSamplingAlgorithmRule value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public RandomSamplingAlgorithmRule() { /** * Creates or finds a RandomSamplingAlgorithmRule from its string representation. - * + * * @param name a name to look for. * @return the corresponding RandomSamplingAlgorithmRule. */ - @JsonCreator public static RandomSamplingAlgorithmRule fromString(String name) { return fromString(name, RandomSamplingAlgorithmRule.class); } /** * Gets known RandomSamplingAlgorithmRule values. - * + * * @return known RandomSamplingAlgorithmRule values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Recurrence.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Recurrence.java new file mode 100644 index 0000000000000..de9fb39fe4c81 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Recurrence.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The workflow trigger recurrence for ComputeStartStop schedule type. + */ +@Fluent +public final class Recurrence implements JsonSerializable { + /* + * [Required] The frequency to trigger schedule. + */ + private ComputeRecurrenceFrequency frequency; + + /* + * [Required] Specifies schedule interval in conjunction with frequency + */ + private Integer interval; + + /* + * The start time in yyyy-MM-ddTHH:mm:ss format. + */ + private String startTime; + + /* + * 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 + */ + private String timeZone; + + /* + * [Required] The recurrence schedule. + */ + private ComputeRecurrenceSchedule schedule; + + /** + * Creates an instance of Recurrence class. + */ + public Recurrence() { + } + + /** + * Get the frequency property: [Required] The frequency to trigger schedule. + * + * @return the frequency value. + */ + public ComputeRecurrenceFrequency frequency() { + return this.frequency; + } + + /** + * Set the frequency property: [Required] The frequency to trigger schedule. + * + * @param frequency the frequency value to set. + * @return the Recurrence object itself. + */ + public Recurrence withFrequency(ComputeRecurrenceFrequency frequency) { + this.frequency = frequency; + return this; + } + + /** + * Get the interval property: [Required] Specifies schedule interval in conjunction with frequency. + * + * @return the interval value. + */ + public Integer interval() { + return this.interval; + } + + /** + * Set the interval property: [Required] Specifies schedule interval in conjunction with frequency. + * + * @param interval the interval value to set. + * @return the Recurrence object itself. + */ + public Recurrence withInterval(Integer interval) { + this.interval = interval; + return this; + } + + /** + * Get the startTime property: The start time in yyyy-MM-ddTHH:mm:ss format. + * + * @return the startTime value. + */ + public String startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The start time in yyyy-MM-ddTHH:mm:ss format. + * + * @param startTime the startTime value to set. + * @return the Recurrence object itself. + */ + public Recurrence withStartTime(String startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the timeZone property: 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. + * + * @return the timeZone value. + */ + public String timeZone() { + return this.timeZone; + } + + /** + * Set the timeZone property: 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. + * + * @param timeZone the timeZone value to set. + * @return the Recurrence object itself. + */ + public Recurrence withTimeZone(String timeZone) { + this.timeZone = timeZone; + return this; + } + + /** + * Get the schedule property: [Required] The recurrence schedule. + * + * @return the schedule value. + */ + public ComputeRecurrenceSchedule schedule() { + return this.schedule; + } + + /** + * Set the schedule property: [Required] The recurrence schedule. + * + * @param schedule the schedule value to set. + * @return the Recurrence object itself. + */ + public Recurrence withSchedule(ComputeRecurrenceSchedule schedule) { + this.schedule = schedule; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (schedule() != null) { + schedule().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("frequency", this.frequency == null ? null : this.frequency.toString()); + jsonWriter.writeNumberField("interval", this.interval); + jsonWriter.writeStringField("startTime", this.startTime); + jsonWriter.writeStringField("timeZone", this.timeZone); + jsonWriter.writeJsonField("schedule", this.schedule); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Recurrence from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Recurrence if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Recurrence. + */ + public static Recurrence fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Recurrence deserializedRecurrence = new Recurrence(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("frequency".equals(fieldName)) { + deserializedRecurrence.frequency = ComputeRecurrenceFrequency.fromString(reader.getString()); + } else if ("interval".equals(fieldName)) { + deserializedRecurrence.interval = reader.getNullable(JsonReader::getInt); + } else if ("startTime".equals(fieldName)) { + deserializedRecurrence.startTime = reader.getString(); + } else if ("timeZone".equals(fieldName)) { + deserializedRecurrence.timeZone = reader.getString(); + } else if ("schedule".equals(fieldName)) { + deserializedRecurrence.schedule = ComputeRecurrenceSchedule.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRecurrence; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RecurrenceFrequency.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RecurrenceFrequency.java index e1fa4dc2dfb9d..cb1d13b767035 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RecurrenceFrequency.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RecurrenceFrequency.java @@ -5,29 +5,40 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Enum to describe the frequency of a recurrence schedule. */ +/** + * Enum to describe the frequency of a recurrence schedule. + */ public final class RecurrenceFrequency extends ExpandableStringEnum { - /** Static value Minute for RecurrenceFrequency. */ + /** + * Static value Minute for RecurrenceFrequency. + */ public static final RecurrenceFrequency MINUTE = fromString("Minute"); - /** Static value Hour for RecurrenceFrequency. */ + /** + * Static value Hour for RecurrenceFrequency. + */ public static final RecurrenceFrequency HOUR = fromString("Hour"); - /** Static value Day for RecurrenceFrequency. */ + /** + * Static value Day for RecurrenceFrequency. + */ public static final RecurrenceFrequency DAY = fromString("Day"); - /** Static value Week for RecurrenceFrequency. */ + /** + * Static value Week for RecurrenceFrequency. + */ public static final RecurrenceFrequency WEEK = fromString("Week"); - /** Static value Month for RecurrenceFrequency. */ + /** + * Static value Month for RecurrenceFrequency. + */ public static final RecurrenceFrequency MONTH = fromString("Month"); /** * Creates a new instance of RecurrenceFrequency value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -36,18 +47,17 @@ public RecurrenceFrequency() { /** * Creates or finds a RecurrenceFrequency from its string representation. - * + * * @param name a name to look for. * @return the corresponding RecurrenceFrequency. */ - @JsonCreator public static RecurrenceFrequency fromString(String name) { return fromString(name, RecurrenceFrequency.class); } /** * Gets known RecurrenceFrequency values. - * + * * @return known RecurrenceFrequency values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RecurrenceSchedule.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RecurrenceSchedule.java index 519561c59993a..98a944c9bb774 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RecurrenceSchedule.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RecurrenceSchedule.java @@ -6,43 +6,47 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** The RecurrenceSchedule model. */ +/** + * The RecurrenceSchedule model. + */ @Fluent -public final class RecurrenceSchedule { +public final class RecurrenceSchedule implements JsonSerializable { /* * [Required] List of hours for the schedule. */ - @JsonProperty(value = "hours", required = true) private List hours; /* * [Required] List of minutes for the schedule. */ - @JsonProperty(value = "minutes", required = true) private List minutes; /* * List of month days for the schedule */ - @JsonProperty(value = "monthDays") private List monthDays; /* * List of days for the schedule. */ - @JsonProperty(value = "weekDays") private List weekDays; - /** Creates an instance of RecurrenceSchedule class. */ + /** + * Creates an instance of RecurrenceSchedule class. + */ public RecurrenceSchedule() { } /** * Get the hours property: [Required] List of hours for the schedule. - * + * * @return the hours value. */ public List hours() { @@ -51,7 +55,7 @@ public List hours() { /** * Set the hours property: [Required] List of hours for the schedule. - * + * * @param hours the hours value to set. * @return the RecurrenceSchedule object itself. */ @@ -62,7 +66,7 @@ public RecurrenceSchedule withHours(List hours) { /** * Get the minutes property: [Required] List of minutes for the schedule. - * + * * @return the minutes value. */ public List minutes() { @@ -71,7 +75,7 @@ public List minutes() { /** * Set the minutes property: [Required] List of minutes for the schedule. - * + * * @param minutes the minutes value to set. * @return the RecurrenceSchedule object itself. */ @@ -82,7 +86,7 @@ public RecurrenceSchedule withMinutes(List minutes) { /** * Get the monthDays property: List of month days for the schedule. - * + * * @return the monthDays value. */ public List monthDays() { @@ -91,7 +95,7 @@ public List monthDays() { /** * Set the monthDays property: List of month days for the schedule. - * + * * @param monthDays the monthDays value to set. * @return the RecurrenceSchedule object itself. */ @@ -102,7 +106,7 @@ public RecurrenceSchedule withMonthDays(List monthDays) { /** * Get the weekDays property: List of days for the schedule. - * + * * @return the weekDays value. */ public List weekDays() { @@ -111,7 +115,7 @@ public List weekDays() { /** * Set the weekDays property: List of days for the schedule. - * + * * @param weekDays the weekDays value to set. * @return the RecurrenceSchedule object itself. */ @@ -122,21 +126,70 @@ public RecurrenceSchedule withWeekDays(List weekDays) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (hours() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property hours in model RecurrenceSchedule")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property hours in model RecurrenceSchedule")); } if (minutes() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property minutes in model RecurrenceSchedule")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property minutes in model RecurrenceSchedule")); } } private static final ClientLogger LOGGER = new ClientLogger(RecurrenceSchedule.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("hours", this.hours, (writer, element) -> writer.writeInt(element)); + jsonWriter.writeArrayField("minutes", this.minutes, (writer, element) -> writer.writeInt(element)); + jsonWriter.writeArrayField("monthDays", this.monthDays, (writer, element) -> writer.writeInt(element)); + jsonWriter.writeArrayField("weekDays", this.weekDays, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecurrenceSchedule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecurrenceSchedule if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RecurrenceSchedule. + */ + public static RecurrenceSchedule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecurrenceSchedule deserializedRecurrenceSchedule = new RecurrenceSchedule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hours".equals(fieldName)) { + List hours = reader.readArray(reader1 -> reader1.getInt()); + deserializedRecurrenceSchedule.hours = hours; + } else if ("minutes".equals(fieldName)) { + List minutes = reader.readArray(reader1 -> reader1.getInt()); + deserializedRecurrenceSchedule.minutes = minutes; + } else if ("monthDays".equals(fieldName)) { + List monthDays = reader.readArray(reader1 -> reader1.getInt()); + deserializedRecurrenceSchedule.monthDays = monthDays; + } else if ("weekDays".equals(fieldName)) { + List weekDays = reader.readArray(reader1 -> WeekDay.fromString(reader1.getString())); + deserializedRecurrenceSchedule.weekDays = weekDays; + } else { + reader.skipChildren(); + } + } + + return deserializedRecurrenceSchedule; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RecurrenceTrigger.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RecurrenceTrigger.java index 8937548c5ba46..e1c1b4c80f865 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RecurrenceTrigger.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RecurrenceTrigger.java @@ -6,40 +6,55 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The RecurrenceTrigger model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "triggerType") -@JsonTypeName("Recurrence") +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The RecurrenceTrigger model. + */ @Fluent public final class RecurrenceTrigger extends TriggerBase { + /* + * [Required] + */ + private TriggerType triggerType = TriggerType.RECURRENCE; + /* * [Required] The frequency to trigger schedule. */ - @JsonProperty(value = "frequency", required = true) private RecurrenceFrequency frequency; /* * [Required] Specifies schedule interval in conjunction with frequency */ - @JsonProperty(value = "interval", required = true) private int interval; /* * The recurrence schedule. */ - @JsonProperty(value = "schedule") private RecurrenceSchedule schedule; - /** Creates an instance of RecurrenceTrigger class. */ + /** + * Creates an instance of RecurrenceTrigger class. + */ public RecurrenceTrigger() { } + /** + * Get the triggerType property: [Required]. + * + * @return the triggerType value. + */ + @Override + public TriggerType triggerType() { + return this.triggerType; + } + /** * Get the frequency property: [Required] The frequency to trigger schedule. - * + * * @return the frequency value. */ public RecurrenceFrequency frequency() { @@ -48,7 +63,7 @@ public RecurrenceFrequency frequency() { /** * Set the frequency property: [Required] The frequency to trigger schedule. - * + * * @param frequency the frequency value to set. * @return the RecurrenceTrigger object itself. */ @@ -59,7 +74,7 @@ public RecurrenceTrigger withFrequency(RecurrenceFrequency frequency) { /** * Get the interval property: [Required] Specifies schedule interval in conjunction with frequency. - * + * * @return the interval value. */ public int interval() { @@ -68,7 +83,7 @@ public int interval() { /** * Set the interval property: [Required] Specifies schedule interval in conjunction with frequency. - * + * * @param interval the interval value to set. * @return the RecurrenceTrigger object itself. */ @@ -79,7 +94,7 @@ public RecurrenceTrigger withInterval(int interval) { /** * Get the schedule property: The recurrence schedule. - * + * * @return the schedule value. */ public RecurrenceSchedule schedule() { @@ -88,7 +103,7 @@ public RecurrenceSchedule schedule() { /** * Set the schedule property: The recurrence schedule. - * + * * @param schedule the schedule value to set. * @return the RecurrenceTrigger object itself. */ @@ -97,21 +112,27 @@ public RecurrenceTrigger withSchedule(RecurrenceSchedule schedule) { return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public RecurrenceTrigger withEndTime(String endTime) { super.withEndTime(endTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public RecurrenceTrigger withStartTime(String startTime) { super.withStartTime(startTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public RecurrenceTrigger withTimeZone(String timeZone) { super.withTimeZone(timeZone); @@ -120,16 +141,15 @@ public RecurrenceTrigger withTimeZone(String timeZone) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (frequency() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property frequency in model RecurrenceTrigger")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property frequency in model RecurrenceTrigger")); } if (schedule() != null) { schedule().validate(); @@ -137,4 +157,59 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(RecurrenceTrigger.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("endTime", endTime()); + jsonWriter.writeStringField("startTime", startTime()); + jsonWriter.writeStringField("timeZone", timeZone()); + jsonWriter.writeStringField("frequency", this.frequency == null ? null : this.frequency.toString()); + jsonWriter.writeIntField("interval", this.interval); + jsonWriter.writeStringField("triggerType", this.triggerType == null ? null : this.triggerType.toString()); + jsonWriter.writeJsonField("schedule", this.schedule); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecurrenceTrigger from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecurrenceTrigger if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RecurrenceTrigger. + */ + public static RecurrenceTrigger fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecurrenceTrigger deserializedRecurrenceTrigger = new RecurrenceTrigger(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("endTime".equals(fieldName)) { + deserializedRecurrenceTrigger.withEndTime(reader.getString()); + } else if ("startTime".equals(fieldName)) { + deserializedRecurrenceTrigger.withStartTime(reader.getString()); + } else if ("timeZone".equals(fieldName)) { + deserializedRecurrenceTrigger.withTimeZone(reader.getString()); + } else if ("frequency".equals(fieldName)) { + deserializedRecurrenceTrigger.frequency = RecurrenceFrequency.fromString(reader.getString()); + } else if ("interval".equals(fieldName)) { + deserializedRecurrenceTrigger.interval = reader.getInt(); + } else if ("triggerType".equals(fieldName)) { + deserializedRecurrenceTrigger.triggerType = TriggerType.fromString(reader.getString()); + } else if ("schedule".equals(fieldName)) { + deserializedRecurrenceTrigger.schedule = RecurrenceSchedule.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRecurrenceTrigger; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ReferenceType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ReferenceType.java index 128be86bca31d..014a22993670a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ReferenceType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ReferenceType.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Enum to determine which reference method to use for an asset. */ +/** + * Enum to determine which reference method to use for an asset. + */ public final class ReferenceType extends ExpandableStringEnum { - /** Static value Id for ReferenceType. */ + /** + * Static value Id for ReferenceType. + */ public static final ReferenceType ID = fromString("Id"); - /** Static value DataPath for ReferenceType. */ + /** + * Static value DataPath for ReferenceType. + */ public static final ReferenceType DATA_PATH = fromString("DataPath"); - /** Static value OutputPath for ReferenceType. */ + /** + * Static value OutputPath for ReferenceType. + */ public static final ReferenceType OUTPUT_PATH = fromString("OutputPath"); /** * Creates a new instance of ReferenceType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public ReferenceType() { /** * Creates or finds a ReferenceType from its string representation. - * + * * @param name a name to look for. * @return the corresponding ReferenceType. */ - @JsonCreator public static ReferenceType fromString(String name) { return fromString(name, ReferenceType.class); } /** * Gets known ReferenceType values. - * + * * @return known ReferenceType values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegenerateEndpointKeysRequest.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegenerateEndpointKeysRequest.java index 637b34d4e5acf..89c554b646d3f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegenerateEndpointKeysRequest.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegenerateEndpointKeysRequest.java @@ -6,30 +6,36 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The RegenerateEndpointKeysRequest model. */ +/** + * The RegenerateEndpointKeysRequest model. + */ @Fluent -public final class RegenerateEndpointKeysRequest { +public final class RegenerateEndpointKeysRequest implements JsonSerializable { /* * [Required] Specification for which type of key to generate. Primary or Secondary. */ - @JsonProperty(value = "keyType", required = true) private KeyType keyType; /* * The value the key is set to. */ - @JsonProperty(value = "keyValue") private String keyValue; - /** Creates an instance of RegenerateEndpointKeysRequest class. */ + /** + * Creates an instance of RegenerateEndpointKeysRequest class. + */ public RegenerateEndpointKeysRequest() { } /** * Get the keyType property: [Required] Specification for which type of key to generate. Primary or Secondary. - * + * * @return the keyType value. */ public KeyType keyType() { @@ -38,7 +44,7 @@ public KeyType keyType() { /** * Set the keyType property: [Required] Specification for which type of key to generate. Primary or Secondary. - * + * * @param keyType the keyType value to set. * @return the RegenerateEndpointKeysRequest object itself. */ @@ -49,7 +55,7 @@ public RegenerateEndpointKeysRequest withKeyType(KeyType keyType) { /** * Get the keyValue property: The value the key is set to. - * + * * @return the keyValue value. */ public String keyValue() { @@ -58,7 +64,7 @@ public String keyValue() { /** * Set the keyValue property: The value the key is set to. - * + * * @param keyValue the keyValue value to set. * @return the RegenerateEndpointKeysRequest object itself. */ @@ -69,17 +75,57 @@ public RegenerateEndpointKeysRequest withKeyValue(String keyValue) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (keyType() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property keyType in model RegenerateEndpointKeysRequest")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property keyType in model RegenerateEndpointKeysRequest")); } } private static final ClientLogger LOGGER = new ClientLogger(RegenerateEndpointKeysRequest.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("keyType", this.keyType == null ? null : this.keyType.toString()); + jsonWriter.writeStringField("keyValue", this.keyValue); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RegenerateEndpointKeysRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RegenerateEndpointKeysRequest if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RegenerateEndpointKeysRequest. + */ + public static RegenerateEndpointKeysRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RegenerateEndpointKeysRequest deserializedRegenerateEndpointKeysRequest + = new RegenerateEndpointKeysRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyType".equals(fieldName)) { + deserializedRegenerateEndpointKeysRequest.keyType = KeyType.fromString(reader.getString()); + } else if ("keyValue".equals(fieldName)) { + deserializedRegenerateEndpointKeysRequest.keyValue = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRegenerateEndpointKeysRequest; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Registries.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Registries.java new file mode 100644 index 0000000000000..df1cd3c0bcf4a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Registries.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.RegistryInner; + +/** + * Resource collection API of Registries. + */ +public interface Registries { + /** + * List registries by subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List registries by subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List registries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List registries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Registry entities as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Delete registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String registryName); + + /** + * Delete registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, Context context); + + /** + * Get registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registry along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String registryName, Context context); + + /** + * Get registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registry. + */ + Registry getByResourceGroup(String resourceGroupName, String registryName); + + /** + * Remove regions from registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Registry removeRegions(String resourceGroupName, String registryName, RegistryInner body); + + /** + * Remove regions from registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param body Details required to create the registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Registry removeRegions(String resourceGroupName, String registryName, RegistryInner body, Context context); + + /** + * Get registry. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registry along with {@link Response}. + */ + Registry getById(String id); + + /** + * Get registry. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registry along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete registry. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete registry. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Registry resource. + * + * @param name resource name. + * @return the first stage of the new Registry definition. + */ + Registry.DefinitionStages.Blank define(String name); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Registry.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Registry.java new file mode 100644 index 0000000000000..4434116a58a0b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Registry.java @@ -0,0 +1,500 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.RegistryInner; +import java.util.List; +import java.util.Map; + +/** + * An immutable client-side representation of Registry. + */ +public interface Registry { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the identity property: Managed service identity (system assigned and/or user assigned identities). + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + + /** + * Gets the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type. + * + * @return the kind value. + */ + String kind(); + + /** + * Gets the sku property: Sku details required for ARM contract for Autoscaling. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the discoveryUrl property: Discovery URL for the Registry. + * + * @return the discoveryUrl value. + */ + String discoveryUrl(); + + /** + * Gets the intellectualPropertyPublisher property: IntellectualPropertyPublisher for the registry. + * + * @return the intellectualPropertyPublisher value. + */ + String intellectualPropertyPublisher(); + + /** + * Gets the managedResourceGroup property: ResourceId of the managed RG if the registry has system created + * resources. + * + * @return the managedResourceGroup value. + */ + ArmResourceId managedResourceGroup(); + + /** + * Gets the mlFlowRegistryUri property: MLFlow Registry URI for the Registry. + * + * @return the mlFlowRegistryUri value. + */ + String mlFlowRegistryUri(); + + /** + * Gets the registryPrivateEndpointConnections property: Private endpoint connections info used for pending + * connections in private link portal. + * + * @return the registryPrivateEndpointConnections value. + */ + List registryPrivateEndpointConnections(); + + /** + * Gets the publicNetworkAccess property: Is the Registry accessible from the internet? + * Possible values: "Enabled" or "Disabled". + * + * @return the publicNetworkAccess value. + */ + String publicNetworkAccess(); + + /** + * Gets the regionDetails property: Details of each region the registry is in. + * + * @return the regionDetails value. + */ + List regionDetails(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.RegistryInner object. + * + * @return the inner object. + */ + RegistryInner innerModel(); + + /** + * The entirety of the Registry definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The Registry definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Registry definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the Registry definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the Registry definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the Registry definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, + DefinitionStages.WithKind, DefinitionStages.WithSku, DefinitionStages.WithDiscoveryUrl, + DefinitionStages.WithIntellectualPropertyPublisher, DefinitionStages.WithManagedResourceGroup, + DefinitionStages.WithMlFlowRegistryUri, DefinitionStages.WithRegistryPrivateEndpointConnections, + DefinitionStages.WithPublicNetworkAccess, DefinitionStages.WithRegionDetails { + /** + * Executes the create request. + * + * @return the created resource. + */ + Registry create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Registry create(Context context); + } + + /** + * The stage of the Registry definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the Registry definition allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: Managed service identity (system assigned and/or user assigned + * identities). + * + * @param identity Managed service identity (system assigned and/or user assigned identities). + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } + + /** + * The stage of the Registry definition allowing to specify kind. + */ + interface WithKind { + /** + * Specifies the kind property: Metadata used by portal/tooling/etc to render different UX experiences for + * resources of the same type.. + * + * @param kind Metadata used by portal/tooling/etc to render different UX experiences for resources of the + * same type. + * @return the next definition stage. + */ + WithCreate withKind(String kind); + } + + /** + * The stage of the Registry definition allowing to specify sku. + */ + interface WithSku { + /** + * Specifies the sku property: Sku details required for ARM contract for Autoscaling.. + * + * @param sku Sku details required for ARM contract for Autoscaling. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + + /** + * The stage of the Registry definition allowing to specify discoveryUrl. + */ + interface WithDiscoveryUrl { + /** + * Specifies the discoveryUrl property: Discovery URL for the Registry. + * + * @param discoveryUrl Discovery URL for the Registry. + * @return the next definition stage. + */ + WithCreate withDiscoveryUrl(String discoveryUrl); + } + + /** + * The stage of the Registry definition allowing to specify intellectualPropertyPublisher. + */ + interface WithIntellectualPropertyPublisher { + /** + * Specifies the intellectualPropertyPublisher property: IntellectualPropertyPublisher for the registry. + * + * @param intellectualPropertyPublisher IntellectualPropertyPublisher for the registry. + * @return the next definition stage. + */ + WithCreate withIntellectualPropertyPublisher(String intellectualPropertyPublisher); + } + + /** + * The stage of the Registry definition allowing to specify managedResourceGroup. + */ + interface WithManagedResourceGroup { + /** + * Specifies the managedResourceGroup property: ResourceId of the managed RG if the registry has system + * created resources. + * + * @param managedResourceGroup ResourceId of the managed RG if the registry has system created resources. + * @return the next definition stage. + */ + WithCreate withManagedResourceGroup(ArmResourceId managedResourceGroup); + } + + /** + * The stage of the Registry definition allowing to specify mlFlowRegistryUri. + */ + interface WithMlFlowRegistryUri { + /** + * Specifies the mlFlowRegistryUri property: MLFlow Registry URI for the Registry. + * + * @param mlFlowRegistryUri MLFlow Registry URI for the Registry. + * @return the next definition stage. + */ + WithCreate withMlFlowRegistryUri(String mlFlowRegistryUri); + } + + /** + * The stage of the Registry definition allowing to specify registryPrivateEndpointConnections. + */ + interface WithRegistryPrivateEndpointConnections { + /** + * Specifies the registryPrivateEndpointConnections property: Private endpoint connections info used for + * pending connections in private link portal. + * + * @param registryPrivateEndpointConnections Private endpoint connections info used for pending connections + * in private link portal. + * @return the next definition stage. + */ + WithCreate withRegistryPrivateEndpointConnections( + List registryPrivateEndpointConnections); + } + + /** + * The stage of the Registry definition allowing to specify publicNetworkAccess. + */ + interface WithPublicNetworkAccess { + /** + * Specifies the publicNetworkAccess property: Is the Registry accessible from the internet? + * Possible values: "Enabled" or "Disabled". + * + * @param publicNetworkAccess Is the Registry accessible from the internet? + * Possible values: "Enabled" or "Disabled". + * @return the next definition stage. + */ + WithCreate withPublicNetworkAccess(String publicNetworkAccess); + } + + /** + * The stage of the Registry definition allowing to specify regionDetails. + */ + interface WithRegionDetails { + /** + * Specifies the regionDetails property: Details of each region the registry is in. + * + * @param regionDetails Details of each region the registry is in. + * @return the next definition stage. + */ + WithCreate withRegionDetails(List regionDetails); + } + } + + /** + * Begins update for the Registry resource. + * + * @return the stage of resource update. + */ + Registry.Update update(); + + /** + * The template for Registry update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithSku { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Registry apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Registry apply(Context context); + } + + /** + * The Registry update stages. + */ + interface UpdateStages { + /** + * The stage of the Registry update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** + * The stage of the Registry update allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: Managed service identity (system assigned and/or user assigned + * identities). + * + * @param identity Managed service identity (system assigned and/or user assigned identities). + * @return the next definition stage. + */ + Update withIdentity(RegistryPartialManagedServiceIdentity identity); + } + + /** + * The stage of the Registry update allowing to specify sku. + */ + interface WithSku { + /** + * Specifies the sku property: Sku details required for ARM contract for Autoscaling.. + * + * @param sku Sku details required for ARM contract for Autoscaling. + * @return the next definition stage. + */ + Update withSku(PartialSku sku); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Registry refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Registry refresh(Context context); + + /** + * Remove regions from registry. + * + * @param body Details required to create the registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Registry removeRegions(RegistryInner body); + + /** + * Remove regions from registry. + * + * @param body Details required to create the registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Registry removeRegions(RegistryInner body, Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryCodeContainers.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryCodeContainers.java new file mode 100644 index 0000000000000..5a28f1a6c9789 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryCodeContainers.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of RegistryCodeContainers. + */ +public interface RegistryCodeContainers { + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeContainer entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeContainer entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, String skip, Context context); + + /** + * Delete Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String codeName); + + /** + * Delete Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String codeName, Context context); + + /** + * Get Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return code container along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String registryName, String codeName, + Context context); + + /** + * Get Code container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return code container. + */ + CodeContainer get(String resourceGroupName, String registryName, String codeName); + + /** + * Get Code container. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return code container along with {@link Response}. + */ + CodeContainer getById(String id); + + /** + * Get Code container. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return code container along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete Code container. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete Code container. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new CodeContainer resource. + * + * @param name resource name. + * @return the first stage of the new CodeContainer definition. + */ + CodeContainer.DefinitionStages.Blank define(String name); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryCodeVersions.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryCodeVersions.java new file mode 100644 index 0000000000000..c1765818c47f4 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryCodeVersions.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of RegistryCodeVersions. + */ +public interface RegistryCodeVersions { + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeVersion entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, String codeName); + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of CodeVersion entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, String codeName, String orderBy, + Integer top, String skip, Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String codeName, String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String codeName, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String registryName, String codeName, + String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + CodeVersion get(String resourceGroupName, String registryName, String codeName, String version); + + /** + * Generate a storage location and credential for the client to upload a code asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Pending upload name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + Response createOrGetStartPendingUploadWithResponse(String resourceGroupName, + String registryName, String codeName, String version, PendingUploadRequestDto body, Context context); + + /** + * Generate a storage location and credential for the client to upload a code asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param codeName Pending upload name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + PendingUploadResponseDto createOrGetStartPendingUpload(String resourceGroupName, String registryName, + String codeName, String version, PendingUploadRequestDto body); + + /** + * Get version. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + CodeVersion getById(String id); + + /** + * Get version. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete version. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete version. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new CodeVersion resource. + * + * @param name resource name. + * @return the first stage of the new CodeVersion definition. + */ + CodeVersion.DefinitionStages.Blank define(String name); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryComponentContainers.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryComponentContainers.java new file mode 100644 index 0000000000000..8456be09d7af8 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryComponentContainers.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of RegistryComponentContainers. + */ +public interface RegistryComponentContainers { + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentContainer entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * List containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentContainer entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, String skip, Context context); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String componentName); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String componentName, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String registryName, String componentName, + Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container. + */ + ComponentContainer get(String resourceGroupName, String registryName, String componentName); + + /** + * Get container. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + ComponentContainer getById(String id); + + /** + * Get container. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete container. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete container. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ComponentContainer resource. + * + * @param name resource name. + * @return the first stage of the new ComponentContainer definition. + */ + ComponentContainer.DefinitionStages.Blank define(String name); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryComponentVersions.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryComponentVersions.java new file mode 100644 index 0000000000000..ef9693aee95d2 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryComponentVersions.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of RegistryComponentVersions. + */ +public interface RegistryComponentVersions { + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentVersion entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, String componentName); + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ComponentVersion entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, String componentName, + String orderBy, Integer top, String skip, Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String componentName, String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String componentName, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String registryName, String componentName, + String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param componentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + ComponentVersion get(String resourceGroupName, String registryName, String componentName, String version); + + /** + * Get version. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + ComponentVersion getById(String id); + + /** + * Get version. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete version. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete version. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ComponentVersion resource. + * + * @param name resource name. + * @return the first stage of the new ComponentVersion definition. + */ + ComponentVersion.DefinitionStages.Blank define(String name); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryDataContainers.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryDataContainers.java new file mode 100644 index 0000000000000..4fc0a12bc99cc --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryDataContainers.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of RegistryDataContainers. + */ +public interface RegistryDataContainers { + /** + * List Data containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataContainer entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * List Data containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataContainer entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, String skip, + ListViewType listViewType, Context context); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String name); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String name, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String registryName, String name, + Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container. + */ + DataContainer get(String resourceGroupName, String registryName, String name); + + /** + * Get container. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + DataContainer getById(String id); + + /** + * Get container. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete container. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete container. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new DataContainer resource. + * + * @param name resource name. + * @return the first stage of the new DataContainer definition. + */ + DataContainer.DefinitionStages.Blank define(String name); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryDataReferences.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryDataReferences.java new file mode 100644 index 0000000000000..61a2ed21e36ff --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryDataReferences.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of RegistryDataReferences. + */ +public interface RegistryDataReferences { + /** + * Get blob reference SAS Uri. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data reference name. + * @param version Version identifier. + * @param body Asset id and blob uri. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return blob reference SAS Uri along with {@link Response}. + */ + Response getBlobReferenceSasWithResponse(String resourceGroupName, + String registryName, String name, String version, GetBlobReferenceSasRequestDto body, Context context); + + /** + * Get blob reference SAS Uri. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data reference name. + * @param version Version identifier. + * @param body Asset id and blob uri. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return blob reference SAS Uri. + */ + GetBlobReferenceSasResponseDto getBlobReferenceSas(String resourceGroupName, String registryName, String name, + String version, GetBlobReferenceSasRequestDto body); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryDataVersions.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryDataVersions.java new file mode 100644 index 0000000000000..3ecc415d17048 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryDataVersions.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of RegistryDataVersions. + */ +public interface RegistryDataVersions { + /** + * List data versions in the data container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data container's name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataVersionBase entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, String name); + + /** + * List data versions in the data container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data container's name. + * @param orderBy Please choose OrderBy value from ['createdtime', 'modifiedtime']. + * @param top 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. + * @param skip Continuation token for pagination. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param listViewType [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for + * including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of DataVersionBase entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, String name, String orderBy, + Integer top, String skip, String tags, ListViewType listViewType, Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String name, String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String name, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String registryName, String name, + String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + DataVersionBase get(String resourceGroupName, String registryName, String name, String version); + + /** + * Generate a storage location and credential for the client to upload a data asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data asset name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + Response createOrGetStartPendingUploadWithResponse(String resourceGroupName, + String registryName, String name, String version, PendingUploadRequestDto body, Context context); + + /** + * Generate a storage location and credential for the client to upload a data asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param name Data asset name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + PendingUploadResponseDto createOrGetStartPendingUpload(String resourceGroupName, String registryName, String name, + String version, PendingUploadRequestDto body); + + /** + * Get version. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + DataVersionBase getById(String id); + + /** + * Get version. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete version. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete version. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new DataVersionBase resource. + * + * @param name resource name. + * @return the first stage of the new DataVersionBase definition. + */ + DataVersionBase.DefinitionStages.Blank define(String name); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryEnvironmentContainers.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryEnvironmentContainers.java new file mode 100644 index 0000000000000..d359edab1e091 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryEnvironmentContainers.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of RegistryEnvironmentContainers. + */ +public interface RegistryEnvironmentContainers { + /** + * List environment containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentContainer entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * List environment containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentContainer entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, String skip, + ListViewType listViewType, Context context); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String environmentName); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String environmentName, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String registryName, + String environmentName, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container. + */ + EnvironmentContainer get(String resourceGroupName, String registryName, String environmentName); + + /** + * Get container. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + EnvironmentContainer getById(String id); + + /** + * Get container. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete container. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete container. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new EnvironmentContainer resource. + * + * @param name resource name. + * @return the first stage of the new EnvironmentContainer definition. + */ + EnvironmentContainer.DefinitionStages.Blank define(String name); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryEnvironmentVersions.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryEnvironmentVersions.java new file mode 100644 index 0000000000000..0c6b0cb396f1e --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryEnvironmentVersions.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of RegistryEnvironmentVersions. + */ +public interface RegistryEnvironmentVersions { + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentVersion entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, String environmentName); + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of EnvironmentVersion entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, String environmentName, + String orderBy, Integer top, String skip, ListViewType listViewType, Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String environmentName, String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String environmentName, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String registryName, String environmentName, + String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param environmentName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + EnvironmentVersion get(String resourceGroupName, String registryName, String environmentName, String version); + + /** + * Get version. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + EnvironmentVersion getById(String id); + + /** + * Get version. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete version. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete version. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new EnvironmentVersion resource. + * + * @param name resource name. + * @return the first stage of the new EnvironmentVersion definition. + */ + EnvironmentVersion.DefinitionStages.Blank define(String name); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryListCredentialsResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryListCredentialsResult.java index ada32c54e2e15..838c746104ce5 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryListCredentialsResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryListCredentialsResult.java @@ -5,37 +5,42 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** The RegistryListCredentialsResult model. */ +/** + * The RegistryListCredentialsResult model. + */ @Fluent -public final class RegistryListCredentialsResult { +public final class RegistryListCredentialsResult implements JsonSerializable { /* * The location property. */ - @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) private String location; /* * The username property. */ - @JsonProperty(value = "username", access = JsonProperty.Access.WRITE_ONLY) private String username; /* * The passwords property. */ - @JsonProperty(value = "passwords") private List passwords; - /** Creates an instance of RegistryListCredentialsResult class. */ + /** + * Creates an instance of RegistryListCredentialsResult class. + */ public RegistryListCredentialsResult() { } /** * Get the location property: The location property. - * + * * @return the location value. */ public String location() { @@ -44,7 +49,7 @@ public String location() { /** * Get the username property: The username property. - * + * * @return the username value. */ public String username() { @@ -53,7 +58,7 @@ public String username() { /** * Get the passwords property: The passwords property. - * + * * @return the passwords value. */ public List passwords() { @@ -62,7 +67,7 @@ public List passwords() { /** * Set the passwords property: The passwords property. - * + * * @param passwords the passwords value to set. * @return the RegistryListCredentialsResult object itself. */ @@ -73,7 +78,7 @@ public RegistryListCredentialsResult withPasswords(List passwords) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -81,4 +86,46 @@ public void validate() { passwords().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("passwords", this.passwords, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RegistryListCredentialsResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RegistryListCredentialsResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RegistryListCredentialsResult. + */ + public static RegistryListCredentialsResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RegistryListCredentialsResult deserializedRegistryListCredentialsResult + = new RegistryListCredentialsResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("location".equals(fieldName)) { + deserializedRegistryListCredentialsResult.location = reader.getString(); + } else if ("username".equals(fieldName)) { + deserializedRegistryListCredentialsResult.username = reader.getString(); + } else if ("passwords".equals(fieldName)) { + List passwords = reader.readArray(reader1 -> Password.fromJson(reader1)); + deserializedRegistryListCredentialsResult.passwords = passwords; + } else { + reader.skipChildren(); + } + } + + return deserializedRegistryListCredentialsResult; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryModelContainers.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryModelContainers.java new file mode 100644 index 0000000000000..fde6d2b6bf31f --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryModelContainers.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of RegistryModelContainers. + */ +public interface RegistryModelContainers { + /** + * List model containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelContainer entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * List model containers. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param skip Continuation token for pagination. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelContainer entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, String skip, + ListViewType listViewType, Context context); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String modelName); + + /** + * Delete container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String modelName, Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String registryName, String modelName, + Context context); + + /** + * Get container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container. + */ + ModelContainer get(String resourceGroupName, String registryName, String modelName); + + /** + * Get container. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + ModelContainer getById(String id); + + /** + * Get container. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete container. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete container. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ModelContainer resource. + * + * @param name resource name. + * @return the first stage of the new ModelContainer definition. + */ + ModelContainer.DefinitionStages.Blank define(String name); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryModelVersions.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryModelVersions.java new file mode 100644 index 0000000000000..01fb7afcf26a2 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryModelVersions.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of RegistryModelVersions. + */ +public interface RegistryModelVersions { + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelVersion entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, String modelName); + + /** + * List versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param skip Continuation token for pagination. + * @param orderBy Ordering of list. + * @param top Maximum number of records to return. + * @param version Version identifier. + * @param description Model description. + * @param tags Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. + * @param properties Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2. + * @param listViewType View type for including/excluding (for example) archived entities. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ModelVersion entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, String modelName, String skip, + String orderBy, Integer top, String version, String description, String tags, String properties, + ListViewType listViewType, Context context); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String modelName, String version); + + /** + * Delete version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. + * @param version Version identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String modelName, String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String registryName, String modelName, + String version, Context context); + + /** + * Get version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Container name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version. + */ + ModelVersion get(String resourceGroupName, String registryName, String modelName, String version); + + /** + * Generate a storage location and credential for the client to upload a model asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Model name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + Response createOrGetStartPendingUploadWithResponse(String resourceGroupName, + String registryName, String modelName, String version, PendingUploadRequestDto body, Context context); + + /** + * Generate a storage location and credential for the client to upload a model asset to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName Name of Azure Machine Learning registry. This is case-insensitive. + * @param modelName Model name. This is case-sensitive. + * @param version Version identifier. This is case-sensitive. + * @param body Pending upload request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + PendingUploadResponseDto createOrGetStartPendingUpload(String resourceGroupName, String registryName, + String modelName, String version, PendingUploadRequestDto body); + + /** + * Get version. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + ModelVersion getById(String id); + + /** + * Get version. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return version along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete version. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete version. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ModelVersion resource. + * + * @param name resource name. + * @return the first stage of the new ModelVersion definition. + */ + ModelVersion.DefinitionStages.Blank define(String name); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryPartialManagedServiceIdentity.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryPartialManagedServiceIdentity.java new file mode 100644 index 0000000000000..758eeba7764ac --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryPartialManagedServiceIdentity.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; +import java.util.UUID; + +/** + * Managed service identity (system assigned and/or user assigned identities). + */ +@Fluent +public final class RegistryPartialManagedServiceIdentity extends ManagedServiceIdentity { + /* + * The service principal ID of the system assigned identity. This property will only be provided for a system + * assigned identity. + */ + private UUID principalId; + + /* + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned + * identity. + */ + private UUID tenantId; + + /** + * Creates an instance of RegistryPartialManagedServiceIdentity class. + */ + public RegistryPartialManagedServiceIdentity() { + } + + /** + * Get the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + @Override + public UUID principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @return the tenantId value. + */ + @Override + public UUID tenantId() { + return this.tenantId; + } + + /** + * {@inheritDoc} + */ + @Override + public RegistryPartialManagedServiceIdentity withType(ManagedServiceIdentityType type) { + super.withType(type); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RegistryPartialManagedServiceIdentity + withUserAssignedIdentities(Map userAssignedIdentities) { + super.withUserAssignedIdentities(userAssignedIdentities); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", type() == null ? null : type().toString()); + jsonWriter.writeMapField("userAssignedIdentities", userAssignedIdentities(), + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RegistryPartialManagedServiceIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RegistryPartialManagedServiceIdentity if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RegistryPartialManagedServiceIdentity. + */ + public static RegistryPartialManagedServiceIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RegistryPartialManagedServiceIdentity deserializedRegistryPartialManagedServiceIdentity + = new RegistryPartialManagedServiceIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedRegistryPartialManagedServiceIdentity + .withType(ManagedServiceIdentityType.fromString(reader.getString())); + } else if ("principalId".equals(fieldName)) { + deserializedRegistryPartialManagedServiceIdentity.principalId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("tenantId".equals(fieldName)) { + deserializedRegistryPartialManagedServiceIdentity.tenantId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); + deserializedRegistryPartialManagedServiceIdentity + .withUserAssignedIdentities(userAssignedIdentities); + } else { + reader.skipChildren(); + } + } + + return deserializedRegistryPartialManagedServiceIdentity; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryPrivateEndpointConnection.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryPrivateEndpointConnection.java new file mode 100644 index 0000000000000..40c7480f96454 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryPrivateEndpointConnection.java @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.machinelearning.fluent.models.RegistryPrivateEndpointConnectionProperties; +import java.io.IOException; +import java.util.List; + +/** + * Private endpoint connection definition. + */ +@Fluent +public final class RegistryPrivateEndpointConnection implements JsonSerializable { + /* + * This is the private endpoint connection name created on SRP + * Full resource id: + * /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{ + * resourceName}/registryPrivateEndpointConnections/{peConnectionName} + */ + private String id; + + /* + * Same as workspace location. + */ + private String location; + + /* + * Properties of the Private Endpoint Connection + */ + private RegistryPrivateEndpointConnectionProperties innerProperties; + + /** + * Creates an instance of RegistryPrivateEndpointConnection class. + */ + public RegistryPrivateEndpointConnection() { + } + + /** + * Get the id property: This is the private endpoint connection name created on SRP + * Full resource id: + * /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/registryPrivateEndpointConnections/{peConnectionName}. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: This is the private endpoint connection name created on SRP + * Full resource id: + * /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/registryPrivateEndpointConnections/{peConnectionName}. + * + * @param id the id value to set. + * @return the RegistryPrivateEndpointConnection object itself. + */ + public RegistryPrivateEndpointConnection withId(String id) { + this.id = id; + return this; + } + + /** + * Get the location property: Same as workspace location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Same as workspace location. + * + * @param location the location value to set. + * @return the RegistryPrivateEndpointConnection object itself. + */ + public RegistryPrivateEndpointConnection withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the innerProperties property: Properties of the Private Endpoint Connection. + * + * @return the innerProperties value. + */ + private RegistryPrivateEndpointConnectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the groupIds property: The group ids. + * + * @return the groupIds value. + */ + public List groupIds() { + return this.innerProperties() == null ? null : this.innerProperties().groupIds(); + } + + /** + * Set the groupIds property: The group ids. + * + * @param groupIds the groupIds value to set. + * @return the RegistryPrivateEndpointConnection object itself. + */ + public RegistryPrivateEndpointConnection withGroupIds(List groupIds) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryPrivateEndpointConnectionProperties(); + } + this.innerProperties().withGroupIds(groupIds); + return this; + } + + /** + * Get the privateEndpoint property: The PE network resource that is linked to this PE connection. + * + * @return the privateEndpoint value. + */ + public PrivateEndpointResource privateEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpoint(); + } + + /** + * Set the privateEndpoint property: The PE network resource that is linked to this PE connection. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the RegistryPrivateEndpointConnection object itself. + */ + public RegistryPrivateEndpointConnection withPrivateEndpoint(PrivateEndpointResource privateEndpoint) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryPrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateEndpoint(privateEndpoint); + return this; + } + + /** + * Get the registryPrivateLinkServiceConnectionState property: The connection state. + * + * @return the registryPrivateLinkServiceConnectionState value. + */ + public RegistryPrivateLinkServiceConnectionState registryPrivateLinkServiceConnectionState() { + return this.innerProperties() == null + ? null + : this.innerProperties().registryPrivateLinkServiceConnectionState(); + } + + /** + * Set the registryPrivateLinkServiceConnectionState property: The connection state. + * + * @param registryPrivateLinkServiceConnectionState the registryPrivateLinkServiceConnectionState value to set. + * @return the RegistryPrivateEndpointConnection object itself. + */ + public RegistryPrivateEndpointConnection withRegistryPrivateLinkServiceConnectionState( + RegistryPrivateLinkServiceConnectionState registryPrivateLinkServiceConnectionState) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryPrivateEndpointConnectionProperties(); + } + this.innerProperties().withRegistryPrivateLinkServiceConnectionState(registryPrivateLinkServiceConnectionState); + return this; + } + + /** + * Get the provisioningState property: One of null, "Succeeded", "Provisioning", "Failed". While not approved, it's + * null. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Set the provisioningState property: One of null, "Succeeded", "Provisioning", "Failed". While not approved, it's + * null. + * + * @param provisioningState the provisioningState value to set. + * @return the RegistryPrivateEndpointConnection object itself. + */ + public RegistryPrivateEndpointConnection withProvisioningState(String provisioningState) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryPrivateEndpointConnectionProperties(); + } + this.innerProperties().withProvisioningState(provisioningState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RegistryPrivateEndpointConnection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RegistryPrivateEndpointConnection if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RegistryPrivateEndpointConnection. + */ + public static RegistryPrivateEndpointConnection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RegistryPrivateEndpointConnection deserializedRegistryPrivateEndpointConnection + = new RegistryPrivateEndpointConnection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRegistryPrivateEndpointConnection.id = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedRegistryPrivateEndpointConnection.location = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedRegistryPrivateEndpointConnection.innerProperties + = RegistryPrivateEndpointConnectionProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRegistryPrivateEndpointConnection; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryPrivateLinkServiceConnectionState.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryPrivateLinkServiceConnectionState.java new file mode 100644 index 0000000000000..e1a5718b593d2 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryPrivateLinkServiceConnectionState.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The connection state. + */ +@Fluent +public final class RegistryPrivateLinkServiceConnectionState + implements JsonSerializable { + /* + * Some RP chose "None". Other RPs use this for region expansion. + */ + private String actionsRequired; + + /* + * User-defined message that, per NRP doc, may be used for approval-related message. + */ + private String description; + + /* + * Connection status of the service consumer with the service provider + */ + private EndpointServiceConnectionStatus status; + + /** + * Creates an instance of RegistryPrivateLinkServiceConnectionState class. + */ + public RegistryPrivateLinkServiceConnectionState() { + } + + /** + * Get the actionsRequired property: Some RP chose "None". Other RPs use this for region expansion. + * + * @return the actionsRequired value. + */ + public String actionsRequired() { + return this.actionsRequired; + } + + /** + * Set the actionsRequired property: Some RP chose "None". Other RPs use this for region expansion. + * + * @param actionsRequired the actionsRequired value to set. + * @return the RegistryPrivateLinkServiceConnectionState object itself. + */ + public RegistryPrivateLinkServiceConnectionState withActionsRequired(String actionsRequired) { + this.actionsRequired = actionsRequired; + return this; + } + + /** + * Get the description property: User-defined message that, per NRP doc, may be used for approval-related message. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: User-defined message that, per NRP doc, may be used for approval-related message. + * + * @param description the description value to set. + * @return the RegistryPrivateLinkServiceConnectionState object itself. + */ + public RegistryPrivateLinkServiceConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the status property: Connection status of the service consumer with the service provider. + * + * @return the status value. + */ + public EndpointServiceConnectionStatus status() { + return this.status; + } + + /** + * Set the status property: Connection status of the service consumer with the service provider. + * + * @param status the status value to set. + * @return the RegistryPrivateLinkServiceConnectionState object itself. + */ + public RegistryPrivateLinkServiceConnectionState withStatus(EndpointServiceConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("actionsRequired", this.actionsRequired); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RegistryPrivateLinkServiceConnectionState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RegistryPrivateLinkServiceConnectionState if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RegistryPrivateLinkServiceConnectionState. + */ + public static RegistryPrivateLinkServiceConnectionState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RegistryPrivateLinkServiceConnectionState deserializedRegistryPrivateLinkServiceConnectionState + = new RegistryPrivateLinkServiceConnectionState(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("actionsRequired".equals(fieldName)) { + deserializedRegistryPrivateLinkServiceConnectionState.actionsRequired = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedRegistryPrivateLinkServiceConnectionState.description = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedRegistryPrivateLinkServiceConnectionState.status + = EndpointServiceConnectionStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRegistryPrivateLinkServiceConnectionState; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryRegionArmDetails.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryRegionArmDetails.java new file mode 100644 index 0000000000000..2d6c2590a760e --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryRegionArmDetails.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Details for each region the registry is in. + */ +@Fluent +public final class RegistryRegionArmDetails implements JsonSerializable { + /* + * List of ACR accounts + */ + private List acrDetails; + + /* + * The location where the registry exists + */ + private String location; + + /* + * List of storage accounts + */ + private List storageAccountDetails; + + /** + * Creates an instance of RegistryRegionArmDetails class. + */ + public RegistryRegionArmDetails() { + } + + /** + * Get the acrDetails property: List of ACR accounts. + * + * @return the acrDetails value. + */ + public List acrDetails() { + return this.acrDetails; + } + + /** + * Set the acrDetails property: List of ACR accounts. + * + * @param acrDetails the acrDetails value to set. + * @return the RegistryRegionArmDetails object itself. + */ + public RegistryRegionArmDetails withAcrDetails(List acrDetails) { + this.acrDetails = acrDetails; + return this; + } + + /** + * Get the location property: The location where the registry exists. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The location where the registry exists. + * + * @param location the location value to set. + * @return the RegistryRegionArmDetails object itself. + */ + public RegistryRegionArmDetails withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the storageAccountDetails property: List of storage accounts. + * + * @return the storageAccountDetails value. + */ + public List storageAccountDetails() { + return this.storageAccountDetails; + } + + /** + * Set the storageAccountDetails property: List of storage accounts. + * + * @param storageAccountDetails the storageAccountDetails value to set. + * @return the RegistryRegionArmDetails object itself. + */ + public RegistryRegionArmDetails withStorageAccountDetails(List storageAccountDetails) { + this.storageAccountDetails = storageAccountDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (acrDetails() != null) { + acrDetails().forEach(e -> e.validate()); + } + if (storageAccountDetails() != null) { + storageAccountDetails().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("acrDetails", this.acrDetails, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeArrayField("storageAccountDetails", this.storageAccountDetails, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RegistryRegionArmDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RegistryRegionArmDetails if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RegistryRegionArmDetails. + */ + public static RegistryRegionArmDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RegistryRegionArmDetails deserializedRegistryRegionArmDetails = new RegistryRegionArmDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("acrDetails".equals(fieldName)) { + List acrDetails = reader.readArray(reader1 -> AcrDetails.fromJson(reader1)); + deserializedRegistryRegionArmDetails.acrDetails = acrDetails; + } else if ("location".equals(fieldName)) { + deserializedRegistryRegionArmDetails.location = reader.getString(); + } else if ("storageAccountDetails".equals(fieldName)) { + List storageAccountDetails + = reader.readArray(reader1 -> StorageAccountDetails.fromJson(reader1)); + deserializedRegistryRegionArmDetails.storageAccountDetails = storageAccountDetails; + } else { + reader.skipChildren(); + } + } + + return deserializedRegistryRegionArmDetails; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryTrackedResourceArmPaginatedResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryTrackedResourceArmPaginatedResult.java new file mode 100644 index 0000000000000..f4ac0bd7dc69a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegistryTrackedResourceArmPaginatedResult.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.machinelearning.fluent.models.RegistryInner; +import java.io.IOException; +import java.util.List; + +/** + * A paginated list of Registry entities. + */ +@Fluent +public final class RegistryTrackedResourceArmPaginatedResult + implements JsonSerializable { + /* + * The link to the next page of Registry objects. If null, there are no additional pages. + */ + private String nextLink; + + /* + * An array of objects of type Registry. + */ + private List value; + + /** + * Creates an instance of RegistryTrackedResourceArmPaginatedResult class. + */ + public RegistryTrackedResourceArmPaginatedResult() { + } + + /** + * Get the nextLink property: The link to the next page of Registry objects. If null, there are no additional pages. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of Registry objects. If null, there are no additional pages. + * + * @param nextLink the nextLink value to set. + * @return the RegistryTrackedResourceArmPaginatedResult object itself. + */ + public RegistryTrackedResourceArmPaginatedResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: An array of objects of type Registry. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of objects of type Registry. + * + * @param value the value value to set. + * @return the RegistryTrackedResourceArmPaginatedResult object itself. + */ + public RegistryTrackedResourceArmPaginatedResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RegistryTrackedResourceArmPaginatedResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RegistryTrackedResourceArmPaginatedResult if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RegistryTrackedResourceArmPaginatedResult. + */ + public static RegistryTrackedResourceArmPaginatedResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RegistryTrackedResourceArmPaginatedResult deserializedRegistryTrackedResourceArmPaginatedResult + = new RegistryTrackedResourceArmPaginatedResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedRegistryTrackedResourceArmPaginatedResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> RegistryInner.fromJson(reader1)); + deserializedRegistryTrackedResourceArmPaginatedResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedRegistryTrackedResourceArmPaginatedResult; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Regression.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Regression.java index 40ed6fd905bf6..6c7b3f6b104c5 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Regression.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Regression.java @@ -5,57 +5,56 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** Regression task in AutoML Table vertical. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") -@JsonTypeName("Regression") +/** + * Regression task in AutoML Table vertical. + */ @Fluent public final class Regression extends AutoMLVertical { + /* + * [Required] Task type for AutoMLJob. + */ + private TaskType taskType = TaskType.REGRESSION; + /* * Primary metric for regression task. */ - @JsonProperty(value = "primaryMetric") private RegressionPrimaryMetrics primaryMetric; /* * Inputs for training phase for an AutoML Job. */ - @JsonProperty(value = "trainingSettings") private RegressionTrainingSettings trainingSettings; /* * Columns to use for CVSplit data. */ - @JsonProperty(value = "cvSplitColumnNames") private List cvSplitColumnNames; /* * Featurization inputs needed for AutoML job. */ - @JsonProperty(value = "featurizationSettings") private TableVerticalFeaturizationSettings featurizationSettings; /* * Execution constraints for AutoMLJob. */ - @JsonProperty(value = "limitSettings") private TableVerticalLimitSettings limitSettings; /* * Number of cross validation folds to be applied on training dataset * when validation dataset is not provided. */ - @JsonProperty(value = "nCrossValidations") private NCrossValidations nCrossValidations; /* * Test data input. */ - @JsonProperty(value = "testData") private MLTableJobInput testData; /* @@ -63,13 +62,11 @@ public final class Regression extends AutoMLVertical { * Values between (0.0 , 1.0) * Applied when validation dataset is not provided. */ - @JsonProperty(value = "testDataSize") private Double testDataSize; /* * Validation data inputs. */ - @JsonProperty(value = "validationData") private MLTableJobInput validationData; /* @@ -77,23 +74,33 @@ public final class Regression extends AutoMLVertical { * Values between (0.0 , 1.0) * Applied when validation dataset is not provided. */ - @JsonProperty(value = "validationDataSize") private Double validationDataSize; /* * 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. */ - @JsonProperty(value = "weightColumnName") private String weightColumnName; - /** Creates an instance of Regression class. */ + /** + * Creates an instance of Regression class. + */ public Regression() { } + /** + * Get the taskType property: [Required] Task type for AutoMLJob. + * + * @return the taskType value. + */ + @Override + public TaskType taskType() { + return this.taskType; + } + /** * Get the primaryMetric property: Primary metric for regression task. - * + * * @return the primaryMetric value. */ public RegressionPrimaryMetrics primaryMetric() { @@ -102,7 +109,7 @@ public RegressionPrimaryMetrics primaryMetric() { /** * Set the primaryMetric property: Primary metric for regression task. - * + * * @param primaryMetric the primaryMetric value to set. * @return the Regression object itself. */ @@ -113,7 +120,7 @@ public Regression withPrimaryMetric(RegressionPrimaryMetrics primaryMetric) { /** * Get the trainingSettings property: Inputs for training phase for an AutoML Job. - * + * * @return the trainingSettings value. */ public RegressionTrainingSettings trainingSettings() { @@ -122,7 +129,7 @@ public RegressionTrainingSettings trainingSettings() { /** * Set the trainingSettings property: Inputs for training phase for an AutoML Job. - * + * * @param trainingSettings the trainingSettings value to set. * @return the Regression object itself. */ @@ -133,7 +140,7 @@ public Regression withTrainingSettings(RegressionTrainingSettings trainingSettin /** * Get the cvSplitColumnNames property: Columns to use for CVSplit data. - * + * * @return the cvSplitColumnNames value. */ public List cvSplitColumnNames() { @@ -142,7 +149,7 @@ public List cvSplitColumnNames() { /** * Set the cvSplitColumnNames property: Columns to use for CVSplit data. - * + * * @param cvSplitColumnNames the cvSplitColumnNames value to set. * @return the Regression object itself. */ @@ -153,7 +160,7 @@ public Regression withCvSplitColumnNames(List cvSplitColumnNames) { /** * Get the featurizationSettings property: Featurization inputs needed for AutoML job. - * + * * @return the featurizationSettings value. */ public TableVerticalFeaturizationSettings featurizationSettings() { @@ -162,7 +169,7 @@ public TableVerticalFeaturizationSettings featurizationSettings() { /** * Set the featurizationSettings property: Featurization inputs needed for AutoML job. - * + * * @param featurizationSettings the featurizationSettings value to set. * @return the Regression object itself. */ @@ -173,7 +180,7 @@ public Regression withFeaturizationSettings(TableVerticalFeaturizationSettings f /** * Get the limitSettings property: Execution constraints for AutoMLJob. - * + * * @return the limitSettings value. */ public TableVerticalLimitSettings limitSettings() { @@ -182,7 +189,7 @@ public TableVerticalLimitSettings limitSettings() { /** * Set the limitSettings property: Execution constraints for AutoMLJob. - * + * * @param limitSettings the limitSettings value to set. * @return the Regression object itself. */ @@ -192,9 +199,9 @@ public Regression withLimitSettings(TableVerticalLimitSettings limitSettings) { } /** - * Get the nCrossValidations property: Number of cross validation folds to be applied on training dataset when - * validation dataset is not provided. - * + * Get the nCrossValidations property: Number of cross validation folds to be applied on training dataset + * when validation dataset is not provided. + * * @return the nCrossValidations value. */ public NCrossValidations nCrossValidations() { @@ -202,9 +209,9 @@ public NCrossValidations nCrossValidations() { } /** - * Set the nCrossValidations property: Number of cross validation folds to be applied on training dataset when - * validation dataset is not provided. - * + * Set the nCrossValidations property: Number of cross validation folds to be applied on training dataset + * when validation dataset is not provided. + * * @param nCrossValidations the nCrossValidations value to set. * @return the Regression object itself. */ @@ -215,7 +222,7 @@ public Regression withNCrossValidations(NCrossValidations nCrossValidations) { /** * Get the testData property: Test data input. - * + * * @return the testData value. */ public MLTableJobInput testData() { @@ -224,7 +231,7 @@ public MLTableJobInput testData() { /** * Set the testData property: Test data input. - * + * * @param testData the testData value to set. * @return the Regression object itself. */ @@ -235,8 +242,9 @@ public Regression withTestData(MLTableJobInput testData) { /** * Get the testDataSize property: 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. - * + * Values between (0.0 , 1.0) + * Applied when validation dataset is not provided. + * * @return the testDataSize value. */ public Double testDataSize() { @@ -245,8 +253,9 @@ public Double testDataSize() { /** * Set the testDataSize property: 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. - * + * Values between (0.0 , 1.0) + * Applied when validation dataset is not provided. + * * @param testDataSize the testDataSize value to set. * @return the Regression object itself. */ @@ -257,7 +266,7 @@ public Regression withTestDataSize(Double testDataSize) { /** * Get the validationData property: Validation data inputs. - * + * * @return the validationData value. */ public MLTableJobInput validationData() { @@ -266,7 +275,7 @@ public MLTableJobInput validationData() { /** * Set the validationData property: Validation data inputs. - * + * * @param validationData the validationData value to set. * @return the Regression object itself. */ @@ -277,8 +286,10 @@ public Regression withValidationData(MLTableJobInput validationData) { /** * Get the validationDataSize property: 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. - * + * purpose. + * Values between (0.0 , 1.0) + * Applied when validation dataset is not provided. + * * @return the validationDataSize value. */ public Double validationDataSize() { @@ -287,8 +298,10 @@ public Double validationDataSize() { /** * Set the validationDataSize property: 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. - * + * purpose. + * Values between (0.0 , 1.0) + * Applied when validation dataset is not provided. + * * @param validationDataSize the validationDataSize value to set. * @return the Regression object itself. */ @@ -300,7 +313,7 @@ public Regression withValidationDataSize(Double validationDataSize) { /** * Get the weightColumnName property: 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. - * + * * @return the weightColumnName value. */ public String weightColumnName() { @@ -310,7 +323,7 @@ public String weightColumnName() { /** * Set the weightColumnName property: 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. - * + * * @param weightColumnName the weightColumnName value to set. * @return the Regression object itself. */ @@ -319,21 +332,27 @@ public Regression withWeightColumnName(String weightColumnName) { return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public Regression withLogVerbosity(LogVerbosity logVerbosity) { super.withLogVerbosity(logVerbosity); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public Regression withTargetColumnName(String targetColumnName) { super.withTargetColumnName(targetColumnName); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public Regression withTrainingData(MLTableJobInput trainingData) { super.withTrainingData(trainingData); @@ -342,7 +361,7 @@ public Regression withTrainingData(MLTableJobInput trainingData) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -367,4 +386,85 @@ public void validate() { validationData().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("trainingData", trainingData()); + jsonWriter.writeStringField("logVerbosity", logVerbosity() == null ? null : logVerbosity().toString()); + jsonWriter.writeStringField("targetColumnName", targetColumnName()); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); + jsonWriter.writeStringField("primaryMetric", this.primaryMetric == null ? null : this.primaryMetric.toString()); + jsonWriter.writeJsonField("trainingSettings", this.trainingSettings); + jsonWriter.writeArrayField("cvSplitColumnNames", this.cvSplitColumnNames, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("featurizationSettings", this.featurizationSettings); + jsonWriter.writeJsonField("limitSettings", this.limitSettings); + jsonWriter.writeJsonField("nCrossValidations", this.nCrossValidations); + jsonWriter.writeJsonField("testData", this.testData); + jsonWriter.writeNumberField("testDataSize", this.testDataSize); + jsonWriter.writeJsonField("validationData", this.validationData); + jsonWriter.writeNumberField("validationDataSize", this.validationDataSize); + jsonWriter.writeStringField("weightColumnName", this.weightColumnName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Regression from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Regression if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Regression. + */ + public static Regression fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Regression deserializedRegression = new Regression(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("trainingData".equals(fieldName)) { + deserializedRegression.withTrainingData(MLTableJobInput.fromJson(reader)); + } else if ("logVerbosity".equals(fieldName)) { + deserializedRegression.withLogVerbosity(LogVerbosity.fromString(reader.getString())); + } else if ("targetColumnName".equals(fieldName)) { + deserializedRegression.withTargetColumnName(reader.getString()); + } else if ("taskType".equals(fieldName)) { + deserializedRegression.taskType = TaskType.fromString(reader.getString()); + } else if ("primaryMetric".equals(fieldName)) { + deserializedRegression.primaryMetric = RegressionPrimaryMetrics.fromString(reader.getString()); + } else if ("trainingSettings".equals(fieldName)) { + deserializedRegression.trainingSettings = RegressionTrainingSettings.fromJson(reader); + } else if ("cvSplitColumnNames".equals(fieldName)) { + List cvSplitColumnNames = reader.readArray(reader1 -> reader1.getString()); + deserializedRegression.cvSplitColumnNames = cvSplitColumnNames; + } else if ("featurizationSettings".equals(fieldName)) { + deserializedRegression.featurizationSettings = TableVerticalFeaturizationSettings.fromJson(reader); + } else if ("limitSettings".equals(fieldName)) { + deserializedRegression.limitSettings = TableVerticalLimitSettings.fromJson(reader); + } else if ("nCrossValidations".equals(fieldName)) { + deserializedRegression.nCrossValidations = NCrossValidations.fromJson(reader); + } else if ("testData".equals(fieldName)) { + deserializedRegression.testData = MLTableJobInput.fromJson(reader); + } else if ("testDataSize".equals(fieldName)) { + deserializedRegression.testDataSize = reader.getNullable(JsonReader::getDouble); + } else if ("validationData".equals(fieldName)) { + deserializedRegression.validationData = MLTableJobInput.fromJson(reader); + } else if ("validationDataSize".equals(fieldName)) { + deserializedRegression.validationDataSize = reader.getNullable(JsonReader::getDouble); + } else if ("weightColumnName".equals(fieldName)) { + deserializedRegression.weightColumnName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRegression; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegressionModels.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegressionModels.java index 2325aadc2dd9a..b57e1bd35f2f7 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegressionModels.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegressionModels.java @@ -5,44 +5,65 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Enum for all Regression models supported by AutoML. */ +/** + * Enum for all Regression models supported by AutoML. + */ public final class RegressionModels extends ExpandableStringEnum { - /** Static value ElasticNet for RegressionModels. */ + /** + * Static value ElasticNet for RegressionModels. + */ public static final RegressionModels ELASTIC_NET = fromString("ElasticNet"); - /** Static value GradientBoosting for RegressionModels. */ + /** + * Static value GradientBoosting for RegressionModels. + */ public static final RegressionModels GRADIENT_BOOSTING = fromString("GradientBoosting"); - /** Static value DecisionTree for RegressionModels. */ + /** + * Static value DecisionTree for RegressionModels. + */ public static final RegressionModels DECISION_TREE = fromString("DecisionTree"); - /** Static value KNN for RegressionModels. */ + /** + * Static value KNN for RegressionModels. + */ public static final RegressionModels KNN = fromString("KNN"); - /** Static value LassoLars for RegressionModels. */ + /** + * Static value LassoLars for RegressionModels. + */ public static final RegressionModels LASSO_LARS = fromString("LassoLars"); - /** Static value SGD for RegressionModels. */ + /** + * Static value SGD for RegressionModels. + */ public static final RegressionModels SGD = fromString("SGD"); - /** Static value RandomForest for RegressionModels. */ + /** + * Static value RandomForest for RegressionModels. + */ public static final RegressionModels RANDOM_FOREST = fromString("RandomForest"); - /** Static value ExtremeRandomTrees for RegressionModels. */ + /** + * Static value ExtremeRandomTrees for RegressionModels. + */ public static final RegressionModels EXTREME_RANDOM_TREES = fromString("ExtremeRandomTrees"); - /** Static value LightGBM for RegressionModels. */ + /** + * Static value LightGBM for RegressionModels. + */ public static final RegressionModels LIGHT_GBM = fromString("LightGBM"); - /** Static value XGBoostRegressor for RegressionModels. */ + /** + * Static value XGBoostRegressor for RegressionModels. + */ public static final RegressionModels XGBOOST_REGRESSOR = fromString("XGBoostRegressor"); /** * Creates a new instance of RegressionModels value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -51,18 +72,17 @@ public RegressionModels() { /** * Creates or finds a RegressionModels from its string representation. - * + * * @param name a name to look for. * @return the corresponding RegressionModels. */ - @JsonCreator public static RegressionModels fromString(String name) { return fromString(name, RegressionModels.class); } /** * Gets known RegressionModels values. - * + * * @return known RegressionModels values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegressionPrimaryMetrics.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegressionPrimaryMetrics.java index 36dd7417b9d5f..012b72021bdd0 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegressionPrimaryMetrics.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegressionPrimaryMetrics.java @@ -5,28 +5,37 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Primary metrics for Regression task. */ +/** + * Primary metrics for Regression task. + */ public final class RegressionPrimaryMetrics extends ExpandableStringEnum { - /** Static value SpearmanCorrelation for RegressionPrimaryMetrics. */ + /** + * Static value SpearmanCorrelation for RegressionPrimaryMetrics. + */ public static final RegressionPrimaryMetrics SPEARMAN_CORRELATION = fromString("SpearmanCorrelation"); - /** Static value NormalizedRootMeanSquaredError for RegressionPrimaryMetrics. */ - public static final RegressionPrimaryMetrics NORMALIZED_ROOT_MEAN_SQUARED_ERROR = - fromString("NormalizedRootMeanSquaredError"); + /** + * Static value NormalizedRootMeanSquaredError for RegressionPrimaryMetrics. + */ + public static final RegressionPrimaryMetrics NORMALIZED_ROOT_MEAN_SQUARED_ERROR + = fromString("NormalizedRootMeanSquaredError"); - /** Static value R2Score for RegressionPrimaryMetrics. */ + /** + * Static value R2Score for RegressionPrimaryMetrics. + */ public static final RegressionPrimaryMetrics R2SCORE = fromString("R2Score"); - /** Static value NormalizedMeanAbsoluteError for RegressionPrimaryMetrics. */ - public static final RegressionPrimaryMetrics NORMALIZED_MEAN_ABSOLUTE_ERROR = - fromString("NormalizedMeanAbsoluteError"); + /** + * Static value NormalizedMeanAbsoluteError for RegressionPrimaryMetrics. + */ + public static final RegressionPrimaryMetrics NORMALIZED_MEAN_ABSOLUTE_ERROR + = fromString("NormalizedMeanAbsoluteError"); /** * Creates a new instance of RegressionPrimaryMetrics value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -35,18 +44,17 @@ public RegressionPrimaryMetrics() { /** * Creates or finds a RegressionPrimaryMetrics from its string representation. - * + * * @param name a name to look for. * @return the corresponding RegressionPrimaryMetrics. */ - @JsonCreator public static RegressionPrimaryMetrics fromString(String name) { return fromString(name, RegressionPrimaryMetrics.class); } /** * Gets known RegressionPrimaryMetrics values. - * + * * @return known RegressionPrimaryMetrics values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegressionTrainingSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegressionTrainingSettings.java index 289a03ff56409..f699a7b614b74 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegressionTrainingSettings.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RegressionTrainingSettings.java @@ -5,32 +5,38 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.Duration; import java.util.List; -/** Regression Training related configuration. */ +/** + * Regression Training related configuration. + */ @Fluent public final class RegressionTrainingSettings extends TrainingSettings { /* * Allowed models for regression task. */ - @JsonProperty(value = "allowedTrainingAlgorithms") private List allowedTrainingAlgorithms; /* * Blocked models for regression task. */ - @JsonProperty(value = "blockedTrainingAlgorithms") private List blockedTrainingAlgorithms; - /** Creates an instance of RegressionTrainingSettings class. */ + /** + * Creates an instance of RegressionTrainingSettings class. + */ public RegressionTrainingSettings() { } /** * Get the allowedTrainingAlgorithms property: Allowed models for regression task. - * + * * @return the allowedTrainingAlgorithms value. */ public List allowedTrainingAlgorithms() { @@ -39,7 +45,7 @@ public List allowedTrainingAlgorithms() { /** * Set the allowedTrainingAlgorithms property: Allowed models for regression task. - * + * * @param allowedTrainingAlgorithms the allowedTrainingAlgorithms value to set. * @return the RegressionTrainingSettings object itself. */ @@ -50,7 +56,7 @@ public RegressionTrainingSettings withAllowedTrainingAlgorithms(List blockedTrainingAlgorithms() { @@ -59,7 +65,7 @@ public List blockedTrainingAlgorithms() { /** * Set the blockedTrainingAlgorithms property: Blocked models for regression task. - * + * * @param blockedTrainingAlgorithms the blockedTrainingAlgorithms value to set. * @return the RegressionTrainingSettings object itself. */ @@ -68,49 +74,63 @@ public RegressionTrainingSettings withBlockedTrainingAlgorithms(List writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("blockedTrainingAlgorithms", this.blockedTrainingAlgorithms, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RegressionTrainingSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RegressionTrainingSettings if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RegressionTrainingSettings. + */ + public static RegressionTrainingSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RegressionTrainingSettings deserializedRegressionTrainingSettings = new RegressionTrainingSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enableDnnTraining".equals(fieldName)) { + deserializedRegressionTrainingSettings + .withEnableDnnTraining(reader.getNullable(JsonReader::getBoolean)); + } else if ("enableModelExplainability".equals(fieldName)) { + deserializedRegressionTrainingSettings + .withEnableModelExplainability(reader.getNullable(JsonReader::getBoolean)); + } else if ("enableOnnxCompatibleModels".equals(fieldName)) { + deserializedRegressionTrainingSettings + .withEnableOnnxCompatibleModels(reader.getNullable(JsonReader::getBoolean)); + } else if ("enableStackEnsemble".equals(fieldName)) { + deserializedRegressionTrainingSettings + .withEnableStackEnsemble(reader.getNullable(JsonReader::getBoolean)); + } else if ("enableVoteEnsemble".equals(fieldName)) { + deserializedRegressionTrainingSettings + .withEnableVoteEnsemble(reader.getNullable(JsonReader::getBoolean)); + } else if ("ensembleModelDownloadTimeout".equals(fieldName)) { + deserializedRegressionTrainingSettings.withEnsembleModelDownloadTimeout( + reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString()))); + } else if ("stackEnsembleSettings".equals(fieldName)) { + deserializedRegressionTrainingSettings + .withStackEnsembleSettings(StackEnsembleSettings.fromJson(reader)); + } else if ("allowedTrainingAlgorithms".equals(fieldName)) { + List allowedTrainingAlgorithms + = reader.readArray(reader1 -> RegressionModels.fromString(reader1.getString())); + deserializedRegressionTrainingSettings.allowedTrainingAlgorithms = allowedTrainingAlgorithms; + } else if ("blockedTrainingAlgorithms".equals(fieldName)) { + List blockedTrainingAlgorithms + = reader.readArray(reader1 -> RegressionModels.fromString(reader1.getString())); + deserializedRegressionTrainingSettings.blockedTrainingAlgorithms = blockedTrainingAlgorithms; + } else { + reader.skipChildren(); + } + } + + return deserializedRegressionTrainingSettings; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RemoteLoginPortPublicAccess.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RemoteLoginPortPublicAccess.java index 2c097b672cdea..8553656691b21 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RemoteLoginPortPublicAccess.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RemoteLoginPortPublicAccess.java @@ -5,31 +5,36 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** * Close remote Login Access Port - * - *

State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on all + * + * State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on all * nodes of the cluster. Enabled - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified * - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, else is open all * public nodes. It can be default only during cluster creation time, after creation it will be either enabled or * disabled. */ public final class RemoteLoginPortPublicAccess extends ExpandableStringEnum { - /** Static value Enabled for RemoteLoginPortPublicAccess. */ + /** + * Static value Enabled for RemoteLoginPortPublicAccess. + */ public static final RemoteLoginPortPublicAccess ENABLED = fromString("Enabled"); - /** Static value Disabled for RemoteLoginPortPublicAccess. */ + /** + * Static value Disabled for RemoteLoginPortPublicAccess. + */ public static final RemoteLoginPortPublicAccess DISABLED = fromString("Disabled"); - /** Static value NotSpecified for RemoteLoginPortPublicAccess. */ + /** + * Static value NotSpecified for RemoteLoginPortPublicAccess. + */ public static final RemoteLoginPortPublicAccess NOT_SPECIFIED = fromString("NotSpecified"); /** * Creates a new instance of RemoteLoginPortPublicAccess value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -38,18 +43,17 @@ public RemoteLoginPortPublicAccess() { /** * Creates or finds a RemoteLoginPortPublicAccess from its string representation. - * + * * @param name a name to look for. * @return the corresponding RemoteLoginPortPublicAccess. */ - @JsonCreator public static RemoteLoginPortPublicAccess fromString(String name) { return fromString(name, RemoteLoginPortPublicAccess.class); } /** * Gets known RemoteLoginPortPublicAccess values. - * + * * @return known RemoteLoginPortPublicAccess values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RequestLogging.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RequestLogging.java new file mode 100644 index 0000000000000..ee29411190b8c --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RequestLogging.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The RequestLogging model. + */ +@Fluent +public final class RequestLogging implements JsonSerializable { + /* + * 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. + */ + private List captureHeaders; + + /** + * Creates an instance of RequestLogging class. + */ + public RequestLogging() { + } + + /** + * Get the captureHeaders property: 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. + * + * @return the captureHeaders value. + */ + public List captureHeaders() { + return this.captureHeaders; + } + + /** + * Set the captureHeaders property: 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. + * + * @param captureHeaders the captureHeaders value to set. + * @return the RequestLogging object itself. + */ + public RequestLogging withCaptureHeaders(List captureHeaders) { + this.captureHeaders = captureHeaders; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("captureHeaders", this.captureHeaders, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RequestLogging from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RequestLogging if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RequestLogging. + */ + public static RequestLogging fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RequestLogging deserializedRequestLogging = new RequestLogging(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("captureHeaders".equals(fieldName)) { + List captureHeaders = reader.readArray(reader1 -> reader1.getString()); + deserializedRequestLogging.captureHeaders = captureHeaders; + } else { + reader.skipChildren(); + } + } + + return deserializedRequestLogging; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ResourceBase.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ResourceBase.java index 4d9b1502f311a..8a0db9c0149a0 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ResourceBase.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ResourceBase.java @@ -5,40 +5,42 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** The ResourceBase model. */ +/** + * The ResourceBase model. + */ @Fluent -public class ResourceBase { +public class ResourceBase implements JsonSerializable { /* * The asset description text. */ - @JsonProperty(value = "description") private String description; /* * The asset property dictionary. */ - @JsonProperty(value = "properties") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map properties; /* * Tag dictionary. Tags can be added, removed, and updated. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /** Creates an instance of ResourceBase class. */ + /** + * Creates an instance of ResourceBase class. + */ public ResourceBase() { } /** * Get the description property: The asset description text. - * + * * @return the description value. */ public String description() { @@ -47,7 +49,7 @@ public String description() { /** * Set the description property: The asset description text. - * + * * @param description the description value to set. * @return the ResourceBase object itself. */ @@ -58,7 +60,7 @@ public ResourceBase withDescription(String description) { /** * Get the properties property: The asset property dictionary. - * + * * @return the properties value. */ public Map properties() { @@ -67,7 +69,7 @@ public Map properties() { /** * Set the properties property: The asset property dictionary. - * + * * @param properties the properties value to set. * @return the ResourceBase object itself. */ @@ -78,7 +80,7 @@ public ResourceBase withProperties(Map properties) { /** * Get the tags property: Tag dictionary. Tags can be added, removed, and updated. - * + * * @return the tags value. */ public Map tags() { @@ -87,7 +89,7 @@ public Map tags() { /** * Set the tags property: Tag dictionary. Tags can be added, removed, and updated. - * + * * @param tags the tags value to set. * @return the ResourceBase object itself. */ @@ -98,9 +100,53 @@ public ResourceBase withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeMapField("properties", this.properties, (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceBase from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceBase if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceBase. + */ + public static ResourceBase fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceBase deserializedResourceBase = new ResourceBase(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedResourceBase.description = reader.getString(); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedResourceBase.properties = properties; + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedResourceBase.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedResourceBase; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ResourceConfiguration.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ResourceConfiguration.java index 01067c5f7380f..5cbf10d7ade1c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ResourceConfiguration.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ResourceConfiguration.java @@ -5,39 +5,42 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** The ResourceConfiguration model. */ +/** + * The ResourceConfiguration model. + */ @Fluent -public class ResourceConfiguration { +public class ResourceConfiguration implements JsonSerializable { /* * Optional number of instances or nodes used by the compute target. */ - @JsonProperty(value = "instanceCount") private Integer instanceCount; /* * Optional type of VM used as supported by the compute target. */ - @JsonProperty(value = "instanceType") private String instanceType; /* * Additional properties bag. */ - @JsonProperty(value = "properties") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map properties; - /** Creates an instance of ResourceConfiguration class. */ + /** + * Creates an instance of ResourceConfiguration class. + */ public ResourceConfiguration() { } /** * Get the instanceCount property: Optional number of instances or nodes used by the compute target. - * + * * @return the instanceCount value. */ public Integer instanceCount() { @@ -46,7 +49,7 @@ public Integer instanceCount() { /** * Set the instanceCount property: Optional number of instances or nodes used by the compute target. - * + * * @param instanceCount the instanceCount value to set. * @return the ResourceConfiguration object itself. */ @@ -57,7 +60,7 @@ public ResourceConfiguration withInstanceCount(Integer instanceCount) { /** * Get the instanceType property: Optional type of VM used as supported by the compute target. - * + * * @return the instanceType value. */ public String instanceType() { @@ -66,7 +69,7 @@ public String instanceType() { /** * Set the instanceType property: Optional type of VM used as supported by the compute target. - * + * * @param instanceType the instanceType value to set. * @return the ResourceConfiguration object itself. */ @@ -77,7 +80,7 @@ public ResourceConfiguration withInstanceType(String instanceType) { /** * Get the properties property: Additional properties bag. - * + * * @return the properties value. */ public Map properties() { @@ -86,7 +89,7 @@ public Map properties() { /** * Set the properties property: Additional properties bag. - * + * * @param properties the properties value to set. * @return the ResourceConfiguration object itself. */ @@ -97,9 +100,52 @@ public ResourceConfiguration withProperties(Map properties) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("instanceCount", this.instanceCount); + jsonWriter.writeStringField("instanceType", this.instanceType); + jsonWriter.writeMapField("properties", this.properties, (writer, element) -> writer.writeUntyped(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceConfiguration. + */ + public static ResourceConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceConfiguration deserializedResourceConfiguration = new ResourceConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("instanceCount".equals(fieldName)) { + deserializedResourceConfiguration.instanceCount = reader.getNullable(JsonReader::getInt); + } else if ("instanceType".equals(fieldName)) { + deserializedResourceConfiguration.instanceType = reader.getString(); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedResourceConfiguration.properties = properties; + } else { + reader.skipChildren(); + } + } + + return deserializedResourceConfiguration; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ResourceId.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ResourceId.java index a5cc276054e2c..194c1b119a671 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ResourceId.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ResourceId.java @@ -6,24 +6,31 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet. */ +/** + * Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet. + */ @Fluent -public final class ResourceId { +public final class ResourceId implements JsonSerializable { /* * The ID of the resource */ - @JsonProperty(value = "id", required = true) private String id; - /** Creates an instance of ResourceId class. */ + /** + * Creates an instance of ResourceId class. + */ public ResourceId() { } /** * Get the id property: The ID of the resource. - * + * * @return the id value. */ public String id() { @@ -32,7 +39,7 @@ public String id() { /** * Set the id property: The ID of the resource. - * + * * @param id the id value to set. * @return the ResourceId object itself. */ @@ -43,15 +50,52 @@ public ResourceId withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (id() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property id in model ResourceId")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property id in model ResourceId")); } } private static final ClientLogger LOGGER = new ClientLogger(ResourceId.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceId from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceId if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ResourceId. + */ + public static ResourceId fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceId deserializedResourceId = new ResourceId(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedResourceId.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceId; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ResourceName.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ResourceName.java index 9824d46b66786..383cf8440c9df 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ResourceName.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ResourceName.java @@ -5,30 +5,36 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The Resource Name. */ +/** + * The Resource Name. + */ @Immutable -public final class ResourceName { +public final class ResourceName implements JsonSerializable { /* * The name of the resource. */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private String value; /* * The localized name of the resource. */ - @JsonProperty(value = "localizedValue", access = JsonProperty.Access.WRITE_ONLY) private String localizedValue; - /** Creates an instance of ResourceName class. */ + /** + * Creates an instance of ResourceName class. + */ public ResourceName() { } /** * Get the value property: The name of the resource. - * + * * @return the value value. */ public String value() { @@ -37,7 +43,7 @@ public String value() { /** * Get the localizedValue property: The localized name of the resource. - * + * * @return the localizedValue value. */ public String localizedValue() { @@ -46,9 +52,46 @@ public String localizedValue() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceName from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceName if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceName. + */ + public static ResourceName fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceName deserializedResourceName = new ResourceName(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedResourceName.value = reader.getString(); + } else if ("localizedValue".equals(fieldName)) { + deserializedResourceName.localizedValue = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceName; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ResourceQuota.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ResourceQuota.java index 107b099bcf5a6..85bc8443984d5 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ResourceQuota.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ResourceQuota.java @@ -6,55 +6,55 @@ import com.azure.resourcemanager.machinelearning.fluent.models.ResourceQuotaInner; -/** An immutable client-side representation of ResourceQuota. */ +/** + * An immutable client-side representation of ResourceQuota. + */ public interface ResourceQuota { /** * Gets the id property: Specifies the resource ID. - * + * * @return the id value. */ String id(); /** * Gets the amlWorkspaceLocation property: Region of the AML workspace in the id. - * + * * @return the amlWorkspaceLocation value. */ String amlWorkspaceLocation(); /** * Gets the type property: Specifies the resource type. - * + * * @return the type value. */ String type(); /** * Gets the name property: Name of the resource. - * + * * @return the name value. */ ResourceName name(); /** - * Gets the limit property: Limit. - * - *

The maximum permitted quota of the resource. - * + * Gets the limit property: The maximum permitted quota of the resource. + * * @return the limit value. */ Long limit(); /** * Gets the unit property: An enum describing the unit of quota measurement. - * + * * @return the unit value. */ QuotaUnit unit(); /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.ResourceQuotaInner object. - * + * * @return the inner object. */ ResourceQuotaInner innerModel(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RollingInputData.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RollingInputData.java new file mode 100644 index 0000000000000..c54bfa168dfe4 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RollingInputData.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Duration; +import java.util.Map; + +/** + * Rolling input data definition. + */ +@Fluent +public final class RollingInputData extends MonitoringInputDataBase { + /* + * [Required] Specifies the type of signal to monitor. + */ + private MonitoringInputDataType inputDataType = MonitoringInputDataType.ROLLING; + + /* + * Reference to the component asset used to preprocess the data. + */ + private String preprocessingComponentId; + + /* + * [Required] The time offset between the end of the data window and the monitor's current run time. + */ + private Duration windowOffset; + + /* + * [Required] The size of the rolling data window. + */ + private Duration windowSize; + + /** + * Creates an instance of RollingInputData class. + */ + public RollingInputData() { + } + + /** + * Get the inputDataType property: [Required] Specifies the type of signal to monitor. + * + * @return the inputDataType value. + */ + @Override + public MonitoringInputDataType inputDataType() { + return this.inputDataType; + } + + /** + * Get the preprocessingComponentId property: Reference to the component asset used to preprocess the data. + * + * @return the preprocessingComponentId value. + */ + public String preprocessingComponentId() { + return this.preprocessingComponentId; + } + + /** + * Set the preprocessingComponentId property: Reference to the component asset used to preprocess the data. + * + * @param preprocessingComponentId the preprocessingComponentId value to set. + * @return the RollingInputData object itself. + */ + public RollingInputData withPreprocessingComponentId(String preprocessingComponentId) { + this.preprocessingComponentId = preprocessingComponentId; + return this; + } + + /** + * Get the windowOffset property: [Required] The time offset between the end of the data window and the monitor's + * current run time. + * + * @return the windowOffset value. + */ + public Duration windowOffset() { + return this.windowOffset; + } + + /** + * Set the windowOffset property: [Required] The time offset between the end of the data window and the monitor's + * current run time. + * + * @param windowOffset the windowOffset value to set. + * @return the RollingInputData object itself. + */ + public RollingInputData withWindowOffset(Duration windowOffset) { + this.windowOffset = windowOffset; + return this; + } + + /** + * Get the windowSize property: [Required] The size of the rolling data window. + * + * @return the windowSize value. + */ + public Duration windowSize() { + return this.windowSize; + } + + /** + * Set the windowSize property: [Required] The size of the rolling data window. + * + * @param windowSize the windowSize value to set. + * @return the RollingInputData object itself. + */ + public RollingInputData withWindowSize(Duration windowSize) { + this.windowSize = windowSize; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RollingInputData withColumns(Map columns) { + super.withColumns(columns); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RollingInputData withDataContext(String dataContext) { + super.withDataContext(dataContext); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RollingInputData withJobInputType(JobInputType jobInputType) { + super.withJobInputType(jobInputType); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RollingInputData withUri(String uri) { + super.withUri(uri); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (windowOffset() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property windowOffset in model RollingInputData")); + } + if (windowSize() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property windowSize in model RollingInputData")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RollingInputData.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("jobInputType", jobInputType() == null ? null : jobInputType().toString()); + jsonWriter.writeStringField("uri", uri()); + jsonWriter.writeMapField("columns", columns(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("dataContext", dataContext()); + jsonWriter.writeStringField("windowOffset", CoreUtils.durationToStringWithDays(this.windowOffset)); + jsonWriter.writeStringField("windowSize", CoreUtils.durationToStringWithDays(this.windowSize)); + jsonWriter.writeStringField("inputDataType", this.inputDataType == null ? null : this.inputDataType.toString()); + jsonWriter.writeStringField("preprocessingComponentId", this.preprocessingComponentId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RollingInputData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RollingInputData if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RollingInputData. + */ + public static RollingInputData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RollingInputData deserializedRollingInputData = new RollingInputData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("jobInputType".equals(fieldName)) { + deserializedRollingInputData.withJobInputType(JobInputType.fromString(reader.getString())); + } else if ("uri".equals(fieldName)) { + deserializedRollingInputData.withUri(reader.getString()); + } else if ("columns".equals(fieldName)) { + Map columns = reader.readMap(reader1 -> reader1.getString()); + deserializedRollingInputData.withColumns(columns); + } else if ("dataContext".equals(fieldName)) { + deserializedRollingInputData.withDataContext(reader.getString()); + } else if ("windowOffset".equals(fieldName)) { + deserializedRollingInputData.windowOffset + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else if ("windowSize".equals(fieldName)) { + deserializedRollingInputData.windowSize + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else if ("inputDataType".equals(fieldName)) { + deserializedRollingInputData.inputDataType = MonitoringInputDataType.fromString(reader.getString()); + } else if ("preprocessingComponentId".equals(fieldName)) { + deserializedRollingInputData.preprocessingComponentId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRollingInputData; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RollingRateType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RollingRateType.java new file mode 100644 index 0000000000000..718833559f87d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RollingRateType.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for RollingRateType. + */ +public final class RollingRateType extends ExpandableStringEnum { + /** + * Static value Year for RollingRateType. + */ + public static final RollingRateType YEAR = fromString("Year"); + + /** + * Static value Month for RollingRateType. + */ + public static final RollingRateType MONTH = fromString("Month"); + + /** + * Static value Day for RollingRateType. + */ + public static final RollingRateType DAY = fromString("Day"); + + /** + * Static value Hour for RollingRateType. + */ + public static final RollingRateType HOUR = fromString("Hour"); + + /** + * Static value Minute for RollingRateType. + */ + public static final RollingRateType MINUTE = fromString("Minute"); + + /** + * Creates a new instance of RollingRateType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RollingRateType() { + } + + /** + * Creates or finds a RollingRateType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RollingRateType. + */ + public static RollingRateType fromString(String name) { + return fromString(name, RollingRateType.class); + } + + /** + * Gets known RollingRateType values. + * + * @return known RollingRateType values. + */ + public static Collection values() { + return values(RollingRateType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Route.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Route.java index ce8860e8900b2..1bdf766427da0 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Route.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Route.java @@ -6,30 +6,36 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The Route model. */ +/** + * The Route model. + */ @Fluent -public final class Route { +public final class Route implements JsonSerializable { /* * [Required] The path for the route. */ - @JsonProperty(value = "path", required = true) private String path; /* * [Required] The port for the route. */ - @JsonProperty(value = "port", required = true) private int port; - /** Creates an instance of Route class. */ + /** + * Creates an instance of Route class. + */ public Route() { } /** * Get the path property: [Required] The path for the route. - * + * * @return the path value. */ public String path() { @@ -38,7 +44,7 @@ public String path() { /** * Set the path property: [Required] The path for the route. - * + * * @param path the path value to set. * @return the Route object itself. */ @@ -49,7 +55,7 @@ public Route withPath(String path) { /** * Get the port property: [Required] The port for the route. - * + * * @return the port value. */ public int port() { @@ -58,7 +64,7 @@ public int port() { /** * Set the port property: [Required] The port for the route. - * + * * @param port the port value to set. * @return the Route object itself. */ @@ -69,15 +75,54 @@ public Route withPort(int port) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (path() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property path in model Route")); + throw LOGGER.atError().log(new IllegalArgumentException("Missing required property path in model Route")); } } private static final ClientLogger LOGGER = new ClientLogger(Route.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("path", this.path); + jsonWriter.writeIntField("port", this.port); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Route from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Route if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Route. + */ + public static Route fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Route deserializedRoute = new Route(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("path".equals(fieldName)) { + deserializedRoute.path = reader.getString(); + } else if ("port".equals(fieldName)) { + deserializedRoute.port = reader.getInt(); + } else { + reader.skipChildren(); + } + } + + return deserializedRoute; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RuleAction.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RuleAction.java new file mode 100644 index 0000000000000..650aad805d24e --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RuleAction.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The action enum for networking rule. + */ +public final class RuleAction extends ExpandableStringEnum { + /** + * Static value Allow for RuleAction. + */ + public static final RuleAction ALLOW = fromString("Allow"); + + /** + * Static value Deny for RuleAction. + */ + public static final RuleAction DENY = fromString("Deny"); + + /** + * Creates a new instance of RuleAction value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RuleAction() { + } + + /** + * Creates or finds a RuleAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding RuleAction. + */ + public static RuleAction fromString(String name) { + return fromString(name, RuleAction.class); + } + + /** + * Gets known RuleAction values. + * + * @return known RuleAction values. + */ + public static Collection values() { + return values(RuleAction.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RuleCategory.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RuleCategory.java new file mode 100644 index 0000000000000..d5b1d8717269a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RuleCategory.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Category of a managed network Outbound Rule of a machine learning workspace. + */ +public final class RuleCategory extends ExpandableStringEnum { + /** + * Static value Required for RuleCategory. + */ + public static final RuleCategory REQUIRED = fromString("Required"); + + /** + * Static value Recommended for RuleCategory. + */ + public static final RuleCategory RECOMMENDED = fromString("Recommended"); + + /** + * Static value UserDefined for RuleCategory. + */ + public static final RuleCategory USER_DEFINED = fromString("UserDefined"); + + /** + * Static value Dependency for RuleCategory. + */ + public static final RuleCategory DEPENDENCY = fromString("Dependency"); + + /** + * Creates a new instance of RuleCategory value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RuleCategory() { + } + + /** + * Creates or finds a RuleCategory from its string representation. + * + * @param name a name to look for. + * @return the corresponding RuleCategory. + */ + public static RuleCategory fromString(String name) { + return fromString(name, RuleCategory.class); + } + + /** + * Gets known RuleCategory values. + * + * @return known RuleCategory values. + */ + public static Collection values() { + return values(RuleCategory.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RuleStatus.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RuleStatus.java new file mode 100644 index 0000000000000..102835e447a44 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RuleStatus.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of a managed network Outbound Rule of a machine learning workspace. + */ +public final class RuleStatus extends ExpandableStringEnum { + /** + * Static value Inactive for RuleStatus. + */ + public static final RuleStatus INACTIVE = fromString("Inactive"); + + /** + * Static value Active for RuleStatus. + */ + public static final RuleStatus ACTIVE = fromString("Active"); + + /** + * Creates a new instance of RuleStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RuleStatus() { + } + + /** + * Creates or finds a RuleStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding RuleStatus. + */ + public static RuleStatus fromString(String name) { + return fromString(name, RuleStatus.class); + } + + /** + * Gets known RuleStatus values. + * + * @return known RuleStatus values. + */ + public static Collection values() { + return values(RuleStatus.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RuleType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RuleType.java new file mode 100644 index 0000000000000..d3c426d67a901 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/RuleType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of a managed network Outbound Rule of a machine learning workspace. + */ +public final class RuleType extends ExpandableStringEnum { + /** + * Static value FQDN for RuleType. + */ + public static final RuleType FQDN = fromString("FQDN"); + + /** + * Static value PrivateEndpoint for RuleType. + */ + public static final RuleType PRIVATE_ENDPOINT = fromString("PrivateEndpoint"); + + /** + * Static value ServiceTag for RuleType. + */ + public static final RuleType SERVICE_TAG = fromString("ServiceTag"); + + /** + * Creates a new instance of RuleType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RuleType() { + } + + /** + * Creates or finds a RuleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RuleType. + */ + public static RuleType fromString(String name) { + return fromString(name, RuleType.class); + } + + /** + * Gets known RuleType values. + * + * @return known RuleType values. + */ + public static Collection values() { + return values(RuleType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SamplingAlgorithm.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SamplingAlgorithm.java index 1a96ee37626e1..4846403c3bed4 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SamplingAlgorithm.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SamplingAlgorithm.java @@ -5,33 +5,111 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The Sampling Algorithm used to generate hyperparameter values, along with properties to configure the algorithm. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "samplingAlgorithmType", - defaultImpl = SamplingAlgorithm.class) -@JsonTypeName("SamplingAlgorithm") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "Bayesian", value = BayesianSamplingAlgorithm.class), - @JsonSubTypes.Type(name = "Grid", value = GridSamplingAlgorithm.class), - @JsonSubTypes.Type(name = "Random", value = RandomSamplingAlgorithm.class) -}) +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The Sampling Algorithm used to generate hyperparameter values, along with properties to + * configure the algorithm. + */ @Immutable -public class SamplingAlgorithm { - /** Creates an instance of SamplingAlgorithm class. */ +public class SamplingAlgorithm implements JsonSerializable { + /* + * [Required] The algorithm used for generating hyperparameter values, along with configuration properties + */ + private SamplingAlgorithmType samplingAlgorithmType = SamplingAlgorithmType.fromString("SamplingAlgorithm"); + + /** + * Creates an instance of SamplingAlgorithm class. + */ public SamplingAlgorithm() { } + /** + * Get the samplingAlgorithmType property: [Required] The algorithm used for generating hyperparameter values, along + * with configuration properties. + * + * @return the samplingAlgorithmType value. + */ + public SamplingAlgorithmType samplingAlgorithmType() { + return this.samplingAlgorithmType; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("samplingAlgorithmType", + this.samplingAlgorithmType == null ? null : this.samplingAlgorithmType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SamplingAlgorithm from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SamplingAlgorithm if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SamplingAlgorithm. + */ + public static SamplingAlgorithm fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("samplingAlgorithmType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Bayesian".equals(discriminatorValue)) { + return BayesianSamplingAlgorithm.fromJson(readerToUse.reset()); + } else if ("Grid".equals(discriminatorValue)) { + return GridSamplingAlgorithm.fromJson(readerToUse.reset()); + } else if ("Random".equals(discriminatorValue)) { + return RandomSamplingAlgorithm.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static SamplingAlgorithm fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SamplingAlgorithm deserializedSamplingAlgorithm = new SamplingAlgorithm(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("samplingAlgorithmType".equals(fieldName)) { + deserializedSamplingAlgorithm.samplingAlgorithmType + = SamplingAlgorithmType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSamplingAlgorithm; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SamplingAlgorithmType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SamplingAlgorithmType.java index 60cde05582b6f..2dc248a5747f1 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SamplingAlgorithmType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SamplingAlgorithmType.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for SamplingAlgorithmType. */ +/** + * Defines values for SamplingAlgorithmType. + */ public final class SamplingAlgorithmType extends ExpandableStringEnum { - /** Static value Grid for SamplingAlgorithmType. */ + /** + * Static value Grid for SamplingAlgorithmType. + */ public static final SamplingAlgorithmType GRID = fromString("Grid"); - /** Static value Random for SamplingAlgorithmType. */ + /** + * Static value Random for SamplingAlgorithmType. + */ public static final SamplingAlgorithmType RANDOM = fromString("Random"); - /** Static value Bayesian for SamplingAlgorithmType. */ + /** + * Static value Bayesian for SamplingAlgorithmType. + */ public static final SamplingAlgorithmType BAYESIAN = fromString("Bayesian"); /** * Creates a new instance of SamplingAlgorithmType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public SamplingAlgorithmType() { /** * Creates or finds a SamplingAlgorithmType from its string representation. - * + * * @param name a name to look for. * @return the corresponding SamplingAlgorithmType. */ - @JsonCreator public static SamplingAlgorithmType fromString(String name) { return fromString(name, SamplingAlgorithmType.class); } /** * Gets known SamplingAlgorithmType values. - * + * * @return known SamplingAlgorithmType values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SasAuthTypeWorkspaceConnectionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SasAuthTypeWorkspaceConnectionProperties.java index 1065fa7947c69..33ccc29791fe3 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SasAuthTypeWorkspaceConnectionProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SasAuthTypeWorkspaceConnectionProperties.java @@ -5,28 +5,60 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; -/** The SasAuthTypeWorkspaceConnectionProperties model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "authType") -@JsonTypeName("SAS") +/** + * The SasAuthTypeWorkspaceConnectionProperties model. + */ @Fluent public final class SasAuthTypeWorkspaceConnectionProperties extends WorkspaceConnectionPropertiesV2 { + /* + * Authentication type of the connection target + */ + private ConnectionAuthType authType = ConnectionAuthType.SAS; + /* * The credentials property. */ - @JsonProperty(value = "credentials") private WorkspaceConnectionSharedAccessSignature credentials; - /** Creates an instance of SasAuthTypeWorkspaceConnectionProperties class. */ + /* + * The createdByWorkspaceArmId property. + */ + private String createdByWorkspaceArmId; + + /* + * Group based on connection category + */ + private ConnectionGroup group; + + /** + * Creates an instance of SasAuthTypeWorkspaceConnectionProperties class. + */ public SasAuthTypeWorkspaceConnectionProperties() { } + /** + * Get the authType property: Authentication type of the connection target. + * + * @return the authType value. + */ + @Override + public ConnectionAuthType authType() { + return this.authType; + } + /** * Get the credentials property: The credentials property. - * + * * @return the credentials value. */ public WorkspaceConnectionSharedAccessSignature credentials() { @@ -35,38 +67,102 @@ public WorkspaceConnectionSharedAccessSignature credentials() { /** * Set the credentials property: The credentials property. - * + * * @param credentials the credentials value to set. * @return the SasAuthTypeWorkspaceConnectionProperties object itself. */ - public SasAuthTypeWorkspaceConnectionProperties withCredentials( - WorkspaceConnectionSharedAccessSignature credentials) { + public SasAuthTypeWorkspaceConnectionProperties + withCredentials(WorkspaceConnectionSharedAccessSignature credentials) { this.credentials = credentials; return this; } - /** {@inheritDoc} */ + /** + * Get the createdByWorkspaceArmId property: The createdByWorkspaceArmId property. + * + * @return the createdByWorkspaceArmId value. + */ + @Override + public String createdByWorkspaceArmId() { + return this.createdByWorkspaceArmId; + } + + /** + * Get the group property: Group based on connection category. + * + * @return the group value. + */ + @Override + public ConnectionGroup group() { + return this.group; + } + + /** + * {@inheritDoc} + */ @Override public SasAuthTypeWorkspaceConnectionProperties withCategory(ConnectionCategory category) { super.withCategory(category); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ + @Override + public SasAuthTypeWorkspaceConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { + super.withExpiryTime(expiryTime); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SasAuthTypeWorkspaceConnectionProperties withIsSharedToAll(Boolean isSharedToAll) { + super.withIsSharedToAll(isSharedToAll); + return this; + } + + /** + * {@inheritDoc} + */ @Override public SasAuthTypeWorkspaceConnectionProperties withTarget(String target) { super.withTarget(target); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ + @Override + public SasAuthTypeWorkspaceConnectionProperties withMetadata(Map metadata) { + super.withMetadata(metadata); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SasAuthTypeWorkspaceConnectionProperties withSharedUserList(List sharedUserList) { + super.withSharedUserList(sharedUserList); + return this; + } + + /** + * {@inheritDoc} + */ @Override public SasAuthTypeWorkspaceConnectionProperties withValue(String value) { super.withValue(value); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public SasAuthTypeWorkspaceConnectionProperties withValueFormat(ValueFormat valueFormat) { super.withValueFormat(valueFormat); @@ -75,7 +171,7 @@ public SasAuthTypeWorkspaceConnectionProperties withValueFormat(ValueFormat valu /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -85,4 +181,83 @@ public void validate() { credentials().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", category() == null ? null : category().toString()); + jsonWriter.writeStringField("expiryTime", + expiryTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expiryTime())); + jsonWriter.writeBooleanField("isSharedToAll", isSharedToAll()); + jsonWriter.writeStringField("target", target()); + jsonWriter.writeMapField("metadata", metadata(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("sharedUserList", sharedUserList(), + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("value", value()); + jsonWriter.writeStringField("valueFormat", valueFormat() == null ? null : valueFormat().toString()); + jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); + jsonWriter.writeJsonField("credentials", this.credentials); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SasAuthTypeWorkspaceConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SasAuthTypeWorkspaceConnectionProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SasAuthTypeWorkspaceConnectionProperties. + */ + public static SasAuthTypeWorkspaceConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SasAuthTypeWorkspaceConnectionProperties deserializedSasAuthTypeWorkspaceConnectionProperties + = new SasAuthTypeWorkspaceConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedSasAuthTypeWorkspaceConnectionProperties + .withCategory(ConnectionCategory.fromString(reader.getString())); + } else if ("createdByWorkspaceArmId".equals(fieldName)) { + deserializedSasAuthTypeWorkspaceConnectionProperties.createdByWorkspaceArmId = reader.getString(); + } else if ("expiryTime".equals(fieldName)) { + deserializedSasAuthTypeWorkspaceConnectionProperties.withExpiryTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("group".equals(fieldName)) { + deserializedSasAuthTypeWorkspaceConnectionProperties.group + = ConnectionGroup.fromString(reader.getString()); + } else if ("isSharedToAll".equals(fieldName)) { + deserializedSasAuthTypeWorkspaceConnectionProperties + .withIsSharedToAll(reader.getNullable(JsonReader::getBoolean)); + } else if ("target".equals(fieldName)) { + deserializedSasAuthTypeWorkspaceConnectionProperties.withTarget(reader.getString()); + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedSasAuthTypeWorkspaceConnectionProperties.withMetadata(metadata); + } else if ("sharedUserList".equals(fieldName)) { + List sharedUserList = reader.readArray(reader1 -> reader1.getString()); + deserializedSasAuthTypeWorkspaceConnectionProperties.withSharedUserList(sharedUserList); + } else if ("value".equals(fieldName)) { + deserializedSasAuthTypeWorkspaceConnectionProperties.withValue(reader.getString()); + } else if ("valueFormat".equals(fieldName)) { + deserializedSasAuthTypeWorkspaceConnectionProperties + .withValueFormat(ValueFormat.fromString(reader.getString())); + } else if ("authType".equals(fieldName)) { + deserializedSasAuthTypeWorkspaceConnectionProperties.authType + = ConnectionAuthType.fromString(reader.getString()); + } else if ("credentials".equals(fieldName)) { + deserializedSasAuthTypeWorkspaceConnectionProperties.credentials + = WorkspaceConnectionSharedAccessSignature.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSasAuthTypeWorkspaceConnectionProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SasCredential.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SasCredential.java new file mode 100644 index 0000000000000..cd31e7be4d1c4 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SasCredential.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Access with full SAS uri. + */ +@Fluent +public final class SasCredential extends DataReferenceCredential { + /* + * [Required] Credential type used to authentication with storage. + */ + private DataReferenceCredentialType credentialType = DataReferenceCredentialType.SAS; + + /* + * Full SAS Uri, including the storage, container/blob path and SAS token + */ + private String sasUri; + + /** + * Creates an instance of SasCredential class. + */ + public SasCredential() { + } + + /** + * Get the credentialType property: [Required] Credential type used to authentication with storage. + * + * @return the credentialType value. + */ + @Override + public DataReferenceCredentialType credentialType() { + return this.credentialType; + } + + /** + * Get the sasUri property: Full SAS Uri, including the storage, container/blob path and SAS token. + * + * @return the sasUri value. + */ + public String sasUri() { + return this.sasUri; + } + + /** + * Set the sasUri property: Full SAS Uri, including the storage, container/blob path and SAS token. + * + * @param sasUri the sasUri value to set. + * @return the SasCredential object itself. + */ + public SasCredential withSasUri(String sasUri) { + this.sasUri = sasUri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("credentialType", + this.credentialType == null ? null : this.credentialType.toString()); + jsonWriter.writeStringField("sasUri", this.sasUri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SasCredential from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SasCredential if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SasCredential. + */ + public static SasCredential fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SasCredential deserializedSasCredential = new SasCredential(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("credentialType".equals(fieldName)) { + deserializedSasCredential.credentialType + = DataReferenceCredentialType.fromString(reader.getString()); + } else if ("sasUri".equals(fieldName)) { + deserializedSasCredential.sasUri = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSasCredential; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SasCredentialDto.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SasCredentialDto.java new file mode 100644 index 0000000000000..435c44e23b65c --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SasCredentialDto.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The SasCredentialDto model. + */ +@Fluent +public final class SasCredentialDto extends PendingUploadCredentialDto { + /* + * [Required] Credential type used to authentication with storage. + */ + private PendingUploadCredentialType credentialType = PendingUploadCredentialType.SAS; + + /* + * Full SAS Uri, including the storage, container/blob path and SAS token + */ + private String sasUri; + + /** + * Creates an instance of SasCredentialDto class. + */ + public SasCredentialDto() { + } + + /** + * Get the credentialType property: [Required] Credential type used to authentication with storage. + * + * @return the credentialType value. + */ + @Override + public PendingUploadCredentialType credentialType() { + return this.credentialType; + } + + /** + * Get the sasUri property: Full SAS Uri, including the storage, container/blob path and SAS token. + * + * @return the sasUri value. + */ + public String sasUri() { + return this.sasUri; + } + + /** + * Set the sasUri property: Full SAS Uri, including the storage, container/blob path and SAS token. + * + * @param sasUri the sasUri value to set. + * @return the SasCredentialDto object itself. + */ + public SasCredentialDto withSasUri(String sasUri) { + this.sasUri = sasUri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("credentialType", + this.credentialType == null ? null : this.credentialType.toString()); + jsonWriter.writeStringField("sasUri", this.sasUri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SasCredentialDto from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SasCredentialDto if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SasCredentialDto. + */ + public static SasCredentialDto fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SasCredentialDto deserializedSasCredentialDto = new SasCredentialDto(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("credentialType".equals(fieldName)) { + deserializedSasCredentialDto.credentialType + = PendingUploadCredentialType.fromString(reader.getString()); + } else if ("sasUri".equals(fieldName)) { + deserializedSasCredentialDto.sasUri = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSasCredentialDto; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SasDatastoreCredentials.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SasDatastoreCredentials.java index 81edf1559396e..6fd6dec723787 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SasDatastoreCredentials.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SasDatastoreCredentials.java @@ -6,28 +6,45 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** SAS datastore credentials configuration. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "credentialsType") -@JsonTypeName("Sas") +/** + * SAS datastore credentials configuration. + */ @Fluent public final class SasDatastoreCredentials extends DatastoreCredentials { + /* + * [Required] Credential type used to authentication with storage. + */ + private CredentialsType credentialsType = CredentialsType.SAS; + /* * [Required] Storage container secrets. */ - @JsonProperty(value = "secrets", required = true) private SasDatastoreSecrets secrets; - /** Creates an instance of SasDatastoreCredentials class. */ + /** + * Creates an instance of SasDatastoreCredentials class. + */ public SasDatastoreCredentials() { } + /** + * Get the credentialsType property: [Required] Credential type used to authentication with storage. + * + * @return the credentialsType value. + */ + @Override + public CredentialsType credentialsType() { + return this.credentialsType; + } + /** * Get the secrets property: [Required] Storage container secrets. - * + * * @return the secrets value. */ public SasDatastoreSecrets secrets() { @@ -36,7 +53,7 @@ public SasDatastoreSecrets secrets() { /** * Set the secrets property: [Required] Storage container secrets. - * + * * @param secrets the secrets value to set. * @return the SasDatastoreCredentials object itself. */ @@ -47,15 +64,15 @@ public SasDatastoreCredentials withSecrets(SasDatastoreSecrets secrets) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (secrets() == null) { - throw LOGGER - .logExceptionAsError( + throw LOGGER.atError() + .log( new IllegalArgumentException("Missing required property secrets in model SasDatastoreCredentials")); } else { secrets().validate(); @@ -63,4 +80,46 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(SasDatastoreCredentials.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("secrets", this.secrets); + jsonWriter.writeStringField("credentialsType", + this.credentialsType == null ? null : this.credentialsType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SasDatastoreCredentials from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SasDatastoreCredentials if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SasDatastoreCredentials. + */ + public static SasDatastoreCredentials fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SasDatastoreCredentials deserializedSasDatastoreCredentials = new SasDatastoreCredentials(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("secrets".equals(fieldName)) { + deserializedSasDatastoreCredentials.secrets = SasDatastoreSecrets.fromJson(reader); + } else if ("credentialsType".equals(fieldName)) { + deserializedSasDatastoreCredentials.credentialsType + = CredentialsType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSasDatastoreCredentials; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SasDatastoreSecrets.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SasDatastoreSecrets.java index dbeda80d6e303..47aca7a15101a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SasDatastoreSecrets.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SasDatastoreSecrets.java @@ -5,29 +5,46 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.fluent.models.DatastoreSecretsInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.IOException; -/** Datastore SAS secrets. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "secretsType") -@JsonTypeName("Sas") +/** + * Datastore SAS secrets. + */ @Fluent public final class SasDatastoreSecrets extends DatastoreSecretsInner { + /* + * [Required] Credential type used to authentication with storage. + */ + private SecretsType secretsType = SecretsType.SAS; + /* * Storage container SAS token. */ - @JsonProperty(value = "sasToken") private String sasToken; - /** Creates an instance of SasDatastoreSecrets class. */ + /** + * Creates an instance of SasDatastoreSecrets class. + */ public SasDatastoreSecrets() { } + /** + * Get the secretsType property: [Required] Credential type used to authentication with storage. + * + * @return the secretsType value. + */ + @Override + public SecretsType secretsType() { + return this.secretsType; + } + /** * Get the sasToken property: Storage container SAS token. - * + * * @return the sasToken value. */ public String sasToken() { @@ -36,7 +53,7 @@ public String sasToken() { /** * Set the sasToken property: Storage container SAS token. - * + * * @param sasToken the sasToken value to set. * @return the SasDatastoreSecrets object itself. */ @@ -47,11 +64,50 @@ public SasDatastoreSecrets withSasToken(String sasToken) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("secretsType", this.secretsType == null ? null : this.secretsType.toString()); + jsonWriter.writeStringField("sasToken", this.sasToken); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SasDatastoreSecrets from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SasDatastoreSecrets if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SasDatastoreSecrets. + */ + public static SasDatastoreSecrets fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SasDatastoreSecrets deserializedSasDatastoreSecrets = new SasDatastoreSecrets(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("secretsType".equals(fieldName)) { + deserializedSasDatastoreSecrets.secretsType = SecretsType.fromString(reader.getString()); + } else if ("sasToken".equals(fieldName)) { + deserializedSasDatastoreSecrets.sasToken = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSasDatastoreSecrets; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScaleSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScaleSettings.java index efd70e8605e1d..943e18f36e2b5 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScaleSettings.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScaleSettings.java @@ -5,37 +5,43 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.Duration; -/** scale settings for AML Compute. */ +/** + * scale settings for AML Compute. + */ @Fluent -public final class ScaleSettings { +public final class ScaleSettings implements JsonSerializable { /* * Max number of nodes to use */ - @JsonProperty(value = "maxNodeCount", required = true) private int maxNodeCount; /* * Min number of nodes to use */ - @JsonProperty(value = "minNodeCount") private Integer minNodeCount; /* * Node Idle Time before scaling down amlCompute. This string needs to be in the RFC Format. */ - @JsonProperty(value = "nodeIdleTimeBeforeScaleDown") private Duration nodeIdleTimeBeforeScaleDown; - /** Creates an instance of ScaleSettings class. */ + /** + * Creates an instance of ScaleSettings class. + */ public ScaleSettings() { } /** * Get the maxNodeCount property: Max number of nodes to use. - * + * * @return the maxNodeCount value. */ public int maxNodeCount() { @@ -44,7 +50,7 @@ public int maxNodeCount() { /** * Set the maxNodeCount property: Max number of nodes to use. - * + * * @param maxNodeCount the maxNodeCount value to set. * @return the ScaleSettings object itself. */ @@ -55,7 +61,7 @@ public ScaleSettings withMaxNodeCount(int maxNodeCount) { /** * Get the minNodeCount property: Min number of nodes to use. - * + * * @return the minNodeCount value. */ public Integer minNodeCount() { @@ -64,7 +70,7 @@ public Integer minNodeCount() { /** * Set the minNodeCount property: Min number of nodes to use. - * + * * @param minNodeCount the minNodeCount value to set. * @return the ScaleSettings object itself. */ @@ -76,7 +82,7 @@ public ScaleSettings withMinNodeCount(Integer minNodeCount) { /** * Get the nodeIdleTimeBeforeScaleDown property: Node Idle Time before scaling down amlCompute. This string needs to * be in the RFC Format. - * + * * @return the nodeIdleTimeBeforeScaleDown value. */ public Duration nodeIdleTimeBeforeScaleDown() { @@ -86,7 +92,7 @@ public Duration nodeIdleTimeBeforeScaleDown() { /** * Set the nodeIdleTimeBeforeScaleDown property: Node Idle Time before scaling down amlCompute. This string needs to * be in the RFC Format. - * + * * @param nodeIdleTimeBeforeScaleDown the nodeIdleTimeBeforeScaleDown value to set. * @return the ScaleSettings object itself. */ @@ -97,9 +103,54 @@ public ScaleSettings withNodeIdleTimeBeforeScaleDown(Duration nodeIdleTimeBefore /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("maxNodeCount", this.maxNodeCount); + jsonWriter.writeNumberField("minNodeCount", this.minNodeCount); + jsonWriter.writeStringField("nodeIdleTimeBeforeScaleDown", + CoreUtils.durationToStringWithDays(this.nodeIdleTimeBeforeScaleDown)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScaleSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScaleSettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ScaleSettings. + */ + public static ScaleSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScaleSettings deserializedScaleSettings = new ScaleSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("maxNodeCount".equals(fieldName)) { + deserializedScaleSettings.maxNodeCount = reader.getInt(); + } else if ("minNodeCount".equals(fieldName)) { + deserializedScaleSettings.minNodeCount = reader.getNullable(JsonReader::getInt); + } else if ("nodeIdleTimeBeforeScaleDown".equals(fieldName)) { + deserializedScaleSettings.nodeIdleTimeBeforeScaleDown + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedScaleSettings; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScaleSettingsInformation.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScaleSettingsInformation.java index f5282e103e15b..b9b9ba1365738 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScaleSettingsInformation.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScaleSettingsInformation.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Desired scale settings for the amlCompute. */ +/** + * Desired scale settings for the amlCompute. + */ @Fluent -public final class ScaleSettingsInformation { +public final class ScaleSettingsInformation implements JsonSerializable { /* * scale settings for AML Compute */ - @JsonProperty(value = "scaleSettings") private ScaleSettings scaleSettings; - /** Creates an instance of ScaleSettingsInformation class. */ + /** + * Creates an instance of ScaleSettingsInformation class. + */ public ScaleSettingsInformation() { } /** * Get the scaleSettings property: scale settings for AML Compute. - * + * * @return the scaleSettings value. */ public ScaleSettings scaleSettings() { @@ -31,7 +38,7 @@ public ScaleSettings scaleSettings() { /** * Set the scaleSettings property: scale settings for AML Compute. - * + * * @param scaleSettings the scaleSettings value to set. * @return the ScaleSettingsInformation object itself. */ @@ -42,7 +49,7 @@ public ScaleSettingsInformation withScaleSettings(ScaleSettings scaleSettings) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -50,4 +57,40 @@ public void validate() { scaleSettings().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("scaleSettings", this.scaleSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScaleSettingsInformation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScaleSettingsInformation if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ScaleSettingsInformation. + */ + public static ScaleSettingsInformation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScaleSettingsInformation deserializedScaleSettingsInformation = new ScaleSettingsInformation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("scaleSettings".equals(fieldName)) { + deserializedScaleSettingsInformation.scaleSettings = ScaleSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedScaleSettingsInformation; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScaleType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScaleType.java index 418165898f397..079d04a2b8725 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScaleType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScaleType.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ScaleType. */ +/** + * Defines values for ScaleType. + */ public final class ScaleType extends ExpandableStringEnum { - /** Static value Default for ScaleType. */ + /** + * Static value Default for ScaleType. + */ public static final ScaleType DEFAULT = fromString("Default"); - /** Static value TargetUtilization for ScaleType. */ + /** + * Static value TargetUtilization for ScaleType. + */ public static final ScaleType TARGET_UTILIZATION = fromString("TargetUtilization"); /** * Creates a new instance of ScaleType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public ScaleType() { /** * Creates or finds a ScaleType from its string representation. - * + * * @param name a name to look for. * @return the corresponding ScaleType. */ - @JsonCreator public static ScaleType fromString(String name) { return fromString(name, ScaleType.class); } /** * Gets known ScaleType values. - * + * * @return known ScaleType values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Schedule.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Schedule.java index 7808d864dab94..7a1c484a85b47 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Schedule.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Schedule.java @@ -8,90 +8,103 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.machinelearning.fluent.models.ScheduleInner; -/** An immutable client-side representation of Schedule. */ +/** + * An immutable client-side representation of Schedule. + */ public interface Schedule { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the properties property: [Required] Additional attributes of the entity. - * + * * @return the properties value. */ ScheduleProperties properties(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.ScheduleInner object. - * + * * @return the inner object. */ ScheduleInner innerModel(); - /** The entirety of the Schedule definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithParentResource, - DefinitionStages.WithProperties, - DefinitionStages.WithCreate { + /** + * The entirety of the Schedule definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, DefinitionStages.WithCreate { } - /** The Schedule definition stages. */ + + /** + * The Schedule definition stages. + */ interface DefinitionStages { - /** The first stage of the Schedule definition. */ + /** + * The first stage of the Schedule definition. + */ interface Blank extends WithParentResource { } - /** The stage of the Schedule definition allowing to specify parent resource. */ + + /** + * The stage of the Schedule definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, workspaceName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @return the next definition stage. */ WithProperties withExistingWorkspace(String resourceGroupName, String workspaceName); } - /** The stage of the Schedule definition allowing to specify properties. */ + + /** + * The stage of the Schedule definition allowing to specify properties. + */ interface WithProperties { /** * Specifies the properties property: [Required] Additional attributes of the entity.. - * + * * @param properties [Required] Additional attributes of the entity. * @return the next definition stage. */ WithCreate withProperties(ScheduleProperties properties); } + /** * The stage of the Schedule definition which contains all the minimum required properties for the resource to * be created, but also allows for any other optional properties to be specified. @@ -99,67 +112,76 @@ interface WithProperties { interface WithCreate { /** * Executes the create request. - * + * * @return the created resource. */ Schedule create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ Schedule create(Context context); } } + /** * Begins update for the Schedule resource. - * + * * @return the stage of resource update. */ Schedule.Update update(); - /** The template for Schedule update. */ + /** + * The template for Schedule update. + */ interface Update extends UpdateStages.WithProperties { /** * Executes the update request. - * + * * @return the updated resource. */ Schedule apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ Schedule apply(Context context); } - /** The Schedule update stages. */ + + /** + * The Schedule update stages. + */ interface UpdateStages { - /** The stage of the Schedule update allowing to specify properties. */ + /** + * The stage of the Schedule update allowing to specify properties. + */ interface WithProperties { /** * Specifies the properties property: [Required] Additional attributes of the entity.. - * + * * @param properties [Required] Additional attributes of the entity. * @return the next definition stage. */ Update withProperties(ScheduleProperties properties); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ Schedule refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleActionBase.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleActionBase.java index d88932a1d1c21..8efcd708c16fe 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleActionBase.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleActionBase.java @@ -5,32 +5,107 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The ScheduleActionBase model. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "actionType", - defaultImpl = ScheduleActionBase.class) -@JsonTypeName("ScheduleActionBase") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "InvokeBatchEndpoint", value = EndpointScheduleAction.class), - @JsonSubTypes.Type(name = "CreateJob", value = JobScheduleAction.class) -}) +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The ScheduleActionBase model. + */ @Immutable -public class ScheduleActionBase { - /** Creates an instance of ScheduleActionBase class. */ +public class ScheduleActionBase implements JsonSerializable { + /* + * [Required] Specifies the action type of the schedule + */ + private ScheduleActionType actionType = ScheduleActionType.fromString("ScheduleActionBase"); + + /** + * Creates an instance of ScheduleActionBase class. + */ public ScheduleActionBase() { } + /** + * Get the actionType property: [Required] Specifies the action type of the schedule. + * + * @return the actionType value. + */ + public ScheduleActionType actionType() { + return this.actionType; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("actionType", this.actionType == null ? null : this.actionType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScheduleActionBase from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScheduleActionBase if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ScheduleActionBase. + */ + public static ScheduleActionBase fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("actionType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("CreateMonitor".equals(discriminatorValue)) { + return CreateMonitorAction.fromJson(readerToUse.reset()); + } else if ("InvokeBatchEndpoint".equals(discriminatorValue)) { + return EndpointScheduleAction.fromJson(readerToUse.reset()); + } else if ("CreateJob".equals(discriminatorValue)) { + return JobScheduleAction.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static ScheduleActionBase fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScheduleActionBase deserializedScheduleActionBase = new ScheduleActionBase(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("actionType".equals(fieldName)) { + deserializedScheduleActionBase.actionType = ScheduleActionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedScheduleActionBase; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleActionType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleActionType.java index 24fe002c87045..d241042768cc6 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleActionType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleActionType.java @@ -5,20 +5,30 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ScheduleActionType. */ +/** + * Defines values for ScheduleActionType. + */ public final class ScheduleActionType extends ExpandableStringEnum { - /** Static value CreateJob for ScheduleActionType. */ + /** + * Static value CreateJob for ScheduleActionType. + */ public static final ScheduleActionType CREATE_JOB = fromString("CreateJob"); - /** Static value InvokeBatchEndpoint for ScheduleActionType. */ + /** + * Static value InvokeBatchEndpoint for ScheduleActionType. + */ public static final ScheduleActionType INVOKE_BATCH_ENDPOINT = fromString("InvokeBatchEndpoint"); + /** + * Static value CreateMonitor for ScheduleActionType. + */ + public static final ScheduleActionType CREATE_MONITOR = fromString("CreateMonitor"); + /** * Creates a new instance of ScheduleActionType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +37,17 @@ public ScheduleActionType() { /** * Creates or finds a ScheduleActionType from its string representation. - * + * * @param name a name to look for. * @return the corresponding ScheduleActionType. */ - @JsonCreator public static ScheduleActionType fromString(String name) { return fromString(name, ScheduleActionType.class); } /** * Gets known ScheduleActionType values. - * + * * @return known ScheduleActionType values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleBase.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleBase.java index dfff857537661..aa0e42bdf3d99 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleBase.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleBase.java @@ -5,36 +5,41 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The ScheduleBase model. */ +/** + * The ScheduleBase model. + */ @Fluent -public final class ScheduleBase { +public final class ScheduleBase implements JsonSerializable { /* * A system assigned id for the schedule. */ - @JsonProperty(value = "id") private String id; /* * The current deployment state of schedule. */ - @JsonProperty(value = "provisioningStatus") private ScheduleProvisioningState provisioningStatus; /* * Is the schedule enabled or disabled? */ - @JsonProperty(value = "status") private ScheduleStatus status; - /** Creates an instance of ScheduleBase class. */ + /** + * Creates an instance of ScheduleBase class. + */ public ScheduleBase() { } /** * Get the id property: A system assigned id for the schedule. - * + * * @return the id value. */ public String id() { @@ -43,7 +48,7 @@ public String id() { /** * Set the id property: A system assigned id for the schedule. - * + * * @param id the id value to set. * @return the ScheduleBase object itself. */ @@ -54,7 +59,7 @@ public ScheduleBase withId(String id) { /** * Get the provisioningStatus property: The current deployment state of schedule. - * + * * @return the provisioningStatus value. */ public ScheduleProvisioningState provisioningStatus() { @@ -63,7 +68,7 @@ public ScheduleProvisioningState provisioningStatus() { /** * Set the provisioningStatus property: The current deployment state of schedule. - * + * * @param provisioningStatus the provisioningStatus value to set. * @return the ScheduleBase object itself. */ @@ -74,7 +79,7 @@ public ScheduleBase withProvisioningStatus(ScheduleProvisioningState provisionin /** * Get the status property: Is the schedule enabled or disabled?. - * + * * @return the status value. */ public ScheduleStatus status() { @@ -83,7 +88,7 @@ public ScheduleStatus status() { /** * Set the status property: Is the schedule enabled or disabled?. - * + * * @param status the status value to set. * @return the ScheduleBase object itself. */ @@ -94,9 +99,53 @@ public ScheduleBase withStatus(ScheduleStatus status) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("provisioningStatus", + this.provisioningStatus == null ? null : this.provisioningStatus.toString()); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScheduleBase from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScheduleBase if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ScheduleBase. + */ + public static ScheduleBase fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScheduleBase deserializedScheduleBase = new ScheduleBase(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedScheduleBase.id = reader.getString(); + } else if ("provisioningStatus".equals(fieldName)) { + deserializedScheduleBase.provisioningStatus + = ScheduleProvisioningState.fromString(reader.getString()); + } else if ("status".equals(fieldName)) { + deserializedScheduleBase.status = ScheduleStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedScheduleBase; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleListViewType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleListViewType.java index a10f3e1b36533..90a9b93aaef0f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleListViewType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleListViewType.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ScheduleListViewType. */ +/** + * Defines values for ScheduleListViewType. + */ public final class ScheduleListViewType extends ExpandableStringEnum { - /** Static value EnabledOnly for ScheduleListViewType. */ + /** + * Static value EnabledOnly for ScheduleListViewType. + */ public static final ScheduleListViewType ENABLED_ONLY = fromString("EnabledOnly"); - /** Static value DisabledOnly for ScheduleListViewType. */ + /** + * Static value DisabledOnly for ScheduleListViewType. + */ public static final ScheduleListViewType DISABLED_ONLY = fromString("DisabledOnly"); - /** Static value All for ScheduleListViewType. */ + /** + * Static value All for ScheduleListViewType. + */ public static final ScheduleListViewType ALL = fromString("All"); /** * Creates a new instance of ScheduleListViewType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public ScheduleListViewType() { /** * Creates or finds a ScheduleListViewType from its string representation. - * + * * @param name a name to look for. * @return the corresponding ScheduleListViewType. */ - @JsonCreator public static ScheduleListViewType fromString(String name) { return fromString(name, ScheduleListViewType.class); } /** * Gets known ScheduleListViewType values. - * + * * @return known ScheduleListViewType values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleProperties.java index 2e486abeab37b..d67d2179d32a3 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleProperties.java @@ -6,49 +6,51 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Base definition of a schedule. */ +/** + * Base definition of a schedule. + */ @Fluent public final class ScheduleProperties extends ResourceBase { /* * [Required] Specifies the action of the schedule */ - @JsonProperty(value = "action", required = true) private ScheduleActionBase action; /* * Display name of schedule. */ - @JsonProperty(value = "displayName") private String displayName; /* * Is the schedule enabled? */ - @JsonProperty(value = "isEnabled") private Boolean isEnabled; /* * Provisioning state for the schedule. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ScheduleProvisioningStatus provisioningState; /* * [Required] Specifies the trigger details */ - @JsonProperty(value = "trigger", required = true) private TriggerBase trigger; - /** Creates an instance of ScheduleProperties class. */ + /** + * Creates an instance of ScheduleProperties class. + */ public ScheduleProperties() { } /** * Get the action property: [Required] Specifies the action of the schedule. - * + * * @return the action value. */ public ScheduleActionBase action() { @@ -57,7 +59,7 @@ public ScheduleActionBase action() { /** * Set the action property: [Required] Specifies the action of the schedule. - * + * * @param action the action value to set. * @return the ScheduleProperties object itself. */ @@ -68,7 +70,7 @@ public ScheduleProperties withAction(ScheduleActionBase action) { /** * Get the displayName property: Display name of schedule. - * + * * @return the displayName value. */ public String displayName() { @@ -77,7 +79,7 @@ public String displayName() { /** * Set the displayName property: Display name of schedule. - * + * * @param displayName the displayName value to set. * @return the ScheduleProperties object itself. */ @@ -88,7 +90,7 @@ public ScheduleProperties withDisplayName(String displayName) { /** * Get the isEnabled property: Is the schedule enabled?. - * + * * @return the isEnabled value. */ public Boolean isEnabled() { @@ -97,7 +99,7 @@ public Boolean isEnabled() { /** * Set the isEnabled property: Is the schedule enabled?. - * + * * @param isEnabled the isEnabled value to set. * @return the ScheduleProperties object itself. */ @@ -108,7 +110,7 @@ public ScheduleProperties withIsEnabled(Boolean isEnabled) { /** * Get the provisioningState property: Provisioning state for the schedule. - * + * * @return the provisioningState value. */ public ScheduleProvisioningStatus provisioningState() { @@ -117,7 +119,7 @@ public ScheduleProvisioningStatus provisioningState() { /** * Get the trigger property: [Required] Specifies the trigger details. - * + * * @return the trigger value. */ public TriggerBase trigger() { @@ -126,7 +128,7 @@ public TriggerBase trigger() { /** * Set the trigger property: [Required] Specifies the trigger details. - * + * * @param trigger the trigger value to set. * @return the ScheduleProperties object itself. */ @@ -135,21 +137,27 @@ public ScheduleProperties withTrigger(TriggerBase trigger) { return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ScheduleProperties withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ScheduleProperties withProperties(Map properties) { super.withProperties(properties); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ScheduleProperties withTags(Map tags) { super.withTags(tags); @@ -158,27 +166,85 @@ public ScheduleProperties withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (action() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property action in model ScheduleProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property action in model ScheduleProperties")); } else { action().validate(); } if (trigger() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property trigger in model ScheduleProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property trigger in model ScheduleProperties")); } else { trigger().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(ScheduleProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("action", this.action); + jsonWriter.writeJsonField("trigger", this.trigger); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeBooleanField("isEnabled", this.isEnabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScheduleProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScheduleProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ScheduleProperties. + */ + public static ScheduleProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScheduleProperties deserializedScheduleProperties = new ScheduleProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedScheduleProperties.withDescription(reader.getString()); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedScheduleProperties.withProperties(properties); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedScheduleProperties.withTags(tags); + } else if ("action".equals(fieldName)) { + deserializedScheduleProperties.action = ScheduleActionBase.fromJson(reader); + } else if ("trigger".equals(fieldName)) { + deserializedScheduleProperties.trigger = TriggerBase.fromJson(reader); + } else if ("displayName".equals(fieldName)) { + deserializedScheduleProperties.displayName = reader.getString(); + } else if ("isEnabled".equals(fieldName)) { + deserializedScheduleProperties.isEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("provisioningState".equals(fieldName)) { + deserializedScheduleProperties.provisioningState + = ScheduleProvisioningStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedScheduleProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleProvisioningState.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleProvisioningState.java index ad887ff8aa516..605cf95e34ca7 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleProvisioningState.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleProvisioningState.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The current deployment state of schedule. */ +/** + * The current deployment state of schedule. + */ public final class ScheduleProvisioningState extends ExpandableStringEnum { - /** Static value Completed for ScheduleProvisioningState. */ + /** + * Static value Completed for ScheduleProvisioningState. + */ public static final ScheduleProvisioningState COMPLETED = fromString("Completed"); - /** Static value Provisioning for ScheduleProvisioningState. */ + /** + * Static value Provisioning for ScheduleProvisioningState. + */ public static final ScheduleProvisioningState PROVISIONING = fromString("Provisioning"); - /** Static value Failed for ScheduleProvisioningState. */ + /** + * Static value Failed for ScheduleProvisioningState. + */ public static final ScheduleProvisioningState FAILED = fromString("Failed"); /** * Creates a new instance of ScheduleProvisioningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public ScheduleProvisioningState() { /** * Creates or finds a ScheduleProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding ScheduleProvisioningState. */ - @JsonCreator public static ScheduleProvisioningState fromString(String name) { return fromString(name, ScheduleProvisioningState.class); } /** * Gets known ScheduleProvisioningState values. - * + * * @return known ScheduleProvisioningState values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleProvisioningStatus.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleProvisioningStatus.java index 5f007b3ec15cc..6aebb75209ec8 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleProvisioningStatus.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleProvisioningStatus.java @@ -5,32 +5,45 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ScheduleProvisioningStatus. */ +/** + * Defines values for ScheduleProvisioningStatus. + */ public final class ScheduleProvisioningStatus extends ExpandableStringEnum { - /** Static value Creating for ScheduleProvisioningStatus. */ + /** + * Static value Creating for ScheduleProvisioningStatus. + */ public static final ScheduleProvisioningStatus CREATING = fromString("Creating"); - /** Static value Updating for ScheduleProvisioningStatus. */ + /** + * Static value Updating for ScheduleProvisioningStatus. + */ public static final ScheduleProvisioningStatus UPDATING = fromString("Updating"); - /** Static value Deleting for ScheduleProvisioningStatus. */ + /** + * Static value Deleting for ScheduleProvisioningStatus. + */ public static final ScheduleProvisioningStatus DELETING = fromString("Deleting"); - /** Static value Succeeded for ScheduleProvisioningStatus. */ + /** + * Static value Succeeded for ScheduleProvisioningStatus. + */ public static final ScheduleProvisioningStatus SUCCEEDED = fromString("Succeeded"); - /** Static value Failed for ScheduleProvisioningStatus. */ + /** + * Static value Failed for ScheduleProvisioningStatus. + */ public static final ScheduleProvisioningStatus FAILED = fromString("Failed"); - /** Static value Canceled for ScheduleProvisioningStatus. */ + /** + * Static value Canceled for ScheduleProvisioningStatus. + */ public static final ScheduleProvisioningStatus CANCELED = fromString("Canceled"); /** * Creates a new instance of ScheduleProvisioningStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -39,18 +52,17 @@ public ScheduleProvisioningStatus() { /** * Creates or finds a ScheduleProvisioningStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding ScheduleProvisioningStatus. */ - @JsonCreator public static ScheduleProvisioningStatus fromString(String name) { return fromString(name, ScheduleProvisioningStatus.class); } /** * Gets known ScheduleProvisioningStatus values. - * + * * @return known ScheduleProvisioningStatus values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleResourceArmPaginatedResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleResourceArmPaginatedResult.java index b43e188d1ab23..23d8dcd7f3d7f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleResourceArmPaginatedResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleResourceArmPaginatedResult.java @@ -5,32 +5,38 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.fluent.models.ScheduleInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** A paginated list of Schedule entities. */ +/** + * A paginated list of Schedule entities. + */ @Fluent -public final class ScheduleResourceArmPaginatedResult { +public final class ScheduleResourceArmPaginatedResult implements JsonSerializable { /* * The link to the next page of Schedule objects. If null, there are no additional pages. */ - @JsonProperty(value = "nextLink") private String nextLink; /* * An array of objects of type Schedule. */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of ScheduleResourceArmPaginatedResult class. */ + /** + * Creates an instance of ScheduleResourceArmPaginatedResult class. + */ public ScheduleResourceArmPaginatedResult() { } /** * Get the nextLink property: The link to the next page of Schedule objects. If null, there are no additional pages. - * + * * @return the nextLink value. */ public String nextLink() { @@ -39,7 +45,7 @@ public String nextLink() { /** * Set the nextLink property: The link to the next page of Schedule objects. If null, there are no additional pages. - * + * * @param nextLink the nextLink value to set. * @return the ScheduleResourceArmPaginatedResult object itself. */ @@ -50,7 +56,7 @@ public ScheduleResourceArmPaginatedResult withNextLink(String nextLink) { /** * Get the value property: An array of objects of type Schedule. - * + * * @return the value value. */ public List value() { @@ -59,7 +65,7 @@ public List value() { /** * Set the value property: An array of objects of type Schedule. - * + * * @param value the value value to set. * @return the ScheduleResourceArmPaginatedResult object itself. */ @@ -70,7 +76,7 @@ public ScheduleResourceArmPaginatedResult withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +84,45 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScheduleResourceArmPaginatedResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScheduleResourceArmPaginatedResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ScheduleResourceArmPaginatedResult. + */ + public static ScheduleResourceArmPaginatedResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScheduleResourceArmPaginatedResult deserializedScheduleResourceArmPaginatedResult + = new ScheduleResourceArmPaginatedResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedScheduleResourceArmPaginatedResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> ScheduleInner.fromJson(reader1)); + deserializedScheduleResourceArmPaginatedResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedScheduleResourceArmPaginatedResult; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleStatus.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleStatus.java index a7abf8e3211c8..bc2d402ad4d51 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleStatus.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScheduleStatus.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Is the schedule enabled or disabled?. */ +/** + * Is the schedule enabled or disabled?. + */ public final class ScheduleStatus extends ExpandableStringEnum { - /** Static value Enabled for ScheduleStatus. */ + /** + * Static value Enabled for ScheduleStatus. + */ public static final ScheduleStatus ENABLED = fromString("Enabled"); - /** Static value Disabled for ScheduleStatus. */ + /** + * Static value Disabled for ScheduleStatus. + */ public static final ScheduleStatus DISABLED = fromString("Disabled"); /** * Creates a new instance of ScheduleStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public ScheduleStatus() { /** * Creates or finds a ScheduleStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding ScheduleStatus. */ - @JsonCreator public static ScheduleStatus fromString(String name) { return fromString(name, ScheduleStatus.class); } /** * Gets known ScheduleStatus values. - * + * * @return known ScheduleStatus values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Schedules.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Schedules.java index 19f7f86838287..8a1f5f25c1c1c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Schedules.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Schedules.java @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Schedules. */ +/** + * Resource collection API of Schedules. + */ public interface Schedules { /** * List schedules in specified workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -24,7 +26,7 @@ public interface Schedules { /** * List schedules in specified workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param skip Continuation token for pagination. @@ -35,16 +37,12 @@ public interface Schedules { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paginated list of Schedule entities as paginated response with {@link PagedIterable}. */ - PagedIterable list( - String resourceGroupName, - String workspaceName, - String skip, - ScheduleListViewType listViewType, - Context context); + PagedIterable list(String resourceGroupName, String workspaceName, String skip, + ScheduleListViewType listViewType, Context context); /** * Delete schedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Schedule name. @@ -56,7 +54,7 @@ PagedIterable list( /** * Delete schedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Schedule name. @@ -69,7 +67,7 @@ PagedIterable list( /** * Get schedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Schedule name. @@ -83,7 +81,7 @@ PagedIterable list( /** * Get schedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param name Schedule name. @@ -96,7 +94,7 @@ PagedIterable list( /** * Get schedule. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -107,7 +105,7 @@ PagedIterable list( /** * Get schedule. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -119,7 +117,7 @@ PagedIterable list( /** * Delete schedule. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -129,7 +127,7 @@ PagedIterable list( /** * Delete schedule. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -140,7 +138,7 @@ PagedIterable list( /** * Begins definition for a new Schedule resource. - * + * * @param name resource name. * @return the first stage of the new Schedule definition. */ diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScriptReference.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScriptReference.java index 8c7ad3d4aa8a7..583b1a9dd62d9 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScriptReference.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScriptReference.java @@ -5,42 +5,46 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Script reference. */ +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Script reference. + */ @Fluent -public final class ScriptReference { +public final class ScriptReference implements JsonSerializable { /* * The storage source of the script: workspace. */ - @JsonProperty(value = "scriptSource") private String scriptSource; /* * The location of scripts in the mounted volume. */ - @JsonProperty(value = "scriptData") private String scriptData; /* * Optional command line arguments passed to the script to run. */ - @JsonProperty(value = "scriptArguments") private String scriptArguments; /* * Optional time period passed to timeout command. */ - @JsonProperty(value = "timeout") private String timeout; - /** Creates an instance of ScriptReference class. */ + /** + * Creates an instance of ScriptReference class. + */ public ScriptReference() { } /** * Get the scriptSource property: The storage source of the script: workspace. - * + * * @return the scriptSource value. */ public String scriptSource() { @@ -49,7 +53,7 @@ public String scriptSource() { /** * Set the scriptSource property: The storage source of the script: workspace. - * + * * @param scriptSource the scriptSource value to set. * @return the ScriptReference object itself. */ @@ -60,7 +64,7 @@ public ScriptReference withScriptSource(String scriptSource) { /** * Get the scriptData property: The location of scripts in the mounted volume. - * + * * @return the scriptData value. */ public String scriptData() { @@ -69,7 +73,7 @@ public String scriptData() { /** * Set the scriptData property: The location of scripts in the mounted volume. - * + * * @param scriptData the scriptData value to set. * @return the ScriptReference object itself. */ @@ -80,7 +84,7 @@ public ScriptReference withScriptData(String scriptData) { /** * Get the scriptArguments property: Optional command line arguments passed to the script to run. - * + * * @return the scriptArguments value. */ public String scriptArguments() { @@ -89,7 +93,7 @@ public String scriptArguments() { /** * Set the scriptArguments property: Optional command line arguments passed to the script to run. - * + * * @param scriptArguments the scriptArguments value to set. * @return the ScriptReference object itself. */ @@ -100,7 +104,7 @@ public ScriptReference withScriptArguments(String scriptArguments) { /** * Get the timeout property: Optional time period passed to timeout command. - * + * * @return the timeout value. */ public String timeout() { @@ -109,7 +113,7 @@ public String timeout() { /** * Set the timeout property: Optional time period passed to timeout command. - * + * * @param timeout the timeout value to set. * @return the ScriptReference object itself. */ @@ -120,9 +124,54 @@ public ScriptReference withTimeout(String timeout) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("scriptSource", this.scriptSource); + jsonWriter.writeStringField("scriptData", this.scriptData); + jsonWriter.writeStringField("scriptArguments", this.scriptArguments); + jsonWriter.writeStringField("timeout", this.timeout); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScriptReference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScriptReference if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ScriptReference. + */ + public static ScriptReference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScriptReference deserializedScriptReference = new ScriptReference(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("scriptSource".equals(fieldName)) { + deserializedScriptReference.scriptSource = reader.getString(); + } else if ("scriptData".equals(fieldName)) { + deserializedScriptReference.scriptData = reader.getString(); + } else if ("scriptArguments".equals(fieldName)) { + deserializedScriptReference.scriptArguments = reader.getString(); + } else if ("timeout".equals(fieldName)) { + deserializedScriptReference.timeout = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedScriptReference; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScriptsToExecute.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScriptsToExecute.java index 5dfd1557e2477..6e04eaa8859ac 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScriptsToExecute.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ScriptsToExecute.java @@ -5,30 +5,36 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Customized setup scripts. */ +/** + * Customized setup scripts. + */ @Fluent -public final class ScriptsToExecute { +public final class ScriptsToExecute implements JsonSerializable { /* * Script that's run every time the machine starts. */ - @JsonProperty(value = "startupScript") private ScriptReference startupScript; /* * Script that's run only once during provision of the compute. */ - @JsonProperty(value = "creationScript") private ScriptReference creationScript; - /** Creates an instance of ScriptsToExecute class. */ + /** + * Creates an instance of ScriptsToExecute class. + */ public ScriptsToExecute() { } /** * Get the startupScript property: Script that's run every time the machine starts. - * + * * @return the startupScript value. */ public ScriptReference startupScript() { @@ -37,7 +43,7 @@ public ScriptReference startupScript() { /** * Set the startupScript property: Script that's run every time the machine starts. - * + * * @param startupScript the startupScript value to set. * @return the ScriptsToExecute object itself. */ @@ -48,7 +54,7 @@ public ScriptsToExecute withStartupScript(ScriptReference startupScript) { /** * Get the creationScript property: Script that's run only once during provision of the compute. - * + * * @return the creationScript value. */ public ScriptReference creationScript() { @@ -57,7 +63,7 @@ public ScriptReference creationScript() { /** * Set the creationScript property: Script that's run only once during provision of the compute. - * + * * @param creationScript the creationScript value to set. * @return the ScriptsToExecute object itself. */ @@ -68,7 +74,7 @@ public ScriptsToExecute withCreationScript(ScriptReference creationScript) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -79,4 +85,43 @@ public void validate() { creationScript().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("startupScript", this.startupScript); + jsonWriter.writeJsonField("creationScript", this.creationScript); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScriptsToExecute from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScriptsToExecute if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ScriptsToExecute. + */ + public static ScriptsToExecute fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScriptsToExecute deserializedScriptsToExecute = new ScriptsToExecute(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("startupScript".equals(fieldName)) { + deserializedScriptsToExecute.startupScript = ScriptReference.fromJson(reader); + } else if ("creationScript".equals(fieldName)) { + deserializedScriptsToExecute.creationScript = ScriptReference.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedScriptsToExecute; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Seasonality.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Seasonality.java index ecb9dc616a660..2bdc415ee3d86 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Seasonality.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Seasonality.java @@ -5,32 +5,105 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Forecasting seasonality. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "mode", - defaultImpl = Seasonality.class) -@JsonTypeName("Seasonality") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "Auto", value = AutoSeasonality.class), - @JsonSubTypes.Type(name = "Custom", value = CustomSeasonality.class) -}) +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Forecasting seasonality. + */ @Immutable -public class Seasonality { - /** Creates an instance of Seasonality class. */ +public class Seasonality implements JsonSerializable { + /* + * [Required] Seasonality mode. + */ + private SeasonalityMode mode = SeasonalityMode.fromString("Seasonality"); + + /** + * Creates an instance of Seasonality class. + */ public Seasonality() { } + /** + * Get the mode property: [Required] Seasonality mode. + * + * @return the mode value. + */ + public SeasonalityMode mode() { + return this.mode; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Seasonality from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Seasonality if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the Seasonality. + */ + public static Seasonality fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("mode".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Auto".equals(discriminatorValue)) { + return AutoSeasonality.fromJson(readerToUse.reset()); + } else if ("Custom".equals(discriminatorValue)) { + return CustomSeasonality.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static Seasonality fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Seasonality deserializedSeasonality = new Seasonality(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("mode".equals(fieldName)) { + deserializedSeasonality.mode = SeasonalityMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSeasonality; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SeasonalityMode.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SeasonalityMode.java index b75dc02a46167..bc816386e04b0 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SeasonalityMode.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SeasonalityMode.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Forecasting seasonality mode. */ +/** + * Forecasting seasonality mode. + */ public final class SeasonalityMode extends ExpandableStringEnum { - /** Static value Auto for SeasonalityMode. */ + /** + * Static value Auto for SeasonalityMode. + */ public static final SeasonalityMode AUTO = fromString("Auto"); - /** Static value Custom for SeasonalityMode. */ + /** + * Static value Custom for SeasonalityMode. + */ public static final SeasonalityMode CUSTOM = fromString("Custom"); /** * Creates a new instance of SeasonalityMode value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public SeasonalityMode() { /** * Creates or finds a SeasonalityMode from its string representation. - * + * * @param name a name to look for. * @return the corresponding SeasonalityMode. */ - @JsonCreator public static SeasonalityMode fromString(String name) { return fromString(name, SeasonalityMode.class); } /** * Gets known SeasonalityMode values. - * + * * @return known SeasonalityMode values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SecretExpiry.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SecretExpiry.java new file mode 100644 index 0000000000000..f51ac8b4ddf73 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SecretExpiry.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Secret expiration configuration. + */ +@Fluent +public final class SecretExpiry implements JsonSerializable { + /* + * Indicates if the secret is expirable. + */ + private Boolean expirableSecret; + + /* + * Number of hours after which the secret will expire. + */ + private Integer expireAfterHours; + + /** + * Creates an instance of SecretExpiry class. + */ + public SecretExpiry() { + } + + /** + * Get the expirableSecret property: Indicates if the secret is expirable. + * + * @return the expirableSecret value. + */ + public Boolean expirableSecret() { + return this.expirableSecret; + } + + /** + * Set the expirableSecret property: Indicates if the secret is expirable. + * + * @param expirableSecret the expirableSecret value to set. + * @return the SecretExpiry object itself. + */ + public SecretExpiry withExpirableSecret(Boolean expirableSecret) { + this.expirableSecret = expirableSecret; + return this; + } + + /** + * Get the expireAfterHours property: Number of hours after which the secret will expire. + * + * @return the expireAfterHours value. + */ + public Integer expireAfterHours() { + return this.expireAfterHours; + } + + /** + * Set the expireAfterHours property: Number of hours after which the secret will expire. + * + * @param expireAfterHours the expireAfterHours value to set. + * @return the SecretExpiry object itself. + */ + public SecretExpiry withExpireAfterHours(Integer expireAfterHours) { + this.expireAfterHours = expireAfterHours; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("expirableSecret", this.expirableSecret); + jsonWriter.writeNumberField("expireAfterHours", this.expireAfterHours); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecretExpiry from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecretExpiry if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SecretExpiry. + */ + public static SecretExpiry fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecretExpiry deserializedSecretExpiry = new SecretExpiry(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("expirableSecret".equals(fieldName)) { + deserializedSecretExpiry.expirableSecret = reader.getNullable(JsonReader::getBoolean); + } else if ("expireAfterHours".equals(fieldName)) { + deserializedSecretExpiry.expireAfterHours = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedSecretExpiry; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SecretsType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SecretsType.java index 39bf275d36524..7652428a933d2 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SecretsType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SecretsType.java @@ -5,26 +5,35 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Enum to determine the datastore secrets type. */ +/** + * Enum to determine the datastore secrets type. + */ public final class SecretsType extends ExpandableStringEnum { - /** Static value AccountKey for SecretsType. */ + /** + * Static value AccountKey for SecretsType. + */ public static final SecretsType ACCOUNT_KEY = fromString("AccountKey"); - /** Static value Certificate for SecretsType. */ + /** + * Static value Certificate for SecretsType. + */ public static final SecretsType CERTIFICATE = fromString("Certificate"); - /** Static value Sas for SecretsType. */ + /** + * Static value Sas for SecretsType. + */ public static final SecretsType SAS = fromString("Sas"); - /** Static value ServicePrincipal for SecretsType. */ + /** + * Static value ServicePrincipal for SecretsType. + */ public static final SecretsType SERVICE_PRINCIPAL = fromString("ServicePrincipal"); /** * Creates a new instance of SecretsType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,18 +42,17 @@ public SecretsType() { /** * Creates or finds a SecretsType from its string representation. - * + * * @param name a name to look for. * @return the corresponding SecretsType. */ - @JsonCreator public static SecretsType fromString(String name) { return fromString(name, SecretsType.class); } /** * Gets known SecretsType values. - * + * * @return known SecretsType values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServerlessComputeSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServerlessComputeSettings.java new file mode 100644 index 0000000000000..67d84ce9fe0dc --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServerlessComputeSettings.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The ServerlessComputeSettings model. + */ +@Fluent +public final class ServerlessComputeSettings implements JsonSerializable { + /* + * The resource ID of an existing virtual network subnet in which serverless compute nodes should be deployed + */ + private String serverlessComputeCustomSubnet; + + /* + * The flag to signal if serverless compute nodes deployed in custom vNet would have no public IP addresses for a + * workspace with private endpoint + */ + private Boolean serverlessComputeNoPublicIp; + + /** + * Creates an instance of ServerlessComputeSettings class. + */ + public ServerlessComputeSettings() { + } + + /** + * Get the serverlessComputeCustomSubnet property: The resource ID of an existing virtual network subnet in which + * serverless compute nodes should be deployed. + * + * @return the serverlessComputeCustomSubnet value. + */ + public String serverlessComputeCustomSubnet() { + return this.serverlessComputeCustomSubnet; + } + + /** + * Set the serverlessComputeCustomSubnet property: The resource ID of an existing virtual network subnet in which + * serverless compute nodes should be deployed. + * + * @param serverlessComputeCustomSubnet the serverlessComputeCustomSubnet value to set. + * @return the ServerlessComputeSettings object itself. + */ + public ServerlessComputeSettings withServerlessComputeCustomSubnet(String serverlessComputeCustomSubnet) { + this.serverlessComputeCustomSubnet = serverlessComputeCustomSubnet; + return this; + } + + /** + * Get the serverlessComputeNoPublicIp property: The flag to signal if serverless compute nodes deployed in custom + * vNet would have no public IP addresses for a workspace with private endpoint. + * + * @return the serverlessComputeNoPublicIp value. + */ + public Boolean serverlessComputeNoPublicIp() { + return this.serverlessComputeNoPublicIp; + } + + /** + * Set the serverlessComputeNoPublicIp property: The flag to signal if serverless compute nodes deployed in custom + * vNet would have no public IP addresses for a workspace with private endpoint. + * + * @param serverlessComputeNoPublicIp the serverlessComputeNoPublicIp value to set. + * @return the ServerlessComputeSettings object itself. + */ + public ServerlessComputeSettings withServerlessComputeNoPublicIp(Boolean serverlessComputeNoPublicIp) { + this.serverlessComputeNoPublicIp = serverlessComputeNoPublicIp; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("serverlessComputeCustomSubnet", this.serverlessComputeCustomSubnet); + jsonWriter.writeBooleanField("serverlessComputeNoPublicIP", this.serverlessComputeNoPublicIp); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServerlessComputeSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServerlessComputeSettings if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServerlessComputeSettings. + */ + public static ServerlessComputeSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServerlessComputeSettings deserializedServerlessComputeSettings = new ServerlessComputeSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serverlessComputeCustomSubnet".equals(fieldName)) { + deserializedServerlessComputeSettings.serverlessComputeCustomSubnet = reader.getString(); + } else if ("serverlessComputeNoPublicIP".equals(fieldName)) { + deserializedServerlessComputeSettings.serverlessComputeNoPublicIp + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedServerlessComputeSettings; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServerlessEndpoint.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServerlessEndpoint.java new file mode 100644 index 0000000000000..cafe00341b2b1 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServerlessEndpoint.java @@ -0,0 +1,389 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.ServerlessEndpointInner; +import java.util.Map; + +/** + * An immutable client-side representation of ServerlessEndpoint. + */ +public interface ServerlessEndpoint { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the identity property: Managed service identity (system assigned and/or user assigned identities). + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + + /** + * Gets the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type. + * + * @return the kind value. + */ + String kind(); + + /** + * Gets the properties property: [Required] Additional attributes of the entity. + * + * @return the properties value. + */ + ServerlessEndpointProperties properties(); + + /** + * Gets the sku property: Sku details required for ARM contract for Autoscaling. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.ServerlessEndpointInner object. + * + * @return the inner object. + */ + ServerlessEndpointInner innerModel(); + + /** + * The entirety of the ServerlessEndpoint definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * The ServerlessEndpoint definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the ServerlessEndpoint definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the ServerlessEndpoint definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + + /** + * The stage of the ServerlessEndpoint definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, workspaceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @return the next definition stage. + */ + WithProperties withExistingWorkspace(String resourceGroupName, String workspaceName); + } + + /** + * The stage of the ServerlessEndpoint definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: [Required] Additional attributes of the entity.. + * + * @param properties [Required] Additional attributes of the entity. + * @return the next definition stage. + */ + WithCreate withProperties(ServerlessEndpointProperties properties); + } + + /** + * The stage of the ServerlessEndpoint definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, + DefinitionStages.WithKind, DefinitionStages.WithSku { + /** + * Executes the create request. + * + * @return the created resource. + */ + ServerlessEndpoint create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ServerlessEndpoint create(Context context); + } + + /** + * The stage of the ServerlessEndpoint definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the ServerlessEndpoint definition allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: Managed service identity (system assigned and/or user assigned + * identities). + * + * @param identity Managed service identity (system assigned and/or user assigned identities). + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } + + /** + * The stage of the ServerlessEndpoint definition allowing to specify kind. + */ + interface WithKind { + /** + * Specifies the kind property: Metadata used by portal/tooling/etc to render different UX experiences for + * resources of the same type.. + * + * @param kind Metadata used by portal/tooling/etc to render different UX experiences for resources of the + * same type. + * @return the next definition stage. + */ + WithCreate withKind(String kind); + } + + /** + * The stage of the ServerlessEndpoint definition allowing to specify sku. + */ + interface WithSku { + /** + * Specifies the sku property: Sku details required for ARM contract for Autoscaling.. + * + * @param sku Sku details required for ARM contract for Autoscaling. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + } + + /** + * Begins update for the ServerlessEndpoint resource. + * + * @return the stage of resource update. + */ + ServerlessEndpoint.Update update(); + + /** + * The template for ServerlessEndpoint update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithSku { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ServerlessEndpoint apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ServerlessEndpoint apply(Context context); + } + + /** + * The ServerlessEndpoint update stages. + */ + interface UpdateStages { + /** + * The stage of the ServerlessEndpoint update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** + * The stage of the ServerlessEndpoint update allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: Managed service identity (system assigned and/or user assigned + * identities). + * + * @param identity Managed service identity (system assigned and/or user assigned identities). + * @return the next definition stage. + */ + Update withIdentity(PartialManagedServiceIdentity identity); + } + + /** + * The stage of the ServerlessEndpoint update allowing to specify sku. + */ + interface WithSku { + /** + * Specifies the sku property: Sku details required for ARM contract for Autoscaling.. + * + * @param sku Sku details required for ARM contract for Autoscaling. + * @return the next definition stage. + */ + Update withSku(PartialSku sku); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ServerlessEndpoint refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ServerlessEndpoint refresh(Context context); + + /** + * List EndpointAuthKeys for an Endpoint using Key-based authentication. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return keys for endpoint authentication along with {@link Response}. + */ + Response listKeysWithResponse(Context context); + + /** + * List EndpointAuthKeys for an Endpoint using Key-based authentication. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return keys for endpoint authentication. + */ + EndpointAuthKeys listKeys(); + + /** + * Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). + * + * @param body RegenerateKeys request . + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return keys for endpoint authentication. + */ + EndpointAuthKeys regenerateKeys(RegenerateEndpointKeysRequest body); + + /** + * Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). + * + * @param body RegenerateKeys request . + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return keys for endpoint authentication. + */ + EndpointAuthKeys regenerateKeys(RegenerateEndpointKeysRequest body, Context context); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServerlessEndpointProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServerlessEndpointProperties.java new file mode 100644 index 0000000000000..0847580d36ae9 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServerlessEndpointProperties.java @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The ServerlessEndpointProperties model. + */ +@Fluent +public final class ServerlessEndpointProperties implements JsonSerializable { + /* + * [Required] Specifies the authentication mode for the Serverless endpoint. + */ + private ServerlessInferenceEndpointAuthMode authMode; + + /* + * Specifies the content safety options. If omitted, the default content safety settings will be configured + */ + private ContentSafety contentSafety; + + /* + * The current state of the ServerlessEndpoint. + */ + private ServerlessEndpointState endpointState; + + /* + * The inference uri to target when making requests against the serverless endpoint + */ + private ServerlessInferenceEndpoint inferenceEndpoint; + + /* + * The MarketplaceSubscription Azure ID associated to this ServerlessEndpoint. + */ + private String marketplaceSubscriptionId; + + /* + * The model settings (model id) for the model being serviced on the ServerlessEndpoint. + */ + private ModelSettings modelSettings; + + /* + * Provisioning state for the endpoint. + */ + private EndpointProvisioningState provisioningState; + + /** + * Creates an instance of ServerlessEndpointProperties class. + */ + public ServerlessEndpointProperties() { + } + + /** + * Get the authMode property: [Required] Specifies the authentication mode for the Serverless endpoint. + * + * @return the authMode value. + */ + public ServerlessInferenceEndpointAuthMode authMode() { + return this.authMode; + } + + /** + * Set the authMode property: [Required] Specifies the authentication mode for the Serverless endpoint. + * + * @param authMode the authMode value to set. + * @return the ServerlessEndpointProperties object itself. + */ + public ServerlessEndpointProperties withAuthMode(ServerlessInferenceEndpointAuthMode authMode) { + this.authMode = authMode; + return this; + } + + /** + * Get the contentSafety property: Specifies the content safety options. If omitted, the default content safety + * settings will be configured. + * + * @return the contentSafety value. + */ + public ContentSafety contentSafety() { + return this.contentSafety; + } + + /** + * Set the contentSafety property: Specifies the content safety options. If omitted, the default content safety + * settings will be configured. + * + * @param contentSafety the contentSafety value to set. + * @return the ServerlessEndpointProperties object itself. + */ + public ServerlessEndpointProperties withContentSafety(ContentSafety contentSafety) { + this.contentSafety = contentSafety; + return this; + } + + /** + * Get the endpointState property: The current state of the ServerlessEndpoint. + * + * @return the endpointState value. + */ + public ServerlessEndpointState endpointState() { + return this.endpointState; + } + + /** + * Get the inferenceEndpoint property: The inference uri to target when making requests against the serverless + * endpoint. + * + * @return the inferenceEndpoint value. + */ + public ServerlessInferenceEndpoint inferenceEndpoint() { + return this.inferenceEndpoint; + } + + /** + * Get the marketplaceSubscriptionId property: The MarketplaceSubscription Azure ID associated to this + * ServerlessEndpoint. + * + * @return the marketplaceSubscriptionId value. + */ + public String marketplaceSubscriptionId() { + return this.marketplaceSubscriptionId; + } + + /** + * Get the modelSettings property: The model settings (model id) for the model being serviced on the + * ServerlessEndpoint. + * + * @return the modelSettings value. + */ + public ModelSettings modelSettings() { + return this.modelSettings; + } + + /** + * Set the modelSettings property: The model settings (model id) for the model being serviced on the + * ServerlessEndpoint. + * + * @param modelSettings the modelSettings value to set. + * @return the ServerlessEndpointProperties object itself. + */ + public ServerlessEndpointProperties withModelSettings(ModelSettings modelSettings) { + this.modelSettings = modelSettings; + return this; + } + + /** + * Get the provisioningState property: Provisioning state for the endpoint. + * + * @return the provisioningState value. + */ + public EndpointProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (authMode() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property authMode in model ServerlessEndpointProperties")); + } + if (contentSafety() != null) { + contentSafety().validate(); + } + if (inferenceEndpoint() != null) { + inferenceEndpoint().validate(); + } + if (modelSettings() != null) { + modelSettings().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ServerlessEndpointProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("authMode", this.authMode == null ? null : this.authMode.toString()); + jsonWriter.writeJsonField("contentSafety", this.contentSafety); + jsonWriter.writeJsonField("modelSettings", this.modelSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServerlessEndpointProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServerlessEndpointProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ServerlessEndpointProperties. + */ + public static ServerlessEndpointProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServerlessEndpointProperties deserializedServerlessEndpointProperties = new ServerlessEndpointProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("authMode".equals(fieldName)) { + deserializedServerlessEndpointProperties.authMode + = ServerlessInferenceEndpointAuthMode.fromString(reader.getString()); + } else if ("contentSafety".equals(fieldName)) { + deserializedServerlessEndpointProperties.contentSafety = ContentSafety.fromJson(reader); + } else if ("endpointState".equals(fieldName)) { + deserializedServerlessEndpointProperties.endpointState + = ServerlessEndpointState.fromString(reader.getString()); + } else if ("inferenceEndpoint".equals(fieldName)) { + deserializedServerlessEndpointProperties.inferenceEndpoint + = ServerlessInferenceEndpoint.fromJson(reader); + } else if ("marketplaceSubscriptionId".equals(fieldName)) { + deserializedServerlessEndpointProperties.marketplaceSubscriptionId = reader.getString(); + } else if ("modelSettings".equals(fieldName)) { + deserializedServerlessEndpointProperties.modelSettings = ModelSettings.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedServerlessEndpointProperties.provisioningState + = EndpointProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedServerlessEndpointProperties; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServerlessEndpointState.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServerlessEndpointState.java new file mode 100644 index 0000000000000..a224cd14a6b85 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServerlessEndpointState.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * State of the Serverless Endpoint. + */ +public final class ServerlessEndpointState extends ExpandableStringEnum { + /** + * Static value Unknown for ServerlessEndpointState. + */ + public static final ServerlessEndpointState UNKNOWN = fromString("Unknown"); + + /** + * Static value Creating for ServerlessEndpointState. + */ + public static final ServerlessEndpointState CREATING = fromString("Creating"); + + /** + * Static value Deleting for ServerlessEndpointState. + */ + public static final ServerlessEndpointState DELETING = fromString("Deleting"); + + /** + * Static value Suspending for ServerlessEndpointState. + */ + public static final ServerlessEndpointState SUSPENDING = fromString("Suspending"); + + /** + * Static value Reinstating for ServerlessEndpointState. + */ + public static final ServerlessEndpointState REINSTATING = fromString("Reinstating"); + + /** + * Static value Online for ServerlessEndpointState. + */ + public static final ServerlessEndpointState ONLINE = fromString("Online"); + + /** + * Static value Suspended for ServerlessEndpointState. + */ + public static final ServerlessEndpointState SUSPENDED = fromString("Suspended"); + + /** + * Static value CreationFailed for ServerlessEndpointState. + */ + public static final ServerlessEndpointState CREATION_FAILED = fromString("CreationFailed"); + + /** + * Static value DeletionFailed for ServerlessEndpointState. + */ + public static final ServerlessEndpointState DELETION_FAILED = fromString("DeletionFailed"); + + /** + * Creates a new instance of ServerlessEndpointState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ServerlessEndpointState() { + } + + /** + * Creates or finds a ServerlessEndpointState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ServerlessEndpointState. + */ + public static ServerlessEndpointState fromString(String name) { + return fromString(name, ServerlessEndpointState.class); + } + + /** + * Gets known ServerlessEndpointState values. + * + * @return known ServerlessEndpointState values. + */ + public static Collection values() { + return values(ServerlessEndpointState.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServerlessEndpointTrackedResourceArmPaginatedResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServerlessEndpointTrackedResourceArmPaginatedResult.java new file mode 100644 index 0000000000000..26f12015a9d2d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServerlessEndpointTrackedResourceArmPaginatedResult.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.machinelearning.fluent.models.ServerlessEndpointInner; +import java.io.IOException; +import java.util.List; + +/** + * A paginated list of ServerlessEndpoint entities. + */ +@Fluent +public final class ServerlessEndpointTrackedResourceArmPaginatedResult + implements JsonSerializable { + /* + * The link to the next page of ServerlessEndpoint objects. If null, there are no additional pages. + */ + private String nextLink; + + /* + * An array of objects of type ServerlessEndpoint. + */ + private List value; + + /** + * Creates an instance of ServerlessEndpointTrackedResourceArmPaginatedResult class. + */ + public ServerlessEndpointTrackedResourceArmPaginatedResult() { + } + + /** + * Get the nextLink property: The link to the next page of ServerlessEndpoint objects. If null, there are no + * additional pages. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of ServerlessEndpoint objects. If null, there are no + * additional pages. + * + * @param nextLink the nextLink value to set. + * @return the ServerlessEndpointTrackedResourceArmPaginatedResult object itself. + */ + public ServerlessEndpointTrackedResourceArmPaginatedResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: An array of objects of type ServerlessEndpoint. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of objects of type ServerlessEndpoint. + * + * @param value the value value to set. + * @return the ServerlessEndpointTrackedResourceArmPaginatedResult object itself. + */ + public ServerlessEndpointTrackedResourceArmPaginatedResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServerlessEndpointTrackedResourceArmPaginatedResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServerlessEndpointTrackedResourceArmPaginatedResult if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServerlessEndpointTrackedResourceArmPaginatedResult. + */ + public static ServerlessEndpointTrackedResourceArmPaginatedResult fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ServerlessEndpointTrackedResourceArmPaginatedResult deserializedServerlessEndpointTrackedResourceArmPaginatedResult + = new ServerlessEndpointTrackedResourceArmPaginatedResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedServerlessEndpointTrackedResourceArmPaginatedResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ServerlessEndpointInner.fromJson(reader1)); + deserializedServerlessEndpointTrackedResourceArmPaginatedResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedServerlessEndpointTrackedResourceArmPaginatedResult; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServerlessEndpoints.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServerlessEndpoints.java new file mode 100644 index 0000000000000..66664125c7bb4 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServerlessEndpoints.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ServerlessEndpoints. + */ +public interface ServerlessEndpoints { + /** + * List Serverless Endpoints. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ServerlessEndpoint entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * List Serverless Endpoints. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param skip Continuation token for pagination. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of ServerlessEndpoint entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String skip, + Context context); + + /** + * Delete Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String name); + + /** + * Delete Serverless Endpoint (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String name, Context context); + + /** + * Get Serverless Endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return serverless Endpoint along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, String name, + Context context); + + /** + * Get Serverless Endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return serverless Endpoint. + */ + ServerlessEndpoint get(String resourceGroupName, String workspaceName, String name); + + /** + * List EndpointAuthKeys for an Endpoint using Key-based authentication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return keys for endpoint authentication along with {@link Response}. + */ + Response listKeysWithResponse(String resourceGroupName, String workspaceName, String name, + Context context); + + /** + * List EndpointAuthKeys for an Endpoint using Key-based authentication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return keys for endpoint authentication. + */ + EndpointAuthKeys listKeys(String resourceGroupName, String workspaceName, String name); + + /** + * Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body RegenerateKeys request . + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return keys for endpoint authentication. + */ + EndpointAuthKeys regenerateKeys(String resourceGroupName, String workspaceName, String name, + RegenerateEndpointKeysRequest body); + + /** + * Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param name Serverless Endpoint name. + * @param body RegenerateKeys request . + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return keys for endpoint authentication. + */ + EndpointAuthKeys regenerateKeys(String resourceGroupName, String workspaceName, String name, + RegenerateEndpointKeysRequest body, Context context); + + /** + * Get Serverless Endpoint. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return serverless Endpoint along with {@link Response}. + */ + ServerlessEndpoint getById(String id); + + /** + * Get Serverless Endpoint. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return serverless Endpoint along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete Serverless Endpoint (asynchronous). + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete Serverless Endpoint (asynchronous). + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ServerlessEndpoint resource. + * + * @param name resource name. + * @return the first stage of the new ServerlessEndpoint definition. + */ + ServerlessEndpoint.DefinitionStages.Blank define(String name); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServerlessInferenceEndpoint.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServerlessInferenceEndpoint.java new file mode 100644 index 0000000000000..880b623cb51d5 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServerlessInferenceEndpoint.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The ServerlessInferenceEndpoint model. + */ +@Fluent +public final class ServerlessInferenceEndpoint implements JsonSerializable { + /* + * Specifies any required headers to target this serverless endpoint. + */ + private Map headers; + + /* + * [Required] The inference uri to target when making requests against the Serverless Endpoint. + */ + private String uri; + + /** + * Creates an instance of ServerlessInferenceEndpoint class. + */ + public ServerlessInferenceEndpoint() { + } + + /** + * Get the headers property: Specifies any required headers to target this serverless endpoint. + * + * @return the headers value. + */ + public Map headers() { + return this.headers; + } + + /** + * Get the uri property: [Required] The inference uri to target when making requests against the Serverless + * Endpoint. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri property: [Required] The inference uri to target when making requests against the Serverless + * Endpoint. + * + * @param uri the uri value to set. + * @return the ServerlessInferenceEndpoint object itself. + */ + public ServerlessInferenceEndpoint withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (uri() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property uri in model ServerlessInferenceEndpoint")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ServerlessInferenceEndpoint.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("uri", this.uri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServerlessInferenceEndpoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServerlessInferenceEndpoint if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ServerlessInferenceEndpoint. + */ + public static ServerlessInferenceEndpoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServerlessInferenceEndpoint deserializedServerlessInferenceEndpoint = new ServerlessInferenceEndpoint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("uri".equals(fieldName)) { + deserializedServerlessInferenceEndpoint.uri = reader.getString(); + } else if ("headers".equals(fieldName)) { + Map headers = reader.readMap(reader1 -> reader1.getString()); + deserializedServerlessInferenceEndpoint.headers = headers; + } else { + reader.skipChildren(); + } + } + + return deserializedServerlessInferenceEndpoint; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServerlessInferenceEndpointAuthMode.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServerlessInferenceEndpointAuthMode.java new file mode 100644 index 0000000000000..7dcd97bc44f81 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServerlessInferenceEndpointAuthMode.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for ServerlessInferenceEndpointAuthMode. + */ +public final class ServerlessInferenceEndpointAuthMode + extends ExpandableStringEnum { + /** + * Static value Key for ServerlessInferenceEndpointAuthMode. + */ + public static final ServerlessInferenceEndpointAuthMode KEY = fromString("Key"); + + /** + * Creates a new instance of ServerlessInferenceEndpointAuthMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ServerlessInferenceEndpointAuthMode() { + } + + /** + * Creates or finds a ServerlessInferenceEndpointAuthMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ServerlessInferenceEndpointAuthMode. + */ + public static ServerlessInferenceEndpointAuthMode fromString(String name) { + return fromString(name, ServerlessInferenceEndpointAuthMode.class); + } + + /** + * Gets known ServerlessInferenceEndpointAuthMode values. + * + * @return known ServerlessInferenceEndpointAuthMode values. + */ + public static Collection values() { + return values(ServerlessInferenceEndpointAuthMode.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServiceDataAccessAuthIdentity.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServiceDataAccessAuthIdentity.java index b8a1ef1975a74..47ba7fbd2cc75 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServiceDataAccessAuthIdentity.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServiceDataAccessAuthIdentity.java @@ -5,25 +5,32 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ServiceDataAccessAuthIdentity. */ +/** + * Defines values for ServiceDataAccessAuthIdentity. + */ public final class ServiceDataAccessAuthIdentity extends ExpandableStringEnum { - /** Static value None for ServiceDataAccessAuthIdentity. */ + /** + * Static value None for ServiceDataAccessAuthIdentity. + */ public static final ServiceDataAccessAuthIdentity NONE = fromString("None"); - /** Static value WorkspaceSystemAssignedIdentity for ServiceDataAccessAuthIdentity. */ - public static final ServiceDataAccessAuthIdentity WORKSPACE_SYSTEM_ASSIGNED_IDENTITY = - fromString("WorkspaceSystemAssignedIdentity"); + /** + * Static value WorkspaceSystemAssignedIdentity for ServiceDataAccessAuthIdentity. + */ + public static final ServiceDataAccessAuthIdentity WORKSPACE_SYSTEM_ASSIGNED_IDENTITY + = fromString("WorkspaceSystemAssignedIdentity"); - /** Static value WorkspaceUserAssignedIdentity for ServiceDataAccessAuthIdentity. */ - public static final ServiceDataAccessAuthIdentity WORKSPACE_USER_ASSIGNED_IDENTITY = - fromString("WorkspaceUserAssignedIdentity"); + /** + * Static value WorkspaceUserAssignedIdentity for ServiceDataAccessAuthIdentity. + */ + public static final ServiceDataAccessAuthIdentity WORKSPACE_USER_ASSIGNED_IDENTITY + = fromString("WorkspaceUserAssignedIdentity"); /** * Creates a new instance of ServiceDataAccessAuthIdentity value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -32,18 +39,17 @@ public ServiceDataAccessAuthIdentity() { /** * Creates or finds a ServiceDataAccessAuthIdentity from its string representation. - * + * * @param name a name to look for. * @return the corresponding ServiceDataAccessAuthIdentity. */ - @JsonCreator public static ServiceDataAccessAuthIdentity fromString(String name) { return fromString(name, ServiceDataAccessAuthIdentity.class); } /** * Gets known ServiceDataAccessAuthIdentity values. - * + * * @return known ServiceDataAccessAuthIdentity values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServiceManagedResourcesSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServiceManagedResourcesSettings.java index aceabf00a371f..3d0853b9b566f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServiceManagedResourcesSettings.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServiceManagedResourcesSettings.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The ServiceManagedResourcesSettings model. */ +/** + * The ServiceManagedResourcesSettings model. + */ @Fluent -public final class ServiceManagedResourcesSettings { +public final class ServiceManagedResourcesSettings implements JsonSerializable { /* * The settings for the service managed cosmosdb account. */ - @JsonProperty(value = "cosmosDb") private CosmosDbSettings cosmosDb; - /** Creates an instance of ServiceManagedResourcesSettings class. */ + /** + * Creates an instance of ServiceManagedResourcesSettings class. + */ public ServiceManagedResourcesSettings() { } /** * Get the cosmosDb property: The settings for the service managed cosmosdb account. - * + * * @return the cosmosDb value. */ public CosmosDbSettings cosmosDb() { @@ -31,7 +38,7 @@ public CosmosDbSettings cosmosDb() { /** * Set the cosmosDb property: The settings for the service managed cosmosdb account. - * + * * @param cosmosDb the cosmosDb value to set. * @return the ServiceManagedResourcesSettings object itself. */ @@ -42,7 +49,7 @@ public ServiceManagedResourcesSettings withCosmosDb(CosmosDbSettings cosmosDb) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -50,4 +57,41 @@ public void validate() { cosmosDb().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("cosmosDb", this.cosmosDb); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceManagedResourcesSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceManagedResourcesSettings if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServiceManagedResourcesSettings. + */ + public static ServiceManagedResourcesSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceManagedResourcesSettings deserializedServiceManagedResourcesSettings + = new ServiceManagedResourcesSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cosmosDb".equals(fieldName)) { + deserializedServiceManagedResourcesSettings.cosmosDb = CosmosDbSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceManagedResourcesSettings; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServicePrincipalAuthTypeWorkspaceConnectionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServicePrincipalAuthTypeWorkspaceConnectionProperties.java new file mode 100644 index 0000000000000..651ca1082d692 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServicePrincipalAuthTypeWorkspaceConnectionProperties.java @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; + +/** + * The ServicePrincipalAuthTypeWorkspaceConnectionProperties model. + */ +@Fluent +public final class ServicePrincipalAuthTypeWorkspaceConnectionProperties extends WorkspaceConnectionPropertiesV2 { + /* + * Authentication type of the connection target + */ + private ConnectionAuthType authType = ConnectionAuthType.SERVICE_PRINCIPAL; + + /* + * The credentials property. + */ + private WorkspaceConnectionServicePrincipal credentials; + + /* + * The createdByWorkspaceArmId property. + */ + private String createdByWorkspaceArmId; + + /* + * Group based on connection category + */ + private ConnectionGroup group; + + /** + * Creates an instance of ServicePrincipalAuthTypeWorkspaceConnectionProperties class. + */ + public ServicePrincipalAuthTypeWorkspaceConnectionProperties() { + } + + /** + * Get the authType property: Authentication type of the connection target. + * + * @return the authType value. + */ + @Override + public ConnectionAuthType authType() { + return this.authType; + } + + /** + * Get the credentials property: The credentials property. + * + * @return the credentials value. + */ + public WorkspaceConnectionServicePrincipal credentials() { + return this.credentials; + } + + /** + * Set the credentials property: The credentials property. + * + * @param credentials the credentials value to set. + * @return the ServicePrincipalAuthTypeWorkspaceConnectionProperties object itself. + */ + public ServicePrincipalAuthTypeWorkspaceConnectionProperties + withCredentials(WorkspaceConnectionServicePrincipal credentials) { + this.credentials = credentials; + return this; + } + + /** + * Get the createdByWorkspaceArmId property: The createdByWorkspaceArmId property. + * + * @return the createdByWorkspaceArmId value. + */ + @Override + public String createdByWorkspaceArmId() { + return this.createdByWorkspaceArmId; + } + + /** + * Get the group property: Group based on connection category. + * + * @return the group value. + */ + @Override + public ConnectionGroup group() { + return this.group; + } + + /** + * {@inheritDoc} + */ + @Override + public ServicePrincipalAuthTypeWorkspaceConnectionProperties withCategory(ConnectionCategory category) { + super.withCategory(category); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ServicePrincipalAuthTypeWorkspaceConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { + super.withExpiryTime(expiryTime); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ServicePrincipalAuthTypeWorkspaceConnectionProperties withIsSharedToAll(Boolean isSharedToAll) { + super.withIsSharedToAll(isSharedToAll); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ServicePrincipalAuthTypeWorkspaceConnectionProperties withTarget(String target) { + super.withTarget(target); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ServicePrincipalAuthTypeWorkspaceConnectionProperties withMetadata(Map metadata) { + super.withMetadata(metadata); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ServicePrincipalAuthTypeWorkspaceConnectionProperties withSharedUserList(List sharedUserList) { + super.withSharedUserList(sharedUserList); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ServicePrincipalAuthTypeWorkspaceConnectionProperties withValue(String value) { + super.withValue(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ServicePrincipalAuthTypeWorkspaceConnectionProperties withValueFormat(ValueFormat valueFormat) { + super.withValueFormat(valueFormat); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (credentials() != null) { + credentials().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", category() == null ? null : category().toString()); + jsonWriter.writeStringField("expiryTime", + expiryTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expiryTime())); + jsonWriter.writeBooleanField("isSharedToAll", isSharedToAll()); + jsonWriter.writeStringField("target", target()); + jsonWriter.writeMapField("metadata", metadata(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("sharedUserList", sharedUserList(), + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("value", value()); + jsonWriter.writeStringField("valueFormat", valueFormat() == null ? null : valueFormat().toString()); + jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); + jsonWriter.writeJsonField("credentials", this.credentials); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServicePrincipalAuthTypeWorkspaceConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServicePrincipalAuthTypeWorkspaceConnectionProperties if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServicePrincipalAuthTypeWorkspaceConnectionProperties. + */ + public static ServicePrincipalAuthTypeWorkspaceConnectionProperties fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ServicePrincipalAuthTypeWorkspaceConnectionProperties deserializedServicePrincipalAuthTypeWorkspaceConnectionProperties + = new ServicePrincipalAuthTypeWorkspaceConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedServicePrincipalAuthTypeWorkspaceConnectionProperties + .withCategory(ConnectionCategory.fromString(reader.getString())); + } else if ("createdByWorkspaceArmId".equals(fieldName)) { + deserializedServicePrincipalAuthTypeWorkspaceConnectionProperties.createdByWorkspaceArmId + = reader.getString(); + } else if ("expiryTime".equals(fieldName)) { + deserializedServicePrincipalAuthTypeWorkspaceConnectionProperties.withExpiryTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("group".equals(fieldName)) { + deserializedServicePrincipalAuthTypeWorkspaceConnectionProperties.group + = ConnectionGroup.fromString(reader.getString()); + } else if ("isSharedToAll".equals(fieldName)) { + deserializedServicePrincipalAuthTypeWorkspaceConnectionProperties + .withIsSharedToAll(reader.getNullable(JsonReader::getBoolean)); + } else if ("target".equals(fieldName)) { + deserializedServicePrincipalAuthTypeWorkspaceConnectionProperties.withTarget(reader.getString()); + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedServicePrincipalAuthTypeWorkspaceConnectionProperties.withMetadata(metadata); + } else if ("sharedUserList".equals(fieldName)) { + List sharedUserList = reader.readArray(reader1 -> reader1.getString()); + deserializedServicePrincipalAuthTypeWorkspaceConnectionProperties + .withSharedUserList(sharedUserList); + } else if ("value".equals(fieldName)) { + deserializedServicePrincipalAuthTypeWorkspaceConnectionProperties.withValue(reader.getString()); + } else if ("valueFormat".equals(fieldName)) { + deserializedServicePrincipalAuthTypeWorkspaceConnectionProperties + .withValueFormat(ValueFormat.fromString(reader.getString())); + } else if ("authType".equals(fieldName)) { + deserializedServicePrincipalAuthTypeWorkspaceConnectionProperties.authType + = ConnectionAuthType.fromString(reader.getString()); + } else if ("credentials".equals(fieldName)) { + deserializedServicePrincipalAuthTypeWorkspaceConnectionProperties.credentials + = WorkspaceConnectionServicePrincipal.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedServicePrincipalAuthTypeWorkspaceConnectionProperties; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServicePrincipalDatastoreCredentials.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServicePrincipalDatastoreCredentials.java index f8898ec7e7449..8417767396663 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServicePrincipalDatastoreCredentials.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServicePrincipalDatastoreCredentials.java @@ -6,53 +6,67 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Objects; import java.util.UUID; -/** Service Principal datastore credentials configuration. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "credentialsType") -@JsonTypeName("ServicePrincipal") +/** + * Service Principal datastore credentials configuration. + */ @Fluent public final class ServicePrincipalDatastoreCredentials extends DatastoreCredentials { + /* + * [Required] Credential type used to authentication with storage. + */ + private CredentialsType credentialsType = CredentialsType.SERVICE_PRINCIPAL; + /* * Authority URL used for authentication. */ - @JsonProperty(value = "authorityUrl") private String authorityUrl; /* * [Required] Service principal client ID. */ - @JsonProperty(value = "clientId", required = true) private UUID clientId; /* * Resource the service principal has access to. */ - @JsonProperty(value = "resourceUrl") private String resourceUrl; /* * [Required] Service principal secrets. */ - @JsonProperty(value = "secrets", required = true) private ServicePrincipalDatastoreSecrets secrets; /* * [Required] ID of the tenant to which the service principal belongs. */ - @JsonProperty(value = "tenantId", required = true) private UUID tenantId; - /** Creates an instance of ServicePrincipalDatastoreCredentials class. */ + /** + * Creates an instance of ServicePrincipalDatastoreCredentials class. + */ public ServicePrincipalDatastoreCredentials() { } + /** + * Get the credentialsType property: [Required] Credential type used to authentication with storage. + * + * @return the credentialsType value. + */ + @Override + public CredentialsType credentialsType() { + return this.credentialsType; + } + /** * Get the authorityUrl property: Authority URL used for authentication. - * + * * @return the authorityUrl value. */ public String authorityUrl() { @@ -61,7 +75,7 @@ public String authorityUrl() { /** * Set the authorityUrl property: Authority URL used for authentication. - * + * * @param authorityUrl the authorityUrl value to set. * @return the ServicePrincipalDatastoreCredentials object itself. */ @@ -72,7 +86,7 @@ public ServicePrincipalDatastoreCredentials withAuthorityUrl(String authorityUrl /** * Get the clientId property: [Required] Service principal client ID. - * + * * @return the clientId value. */ public UUID clientId() { @@ -81,7 +95,7 @@ public UUID clientId() { /** * Set the clientId property: [Required] Service principal client ID. - * + * * @param clientId the clientId value to set. * @return the ServicePrincipalDatastoreCredentials object itself. */ @@ -92,7 +106,7 @@ public ServicePrincipalDatastoreCredentials withClientId(UUID clientId) { /** * Get the resourceUrl property: Resource the service principal has access to. - * + * * @return the resourceUrl value. */ public String resourceUrl() { @@ -101,7 +115,7 @@ public String resourceUrl() { /** * Set the resourceUrl property: Resource the service principal has access to. - * + * * @param resourceUrl the resourceUrl value to set. * @return the ServicePrincipalDatastoreCredentials object itself. */ @@ -112,7 +126,7 @@ public ServicePrincipalDatastoreCredentials withResourceUrl(String resourceUrl) /** * Get the secrets property: [Required] Service principal secrets. - * + * * @return the secrets value. */ public ServicePrincipalDatastoreSecrets secrets() { @@ -121,7 +135,7 @@ public ServicePrincipalDatastoreSecrets secrets() { /** * Set the secrets property: [Required] Service principal secrets. - * + * * @param secrets the secrets value to set. * @return the ServicePrincipalDatastoreCredentials object itself. */ @@ -132,7 +146,7 @@ public ServicePrincipalDatastoreCredentials withSecrets(ServicePrincipalDatastor /** * Get the tenantId property: [Required] ID of the tenant to which the service principal belongs. - * + * * @return the tenantId value. */ public UUID tenantId() { @@ -141,7 +155,7 @@ public UUID tenantId() { /** * Set the tenantId property: [Required] ID of the tenant to which the service principal belongs. - * + * * @param tenantId the tenantId value to set. * @return the ServicePrincipalDatastoreCredentials object itself. */ @@ -152,33 +166,88 @@ public ServicePrincipalDatastoreCredentials withTenantId(UUID tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (clientId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property clientId in model ServicePrincipalDatastoreCredentials")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property clientId in model ServicePrincipalDatastoreCredentials")); } if (secrets() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property secrets in model ServicePrincipalDatastoreCredentials")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property secrets in model ServicePrincipalDatastoreCredentials")); } else { secrets().validate(); } if (tenantId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property tenantId in model ServicePrincipalDatastoreCredentials")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property tenantId in model ServicePrincipalDatastoreCredentials")); } } private static final ClientLogger LOGGER = new ClientLogger(ServicePrincipalDatastoreCredentials.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("clientId", Objects.toString(this.clientId, null)); + jsonWriter.writeJsonField("secrets", this.secrets); + jsonWriter.writeStringField("tenantId", Objects.toString(this.tenantId, null)); + jsonWriter.writeStringField("credentialsType", + this.credentialsType == null ? null : this.credentialsType.toString()); + jsonWriter.writeStringField("authorityUrl", this.authorityUrl); + jsonWriter.writeStringField("resourceUrl", this.resourceUrl); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServicePrincipalDatastoreCredentials from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServicePrincipalDatastoreCredentials if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ServicePrincipalDatastoreCredentials. + */ + public static ServicePrincipalDatastoreCredentials fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServicePrincipalDatastoreCredentials deserializedServicePrincipalDatastoreCredentials + = new ServicePrincipalDatastoreCredentials(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clientId".equals(fieldName)) { + deserializedServicePrincipalDatastoreCredentials.clientId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("secrets".equals(fieldName)) { + deserializedServicePrincipalDatastoreCredentials.secrets + = ServicePrincipalDatastoreSecrets.fromJson(reader); + } else if ("tenantId".equals(fieldName)) { + deserializedServicePrincipalDatastoreCredentials.tenantId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("credentialsType".equals(fieldName)) { + deserializedServicePrincipalDatastoreCredentials.credentialsType + = CredentialsType.fromString(reader.getString()); + } else if ("authorityUrl".equals(fieldName)) { + deserializedServicePrincipalDatastoreCredentials.authorityUrl = reader.getString(); + } else if ("resourceUrl".equals(fieldName)) { + deserializedServicePrincipalDatastoreCredentials.resourceUrl = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedServicePrincipalDatastoreCredentials; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServicePrincipalDatastoreSecrets.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServicePrincipalDatastoreSecrets.java index 8b4dcd3f879ab..98cbcf7f186db 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServicePrincipalDatastoreSecrets.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServicePrincipalDatastoreSecrets.java @@ -5,29 +5,46 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.fluent.models.DatastoreSecretsInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.IOException; -/** Datastore Service Principal secrets. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "secretsType") -@JsonTypeName("ServicePrincipal") +/** + * Datastore Service Principal secrets. + */ @Fluent public final class ServicePrincipalDatastoreSecrets extends DatastoreSecretsInner { + /* + * [Required] Credential type used to authentication with storage. + */ + private SecretsType secretsType = SecretsType.SERVICE_PRINCIPAL; + /* * Service principal secret. */ - @JsonProperty(value = "clientSecret") private String clientSecret; - /** Creates an instance of ServicePrincipalDatastoreSecrets class. */ + /** + * Creates an instance of ServicePrincipalDatastoreSecrets class. + */ public ServicePrincipalDatastoreSecrets() { } + /** + * Get the secretsType property: [Required] Credential type used to authentication with storage. + * + * @return the secretsType value. + */ + @Override + public SecretsType secretsType() { + return this.secretsType; + } + /** * Get the clientSecret property: Service principal secret. - * + * * @return the clientSecret value. */ public String clientSecret() { @@ -36,7 +53,7 @@ public String clientSecret() { /** * Set the clientSecret property: Service principal secret. - * + * * @param clientSecret the clientSecret value to set. * @return the ServicePrincipalDatastoreSecrets object itself. */ @@ -47,11 +64,52 @@ public ServicePrincipalDatastoreSecrets withClientSecret(String clientSecret) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("secretsType", this.secretsType == null ? null : this.secretsType.toString()); + jsonWriter.writeStringField("clientSecret", this.clientSecret); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServicePrincipalDatastoreSecrets from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServicePrincipalDatastoreSecrets if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServicePrincipalDatastoreSecrets. + */ + public static ServicePrincipalDatastoreSecrets fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServicePrincipalDatastoreSecrets deserializedServicePrincipalDatastoreSecrets + = new ServicePrincipalDatastoreSecrets(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("secretsType".equals(fieldName)) { + deserializedServicePrincipalDatastoreSecrets.secretsType + = SecretsType.fromString(reader.getString()); + } else if ("clientSecret".equals(fieldName)) { + deserializedServicePrincipalDatastoreSecrets.clientSecret = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedServicePrincipalDatastoreSecrets; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServiceTagDestination.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServiceTagDestination.java new file mode 100644 index 0000000000000..a574a3eb61d6e --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServiceTagDestination.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Service Tag destination for a Service Tag Outbound Rule for the managed network of a machine learning workspace. + */ +@Fluent +public final class ServiceTagDestination implements JsonSerializable { + /* + * The action enum for networking rule. + */ + private RuleAction action; + + /* + * Optional, if provided, the ServiceTag property will be ignored. + */ + private List addressPrefixes; + + /* + * The portRanges property. + */ + private String portRanges; + + /* + * The protocol property. + */ + private String protocol; + + /* + * The serviceTag property. + */ + private String serviceTag; + + /** + * Creates an instance of ServiceTagDestination class. + */ + public ServiceTagDestination() { + } + + /** + * Get the action property: The action enum for networking rule. + * + * @return the action value. + */ + public RuleAction action() { + return this.action; + } + + /** + * Set the action property: The action enum for networking rule. + * + * @param action the action value to set. + * @return the ServiceTagDestination object itself. + */ + public ServiceTagDestination withAction(RuleAction action) { + this.action = action; + return this; + } + + /** + * Get the addressPrefixes property: Optional, if provided, the ServiceTag property will be ignored. + * + * @return the addressPrefixes value. + */ + public List addressPrefixes() { + return this.addressPrefixes; + } + + /** + * Get the portRanges property: The portRanges property. + * + * @return the portRanges value. + */ + public String portRanges() { + return this.portRanges; + } + + /** + * Set the portRanges property: The portRanges property. + * + * @param portRanges the portRanges value to set. + * @return the ServiceTagDestination object itself. + */ + public ServiceTagDestination withPortRanges(String portRanges) { + this.portRanges = portRanges; + return this; + } + + /** + * Get the protocol property: The protocol property. + * + * @return the protocol value. + */ + public String protocol() { + return this.protocol; + } + + /** + * Set the protocol property: The protocol property. + * + * @param protocol the protocol value to set. + * @return the ServiceTagDestination object itself. + */ + public ServiceTagDestination withProtocol(String protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the serviceTag property: The serviceTag property. + * + * @return the serviceTag value. + */ + public String serviceTag() { + return this.serviceTag; + } + + /** + * Set the serviceTag property: The serviceTag property. + * + * @param serviceTag the serviceTag value to set. + * @return the ServiceTagDestination object itself. + */ + public ServiceTagDestination withServiceTag(String serviceTag) { + this.serviceTag = serviceTag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); + jsonWriter.writeStringField("portRanges", this.portRanges); + jsonWriter.writeStringField("protocol", this.protocol); + jsonWriter.writeStringField("serviceTag", this.serviceTag); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceTagDestination from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceTagDestination if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServiceTagDestination. + */ + public static ServiceTagDestination fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceTagDestination deserializedServiceTagDestination = new ServiceTagDestination(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("action".equals(fieldName)) { + deserializedServiceTagDestination.action = RuleAction.fromString(reader.getString()); + } else if ("addressPrefixes".equals(fieldName)) { + List addressPrefixes = reader.readArray(reader1 -> reader1.getString()); + deserializedServiceTagDestination.addressPrefixes = addressPrefixes; + } else if ("portRanges".equals(fieldName)) { + deserializedServiceTagDestination.portRanges = reader.getString(); + } else if ("protocol".equals(fieldName)) { + deserializedServiceTagDestination.protocol = reader.getString(); + } else if ("serviceTag".equals(fieldName)) { + deserializedServiceTagDestination.serviceTag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceTagDestination; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServiceTagOutboundRule.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServiceTagOutboundRule.java new file mode 100644 index 0000000000000..742b73db9dc8d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ServiceTagOutboundRule.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Service Tag Outbound Rule for the managed network of a machine learning workspace. + */ +@Fluent +public final class ServiceTagOutboundRule extends OutboundRule { + /* + * Type of a managed network Outbound Rule of a machine learning workspace. + */ + private RuleType type = RuleType.SERVICE_TAG; + + /* + * Service Tag destination for a Service Tag Outbound Rule for the managed network of a machine learning workspace. + */ + private ServiceTagDestination destination; + + /** + * Creates an instance of ServiceTagOutboundRule class. + */ + public ServiceTagOutboundRule() { + } + + /** + * Get the type property: Type of a managed network Outbound Rule of a machine learning workspace. + * + * @return the type value. + */ + @Override + public RuleType type() { + return this.type; + } + + /** + * Get the destination property: Service Tag destination for a Service Tag Outbound Rule for the managed network of + * a machine learning workspace. + * + * @return the destination value. + */ + public ServiceTagDestination destination() { + return this.destination; + } + + /** + * Set the destination property: Service Tag destination for a Service Tag Outbound Rule for the managed network of + * a machine learning workspace. + * + * @param destination the destination value to set. + * @return the ServiceTagOutboundRule object itself. + */ + public ServiceTagOutboundRule withDestination(ServiceTagDestination destination) { + this.destination = destination; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ServiceTagOutboundRule withCategory(RuleCategory category) { + super.withCategory(category); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ServiceTagOutboundRule withStatus(RuleStatus status) { + super.withStatus(status); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (destination() != null) { + destination().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", category() == null ? null : category().toString()); + jsonWriter.writeStringField("status", status() == null ? null : status().toString()); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeJsonField("destination", this.destination); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceTagOutboundRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceTagOutboundRule if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServiceTagOutboundRule. + */ + public static ServiceTagOutboundRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceTagOutboundRule deserializedServiceTagOutboundRule = new ServiceTagOutboundRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedServiceTagOutboundRule.withCategory(RuleCategory.fromString(reader.getString())); + } else if ("status".equals(fieldName)) { + deserializedServiceTagOutboundRule.withStatus(RuleStatus.fromString(reader.getString())); + } else if ("type".equals(fieldName)) { + deserializedServiceTagOutboundRule.type = RuleType.fromString(reader.getString()); + } else if ("destination".equals(fieldName)) { + deserializedServiceTagOutboundRule.destination = ServiceTagDestination.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceTagOutboundRule; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SetupScripts.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SetupScripts.java index 761f98594eea7..f4c6309c0d0e0 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SetupScripts.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SetupScripts.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Details of customized scripts to execute for setting up the cluster. */ +/** + * Details of customized scripts to execute for setting up the cluster. + */ @Fluent -public final class SetupScripts { +public final class SetupScripts implements JsonSerializable { /* * Customized setup scripts */ - @JsonProperty(value = "scripts") private ScriptsToExecute scripts; - /** Creates an instance of SetupScripts class. */ + /** + * Creates an instance of SetupScripts class. + */ public SetupScripts() { } /** * Get the scripts property: Customized setup scripts. - * + * * @return the scripts value. */ public ScriptsToExecute scripts() { @@ -31,7 +38,7 @@ public ScriptsToExecute scripts() { /** * Set the scripts property: Customized setup scripts. - * + * * @param scripts the scripts value to set. * @return the SetupScripts object itself. */ @@ -42,7 +49,7 @@ public SetupScripts withScripts(ScriptsToExecute scripts) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -50,4 +57,40 @@ public void validate() { scripts().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("scripts", this.scripts); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SetupScripts from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SetupScripts if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SetupScripts. + */ + public static SetupScripts fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SetupScripts deserializedSetupScripts = new SetupScripts(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("scripts".equals(fieldName)) { + deserializedSetupScripts.scripts = ScriptsToExecute.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSetupScripts; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SharedPrivateLinkResource.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SharedPrivateLinkResource.java index 46ec2f251384d..06fbc71b599a7 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SharedPrivateLinkResource.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SharedPrivateLinkResource.java @@ -5,31 +5,37 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.fluent.models.SharedPrivateLinkResourceProperty; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** The SharedPrivateLinkResource model. */ +/** + * The SharedPrivateLinkResource model. + */ @Fluent -public final class SharedPrivateLinkResource { +public final class SharedPrivateLinkResource implements JsonSerializable { /* * Unique name of the private link. */ - @JsonProperty(value = "name") private String name; /* * Resource properties. */ - @JsonProperty(value = "properties") private SharedPrivateLinkResourceProperty innerProperties; - /** Creates an instance of SharedPrivateLinkResource class. */ + /** + * Creates an instance of SharedPrivateLinkResource class. + */ public SharedPrivateLinkResource() { } /** * Get the name property: Unique name of the private link. - * + * * @return the name value. */ public String name() { @@ -38,7 +44,7 @@ public String name() { /** * Set the name property: Unique name of the private link. - * + * * @param name the name value to set. * @return the SharedPrivateLinkResource object itself. */ @@ -49,7 +55,7 @@ public SharedPrivateLinkResource withName(String name) { /** * Get the innerProperties property: Resource properties. - * + * * @return the innerProperties value. */ private SharedPrivateLinkResourceProperty innerProperties() { @@ -58,7 +64,7 @@ private SharedPrivateLinkResourceProperty innerProperties() { /** * Get the privateLinkResourceId property: The resource id that private link links to. - * + * * @return the privateLinkResourceId value. */ public String privateLinkResourceId() { @@ -67,7 +73,7 @@ public String privateLinkResourceId() { /** * Set the privateLinkResourceId property: The resource id that private link links to. - * + * * @param privateLinkResourceId the privateLinkResourceId value to set. * @return the SharedPrivateLinkResource object itself. */ @@ -81,7 +87,7 @@ public SharedPrivateLinkResource withPrivateLinkResourceId(String privateLinkRes /** * Get the groupId property: The private link resource group id. - * + * * @return the groupId value. */ public String groupId() { @@ -90,7 +96,7 @@ public String groupId() { /** * Set the groupId property: The private link resource group id. - * + * * @param groupId the groupId value to set. * @return the SharedPrivateLinkResource object itself. */ @@ -104,7 +110,7 @@ public SharedPrivateLinkResource withGroupId(String groupId) { /** * Get the requestMessage property: Request message. - * + * * @return the requestMessage value. */ public String requestMessage() { @@ -113,7 +119,7 @@ public String requestMessage() { /** * Set the requestMessage property: Request message. - * + * * @param requestMessage the requestMessage value to set. * @return the SharedPrivateLinkResource object itself. */ @@ -128,7 +134,7 @@ public SharedPrivateLinkResource withRequestMessage(String requestMessage) { /** * Get the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the * service. - * + * * @return the status value. */ public PrivateEndpointServiceConnectionStatus status() { @@ -138,7 +144,7 @@ public PrivateEndpointServiceConnectionStatus status() { /** * Set the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the * service. - * + * * @param status the status value to set. * @return the SharedPrivateLinkResource object itself. */ @@ -152,7 +158,7 @@ public SharedPrivateLinkResource withStatus(PrivateEndpointServiceConnectionStat /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -160,4 +166,44 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SharedPrivateLinkResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SharedPrivateLinkResource if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SharedPrivateLinkResource. + */ + public static SharedPrivateLinkResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SharedPrivateLinkResource deserializedSharedPrivateLinkResource = new SharedPrivateLinkResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSharedPrivateLinkResource.name = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedSharedPrivateLinkResource.innerProperties + = SharedPrivateLinkResourceProperty.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSharedPrivateLinkResource; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ShortSeriesHandlingConfiguration.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ShortSeriesHandlingConfiguration.java index 2ff1fd6f8e2ee..c0432d8030ada 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ShortSeriesHandlingConfiguration.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ShortSeriesHandlingConfiguration.java @@ -5,26 +5,35 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The parameter defining how if AutoML should handle short time series. */ +/** + * The parameter defining how if AutoML should handle short time series. + */ public final class ShortSeriesHandlingConfiguration extends ExpandableStringEnum { - /** Static value None for ShortSeriesHandlingConfiguration. */ + /** + * Static value None for ShortSeriesHandlingConfiguration. + */ public static final ShortSeriesHandlingConfiguration NONE = fromString("None"); - /** Static value Auto for ShortSeriesHandlingConfiguration. */ + /** + * Static value Auto for ShortSeriesHandlingConfiguration. + */ public static final ShortSeriesHandlingConfiguration AUTO = fromString("Auto"); - /** Static value Pad for ShortSeriesHandlingConfiguration. */ + /** + * Static value Pad for ShortSeriesHandlingConfiguration. + */ public static final ShortSeriesHandlingConfiguration PAD = fromString("Pad"); - /** Static value Drop for ShortSeriesHandlingConfiguration. */ + /** + * Static value Drop for ShortSeriesHandlingConfiguration. + */ public static final ShortSeriesHandlingConfiguration DROP = fromString("Drop"); /** * Creates a new instance of ShortSeriesHandlingConfiguration value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,18 +42,17 @@ public ShortSeriesHandlingConfiguration() { /** * Creates or finds a ShortSeriesHandlingConfiguration from its string representation. - * + * * @param name a name to look for. * @return the corresponding ShortSeriesHandlingConfiguration. */ - @JsonCreator public static ShortSeriesHandlingConfiguration fromString(String name) { return fromString(name, ShortSeriesHandlingConfiguration.class); } /** * Gets known ShortSeriesHandlingConfiguration values. - * + * * @return known ShortSeriesHandlingConfiguration values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Sku.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Sku.java index 81a4a2701f804..43243f6100f79 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Sku.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Sku.java @@ -6,51 +6,54 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The resource model definition representing SKU. */ +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The resource model definition representing SKU. + */ @Fluent -public final class Sku { +public final class Sku implements JsonSerializable { /* * The name of the SKU. Ex - P3. It is typically a letter+number code */ - @JsonProperty(value = "name", required = true) private String name; /* * This field is required to be implemented by the Resource Provider if the service has more than one tier, but is * not required on a PUT. */ - @JsonProperty(value = "tier") private SkuTier tier; /* * The SKU size. When the name field is the combination of tier and some other value, this would be the standalone * code. */ - @JsonProperty(value = "size") private String size; /* * If the service has different generations of hardware, for the same SKU, then that can be captured here. */ - @JsonProperty(value = "family") private String family; /* * If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible * for the resource this may be omitted. */ - @JsonProperty(value = "capacity") private Integer capacity; - /** Creates an instance of Sku class. */ + /** + * Creates an instance of Sku class. + */ public Sku() { } /** * Get the name property: The name of the SKU. Ex - P3. It is typically a letter+number code. - * + * * @return the name value. */ public String name() { @@ -59,7 +62,7 @@ public String name() { /** * Set the name property: The name of the SKU. Ex - P3. It is typically a letter+number code. - * + * * @param name the name value to set. * @return the Sku object itself. */ @@ -71,7 +74,7 @@ public Sku withName(String name) { /** * Get the tier property: This field is required to be implemented by the Resource Provider if the service has more * than one tier, but is not required on a PUT. - * + * * @return the tier value. */ public SkuTier tier() { @@ -81,7 +84,7 @@ public SkuTier tier() { /** * Set the tier property: This field is required to be implemented by the Resource Provider if the service has more * than one tier, but is not required on a PUT. - * + * * @param tier the tier value to set. * @return the Sku object itself. */ @@ -93,7 +96,7 @@ public Sku withTier(SkuTier tier) { /** * Get the size property: The SKU size. When the name field is the combination of tier and some other value, this * would be the standalone code. - * + * * @return the size value. */ public String size() { @@ -103,7 +106,7 @@ public String size() { /** * Set the size property: The SKU size. When the name field is the combination of tier and some other value, this * would be the standalone code. - * + * * @param size the size value to set. * @return the Sku object itself. */ @@ -115,7 +118,7 @@ public Sku withSize(String size) { /** * Get the family property: If the service has different generations of hardware, for the same SKU, then that can be * captured here. - * + * * @return the family value. */ public String family() { @@ -125,7 +128,7 @@ public String family() { /** * Set the family property: If the service has different generations of hardware, for the same SKU, then that can be * captured here. - * + * * @param family the family value to set. * @return the Sku object itself. */ @@ -137,7 +140,7 @@ public Sku withFamily(String family) { /** * Get the capacity property: If the SKU supports scale out/in then the capacity integer should be included. If * scale out/in is not possible for the resource this may be omitted. - * + * * @return the capacity value. */ public Integer capacity() { @@ -147,7 +150,7 @@ public Integer capacity() { /** * Set the capacity property: If the SKU supports scale out/in then the capacity integer should be included. If * scale out/in is not possible for the resource this may be omitted. - * + * * @param capacity the capacity value to set. * @return the Sku object itself. */ @@ -158,15 +161,63 @@ public Sku withCapacity(Integer capacity) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (name() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Sku")); + throw LOGGER.atError().log(new IllegalArgumentException("Missing required property name in model Sku")); } } private static final ClientLogger LOGGER = new ClientLogger(Sku.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("tier", this.tier == null ? null : this.tier.toString()); + jsonWriter.writeStringField("size", this.size); + jsonWriter.writeStringField("family", this.family); + jsonWriter.writeNumberField("capacity", this.capacity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Sku from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Sku if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Sku. + */ + public static Sku fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Sku deserializedSku = new Sku(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSku.name = reader.getString(); + } else if ("tier".equals(fieldName)) { + deserializedSku.tier = SkuTier.fromString(reader.getString()); + } else if ("size".equals(fieldName)) { + deserializedSku.size = reader.getString(); + } else if ("family".equals(fieldName)) { + deserializedSku.family = reader.getString(); + } else if ("capacity".equals(fieldName)) { + deserializedSku.capacity = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedSku; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SkuCapacity.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SkuCapacity.java index 4948ce477871c..cf50ad11c62d9 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SkuCapacity.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SkuCapacity.java @@ -5,42 +5,46 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** SKU capacity information. */ +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * SKU capacity information. + */ @Fluent -public final class SkuCapacity { +public final class SkuCapacity implements JsonSerializable { /* * Gets or sets the default capacity. */ - @JsonProperty(value = "default") private Integer defaultProperty; /* * Gets or sets the maximum. */ - @JsonProperty(value = "maximum") private Integer maximum; /* * Gets or sets the minimum. */ - @JsonProperty(value = "minimum") private Integer minimum; /* * Gets or sets the type of the scale. */ - @JsonProperty(value = "scaleType") private SkuScaleType scaleType; - /** Creates an instance of SkuCapacity class. */ + /** + * Creates an instance of SkuCapacity class. + */ public SkuCapacity() { } /** * Get the defaultProperty property: Gets or sets the default capacity. - * + * * @return the defaultProperty value. */ public Integer defaultProperty() { @@ -49,7 +53,7 @@ public Integer defaultProperty() { /** * Set the defaultProperty property: Gets or sets the default capacity. - * + * * @param defaultProperty the defaultProperty value to set. * @return the SkuCapacity object itself. */ @@ -60,7 +64,7 @@ public SkuCapacity withDefaultProperty(Integer defaultProperty) { /** * Get the maximum property: Gets or sets the maximum. - * + * * @return the maximum value. */ public Integer maximum() { @@ -69,7 +73,7 @@ public Integer maximum() { /** * Set the maximum property: Gets or sets the maximum. - * + * * @param maximum the maximum value to set. * @return the SkuCapacity object itself. */ @@ -80,7 +84,7 @@ public SkuCapacity withMaximum(Integer maximum) { /** * Get the minimum property: Gets or sets the minimum. - * + * * @return the minimum value. */ public Integer minimum() { @@ -89,7 +93,7 @@ public Integer minimum() { /** * Set the minimum property: Gets or sets the minimum. - * + * * @param minimum the minimum value to set. * @return the SkuCapacity object itself. */ @@ -100,7 +104,7 @@ public SkuCapacity withMinimum(Integer minimum) { /** * Get the scaleType property: Gets or sets the type of the scale. - * + * * @return the scaleType value. */ public SkuScaleType scaleType() { @@ -109,7 +113,7 @@ public SkuScaleType scaleType() { /** * Set the scaleType property: Gets or sets the type of the scale. - * + * * @param scaleType the scaleType value to set. * @return the SkuCapacity object itself. */ @@ -120,9 +124,54 @@ public SkuCapacity withScaleType(SkuScaleType scaleType) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("default", this.defaultProperty); + jsonWriter.writeNumberField("maximum", this.maximum); + jsonWriter.writeNumberField("minimum", this.minimum); + jsonWriter.writeStringField("scaleType", this.scaleType == null ? null : this.scaleType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SkuCapacity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SkuCapacity if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SkuCapacity. + */ + public static SkuCapacity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SkuCapacity deserializedSkuCapacity = new SkuCapacity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("default".equals(fieldName)) { + deserializedSkuCapacity.defaultProperty = reader.getNullable(JsonReader::getInt); + } else if ("maximum".equals(fieldName)) { + deserializedSkuCapacity.maximum = reader.getNullable(JsonReader::getInt); + } else if ("minimum".equals(fieldName)) { + deserializedSkuCapacity.minimum = reader.getNullable(JsonReader::getInt); + } else if ("scaleType".equals(fieldName)) { + deserializedSkuCapacity.scaleType = SkuScaleType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSkuCapacity; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SkuResource.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SkuResource.java index 40eb8b46ed0db..955f61f309ea5 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SkuResource.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SkuResource.java @@ -6,32 +6,34 @@ import com.azure.resourcemanager.machinelearning.fluent.models.SkuResourceInner; -/** An immutable client-side representation of SkuResource. */ +/** + * An immutable client-side representation of SkuResource. + */ public interface SkuResource { /** * Gets the capacity property: Gets or sets the Sku Capacity. - * + * * @return the capacity value. */ SkuCapacity capacity(); /** * Gets the resourceType property: The resource type name. - * + * * @return the resourceType value. */ String resourceType(); /** * Gets the sku property: Gets or sets the Sku. - * + * * @return the sku value. */ SkuSetting sku(); /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.SkuResourceInner object. - * + * * @return the inner object. */ SkuResourceInner innerModel(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SkuResourceArmPaginatedResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SkuResourceArmPaginatedResult.java index 33f198f1dfb7f..55e7d73d06b2c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SkuResourceArmPaginatedResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SkuResourceArmPaginatedResult.java @@ -5,33 +5,39 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.fluent.models.SkuResourceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** A paginated list of SkuResource entities. */ +/** + * A paginated list of SkuResource entities. + */ @Fluent -public final class SkuResourceArmPaginatedResult { +public final class SkuResourceArmPaginatedResult implements JsonSerializable { /* * The link to the next page of SkuResource objects. If null, there are no additional pages. */ - @JsonProperty(value = "nextLink") private String nextLink; /* * An array of objects of type SkuResource. */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of SkuResourceArmPaginatedResult class. */ + /** + * Creates an instance of SkuResourceArmPaginatedResult class. + */ public SkuResourceArmPaginatedResult() { } /** * Get the nextLink property: The link to the next page of SkuResource objects. If null, there are no additional * pages. - * + * * @return the nextLink value. */ public String nextLink() { @@ -41,7 +47,7 @@ public String nextLink() { /** * Set the nextLink property: The link to the next page of SkuResource objects. If null, there are no additional * pages. - * + * * @param nextLink the nextLink value to set. * @return the SkuResourceArmPaginatedResult object itself. */ @@ -52,7 +58,7 @@ public SkuResourceArmPaginatedResult withNextLink(String nextLink) { /** * Get the value property: An array of objects of type SkuResource. - * + * * @return the value value. */ public List value() { @@ -61,7 +67,7 @@ public List value() { /** * Set the value property: An array of objects of type SkuResource. - * + * * @param value the value value to set. * @return the SkuResourceArmPaginatedResult object itself. */ @@ -72,7 +78,7 @@ public SkuResourceArmPaginatedResult withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -80,4 +86,45 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SkuResourceArmPaginatedResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SkuResourceArmPaginatedResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SkuResourceArmPaginatedResult. + */ + public static SkuResourceArmPaginatedResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SkuResourceArmPaginatedResult deserializedSkuResourceArmPaginatedResult + = new SkuResourceArmPaginatedResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedSkuResourceArmPaginatedResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> SkuResourceInner.fromJson(reader1)); + deserializedSkuResourceArmPaginatedResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedSkuResourceArmPaginatedResult; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SkuScaleType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SkuScaleType.java index 65e5e32d1e553..2d53080f89762 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SkuScaleType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SkuScaleType.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Node scaling setting for the compute sku. */ +/** + * Node scaling setting for the compute sku. + */ public final class SkuScaleType extends ExpandableStringEnum { - /** Static value Automatic for SkuScaleType. */ + /** + * Static value Automatic for SkuScaleType. + */ public static final SkuScaleType AUTOMATIC = fromString("Automatic"); - /** Static value Manual for SkuScaleType. */ + /** + * Static value Manual for SkuScaleType. + */ public static final SkuScaleType MANUAL = fromString("Manual"); - /** Static value None for SkuScaleType. */ + /** + * Static value None for SkuScaleType. + */ public static final SkuScaleType NONE = fromString("None"); /** * Creates a new instance of SkuScaleType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public SkuScaleType() { /** * Creates or finds a SkuScaleType from its string representation. - * + * * @param name a name to look for. * @return the corresponding SkuScaleType. */ - @JsonCreator public static SkuScaleType fromString(String name) { return fromString(name, SkuScaleType.class); } /** * Gets known SkuScaleType values. - * + * * @return known SkuScaleType values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SkuSetting.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SkuSetting.java index ab0554e107637..a847b264d6ab3 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SkuSetting.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SkuSetting.java @@ -6,31 +6,37 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** SkuSetting fulfills the need for stripped down SKU info in ARM contract. */ +/** + * SkuSetting fulfills the need for stripped down SKU info in ARM contract. + */ @Fluent -public final class SkuSetting { +public final class SkuSetting implements JsonSerializable { /* * [Required] The name of the SKU. Ex - P3. It is typically a letter+number code. */ - @JsonProperty(value = "name", required = true) private String name; /* * This field is required to be implemented by the Resource Provider if the service has more than one tier, but is * not required on a PUT. */ - @JsonProperty(value = "tier") private SkuTier tier; - /** Creates an instance of SkuSetting class. */ + /** + * Creates an instance of SkuSetting class. + */ public SkuSetting() { } /** * Get the name property: [Required] The name of the SKU. Ex - P3. It is typically a letter+number code. - * + * * @return the name value. */ public String name() { @@ -39,7 +45,7 @@ public String name() { /** * Set the name property: [Required] The name of the SKU. Ex - P3. It is typically a letter+number code. - * + * * @param name the name value to set. * @return the SkuSetting object itself. */ @@ -51,7 +57,7 @@ public SkuSetting withName(String name) { /** * Get the tier property: This field is required to be implemented by the Resource Provider if the service has more * than one tier, but is not required on a PUT. - * + * * @return the tier value. */ public SkuTier tier() { @@ -61,7 +67,7 @@ public SkuTier tier() { /** * Set the tier property: This field is required to be implemented by the Resource Provider if the service has more * than one tier, but is not required on a PUT. - * + * * @param tier the tier value to set. * @return the SkuSetting object itself. */ @@ -72,16 +78,55 @@ public SkuSetting withTier(SkuTier tier) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (name() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model SkuSetting")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model SkuSetting")); } } private static final ClientLogger LOGGER = new ClientLogger(SkuSetting.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("tier", this.tier == null ? null : this.tier.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SkuSetting from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SkuSetting if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SkuSetting. + */ + public static SkuSetting fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SkuSetting deserializedSkuSetting = new SkuSetting(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSkuSetting.name = reader.getString(); + } else if ("tier".equals(fieldName)) { + deserializedSkuSetting.tier = SkuTier.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSkuSetting; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SkuTier.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SkuTier.java index 60ccbff0c23ff..9fe163fb9c665 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SkuTier.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SkuTier.java @@ -4,27 +4,34 @@ package com.azure.resourcemanager.machinelearning.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - /** * This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not * required on a PUT. */ public enum SkuTier { - /** Enum value Free. */ + /** + * Enum value Free. + */ FREE("Free"), - /** Enum value Basic. */ + /** + * Enum value Basic. + */ BASIC("Basic"), - /** Enum value Standard. */ + /** + * Enum value Standard. + */ STANDARD("Standard"), - /** Enum value Premium. */ + /** + * Enum value Premium. + */ PREMIUM("Premium"); - /** The actual serialized value for a SkuTier instance. */ + /** + * The actual serialized value for a SkuTier instance. + */ private final String value; SkuTier(String value) { @@ -33,11 +40,10 @@ public enum SkuTier { /** * Parses a serialized value to a SkuTier instance. - * + * * @param value the serialized value to parse. * @return the parsed SkuTier object, or null if unable to parse. */ - @JsonCreator public static SkuTier fromString(String value) { if (value == null) { return null; @@ -51,8 +57,9 @@ public static SkuTier fromString(String value) { return null; } - /** {@inheritDoc} */ - @JsonValue + /** + * {@inheritDoc} + */ @Override public String toString() { return this.value; diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SourceType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SourceType.java index 8499987e169b5..16600363c58d7 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SourceType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SourceType.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Data source type. */ +/** + * Data source type. + */ public final class SourceType extends ExpandableStringEnum { - /** Static value Dataset for SourceType. */ + /** + * Static value Dataset for SourceType. + */ public static final SourceType DATASET = fromString("Dataset"); - /** Static value Datastore for SourceType. */ + /** + * Static value Datastore for SourceType. + */ public static final SourceType DATASTORE = fromString("Datastore"); - /** Static value URI for SourceType. */ + /** + * Static value URI for SourceType. + */ public static final SourceType URI = fromString("URI"); /** * Creates a new instance of SourceType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public SourceType() { /** * Creates or finds a SourceType from its string representation. - * + * * @param name a name to look for. * @return the corresponding SourceType. */ - @JsonCreator public static SourceType fromString(String name) { return fromString(name, SourceType.class); } /** * Gets known SourceType values. - * + * * @return known SourceType values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SparkJob.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SparkJob.java new file mode 100644 index 0000000000000..60773aa0eca8d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SparkJob.java @@ -0,0 +1,673 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Spark job definition. + */ +@Fluent +public final class SparkJob extends JobBaseProperties { + /* + * [Required] Specifies the type of job. + */ + private JobType jobType = JobType.SPARK; + + /* + * Archive files used in the job. + */ + private List archives; + + /* + * Arguments for the job. + */ + private String args; + + /* + * [Required] arm-id of the code asset. + */ + private String codeId; + + /* + * Spark configured properties. + */ + private Map conf; + + /* + * [Required] The entry to execute on startup of the job. + */ + private SparkJobEntry entry; + + /* + * The ARM resource ID of the Environment specification for the job. + */ + private String environmentId; + + /* + * Environment variables included in the job. + */ + private Map environmentVariables; + + /* + * Files used in the job. + */ + private List files; + + /* + * Mapping of input data bindings used in the job. + */ + private Map inputs; + + /* + * Jar files used in the job. + */ + private List jars; + + /* + * Mapping of output data bindings used in the job. + */ + private Map outputs; + + /* + * Python files used in the job. + */ + private List pyFiles; + + /* + * Queue settings for the job + */ + private QueueSettings queueSettings; + + /* + * Compute Resource configuration for the job. + */ + private SparkResourceConfiguration resources; + + /* + * Status of the job. + */ + private JobStatus status; + + /** + * Creates an instance of SparkJob class. + */ + public SparkJob() { + } + + /** + * Get the jobType property: [Required] Specifies the type of job. + * + * @return the jobType value. + */ + @Override + public JobType jobType() { + return this.jobType; + } + + /** + * Get the archives property: Archive files used in the job. + * + * @return the archives value. + */ + public List archives() { + return this.archives; + } + + /** + * Set the archives property: Archive files used in the job. + * + * @param archives the archives value to set. + * @return the SparkJob object itself. + */ + public SparkJob withArchives(List archives) { + this.archives = archives; + return this; + } + + /** + * Get the args property: Arguments for the job. + * + * @return the args value. + */ + public String args() { + return this.args; + } + + /** + * Set the args property: Arguments for the job. + * + * @param args the args value to set. + * @return the SparkJob object itself. + */ + public SparkJob withArgs(String args) { + this.args = args; + return this; + } + + /** + * Get the codeId property: [Required] arm-id of the code asset. + * + * @return the codeId value. + */ + public String codeId() { + return this.codeId; + } + + /** + * Set the codeId property: [Required] arm-id of the code asset. + * + * @param codeId the codeId value to set. + * @return the SparkJob object itself. + */ + public SparkJob withCodeId(String codeId) { + this.codeId = codeId; + return this; + } + + /** + * Get the conf property: Spark configured properties. + * + * @return the conf value. + */ + public Map conf() { + return this.conf; + } + + /** + * Set the conf property: Spark configured properties. + * + * @param conf the conf value to set. + * @return the SparkJob object itself. + */ + public SparkJob withConf(Map conf) { + this.conf = conf; + return this; + } + + /** + * Get the entry property: [Required] The entry to execute on startup of the job. + * + * @return the entry value. + */ + public SparkJobEntry entry() { + return this.entry; + } + + /** + * Set the entry property: [Required] The entry to execute on startup of the job. + * + * @param entry the entry value to set. + * @return the SparkJob object itself. + */ + public SparkJob withEntry(SparkJobEntry entry) { + this.entry = entry; + return this; + } + + /** + * Get the environmentId property: The ARM resource ID of the Environment specification for the job. + * + * @return the environmentId value. + */ + public String environmentId() { + return this.environmentId; + } + + /** + * Set the environmentId property: The ARM resource ID of the Environment specification for the job. + * + * @param environmentId the environmentId value to set. + * @return the SparkJob object itself. + */ + public SparkJob withEnvironmentId(String environmentId) { + this.environmentId = environmentId; + return this; + } + + /** + * Get the environmentVariables property: Environment variables included in the job. + * + * @return the environmentVariables value. + */ + public Map environmentVariables() { + return this.environmentVariables; + } + + /** + * Set the environmentVariables property: Environment variables included in the job. + * + * @param environmentVariables the environmentVariables value to set. + * @return the SparkJob object itself. + */ + public SparkJob withEnvironmentVariables(Map environmentVariables) { + this.environmentVariables = environmentVariables; + return this; + } + + /** + * Get the files property: Files used in the job. + * + * @return the files value. + */ + public List files() { + return this.files; + } + + /** + * Set the files property: Files used in the job. + * + * @param files the files value to set. + * @return the SparkJob object itself. + */ + public SparkJob withFiles(List files) { + this.files = files; + return this; + } + + /** + * Get the inputs property: Mapping of input data bindings used in the job. + * + * @return the inputs value. + */ + public Map inputs() { + return this.inputs; + } + + /** + * Set the inputs property: Mapping of input data bindings used in the job. + * + * @param inputs the inputs value to set. + * @return the SparkJob object itself. + */ + public SparkJob withInputs(Map inputs) { + this.inputs = inputs; + return this; + } + + /** + * Get the jars property: Jar files used in the job. + * + * @return the jars value. + */ + public List jars() { + return this.jars; + } + + /** + * Set the jars property: Jar files used in the job. + * + * @param jars the jars value to set. + * @return the SparkJob object itself. + */ + public SparkJob withJars(List jars) { + this.jars = jars; + return this; + } + + /** + * Get the outputs property: Mapping of output data bindings used in the job. + * + * @return the outputs value. + */ + public Map outputs() { + return this.outputs; + } + + /** + * Set the outputs property: Mapping of output data bindings used in the job. + * + * @param outputs the outputs value to set. + * @return the SparkJob object itself. + */ + public SparkJob withOutputs(Map outputs) { + this.outputs = outputs; + return this; + } + + /** + * Get the pyFiles property: Python files used in the job. + * + * @return the pyFiles value. + */ + public List pyFiles() { + return this.pyFiles; + } + + /** + * Set the pyFiles property: Python files used in the job. + * + * @param pyFiles the pyFiles value to set. + * @return the SparkJob object itself. + */ + public SparkJob withPyFiles(List pyFiles) { + this.pyFiles = pyFiles; + return this; + } + + /** + * Get the queueSettings property: Queue settings for the job. + * + * @return the queueSettings value. + */ + public QueueSettings queueSettings() { + return this.queueSettings; + } + + /** + * Set the queueSettings property: Queue settings for the job. + * + * @param queueSettings the queueSettings value to set. + * @return the SparkJob object itself. + */ + public SparkJob withQueueSettings(QueueSettings queueSettings) { + this.queueSettings = queueSettings; + return this; + } + + /** + * Get the resources property: Compute Resource configuration for the job. + * + * @return the resources value. + */ + public SparkResourceConfiguration resources() { + return this.resources; + } + + /** + * Set the resources property: Compute Resource configuration for the job. + * + * @param resources the resources value to set. + * @return the SparkJob object itself. + */ + public SparkJob withResources(SparkResourceConfiguration resources) { + this.resources = resources; + return this; + } + + /** + * Get the status property: Status of the job. + * + * @return the status value. + */ + @Override + public JobStatus status() { + return this.status; + } + + /** + * {@inheritDoc} + */ + @Override + public SparkJob withComponentId(String componentId) { + super.withComponentId(componentId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SparkJob withComputeId(String computeId) { + super.withComputeId(computeId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SparkJob withDisplayName(String displayName) { + super.withDisplayName(displayName); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SparkJob withExperimentName(String experimentName) { + super.withExperimentName(experimentName); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SparkJob withIdentity(IdentityConfiguration identity) { + super.withIdentity(identity); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SparkJob withIsArchived(Boolean isArchived) { + super.withIsArchived(isArchived); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SparkJob withNotificationSetting(NotificationSetting notificationSetting) { + super.withNotificationSetting(notificationSetting); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SparkJob withServices(Map services) { + super.withServices(services); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SparkJob withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SparkJob withProperties(Map properties) { + super.withProperties(properties); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SparkJob withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (codeId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property codeId in model SparkJob")); + } + if (entry() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property entry in model SparkJob")); + } else { + entry().validate(); + } + if (inputs() != null) { + inputs().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + if (outputs() != null) { + outputs().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + if (queueSettings() != null) { + queueSettings().validate(); + } + if (resources() != null) { + resources().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SparkJob.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("componentId", componentId()); + jsonWriter.writeStringField("computeId", computeId()); + jsonWriter.writeStringField("displayName", displayName()); + jsonWriter.writeStringField("experimentName", experimentName()); + jsonWriter.writeJsonField("identity", identity()); + jsonWriter.writeBooleanField("isArchived", isArchived()); + jsonWriter.writeJsonField("notificationSetting", notificationSetting()); + jsonWriter.writeMapField("services", services(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("codeId", this.codeId); + jsonWriter.writeJsonField("entry", this.entry); + jsonWriter.writeStringField("jobType", this.jobType == null ? null : this.jobType.toString()); + jsonWriter.writeArrayField("archives", this.archives, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("args", this.args); + jsonWriter.writeMapField("conf", this.conf, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("environmentId", this.environmentId); + jsonWriter.writeMapField("environmentVariables", this.environmentVariables, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("files", this.files, (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("inputs", this.inputs, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("jars", this.jars, (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("outputs", this.outputs, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("pyFiles", this.pyFiles, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("queueSettings", this.queueSettings); + jsonWriter.writeJsonField("resources", this.resources); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SparkJob from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SparkJob if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SparkJob. + */ + public static SparkJob fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SparkJob deserializedSparkJob = new SparkJob(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedSparkJob.withDescription(reader.getString()); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedSparkJob.withProperties(properties); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSparkJob.withTags(tags); + } else if ("componentId".equals(fieldName)) { + deserializedSparkJob.withComponentId(reader.getString()); + } else if ("computeId".equals(fieldName)) { + deserializedSparkJob.withComputeId(reader.getString()); + } else if ("displayName".equals(fieldName)) { + deserializedSparkJob.withDisplayName(reader.getString()); + } else if ("experimentName".equals(fieldName)) { + deserializedSparkJob.withExperimentName(reader.getString()); + } else if ("identity".equals(fieldName)) { + deserializedSparkJob.withIdentity(IdentityConfiguration.fromJson(reader)); + } else if ("isArchived".equals(fieldName)) { + deserializedSparkJob.withIsArchived(reader.getNullable(JsonReader::getBoolean)); + } else if ("notificationSetting".equals(fieldName)) { + deserializedSparkJob.withNotificationSetting(NotificationSetting.fromJson(reader)); + } else if ("services".equals(fieldName)) { + Map services = reader.readMap(reader1 -> JobService.fromJson(reader1)); + deserializedSparkJob.withServices(services); + } else if ("status".equals(fieldName)) { + deserializedSparkJob.status = JobStatus.fromString(reader.getString()); + } else if ("codeId".equals(fieldName)) { + deserializedSparkJob.codeId = reader.getString(); + } else if ("entry".equals(fieldName)) { + deserializedSparkJob.entry = SparkJobEntry.fromJson(reader); + } else if ("jobType".equals(fieldName)) { + deserializedSparkJob.jobType = JobType.fromString(reader.getString()); + } else if ("archives".equals(fieldName)) { + List archives = reader.readArray(reader1 -> reader1.getString()); + deserializedSparkJob.archives = archives; + } else if ("args".equals(fieldName)) { + deserializedSparkJob.args = reader.getString(); + } else if ("conf".equals(fieldName)) { + Map conf = reader.readMap(reader1 -> reader1.getString()); + deserializedSparkJob.conf = conf; + } else if ("environmentId".equals(fieldName)) { + deserializedSparkJob.environmentId = reader.getString(); + } else if ("environmentVariables".equals(fieldName)) { + Map environmentVariables = reader.readMap(reader1 -> reader1.getString()); + deserializedSparkJob.environmentVariables = environmentVariables; + } else if ("files".equals(fieldName)) { + List files = reader.readArray(reader1 -> reader1.getString()); + deserializedSparkJob.files = files; + } else if ("inputs".equals(fieldName)) { + Map inputs = reader.readMap(reader1 -> JobInput.fromJson(reader1)); + deserializedSparkJob.inputs = inputs; + } else if ("jars".equals(fieldName)) { + List jars = reader.readArray(reader1 -> reader1.getString()); + deserializedSparkJob.jars = jars; + } else if ("outputs".equals(fieldName)) { + Map outputs = reader.readMap(reader1 -> JobOutput.fromJson(reader1)); + deserializedSparkJob.outputs = outputs; + } else if ("pyFiles".equals(fieldName)) { + List pyFiles = reader.readArray(reader1 -> reader1.getString()); + deserializedSparkJob.pyFiles = pyFiles; + } else if ("queueSettings".equals(fieldName)) { + deserializedSparkJob.queueSettings = QueueSettings.fromJson(reader); + } else if ("resources".equals(fieldName)) { + deserializedSparkJob.resources = SparkResourceConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSparkJob; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SparkJobEntry.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SparkJobEntry.java new file mode 100644 index 0000000000000..798b5708150d9 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SparkJobEntry.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Spark job entry point definition. + */ +@Immutable +public class SparkJobEntry implements JsonSerializable { + /* + * [Required] Type of the job's entry point. + */ + private SparkJobEntryType sparkJobEntryType = SparkJobEntryType.fromString("SparkJobEntry"); + + /** + * Creates an instance of SparkJobEntry class. + */ + public SparkJobEntry() { + } + + /** + * Get the sparkJobEntryType property: [Required] Type of the job's entry point. + * + * @return the sparkJobEntryType value. + */ + public SparkJobEntryType sparkJobEntryType() { + return this.sparkJobEntryType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sparkJobEntryType", + this.sparkJobEntryType == null ? null : this.sparkJobEntryType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SparkJobEntry from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SparkJobEntry if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SparkJobEntry. + */ + public static SparkJobEntry fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("sparkJobEntryType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("SparkJobPythonEntry".equals(discriminatorValue)) { + return SparkJobPythonEntry.fromJson(readerToUse.reset()); + } else if ("SparkJobScalaEntry".equals(discriminatorValue)) { + return SparkJobScalaEntry.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static SparkJobEntry fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SparkJobEntry deserializedSparkJobEntry = new SparkJobEntry(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sparkJobEntryType".equals(fieldName)) { + deserializedSparkJobEntry.sparkJobEntryType = SparkJobEntryType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSparkJobEntry; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SparkJobEntryType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SparkJobEntryType.java new file mode 100644 index 0000000000000..faca97a178bd8 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SparkJobEntryType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for SparkJobEntryType. + */ +public final class SparkJobEntryType extends ExpandableStringEnum { + /** + * Static value SparkJobPythonEntry for SparkJobEntryType. + */ + public static final SparkJobEntryType SPARK_JOB_PYTHON_ENTRY = fromString("SparkJobPythonEntry"); + + /** + * Static value SparkJobScalaEntry for SparkJobEntryType. + */ + public static final SparkJobEntryType SPARK_JOB_SCALA_ENTRY = fromString("SparkJobScalaEntry"); + + /** + * Creates a new instance of SparkJobEntryType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SparkJobEntryType() { + } + + /** + * Creates or finds a SparkJobEntryType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SparkJobEntryType. + */ + public static SparkJobEntryType fromString(String name) { + return fromString(name, SparkJobEntryType.class); + } + + /** + * Gets known SparkJobEntryType values. + * + * @return known SparkJobEntryType values. + */ + public static Collection values() { + return values(SparkJobEntryType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SparkJobPythonEntry.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SparkJobPythonEntry.java new file mode 100644 index 0000000000000..c2db6133028f7 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SparkJobPythonEntry.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The SparkJobPythonEntry model. + */ +@Fluent +public final class SparkJobPythonEntry extends SparkJobEntry { + /* + * [Required] Type of the job's entry point. + */ + private SparkJobEntryType sparkJobEntryType = SparkJobEntryType.SPARK_JOB_PYTHON_ENTRY; + + /* + * [Required] Relative python file path for job entry point. + */ + private String file; + + /** + * Creates an instance of SparkJobPythonEntry class. + */ + public SparkJobPythonEntry() { + } + + /** + * Get the sparkJobEntryType property: [Required] Type of the job's entry point. + * + * @return the sparkJobEntryType value. + */ + @Override + public SparkJobEntryType sparkJobEntryType() { + return this.sparkJobEntryType; + } + + /** + * Get the file property: [Required] Relative python file path for job entry point. + * + * @return the file value. + */ + public String file() { + return this.file; + } + + /** + * Set the file property: [Required] Relative python file path for job entry point. + * + * @param file the file value to set. + * @return the SparkJobPythonEntry object itself. + */ + public SparkJobPythonEntry withFile(String file) { + this.file = file; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (file() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property file in model SparkJobPythonEntry")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SparkJobPythonEntry.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("file", this.file); + jsonWriter.writeStringField("sparkJobEntryType", + this.sparkJobEntryType == null ? null : this.sparkJobEntryType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SparkJobPythonEntry from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SparkJobPythonEntry if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SparkJobPythonEntry. + */ + public static SparkJobPythonEntry fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SparkJobPythonEntry deserializedSparkJobPythonEntry = new SparkJobPythonEntry(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("file".equals(fieldName)) { + deserializedSparkJobPythonEntry.file = reader.getString(); + } else if ("sparkJobEntryType".equals(fieldName)) { + deserializedSparkJobPythonEntry.sparkJobEntryType + = SparkJobEntryType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSparkJobPythonEntry; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SparkJobScalaEntry.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SparkJobScalaEntry.java new file mode 100644 index 0000000000000..e735204c3b6d5 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SparkJobScalaEntry.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The SparkJobScalaEntry model. + */ +@Fluent +public final class SparkJobScalaEntry extends SparkJobEntry { + /* + * [Required] Type of the job's entry point. + */ + private SparkJobEntryType sparkJobEntryType = SparkJobEntryType.SPARK_JOB_SCALA_ENTRY; + + /* + * [Required] Scala class name used as entry point. + */ + private String className; + + /** + * Creates an instance of SparkJobScalaEntry class. + */ + public SparkJobScalaEntry() { + } + + /** + * Get the sparkJobEntryType property: [Required] Type of the job's entry point. + * + * @return the sparkJobEntryType value. + */ + @Override + public SparkJobEntryType sparkJobEntryType() { + return this.sparkJobEntryType; + } + + /** + * Get the className property: [Required] Scala class name used as entry point. + * + * @return the className value. + */ + public String className() { + return this.className; + } + + /** + * Set the className property: [Required] Scala class name used as entry point. + * + * @param className the className value to set. + * @return the SparkJobScalaEntry object itself. + */ + public SparkJobScalaEntry withClassName(String className) { + this.className = className; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (className() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property className in model SparkJobScalaEntry")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SparkJobScalaEntry.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("className", this.className); + jsonWriter.writeStringField("sparkJobEntryType", + this.sparkJobEntryType == null ? null : this.sparkJobEntryType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SparkJobScalaEntry from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SparkJobScalaEntry if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SparkJobScalaEntry. + */ + public static SparkJobScalaEntry fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SparkJobScalaEntry deserializedSparkJobScalaEntry = new SparkJobScalaEntry(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("className".equals(fieldName)) { + deserializedSparkJobScalaEntry.className = reader.getString(); + } else if ("sparkJobEntryType".equals(fieldName)) { + deserializedSparkJobScalaEntry.sparkJobEntryType = SparkJobEntryType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSparkJobScalaEntry; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SparkResourceConfiguration.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SparkResourceConfiguration.java new file mode 100644 index 0000000000000..49b2e0c596d78 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SparkResourceConfiguration.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The SparkResourceConfiguration model. + */ +@Fluent +public final class SparkResourceConfiguration implements JsonSerializable { + /* + * Optional type of VM used as supported by the compute target. + */ + private String instanceType; + + /* + * Version of spark runtime used for the job. + */ + private String runtimeVersion; + + /** + * Creates an instance of SparkResourceConfiguration class. + */ + public SparkResourceConfiguration() { + } + + /** + * Get the instanceType property: Optional type of VM used as supported by the compute target. + * + * @return the instanceType value. + */ + public String instanceType() { + return this.instanceType; + } + + /** + * Set the instanceType property: Optional type of VM used as supported by the compute target. + * + * @param instanceType the instanceType value to set. + * @return the SparkResourceConfiguration object itself. + */ + public SparkResourceConfiguration withInstanceType(String instanceType) { + this.instanceType = instanceType; + return this; + } + + /** + * Get the runtimeVersion property: Version of spark runtime used for the job. + * + * @return the runtimeVersion value. + */ + public String runtimeVersion() { + return this.runtimeVersion; + } + + /** + * Set the runtimeVersion property: Version of spark runtime used for the job. + * + * @param runtimeVersion the runtimeVersion value to set. + * @return the SparkResourceConfiguration object itself. + */ + public SparkResourceConfiguration withRuntimeVersion(String runtimeVersion) { + this.runtimeVersion = runtimeVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("instanceType", this.instanceType); + jsonWriter.writeStringField("runtimeVersion", this.runtimeVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SparkResourceConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SparkResourceConfiguration if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SparkResourceConfiguration. + */ + public static SparkResourceConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SparkResourceConfiguration deserializedSparkResourceConfiguration = new SparkResourceConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("instanceType".equals(fieldName)) { + deserializedSparkResourceConfiguration.instanceType = reader.getString(); + } else if ("runtimeVersion".equals(fieldName)) { + deserializedSparkResourceConfiguration.runtimeVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSparkResourceConfiguration; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SshPublicAccess.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SshPublicAccess.java index eaad83db9998d..0468dbf671a72 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SshPublicAccess.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SshPublicAccess.java @@ -5,26 +5,29 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** * Access policy for SSH - * - *

State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on this + * + * State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on this * instance. Enabled - Indicates that the public ssh port is open and accessible according to the VNet/subnet policy if * applicable. */ public final class SshPublicAccess extends ExpandableStringEnum { - /** Static value Enabled for SshPublicAccess. */ + /** + * Static value Enabled for SshPublicAccess. + */ public static final SshPublicAccess ENABLED = fromString("Enabled"); - /** Static value Disabled for SshPublicAccess. */ + /** + * Static value Disabled for SshPublicAccess. + */ public static final SshPublicAccess DISABLED = fromString("Disabled"); /** * Creates a new instance of SshPublicAccess value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,18 +36,17 @@ public SshPublicAccess() { /** * Creates or finds a SshPublicAccess from its string representation. - * + * * @param name a name to look for. * @return the corresponding SshPublicAccess. */ - @JsonCreator public static SshPublicAccess fromString(String name) { return fromString(name, SshPublicAccess.class); } /** * Gets known SshPublicAccess values. - * + * * @return known SshPublicAccess values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SslConfigStatus.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SslConfigStatus.java index 8adaca76bc15f..dbd0ce1205354 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SslConfigStatus.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SslConfigStatus.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Enable or disable ssl for scoring. */ +/** + * Enable or disable ssl for scoring. + */ public final class SslConfigStatus extends ExpandableStringEnum { - /** Static value Disabled for SslConfigStatus. */ + /** + * Static value Disabled for SslConfigStatus. + */ public static final SslConfigStatus DISABLED = fromString("Disabled"); - /** Static value Enabled for SslConfigStatus. */ + /** + * Static value Enabled for SslConfigStatus. + */ public static final SslConfigStatus ENABLED = fromString("Enabled"); - /** Static value Auto for SslConfigStatus. */ + /** + * Static value Auto for SslConfigStatus. + */ public static final SslConfigStatus AUTO = fromString("Auto"); /** * Creates a new instance of SslConfigStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public SslConfigStatus() { /** * Creates or finds a SslConfigStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding SslConfigStatus. */ - @JsonCreator public static SslConfigStatus fromString(String name) { return fromString(name, SslConfigStatus.class); } /** * Gets known SslConfigStatus values. - * + * * @return known SslConfigStatus values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SslConfiguration.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SslConfiguration.java index 894cce612693c..e47753ea237d7 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SslConfiguration.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SslConfiguration.java @@ -5,54 +5,56 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The ssl configuration for scoring. */ +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The ssl configuration for scoring. + */ @Fluent -public final class SslConfiguration { +public final class SslConfiguration implements JsonSerializable { /* * Enable or disable ssl for scoring */ - @JsonProperty(value = "status") private SslConfigStatus status; /* * Cert data */ - @JsonProperty(value = "cert") private String cert; /* * Key data */ - @JsonProperty(value = "key") private String key; /* * CNAME of the cert */ - @JsonProperty(value = "cname") private String cname; /* * Leaf domain label of public endpoint */ - @JsonProperty(value = "leafDomainLabel") private String leafDomainLabel; /* * Indicates whether to overwrite existing domain label. */ - @JsonProperty(value = "overwriteExistingDomain") private Boolean overwriteExistingDomain; - /** Creates an instance of SslConfiguration class. */ + /** + * Creates an instance of SslConfiguration class. + */ public SslConfiguration() { } /** * Get the status property: Enable or disable ssl for scoring. - * + * * @return the status value. */ public SslConfigStatus status() { @@ -61,7 +63,7 @@ public SslConfigStatus status() { /** * Set the status property: Enable or disable ssl for scoring. - * + * * @param status the status value to set. * @return the SslConfiguration object itself. */ @@ -72,7 +74,7 @@ public SslConfiguration withStatus(SslConfigStatus status) { /** * Get the cert property: Cert data. - * + * * @return the cert value. */ public String cert() { @@ -81,7 +83,7 @@ public String cert() { /** * Set the cert property: Cert data. - * + * * @param cert the cert value to set. * @return the SslConfiguration object itself. */ @@ -92,7 +94,7 @@ public SslConfiguration withCert(String cert) { /** * Get the key property: Key data. - * + * * @return the key value. */ public String key() { @@ -101,7 +103,7 @@ public String key() { /** * Set the key property: Key data. - * + * * @param key the key value to set. * @return the SslConfiguration object itself. */ @@ -112,7 +114,7 @@ public SslConfiguration withKey(String key) { /** * Get the cname property: CNAME of the cert. - * + * * @return the cname value. */ public String cname() { @@ -121,7 +123,7 @@ public String cname() { /** * Set the cname property: CNAME of the cert. - * + * * @param cname the cname value to set. * @return the SslConfiguration object itself. */ @@ -132,7 +134,7 @@ public SslConfiguration withCname(String cname) { /** * Get the leafDomainLabel property: Leaf domain label of public endpoint. - * + * * @return the leafDomainLabel value. */ public String leafDomainLabel() { @@ -141,7 +143,7 @@ public String leafDomainLabel() { /** * Set the leafDomainLabel property: Leaf domain label of public endpoint. - * + * * @param leafDomainLabel the leafDomainLabel value to set. * @return the SslConfiguration object itself. */ @@ -152,7 +154,7 @@ public SslConfiguration withLeafDomainLabel(String leafDomainLabel) { /** * Get the overwriteExistingDomain property: Indicates whether to overwrite existing domain label. - * + * * @return the overwriteExistingDomain value. */ public Boolean overwriteExistingDomain() { @@ -161,7 +163,7 @@ public Boolean overwriteExistingDomain() { /** * Set the overwriteExistingDomain property: Indicates whether to overwrite existing domain label. - * + * * @param overwriteExistingDomain the overwriteExistingDomain value to set. * @return the SslConfiguration object itself. */ @@ -172,9 +174,60 @@ public SslConfiguration withOverwriteExistingDomain(Boolean overwriteExistingDom /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("cert", this.cert); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("cname", this.cname); + jsonWriter.writeStringField("leafDomainLabel", this.leafDomainLabel); + jsonWriter.writeBooleanField("overwriteExistingDomain", this.overwriteExistingDomain); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SslConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SslConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SslConfiguration. + */ + public static SslConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SslConfiguration deserializedSslConfiguration = new SslConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedSslConfiguration.status = SslConfigStatus.fromString(reader.getString()); + } else if ("cert".equals(fieldName)) { + deserializedSslConfiguration.cert = reader.getString(); + } else if ("key".equals(fieldName)) { + deserializedSslConfiguration.key = reader.getString(); + } else if ("cname".equals(fieldName)) { + deserializedSslConfiguration.cname = reader.getString(); + } else if ("leafDomainLabel".equals(fieldName)) { + deserializedSslConfiguration.leafDomainLabel = reader.getString(); + } else if ("overwriteExistingDomain".equals(fieldName)) { + deserializedSslConfiguration.overwriteExistingDomain = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedSslConfiguration; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/StackEnsembleSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/StackEnsembleSettings.java index d0081827f0330..45bd7e5004b7f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/StackEnsembleSettings.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/StackEnsembleSettings.java @@ -5,37 +5,42 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Advances setting to customize StackEnsemble run. */ +/** + * Advances setting to customize StackEnsemble run. + */ @Fluent -public final class StackEnsembleSettings { +public final class StackEnsembleSettings implements JsonSerializable { /* * Optional parameters to pass to the initializer of the meta-learner. */ - @JsonProperty(value = "stackMetaLearnerKWargs") private Object stackMetaLearnerKWargs; /* - * Specifies the proportion of the training set (when choosing train and validation type of training) to be - * reserved for training the meta-learner. Default value is 0.2. + * Specifies the proportion of the training set (when choosing train and validation type of training) to be reserved + * for training the meta-learner. Default value is 0.2. */ - @JsonProperty(value = "stackMetaLearnerTrainPercentage") private Double stackMetaLearnerTrainPercentage; /* * The meta-learner is a model trained on the output of the individual heterogeneous models. */ - @JsonProperty(value = "stackMetaLearnerType") private StackMetaLearnerType stackMetaLearnerType; - /** Creates an instance of StackEnsembleSettings class. */ + /** + * Creates an instance of StackEnsembleSettings class. + */ public StackEnsembleSettings() { } /** * Get the stackMetaLearnerKWargs property: Optional parameters to pass to the initializer of the meta-learner. - * + * * @return the stackMetaLearnerKWargs value. */ public Object stackMetaLearnerKWargs() { @@ -44,7 +49,7 @@ public Object stackMetaLearnerKWargs() { /** * Set the stackMetaLearnerKWargs property: Optional parameters to pass to the initializer of the meta-learner. - * + * * @param stackMetaLearnerKWargs the stackMetaLearnerKWargs value to set. * @return the StackEnsembleSettings object itself. */ @@ -56,7 +61,7 @@ public StackEnsembleSettings withStackMetaLearnerKWargs(Object stackMetaLearnerK /** * Get the stackMetaLearnerTrainPercentage property: Specifies the proportion of the training set (when choosing * train and validation type of training) to be reserved for training the meta-learner. Default value is 0.2. - * + * * @return the stackMetaLearnerTrainPercentage value. */ public Double stackMetaLearnerTrainPercentage() { @@ -66,7 +71,7 @@ public Double stackMetaLearnerTrainPercentage() { /** * Set the stackMetaLearnerTrainPercentage property: Specifies the proportion of the training set (when choosing * train and validation type of training) to be reserved for training the meta-learner. Default value is 0.2. - * + * * @param stackMetaLearnerTrainPercentage the stackMetaLearnerTrainPercentage value to set. * @return the StackEnsembleSettings object itself. */ @@ -78,7 +83,7 @@ public StackEnsembleSettings withStackMetaLearnerTrainPercentage(Double stackMet /** * Get the stackMetaLearnerType property: The meta-learner is a model trained on the output of the individual * heterogeneous models. - * + * * @return the stackMetaLearnerType value. */ public StackMetaLearnerType stackMetaLearnerType() { @@ -88,7 +93,7 @@ public StackMetaLearnerType stackMetaLearnerType() { /** * Set the stackMetaLearnerType property: The meta-learner is a model trained on the output of the individual * heterogeneous models. - * + * * @param stackMetaLearnerType the stackMetaLearnerType value to set. * @return the StackEnsembleSettings object itself. */ @@ -99,9 +104,54 @@ public StackEnsembleSettings withStackMetaLearnerType(StackMetaLearnerType stack /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeUntypedField("stackMetaLearnerKWargs", this.stackMetaLearnerKWargs); + jsonWriter.writeNumberField("stackMetaLearnerTrainPercentage", this.stackMetaLearnerTrainPercentage); + jsonWriter.writeStringField("stackMetaLearnerType", + this.stackMetaLearnerType == null ? null : this.stackMetaLearnerType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StackEnsembleSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StackEnsembleSettings if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the StackEnsembleSettings. + */ + public static StackEnsembleSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StackEnsembleSettings deserializedStackEnsembleSettings = new StackEnsembleSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("stackMetaLearnerKWargs".equals(fieldName)) { + deserializedStackEnsembleSettings.stackMetaLearnerKWargs = reader.readUntyped(); + } else if ("stackMetaLearnerTrainPercentage".equals(fieldName)) { + deserializedStackEnsembleSettings.stackMetaLearnerTrainPercentage + = reader.getNullable(JsonReader::getDouble); + } else if ("stackMetaLearnerType".equals(fieldName)) { + deserializedStackEnsembleSettings.stackMetaLearnerType + = StackMetaLearnerType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedStackEnsembleSettings; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/StackMetaLearnerType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/StackMetaLearnerType.java index cd5e9dba54d6d..5276a57767cc4 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/StackMetaLearnerType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/StackMetaLearnerType.java @@ -5,44 +5,59 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** - * 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). This parameter can be one of the - * following strings: LogisticRegression, LogisticRegressionCV, LightGBMClassifier, ElasticNet, ElasticNetCV, - * LightGBMRegressor, or LinearRegression. + * 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). + * This parameter can be one of the following strings: LogisticRegression, LogisticRegressionCV, LightGBMClassifier, + * ElasticNet, ElasticNetCV, LightGBMRegressor, or LinearRegression. */ public final class StackMetaLearnerType extends ExpandableStringEnum { - /** Static value None for StackMetaLearnerType. */ + /** + * Static value None for StackMetaLearnerType. + */ public static final StackMetaLearnerType NONE = fromString("None"); - /** Static value LogisticRegression for StackMetaLearnerType. */ + /** + * Static value LogisticRegression for StackMetaLearnerType. + */ public static final StackMetaLearnerType LOGISTIC_REGRESSION = fromString("LogisticRegression"); - /** Static value LogisticRegressionCV for StackMetaLearnerType. */ + /** + * Static value LogisticRegressionCV for StackMetaLearnerType. + */ public static final StackMetaLearnerType LOGISTIC_REGRESSION_CV = fromString("LogisticRegressionCV"); - /** Static value LightGBMClassifier for StackMetaLearnerType. */ + /** + * Static value LightGBMClassifier for StackMetaLearnerType. + */ public static final StackMetaLearnerType LIGHT_GBMCLASSIFIER = fromString("LightGBMClassifier"); - /** Static value ElasticNet for StackMetaLearnerType. */ + /** + * Static value ElasticNet for StackMetaLearnerType. + */ public static final StackMetaLearnerType ELASTIC_NET = fromString("ElasticNet"); - /** Static value ElasticNetCV for StackMetaLearnerType. */ + /** + * Static value ElasticNetCV for StackMetaLearnerType. + */ public static final StackMetaLearnerType ELASTIC_NET_CV = fromString("ElasticNetCV"); - /** Static value LightGBMRegressor for StackMetaLearnerType. */ + /** + * Static value LightGBMRegressor for StackMetaLearnerType. + */ public static final StackMetaLearnerType LIGHT_GBMREGRESSOR = fromString("LightGBMRegressor"); - /** Static value LinearRegression for StackMetaLearnerType. */ + /** + * Static value LinearRegression for StackMetaLearnerType. + */ public static final StackMetaLearnerType LINEAR_REGRESSION = fromString("LinearRegression"); /** * Creates a new instance of StackMetaLearnerType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -51,18 +66,17 @@ public StackMetaLearnerType() { /** * Creates or finds a StackMetaLearnerType from its string representation. - * + * * @param name a name to look for. * @return the corresponding StackMetaLearnerType. */ - @JsonCreator public static StackMetaLearnerType fromString(String name) { return fromString(name, StackMetaLearnerType.class); } /** * Gets known StackMetaLearnerType values. - * + * * @return known StackMetaLearnerType values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/StaticInputData.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/StaticInputData.java new file mode 100644 index 0000000000000..33045aa403f85 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/StaticInputData.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Map; + +/** + * Static input data definition. + */ +@Fluent +public final class StaticInputData extends MonitoringInputDataBase { + /* + * [Required] Specifies the type of signal to monitor. + */ + private MonitoringInputDataType inputDataType = MonitoringInputDataType.STATIC; + + /* + * Reference to the component asset used to preprocess the data. + */ + private String preprocessingComponentId; + + /* + * [Required] The end date of the data window. + */ + private OffsetDateTime windowEnd; + + /* + * [Required] The start date of the data window. + */ + private OffsetDateTime windowStart; + + /** + * Creates an instance of StaticInputData class. + */ + public StaticInputData() { + } + + /** + * Get the inputDataType property: [Required] Specifies the type of signal to monitor. + * + * @return the inputDataType value. + */ + @Override + public MonitoringInputDataType inputDataType() { + return this.inputDataType; + } + + /** + * Get the preprocessingComponentId property: Reference to the component asset used to preprocess the data. + * + * @return the preprocessingComponentId value. + */ + public String preprocessingComponentId() { + return this.preprocessingComponentId; + } + + /** + * Set the preprocessingComponentId property: Reference to the component asset used to preprocess the data. + * + * @param preprocessingComponentId the preprocessingComponentId value to set. + * @return the StaticInputData object itself. + */ + public StaticInputData withPreprocessingComponentId(String preprocessingComponentId) { + this.preprocessingComponentId = preprocessingComponentId; + return this; + } + + /** + * Get the windowEnd property: [Required] The end date of the data window. + * + * @return the windowEnd value. + */ + public OffsetDateTime windowEnd() { + return this.windowEnd; + } + + /** + * Set the windowEnd property: [Required] The end date of the data window. + * + * @param windowEnd the windowEnd value to set. + * @return the StaticInputData object itself. + */ + public StaticInputData withWindowEnd(OffsetDateTime windowEnd) { + this.windowEnd = windowEnd; + return this; + } + + /** + * Get the windowStart property: [Required] The start date of the data window. + * + * @return the windowStart value. + */ + public OffsetDateTime windowStart() { + return this.windowStart; + } + + /** + * Set the windowStart property: [Required] The start date of the data window. + * + * @param windowStart the windowStart value to set. + * @return the StaticInputData object itself. + */ + public StaticInputData withWindowStart(OffsetDateTime windowStart) { + this.windowStart = windowStart; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public StaticInputData withColumns(Map columns) { + super.withColumns(columns); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public StaticInputData withDataContext(String dataContext) { + super.withDataContext(dataContext); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public StaticInputData withJobInputType(JobInputType jobInputType) { + super.withJobInputType(jobInputType); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public StaticInputData withUri(String uri) { + super.withUri(uri); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (windowEnd() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property windowEnd in model StaticInputData")); + } + if (windowStart() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property windowStart in model StaticInputData")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(StaticInputData.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("jobInputType", jobInputType() == null ? null : jobInputType().toString()); + jsonWriter.writeStringField("uri", uri()); + jsonWriter.writeMapField("columns", columns(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("dataContext", dataContext()); + jsonWriter.writeStringField("windowEnd", + this.windowEnd == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.windowEnd)); + jsonWriter.writeStringField("windowStart", + this.windowStart == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.windowStart)); + jsonWriter.writeStringField("inputDataType", this.inputDataType == null ? null : this.inputDataType.toString()); + jsonWriter.writeStringField("preprocessingComponentId", this.preprocessingComponentId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StaticInputData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StaticInputData if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the StaticInputData. + */ + public static StaticInputData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StaticInputData deserializedStaticInputData = new StaticInputData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("jobInputType".equals(fieldName)) { + deserializedStaticInputData.withJobInputType(JobInputType.fromString(reader.getString())); + } else if ("uri".equals(fieldName)) { + deserializedStaticInputData.withUri(reader.getString()); + } else if ("columns".equals(fieldName)) { + Map columns = reader.readMap(reader1 -> reader1.getString()); + deserializedStaticInputData.withColumns(columns); + } else if ("dataContext".equals(fieldName)) { + deserializedStaticInputData.withDataContext(reader.getString()); + } else if ("windowEnd".equals(fieldName)) { + deserializedStaticInputData.windowEnd = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("windowStart".equals(fieldName)) { + deserializedStaticInputData.windowStart = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("inputDataType".equals(fieldName)) { + deserializedStaticInputData.inputDataType = MonitoringInputDataType.fromString(reader.getString()); + } else if ("preprocessingComponentId".equals(fieldName)) { + deserializedStaticInputData.preprocessingComponentId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStaticInputData; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Status.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Status.java index c4aa1a421e11b..cdd87410f6c6d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Status.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Status.java @@ -5,43 +5,58 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** * Update Workspace Quota Status. - * - *

Status of update workspace quota. + * + * Status of update workspace quota. */ public final class Status extends ExpandableStringEnum { - /** Static value Undefined for Status. */ + /** + * Static value Undefined for Status. + */ public static final Status UNDEFINED = fromString("Undefined"); - /** Static value Success for Status. */ + /** + * Static value Success for Status. + */ public static final Status SUCCESS = fromString("Success"); - /** Static value Failure for Status. */ + /** + * Static value Failure for Status. + */ public static final Status FAILURE = fromString("Failure"); - /** Static value InvalidQuotaBelowClusterMinimum for Status. */ + /** + * Static value InvalidQuotaBelowClusterMinimum for Status. + */ public static final Status INVALID_QUOTA_BELOW_CLUSTER_MINIMUM = fromString("InvalidQuotaBelowClusterMinimum"); - /** Static value InvalidQuotaExceedsSubscriptionLimit for Status. */ - public static final Status INVALID_QUOTA_EXCEEDS_SUBSCRIPTION_LIMIT = - fromString("InvalidQuotaExceedsSubscriptionLimit"); + /** + * Static value InvalidQuotaExceedsSubscriptionLimit for Status. + */ + public static final Status INVALID_QUOTA_EXCEEDS_SUBSCRIPTION_LIMIT + = fromString("InvalidQuotaExceedsSubscriptionLimit"); - /** Static value InvalidVMFamilyName for Status. */ + /** + * Static value InvalidVMFamilyName for Status. + */ public static final Status INVALID_VMFAMILY_NAME = fromString("InvalidVMFamilyName"); - /** Static value OperationNotSupportedForSku for Status. */ + /** + * Static value OperationNotSupportedForSku for Status. + */ public static final Status OPERATION_NOT_SUPPORTED_FOR_SKU = fromString("OperationNotSupportedForSku"); - /** Static value OperationNotEnabledForRegion for Status. */ + /** + * Static value OperationNotEnabledForRegion for Status. + */ public static final Status OPERATION_NOT_ENABLED_FOR_REGION = fromString("OperationNotEnabledForRegion"); /** * Creates a new instance of Status value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -50,18 +65,17 @@ public Status() { /** * Creates or finds a Status from its string representation. - * + * * @param name a name to look for. * @return the corresponding Status. */ - @JsonCreator public static Status fromString(String name) { return fromString(name, Status.class); } /** * Gets known Status values. - * + * * @return known Status values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/StochasticOptimizer.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/StochasticOptimizer.java index 7fcd721f062b2..4ed799a937cdd 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/StochasticOptimizer.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/StochasticOptimizer.java @@ -5,26 +5,35 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Stochastic optimizer for image models. */ +/** + * Stochastic optimizer for image models. + */ public final class StochasticOptimizer extends ExpandableStringEnum { - /** Static value None for StochasticOptimizer. */ + /** + * Static value None for StochasticOptimizer. + */ public static final StochasticOptimizer NONE = fromString("None"); - /** Static value Sgd for StochasticOptimizer. */ + /** + * Static value Sgd for StochasticOptimizer. + */ public static final StochasticOptimizer SGD = fromString("Sgd"); - /** Static value Adam for StochasticOptimizer. */ + /** + * Static value Adam for StochasticOptimizer. + */ public static final StochasticOptimizer ADAM = fromString("Adam"); - /** Static value Adamw for StochasticOptimizer. */ + /** + * Static value Adamw for StochasticOptimizer. + */ public static final StochasticOptimizer ADAMW = fromString("Adamw"); /** * Creates a new instance of StochasticOptimizer value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,18 +42,17 @@ public StochasticOptimizer() { /** * Creates or finds a StochasticOptimizer from its string representation. - * + * * @param name a name to look for. * @return the corresponding StochasticOptimizer. */ - @JsonCreator public static StochasticOptimizer fromString(String name) { return fromString(name, StochasticOptimizer.class); } /** * Gets known StochasticOptimizer values. - * + * * @return known StochasticOptimizer values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/StorageAccountDetails.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/StorageAccountDetails.java new file mode 100644 index 0000000000000..f11d487bb51a5 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/StorageAccountDetails.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Details of storage account to be used for the Registry. + */ +@Fluent +public final class StorageAccountDetails implements JsonSerializable { + /* + * Details of system created storage account to be used for the registry + */ + private SystemCreatedStorageAccount systemCreatedStorageAccount; + + /* + * Details of user created storage account to be used for the registry + */ + private UserCreatedStorageAccount userCreatedStorageAccount; + + /** + * Creates an instance of StorageAccountDetails class. + */ + public StorageAccountDetails() { + } + + /** + * Get the systemCreatedStorageAccount property: Details of system created storage account to be used for the + * registry. + * + * @return the systemCreatedStorageAccount value. + */ + public SystemCreatedStorageAccount systemCreatedStorageAccount() { + return this.systemCreatedStorageAccount; + } + + /** + * Set the systemCreatedStorageAccount property: Details of system created storage account to be used for the + * registry. + * + * @param systemCreatedStorageAccount the systemCreatedStorageAccount value to set. + * @return the StorageAccountDetails object itself. + */ + public StorageAccountDetails + withSystemCreatedStorageAccount(SystemCreatedStorageAccount systemCreatedStorageAccount) { + this.systemCreatedStorageAccount = systemCreatedStorageAccount; + return this; + } + + /** + * Get the userCreatedStorageAccount property: Details of user created storage account to be used for the registry. + * + * @return the userCreatedStorageAccount value. + */ + public UserCreatedStorageAccount userCreatedStorageAccount() { + return this.userCreatedStorageAccount; + } + + /** + * Set the userCreatedStorageAccount property: Details of user created storage account to be used for the registry. + * + * @param userCreatedStorageAccount the userCreatedStorageAccount value to set. + * @return the StorageAccountDetails object itself. + */ + public StorageAccountDetails withUserCreatedStorageAccount(UserCreatedStorageAccount userCreatedStorageAccount) { + this.userCreatedStorageAccount = userCreatedStorageAccount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (systemCreatedStorageAccount() != null) { + systemCreatedStorageAccount().validate(); + } + if (userCreatedStorageAccount() != null) { + userCreatedStorageAccount().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("systemCreatedStorageAccount", this.systemCreatedStorageAccount); + jsonWriter.writeJsonField("userCreatedStorageAccount", this.userCreatedStorageAccount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageAccountDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageAccountDetails if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the StorageAccountDetails. + */ + public static StorageAccountDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageAccountDetails deserializedStorageAccountDetails = new StorageAccountDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("systemCreatedStorageAccount".equals(fieldName)) { + deserializedStorageAccountDetails.systemCreatedStorageAccount + = SystemCreatedStorageAccount.fromJson(reader); + } else if ("userCreatedStorageAccount".equals(fieldName)) { + deserializedStorageAccountDetails.userCreatedStorageAccount + = UserCreatedStorageAccount.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageAccountDetails; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/StorageAccountType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/StorageAccountType.java index faa2e9484d9eb..ee85b8de4d4ab 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/StorageAccountType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/StorageAccountType.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** type of this storage account. */ +/** + * type of this storage account. + */ public final class StorageAccountType extends ExpandableStringEnum { - /** Static value Standard_LRS for StorageAccountType. */ + /** + * Static value Standard_LRS for StorageAccountType. + */ public static final StorageAccountType STANDARD_LRS = fromString("Standard_LRS"); - /** Static value Premium_LRS for StorageAccountType. */ + /** + * Static value Premium_LRS for StorageAccountType. + */ public static final StorageAccountType PREMIUM_LRS = fromString("Premium_LRS"); /** * Creates a new instance of StorageAccountType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public StorageAccountType() { /** * Creates or finds a StorageAccountType from its string representation. - * + * * @param name a name to look for. * @return the corresponding StorageAccountType. */ - @JsonCreator public static StorageAccountType fromString(String name) { return fromString(name, StorageAccountType.class); } /** * Gets known StorageAccountType values. - * + * * @return known StorageAccountType values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SweepJob.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SweepJob.java index 0a72071e3d48f..b836fea3ac282 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SweepJob.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SweepJob.java @@ -6,76 +6,93 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Sweep job definition. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobType") -@JsonTypeName("Sweep") +/** + * Sweep job definition. + */ @Fluent public final class SweepJob extends JobBaseProperties { + /* + * [Required] Specifies the type of job. + */ + private JobType jobType = JobType.SWEEP; + /* * Early termination policies enable canceling poor-performing runs before they complete */ - @JsonProperty(value = "earlyTermination") private EarlyTerminationPolicy earlyTermination; /* * Mapping of input data bindings used in the job. */ - @JsonProperty(value = "inputs") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map inputs; /* * Sweep Job limit. */ - @JsonProperty(value = "limits") private SweepJobLimits limits; /* * [Required] Optimization objective. */ - @JsonProperty(value = "objective", required = true) private Objective objective; /* * Mapping of output data bindings used in the job. */ - @JsonProperty(value = "outputs") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map outputs; + /* + * Queue settings for the job + */ + private QueueSettings queueSettings; + /* * [Required] The hyperparameter sampling algorithm */ - @JsonProperty(value = "samplingAlgorithm", required = true) private SamplingAlgorithm samplingAlgorithm; /* * [Required] A dictionary containing each parameter and its distribution. The dictionary key is the name of the * parameter */ - @JsonProperty(value = "searchSpace", required = true) private Object searchSpace; /* * [Required] Trial component definition. */ - @JsonProperty(value = "trial", required = true) private TrialComponent trial; - /** Creates an instance of SweepJob class. */ + /* + * Status of the job. + */ + private JobStatus status; + + /** + * Creates an instance of SweepJob class. + */ public SweepJob() { } + /** + * Get the jobType property: [Required] Specifies the type of job. + * + * @return the jobType value. + */ + @Override + public JobType jobType() { + return this.jobType; + } + /** * Get the earlyTermination property: Early termination policies enable canceling poor-performing runs before they * complete. - * + * * @return the earlyTermination value. */ public EarlyTerminationPolicy earlyTermination() { @@ -85,7 +102,7 @@ public EarlyTerminationPolicy earlyTermination() { /** * Set the earlyTermination property: Early termination policies enable canceling poor-performing runs before they * complete. - * + * * @param earlyTermination the earlyTermination value to set. * @return the SweepJob object itself. */ @@ -96,7 +113,7 @@ public SweepJob withEarlyTermination(EarlyTerminationPolicy earlyTermination) { /** * Get the inputs property: Mapping of input data bindings used in the job. - * + * * @return the inputs value. */ public Map inputs() { @@ -105,7 +122,7 @@ public Map inputs() { /** * Set the inputs property: Mapping of input data bindings used in the job. - * + * * @param inputs the inputs value to set. * @return the SweepJob object itself. */ @@ -116,7 +133,7 @@ public SweepJob withInputs(Map inputs) { /** * Get the limits property: Sweep Job limit. - * + * * @return the limits value. */ public SweepJobLimits limits() { @@ -125,7 +142,7 @@ public SweepJobLimits limits() { /** * Set the limits property: Sweep Job limit. - * + * * @param limits the limits value to set. * @return the SweepJob object itself. */ @@ -136,7 +153,7 @@ public SweepJob withLimits(SweepJobLimits limits) { /** * Get the objective property: [Required] Optimization objective. - * + * * @return the objective value. */ public Objective objective() { @@ -145,7 +162,7 @@ public Objective objective() { /** * Set the objective property: [Required] Optimization objective. - * + * * @param objective the objective value to set. * @return the SweepJob object itself. */ @@ -156,7 +173,7 @@ public SweepJob withObjective(Objective objective) { /** * Get the outputs property: Mapping of output data bindings used in the job. - * + * * @return the outputs value. */ public Map outputs() { @@ -165,7 +182,7 @@ public Map outputs() { /** * Set the outputs property: Mapping of output data bindings used in the job. - * + * * @param outputs the outputs value to set. * @return the SweepJob object itself. */ @@ -174,9 +191,29 @@ public SweepJob withOutputs(Map outputs) { return this; } + /** + * Get the queueSettings property: Queue settings for the job. + * + * @return the queueSettings value. + */ + public QueueSettings queueSettings() { + return this.queueSettings; + } + + /** + * Set the queueSettings property: Queue settings for the job. + * + * @param queueSettings the queueSettings value to set. + * @return the SweepJob object itself. + */ + public SweepJob withQueueSettings(QueueSettings queueSettings) { + this.queueSettings = queueSettings; + return this; + } + /** * Get the samplingAlgorithm property: [Required] The hyperparameter sampling algorithm. - * + * * @return the samplingAlgorithm value. */ public SamplingAlgorithm samplingAlgorithm() { @@ -185,7 +222,7 @@ public SamplingAlgorithm samplingAlgorithm() { /** * Set the samplingAlgorithm property: [Required] The hyperparameter sampling algorithm. - * + * * @param samplingAlgorithm the samplingAlgorithm value to set. * @return the SweepJob object itself. */ @@ -197,7 +234,7 @@ public SweepJob withSamplingAlgorithm(SamplingAlgorithm samplingAlgorithm) { /** * Get the searchSpace property: [Required] A dictionary containing each parameter and its distribution. The * dictionary key is the name of the parameter. - * + * * @return the searchSpace value. */ public Object searchSpace() { @@ -207,7 +244,7 @@ public Object searchSpace() { /** * Set the searchSpace property: [Required] A dictionary containing each parameter and its distribution. The * dictionary key is the name of the parameter. - * + * * @param searchSpace the searchSpace value to set. * @return the SweepJob object itself. */ @@ -218,7 +255,7 @@ public SweepJob withSearchSpace(Object searchSpace) { /** * Get the trial property: [Required] Trial component definition. - * + * * @return the trial value. */ public TrialComponent trial() { @@ -227,7 +264,7 @@ public TrialComponent trial() { /** * Set the trial property: [Required] Trial component definition. - * + * * @param trial the trial value to set. * @return the SweepJob object itself. */ @@ -236,70 +273,109 @@ public SweepJob withTrial(TrialComponent trial) { return this; } - /** {@inheritDoc} */ + /** + * Get the status property: Status of the job. + * + * @return the status value. + */ + @Override + public JobStatus status() { + return this.status; + } + + /** + * {@inheritDoc} + */ @Override public SweepJob withComponentId(String componentId) { super.withComponentId(componentId); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public SweepJob withComputeId(String computeId) { super.withComputeId(computeId); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public SweepJob withDisplayName(String displayName) { super.withDisplayName(displayName); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public SweepJob withExperimentName(String experimentName) { super.withExperimentName(experimentName); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public SweepJob withIdentity(IdentityConfiguration identity) { super.withIdentity(identity); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public SweepJob withIsArchived(Boolean isArchived) { super.withIsArchived(isArchived); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ + @Override + public SweepJob withNotificationSetting(NotificationSetting notificationSetting) { + super.withNotificationSetting(notificationSetting); + return this; + } + + /** + * {@inheritDoc} + */ @Override public SweepJob withServices(Map services) { super.withServices(services); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public SweepJob withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public SweepJob withProperties(Map properties) { super.withProperties(properties); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public SweepJob withTags(Map tags) { super.withTags(tags); @@ -308,7 +384,7 @@ public SweepJob withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -318,54 +394,152 @@ public void validate() { earlyTermination().validate(); } if (inputs() != null) { - inputs() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); + inputs().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); } if (limits() != null) { limits().validate(); } if (objective() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property objective in model SweepJob")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property objective in model SweepJob")); } else { objective().validate(); } if (outputs() != null) { - outputs() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); + outputs().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + if (queueSettings() != null) { + queueSettings().validate(); } if (samplingAlgorithm() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property samplingAlgorithm in model SweepJob")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property samplingAlgorithm in model SweepJob")); } else { samplingAlgorithm().validate(); } if (searchSpace() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property searchSpace in model SweepJob")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property searchSpace in model SweepJob")); } if (trial() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property trial in model SweepJob")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property trial in model SweepJob")); } else { trial().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(SweepJob.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("componentId", componentId()); + jsonWriter.writeStringField("computeId", computeId()); + jsonWriter.writeStringField("displayName", displayName()); + jsonWriter.writeStringField("experimentName", experimentName()); + jsonWriter.writeJsonField("identity", identity()); + jsonWriter.writeBooleanField("isArchived", isArchived()); + jsonWriter.writeJsonField("notificationSetting", notificationSetting()); + jsonWriter.writeMapField("services", services(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("objective", this.objective); + jsonWriter.writeJsonField("samplingAlgorithm", this.samplingAlgorithm); + jsonWriter.writeUntypedField("searchSpace", this.searchSpace); + jsonWriter.writeJsonField("trial", this.trial); + jsonWriter.writeStringField("jobType", this.jobType == null ? null : this.jobType.toString()); + jsonWriter.writeJsonField("earlyTermination", this.earlyTermination); + jsonWriter.writeMapField("inputs", this.inputs, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("limits", this.limits); + jsonWriter.writeMapField("outputs", this.outputs, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("queueSettings", this.queueSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SweepJob from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SweepJob if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SweepJob. + */ + public static SweepJob fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SweepJob deserializedSweepJob = new SweepJob(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedSweepJob.withDescription(reader.getString()); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedSweepJob.withProperties(properties); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSweepJob.withTags(tags); + } else if ("componentId".equals(fieldName)) { + deserializedSweepJob.withComponentId(reader.getString()); + } else if ("computeId".equals(fieldName)) { + deserializedSweepJob.withComputeId(reader.getString()); + } else if ("displayName".equals(fieldName)) { + deserializedSweepJob.withDisplayName(reader.getString()); + } else if ("experimentName".equals(fieldName)) { + deserializedSweepJob.withExperimentName(reader.getString()); + } else if ("identity".equals(fieldName)) { + deserializedSweepJob.withIdentity(IdentityConfiguration.fromJson(reader)); + } else if ("isArchived".equals(fieldName)) { + deserializedSweepJob.withIsArchived(reader.getNullable(JsonReader::getBoolean)); + } else if ("notificationSetting".equals(fieldName)) { + deserializedSweepJob.withNotificationSetting(NotificationSetting.fromJson(reader)); + } else if ("services".equals(fieldName)) { + Map services = reader.readMap(reader1 -> JobService.fromJson(reader1)); + deserializedSweepJob.withServices(services); + } else if ("status".equals(fieldName)) { + deserializedSweepJob.status = JobStatus.fromString(reader.getString()); + } else if ("objective".equals(fieldName)) { + deserializedSweepJob.objective = Objective.fromJson(reader); + } else if ("samplingAlgorithm".equals(fieldName)) { + deserializedSweepJob.samplingAlgorithm = SamplingAlgorithm.fromJson(reader); + } else if ("searchSpace".equals(fieldName)) { + deserializedSweepJob.searchSpace = reader.readUntyped(); + } else if ("trial".equals(fieldName)) { + deserializedSweepJob.trial = TrialComponent.fromJson(reader); + } else if ("jobType".equals(fieldName)) { + deserializedSweepJob.jobType = JobType.fromString(reader.getString()); + } else if ("earlyTermination".equals(fieldName)) { + deserializedSweepJob.earlyTermination = EarlyTerminationPolicy.fromJson(reader); + } else if ("inputs".equals(fieldName)) { + Map inputs = reader.readMap(reader1 -> JobInput.fromJson(reader1)); + deserializedSweepJob.inputs = inputs; + } else if ("limits".equals(fieldName)) { + deserializedSweepJob.limits = SweepJobLimits.fromJson(reader); + } else if ("outputs".equals(fieldName)) { + Map outputs = reader.readMap(reader1 -> JobOutput.fromJson(reader1)); + deserializedSweepJob.outputs = outputs; + } else if ("queueSettings".equals(fieldName)) { + deserializedSweepJob.queueSettings = QueueSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSweepJob; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SweepJobLimits.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SweepJobLimits.java index 6bca811bd4032..596a5b39cf373 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SweepJobLimits.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SweepJobLimits.java @@ -5,41 +5,57 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.Duration; -/** Sweep Job limit class. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobLimitsType") -@JsonTypeName("Sweep") +/** + * Sweep Job limit class. + */ @Fluent public final class SweepJobLimits extends JobLimits { + /* + * [Required] JobLimit type. + */ + private JobLimitsType jobLimitsType = JobLimitsType.SWEEP; + /* * Sweep Job max concurrent trials. */ - @JsonProperty(value = "maxConcurrentTrials") private Integer maxConcurrentTrials; /* * Sweep Job max total trials. */ - @JsonProperty(value = "maxTotalTrials") private Integer maxTotalTrials; /* * Sweep Job Trial timeout value. */ - @JsonProperty(value = "trialTimeout") private Duration trialTimeout; - /** Creates an instance of SweepJobLimits class. */ + /** + * Creates an instance of SweepJobLimits class. + */ public SweepJobLimits() { } + /** + * Get the jobLimitsType property: [Required] JobLimit type. + * + * @return the jobLimitsType value. + */ + @Override + public JobLimitsType jobLimitsType() { + return this.jobLimitsType; + } + /** * Get the maxConcurrentTrials property: Sweep Job max concurrent trials. - * + * * @return the maxConcurrentTrials value. */ public Integer maxConcurrentTrials() { @@ -48,7 +64,7 @@ public Integer maxConcurrentTrials() { /** * Set the maxConcurrentTrials property: Sweep Job max concurrent trials. - * + * * @param maxConcurrentTrials the maxConcurrentTrials value to set. * @return the SweepJobLimits object itself. */ @@ -59,7 +75,7 @@ public SweepJobLimits withMaxConcurrentTrials(Integer maxConcurrentTrials) { /** * Get the maxTotalTrials property: Sweep Job max total trials. - * + * * @return the maxTotalTrials value. */ public Integer maxTotalTrials() { @@ -68,7 +84,7 @@ public Integer maxTotalTrials() { /** * Set the maxTotalTrials property: Sweep Job max total trials. - * + * * @param maxTotalTrials the maxTotalTrials value to set. * @return the SweepJobLimits object itself. */ @@ -79,7 +95,7 @@ public SweepJobLimits withMaxTotalTrials(Integer maxTotalTrials) { /** * Get the trialTimeout property: Sweep Job Trial timeout value. - * + * * @return the trialTimeout value. */ public Duration trialTimeout() { @@ -88,7 +104,7 @@ public Duration trialTimeout() { /** * Set the trialTimeout property: Sweep Job Trial timeout value. - * + * * @param trialTimeout the trialTimeout value to set. * @return the SweepJobLimits object itself. */ @@ -97,7 +113,9 @@ public SweepJobLimits withTrialTimeout(Duration trialTimeout) { return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public SweepJobLimits withTimeout(Duration timeout) { super.withTimeout(timeout); @@ -106,11 +124,61 @@ public SweepJobLimits withTimeout(Duration timeout) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("timeout", CoreUtils.durationToStringWithDays(timeout())); + jsonWriter.writeStringField("jobLimitsType", this.jobLimitsType == null ? null : this.jobLimitsType.toString()); + jsonWriter.writeNumberField("maxConcurrentTrials", this.maxConcurrentTrials); + jsonWriter.writeNumberField("maxTotalTrials", this.maxTotalTrials); + jsonWriter.writeStringField("trialTimeout", CoreUtils.durationToStringWithDays(this.trialTimeout)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SweepJobLimits from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SweepJobLimits if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SweepJobLimits. + */ + public static SweepJobLimits fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SweepJobLimits deserializedSweepJobLimits = new SweepJobLimits(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("timeout".equals(fieldName)) { + deserializedSweepJobLimits + .withTimeout(reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString()))); + } else if ("jobLimitsType".equals(fieldName)) { + deserializedSweepJobLimits.jobLimitsType = JobLimitsType.fromString(reader.getString()); + } else if ("maxConcurrentTrials".equals(fieldName)) { + deserializedSweepJobLimits.maxConcurrentTrials = reader.getNullable(JsonReader::getInt); + } else if ("maxTotalTrials".equals(fieldName)) { + deserializedSweepJobLimits.maxTotalTrials = reader.getNullable(JsonReader::getInt); + } else if ("trialTimeout".equals(fieldName)) { + deserializedSweepJobLimits.trialTimeout + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedSweepJobLimits; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SynapseSpark.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SynapseSpark.java index 287f483c99310..3a00e4eb5ea80 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SynapseSpark.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SynapseSpark.java @@ -5,28 +5,75 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; -/** A SynapseSpark compute. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "computeType") -@JsonTypeName("SynapseSpark") +/** + * A SynapseSpark compute. + */ @Fluent public final class SynapseSpark extends Compute { + /* + * The type of compute + */ + private ComputeType computeType = ComputeType.SYNAPSE_SPARK; + /* * The properties property. */ - @JsonProperty(value = "properties") private SynapseSparkProperties properties; - /** Creates an instance of SynapseSpark class. */ + /* + * The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. + */ + private ProvisioningState provisioningState; + + /* + * The time at which the compute was created. + */ + private OffsetDateTime createdOn; + + /* + * The time at which the compute was last modified. + */ + private OffsetDateTime modifiedOn; + + /* + * Errors during provisioning + */ + private List provisioningErrors; + + /* + * Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning + * service provisioned it if false. + */ + private Boolean isAttachedCompute; + + /** + * Creates an instance of SynapseSpark class. + */ public SynapseSpark() { } + /** + * Get the computeType property: The type of compute. + * + * @return the computeType value. + */ + @Override + public ComputeType computeType() { + return this.computeType; + } + /** * Get the properties property: The properties property. - * + * * @return the properties value. */ public SynapseSparkProperties properties() { @@ -35,7 +82,7 @@ public SynapseSparkProperties properties() { /** * Set the properties property: The properties property. - * + * * @param properties the properties value to set. * @return the SynapseSpark object itself. */ @@ -44,28 +91,88 @@ public SynapseSpark withProperties(SynapseSparkProperties properties) { return this; } - /** {@inheritDoc} */ + /** + * Get the provisioningState property: The provision state of the cluster. Valid values are Unknown, Updating, + * Provisioning, Succeeded, and Failed. + * + * @return the provisioningState value. + */ + @Override + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the createdOn property: The time at which the compute was created. + * + * @return the createdOn value. + */ + @Override + public OffsetDateTime createdOn() { + return this.createdOn; + } + + /** + * Get the modifiedOn property: The time at which the compute was last modified. + * + * @return the modifiedOn value. + */ + @Override + public OffsetDateTime modifiedOn() { + return this.modifiedOn; + } + + /** + * Get the provisioningErrors property: Errors during provisioning. + * + * @return the provisioningErrors value. + */ + @Override + public List provisioningErrors() { + return this.provisioningErrors; + } + + /** + * Get the isAttachedCompute property: Indicating whether the compute was provisioned by user and brought from + * outside if true, or machine learning service provisioned it if false. + * + * @return the isAttachedCompute value. + */ + @Override + public Boolean isAttachedCompute() { + return this.isAttachedCompute; + } + + /** + * {@inheritDoc} + */ @Override public SynapseSpark withComputeLocation(String computeLocation) { super.withComputeLocation(computeLocation); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public SynapseSpark withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public SynapseSpark withResourceId(String resourceId) { super.withResourceId(resourceId); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public SynapseSpark withDisableLocalAuth(Boolean disableLocalAuth) { super.withDisableLocalAuth(disableLocalAuth); @@ -74,7 +181,7 @@ public SynapseSpark withDisableLocalAuth(Boolean disableLocalAuth) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -84,4 +191,69 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("computeLocation", computeLocation()); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("resourceId", resourceId()); + jsonWriter.writeBooleanField("disableLocalAuth", disableLocalAuth()); + jsonWriter.writeStringField("computeType", this.computeType == null ? null : this.computeType.toString()); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SynapseSpark from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SynapseSpark if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SynapseSpark. + */ + public static SynapseSpark fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SynapseSpark deserializedSynapseSpark = new SynapseSpark(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("computeLocation".equals(fieldName)) { + deserializedSynapseSpark.withComputeLocation(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedSynapseSpark.provisioningState = ProvisioningState.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedSynapseSpark.withDescription(reader.getString()); + } else if ("createdOn".equals(fieldName)) { + deserializedSynapseSpark.createdOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("modifiedOn".equals(fieldName)) { + deserializedSynapseSpark.modifiedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("resourceId".equals(fieldName)) { + deserializedSynapseSpark.withResourceId(reader.getString()); + } else if ("provisioningErrors".equals(fieldName)) { + List provisioningErrors + = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); + deserializedSynapseSpark.provisioningErrors = provisioningErrors; + } else if ("isAttachedCompute".equals(fieldName)) { + deserializedSynapseSpark.isAttachedCompute = reader.getNullable(JsonReader::getBoolean); + } else if ("disableLocalAuth".equals(fieldName)) { + deserializedSynapseSpark.withDisableLocalAuth(reader.getNullable(JsonReader::getBoolean)); + } else if ("computeType".equals(fieldName)) { + deserializedSynapseSpark.computeType = ComputeType.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedSynapseSpark.properties = SynapseSparkProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSynapseSpark; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SynapseSparkProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SynapseSparkProperties.java index 29e0a16a673d5..a473862a14a4a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SynapseSparkProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SynapseSparkProperties.java @@ -5,78 +5,76 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The SynapseSparkProperties model. */ +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The SynapseSparkProperties model. + */ @Fluent -public final class SynapseSparkProperties { +public final class SynapseSparkProperties implements JsonSerializable { /* * Auto scale properties. */ - @JsonProperty(value = "autoScaleProperties") private AutoScaleProperties autoScaleProperties; /* * Auto pause properties. */ - @JsonProperty(value = "autoPauseProperties") private AutoPauseProperties autoPauseProperties; /* * Spark version. */ - @JsonProperty(value = "sparkVersion") private String sparkVersion; /* * The number of compute nodes currently assigned to the compute. */ - @JsonProperty(value = "nodeCount") private Integer nodeCount; /* * Node size. */ - @JsonProperty(value = "nodeSize") private String nodeSize; /* * Node size family. */ - @JsonProperty(value = "nodeSizeFamily") private String nodeSizeFamily; /* * Azure subscription identifier. */ - @JsonProperty(value = "subscriptionId") private String subscriptionId; /* * Name of the resource group in which workspace is located. */ - @JsonProperty(value = "resourceGroup") private String resourceGroup; /* * Name of Azure Machine Learning workspace. */ - @JsonProperty(value = "workspaceName") private String workspaceName; /* * Pool name. */ - @JsonProperty(value = "poolName") private String poolName; - /** Creates an instance of SynapseSparkProperties class. */ + /** + * Creates an instance of SynapseSparkProperties class. + */ public SynapseSparkProperties() { } /** * Get the autoScaleProperties property: Auto scale properties. - * + * * @return the autoScaleProperties value. */ public AutoScaleProperties autoScaleProperties() { @@ -85,7 +83,7 @@ public AutoScaleProperties autoScaleProperties() { /** * Set the autoScaleProperties property: Auto scale properties. - * + * * @param autoScaleProperties the autoScaleProperties value to set. * @return the SynapseSparkProperties object itself. */ @@ -96,7 +94,7 @@ public SynapseSparkProperties withAutoScaleProperties(AutoScaleProperties autoSc /** * Get the autoPauseProperties property: Auto pause properties. - * + * * @return the autoPauseProperties value. */ public AutoPauseProperties autoPauseProperties() { @@ -105,7 +103,7 @@ public AutoPauseProperties autoPauseProperties() { /** * Set the autoPauseProperties property: Auto pause properties. - * + * * @param autoPauseProperties the autoPauseProperties value to set. * @return the SynapseSparkProperties object itself. */ @@ -116,7 +114,7 @@ public SynapseSparkProperties withAutoPauseProperties(AutoPauseProperties autoPa /** * Get the sparkVersion property: Spark version. - * + * * @return the sparkVersion value. */ public String sparkVersion() { @@ -125,7 +123,7 @@ public String sparkVersion() { /** * Set the sparkVersion property: Spark version. - * + * * @param sparkVersion the sparkVersion value to set. * @return the SynapseSparkProperties object itself. */ @@ -136,7 +134,7 @@ public SynapseSparkProperties withSparkVersion(String sparkVersion) { /** * Get the nodeCount property: The number of compute nodes currently assigned to the compute. - * + * * @return the nodeCount value. */ public Integer nodeCount() { @@ -145,7 +143,7 @@ public Integer nodeCount() { /** * Set the nodeCount property: The number of compute nodes currently assigned to the compute. - * + * * @param nodeCount the nodeCount value to set. * @return the SynapseSparkProperties object itself. */ @@ -156,7 +154,7 @@ public SynapseSparkProperties withNodeCount(Integer nodeCount) { /** * Get the nodeSize property: Node size. - * + * * @return the nodeSize value. */ public String nodeSize() { @@ -165,7 +163,7 @@ public String nodeSize() { /** * Set the nodeSize property: Node size. - * + * * @param nodeSize the nodeSize value to set. * @return the SynapseSparkProperties object itself. */ @@ -176,7 +174,7 @@ public SynapseSparkProperties withNodeSize(String nodeSize) { /** * Get the nodeSizeFamily property: Node size family. - * + * * @return the nodeSizeFamily value. */ public String nodeSizeFamily() { @@ -185,7 +183,7 @@ public String nodeSizeFamily() { /** * Set the nodeSizeFamily property: Node size family. - * + * * @param nodeSizeFamily the nodeSizeFamily value to set. * @return the SynapseSparkProperties object itself. */ @@ -196,7 +194,7 @@ public SynapseSparkProperties withNodeSizeFamily(String nodeSizeFamily) { /** * Get the subscriptionId property: Azure subscription identifier. - * + * * @return the subscriptionId value. */ public String subscriptionId() { @@ -205,7 +203,7 @@ public String subscriptionId() { /** * Set the subscriptionId property: Azure subscription identifier. - * + * * @param subscriptionId the subscriptionId value to set. * @return the SynapseSparkProperties object itself. */ @@ -216,7 +214,7 @@ public SynapseSparkProperties withSubscriptionId(String subscriptionId) { /** * Get the resourceGroup property: Name of the resource group in which workspace is located. - * + * * @return the resourceGroup value. */ public String resourceGroup() { @@ -225,7 +223,7 @@ public String resourceGroup() { /** * Set the resourceGroup property: Name of the resource group in which workspace is located. - * + * * @param resourceGroup the resourceGroup value to set. * @return the SynapseSparkProperties object itself. */ @@ -236,7 +234,7 @@ public SynapseSparkProperties withResourceGroup(String resourceGroup) { /** * Get the workspaceName property: Name of Azure Machine Learning workspace. - * + * * @return the workspaceName value. */ public String workspaceName() { @@ -245,7 +243,7 @@ public String workspaceName() { /** * Set the workspaceName property: Name of Azure Machine Learning workspace. - * + * * @param workspaceName the workspaceName value to set. * @return the SynapseSparkProperties object itself. */ @@ -256,7 +254,7 @@ public SynapseSparkProperties withWorkspaceName(String workspaceName) { /** * Get the poolName property: Pool name. - * + * * @return the poolName value. */ public String poolName() { @@ -265,7 +263,7 @@ public String poolName() { /** * Set the poolName property: Pool name. - * + * * @param poolName the poolName value to set. * @return the SynapseSparkProperties object itself. */ @@ -276,7 +274,7 @@ public SynapseSparkProperties withPoolName(String poolName) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -287,4 +285,67 @@ public void validate() { autoPauseProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("autoScaleProperties", this.autoScaleProperties); + jsonWriter.writeJsonField("autoPauseProperties", this.autoPauseProperties); + jsonWriter.writeStringField("sparkVersion", this.sparkVersion); + jsonWriter.writeNumberField("nodeCount", this.nodeCount); + jsonWriter.writeStringField("nodeSize", this.nodeSize); + jsonWriter.writeStringField("nodeSizeFamily", this.nodeSizeFamily); + jsonWriter.writeStringField("subscriptionId", this.subscriptionId); + jsonWriter.writeStringField("resourceGroup", this.resourceGroup); + jsonWriter.writeStringField("workspaceName", this.workspaceName); + jsonWriter.writeStringField("poolName", this.poolName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SynapseSparkProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SynapseSparkProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SynapseSparkProperties. + */ + public static SynapseSparkProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SynapseSparkProperties deserializedSynapseSparkProperties = new SynapseSparkProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("autoScaleProperties".equals(fieldName)) { + deserializedSynapseSparkProperties.autoScaleProperties = AutoScaleProperties.fromJson(reader); + } else if ("autoPauseProperties".equals(fieldName)) { + deserializedSynapseSparkProperties.autoPauseProperties = AutoPauseProperties.fromJson(reader); + } else if ("sparkVersion".equals(fieldName)) { + deserializedSynapseSparkProperties.sparkVersion = reader.getString(); + } else if ("nodeCount".equals(fieldName)) { + deserializedSynapseSparkProperties.nodeCount = reader.getNullable(JsonReader::getInt); + } else if ("nodeSize".equals(fieldName)) { + deserializedSynapseSparkProperties.nodeSize = reader.getString(); + } else if ("nodeSizeFamily".equals(fieldName)) { + deserializedSynapseSparkProperties.nodeSizeFamily = reader.getString(); + } else if ("subscriptionId".equals(fieldName)) { + deserializedSynapseSparkProperties.subscriptionId = reader.getString(); + } else if ("resourceGroup".equals(fieldName)) { + deserializedSynapseSparkProperties.resourceGroup = reader.getString(); + } else if ("workspaceName".equals(fieldName)) { + deserializedSynapseSparkProperties.workspaceName = reader.getString(); + } else if ("poolName".equals(fieldName)) { + deserializedSynapseSparkProperties.poolName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSynapseSparkProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SystemCreatedAcrAccount.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SystemCreatedAcrAccount.java new file mode 100644 index 0000000000000..1bbd63d0359d0 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SystemCreatedAcrAccount.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The SystemCreatedAcrAccount model. + */ +@Fluent +public final class SystemCreatedAcrAccount implements JsonSerializable { + /* + * Name of the ACR account + */ + private String acrAccountName; + + /* + * SKU of the ACR account + */ + private String acrAccountSku; + + /* + * This is populated once the ACR account is created. + */ + private ArmResourceId armResourceId; + + /** + * Creates an instance of SystemCreatedAcrAccount class. + */ + public SystemCreatedAcrAccount() { + } + + /** + * Get the acrAccountName property: Name of the ACR account. + * + * @return the acrAccountName value. + */ + public String acrAccountName() { + return this.acrAccountName; + } + + /** + * Set the acrAccountName property: Name of the ACR account. + * + * @param acrAccountName the acrAccountName value to set. + * @return the SystemCreatedAcrAccount object itself. + */ + public SystemCreatedAcrAccount withAcrAccountName(String acrAccountName) { + this.acrAccountName = acrAccountName; + return this; + } + + /** + * Get the acrAccountSku property: SKU of the ACR account. + * + * @return the acrAccountSku value. + */ + public String acrAccountSku() { + return this.acrAccountSku; + } + + /** + * Set the acrAccountSku property: SKU of the ACR account. + * + * @param acrAccountSku the acrAccountSku value to set. + * @return the SystemCreatedAcrAccount object itself. + */ + public SystemCreatedAcrAccount withAcrAccountSku(String acrAccountSku) { + this.acrAccountSku = acrAccountSku; + return this; + } + + /** + * Get the armResourceId property: This is populated once the ACR account is created. + * + * @return the armResourceId value. + */ + public ArmResourceId armResourceId() { + return this.armResourceId; + } + + /** + * Set the armResourceId property: This is populated once the ACR account is created. + * + * @param armResourceId the armResourceId value to set. + * @return the SystemCreatedAcrAccount object itself. + */ + public SystemCreatedAcrAccount withArmResourceId(ArmResourceId armResourceId) { + this.armResourceId = armResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (armResourceId() != null) { + armResourceId().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("acrAccountName", this.acrAccountName); + jsonWriter.writeStringField("acrAccountSku", this.acrAccountSku); + jsonWriter.writeJsonField("armResourceId", this.armResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SystemCreatedAcrAccount from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SystemCreatedAcrAccount if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SystemCreatedAcrAccount. + */ + public static SystemCreatedAcrAccount fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SystemCreatedAcrAccount deserializedSystemCreatedAcrAccount = new SystemCreatedAcrAccount(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("acrAccountName".equals(fieldName)) { + deserializedSystemCreatedAcrAccount.acrAccountName = reader.getString(); + } else if ("acrAccountSku".equals(fieldName)) { + deserializedSystemCreatedAcrAccount.acrAccountSku = reader.getString(); + } else if ("armResourceId".equals(fieldName)) { + deserializedSystemCreatedAcrAccount.armResourceId = ArmResourceId.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSystemCreatedAcrAccount; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SystemCreatedStorageAccount.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SystemCreatedStorageAccount.java new file mode 100644 index 0000000000000..67a7acf2c9553 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SystemCreatedStorageAccount.java @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The SystemCreatedStorageAccount model. + */ +@Fluent +public final class SystemCreatedStorageAccount implements JsonSerializable { + /* + * Public blob access allowed + */ + private Boolean allowBlobPublicAccess; + + /* + * This is populated once the storage account is created. + */ + private ArmResourceId armResourceId; + + /* + * HNS enabled for storage account + */ + private Boolean storageAccountHnsEnabled; + + /* + * Name of the storage account + */ + private String storageAccountName; + + /* + * Allowed values: + * "Standard_LRS", + * "Standard_GRS", + * "Standard_RAGRS", + * "Standard_ZRS", + * "Standard_GZRS", + * "Standard_RAGZRS", + * "Premium_LRS", + * "Premium_ZRS" + */ + private String storageAccountType; + + /** + * Creates an instance of SystemCreatedStorageAccount class. + */ + public SystemCreatedStorageAccount() { + } + + /** + * Get the allowBlobPublicAccess property: Public blob access allowed. + * + * @return the allowBlobPublicAccess value. + */ + public Boolean allowBlobPublicAccess() { + return this.allowBlobPublicAccess; + } + + /** + * Set the allowBlobPublicAccess property: Public blob access allowed. + * + * @param allowBlobPublicAccess the allowBlobPublicAccess value to set. + * @return the SystemCreatedStorageAccount object itself. + */ + public SystemCreatedStorageAccount withAllowBlobPublicAccess(Boolean allowBlobPublicAccess) { + this.allowBlobPublicAccess = allowBlobPublicAccess; + return this; + } + + /** + * Get the armResourceId property: This is populated once the storage account is created. + * + * @return the armResourceId value. + */ + public ArmResourceId armResourceId() { + return this.armResourceId; + } + + /** + * Set the armResourceId property: This is populated once the storage account is created. + * + * @param armResourceId the armResourceId value to set. + * @return the SystemCreatedStorageAccount object itself. + */ + public SystemCreatedStorageAccount withArmResourceId(ArmResourceId armResourceId) { + this.armResourceId = armResourceId; + return this; + } + + /** + * Get the storageAccountHnsEnabled property: HNS enabled for storage account. + * + * @return the storageAccountHnsEnabled value. + */ + public Boolean storageAccountHnsEnabled() { + return this.storageAccountHnsEnabled; + } + + /** + * Set the storageAccountHnsEnabled property: HNS enabled for storage account. + * + * @param storageAccountHnsEnabled the storageAccountHnsEnabled value to set. + * @return the SystemCreatedStorageAccount object itself. + */ + public SystemCreatedStorageAccount withStorageAccountHnsEnabled(Boolean storageAccountHnsEnabled) { + this.storageAccountHnsEnabled = storageAccountHnsEnabled; + return this; + } + + /** + * Get the storageAccountName property: Name of the storage account. + * + * @return the storageAccountName value. + */ + public String storageAccountName() { + return this.storageAccountName; + } + + /** + * Set the storageAccountName property: Name of the storage account. + * + * @param storageAccountName the storageAccountName value to set. + * @return the SystemCreatedStorageAccount object itself. + */ + public SystemCreatedStorageAccount withStorageAccountName(String storageAccountName) { + this.storageAccountName = storageAccountName; + return this; + } + + /** + * Get the storageAccountType property: Allowed values: + * "Standard_LRS", + * "Standard_GRS", + * "Standard_RAGRS", + * "Standard_ZRS", + * "Standard_GZRS", + * "Standard_RAGZRS", + * "Premium_LRS", + * "Premium_ZRS". + * + * @return the storageAccountType value. + */ + public String storageAccountType() { + return this.storageAccountType; + } + + /** + * Set the storageAccountType property: Allowed values: + * "Standard_LRS", + * "Standard_GRS", + * "Standard_RAGRS", + * "Standard_ZRS", + * "Standard_GZRS", + * "Standard_RAGZRS", + * "Premium_LRS", + * "Premium_ZRS". + * + * @param storageAccountType the storageAccountType value to set. + * @return the SystemCreatedStorageAccount object itself. + */ + public SystemCreatedStorageAccount withStorageAccountType(String storageAccountType) { + this.storageAccountType = storageAccountType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (armResourceId() != null) { + armResourceId().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("allowBlobPublicAccess", this.allowBlobPublicAccess); + jsonWriter.writeJsonField("armResourceId", this.armResourceId); + jsonWriter.writeBooleanField("storageAccountHnsEnabled", this.storageAccountHnsEnabled); + jsonWriter.writeStringField("storageAccountName", this.storageAccountName); + jsonWriter.writeStringField("storageAccountType", this.storageAccountType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SystemCreatedStorageAccount from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SystemCreatedStorageAccount if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SystemCreatedStorageAccount. + */ + public static SystemCreatedStorageAccount fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SystemCreatedStorageAccount deserializedSystemCreatedStorageAccount = new SystemCreatedStorageAccount(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("allowBlobPublicAccess".equals(fieldName)) { + deserializedSystemCreatedStorageAccount.allowBlobPublicAccess + = reader.getNullable(JsonReader::getBoolean); + } else if ("armResourceId".equals(fieldName)) { + deserializedSystemCreatedStorageAccount.armResourceId = ArmResourceId.fromJson(reader); + } else if ("storageAccountHnsEnabled".equals(fieldName)) { + deserializedSystemCreatedStorageAccount.storageAccountHnsEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("storageAccountName".equals(fieldName)) { + deserializedSystemCreatedStorageAccount.storageAccountName = reader.getString(); + } else if ("storageAccountType".equals(fieldName)) { + deserializedSystemCreatedStorageAccount.storageAccountType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSystemCreatedStorageAccount; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SystemService.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SystemService.java index 3bdbdeaf51e7e..0ebdb9798ed76 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SystemService.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/SystemService.java @@ -5,36 +5,41 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** A system service running on a compute. */ +/** + * A system service running on a compute. + */ @Immutable -public final class SystemService { +public final class SystemService implements JsonSerializable { /* * The type of this system service. */ - @JsonProperty(value = "systemServiceType", access = JsonProperty.Access.WRITE_ONLY) private String systemServiceType; /* * Public IP address */ - @JsonProperty(value = "publicIpAddress", access = JsonProperty.Access.WRITE_ONLY) private String publicIpAddress; /* * The version for this type. */ - @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) private String version; - /** Creates an instance of SystemService class. */ + /** + * Creates an instance of SystemService class. + */ public SystemService() { } /** * Get the systemServiceType property: The type of this system service. - * + * * @return the systemServiceType value. */ public String systemServiceType() { @@ -43,7 +48,7 @@ public String systemServiceType() { /** * Get the publicIpAddress property: Public IP address. - * + * * @return the publicIpAddress value. */ public String publicIpAddress() { @@ -52,7 +57,7 @@ public String publicIpAddress() { /** * Get the version property: The version for this type. - * + * * @return the version value. */ public String version() { @@ -61,9 +66,48 @@ public String version() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SystemService from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SystemService if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SystemService. + */ + public static SystemService fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SystemService deserializedSystemService = new SystemService(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("systemServiceType".equals(fieldName)) { + deserializedSystemService.systemServiceType = reader.getString(); + } else if ("publicIpAddress".equals(fieldName)) { + deserializedSystemService.publicIpAddress = reader.getString(); + } else if ("version".equals(fieldName)) { + deserializedSystemService.version = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSystemService; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TableVertical.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TableVertical.java index c9bb43ee04433..ae837f005e88d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TableVertical.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TableVertical.java @@ -5,41 +5,42 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** Abstract class for AutoML tasks that use table dataset as input - such as Classification/Regression/Forecasting. */ +/** + * Abstract class for AutoML tasks that use table dataset as input - such as Classification/Regression/Forecasting. + */ @Fluent -public class TableVertical { +public class TableVertical implements JsonSerializable { /* * Columns to use for CVSplit data. */ - @JsonProperty(value = "cvSplitColumnNames") private List cvSplitColumnNames; /* * Featurization inputs needed for AutoML job. */ - @JsonProperty(value = "featurizationSettings") private TableVerticalFeaturizationSettings featurizationSettings; /* * Execution constraints for AutoMLJob. */ - @JsonProperty(value = "limitSettings") private TableVerticalLimitSettings limitSettings; /* * Number of cross validation folds to be applied on training dataset * when validation dataset is not provided. */ - @JsonProperty(value = "nCrossValidations") private NCrossValidations nCrossValidations; /* * Test data input. */ - @JsonProperty(value = "testData") private MLTableJobInput testData; /* @@ -47,13 +48,11 @@ public class TableVertical { * Values between (0.0 , 1.0) * Applied when validation dataset is not provided. */ - @JsonProperty(value = "testDataSize") private Double testDataSize; /* * Validation data inputs. */ - @JsonProperty(value = "validationData") private MLTableJobInput validationData; /* @@ -61,23 +60,23 @@ public class TableVertical { * Values between (0.0 , 1.0) * Applied when validation dataset is not provided. */ - @JsonProperty(value = "validationDataSize") private Double validationDataSize; /* * 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. */ - @JsonProperty(value = "weightColumnName") private String weightColumnName; - /** Creates an instance of TableVertical class. */ + /** + * Creates an instance of TableVertical class. + */ public TableVertical() { } /** * Get the cvSplitColumnNames property: Columns to use for CVSplit data. - * + * * @return the cvSplitColumnNames value. */ public List cvSplitColumnNames() { @@ -86,7 +85,7 @@ public List cvSplitColumnNames() { /** * Set the cvSplitColumnNames property: Columns to use for CVSplit data. - * + * * @param cvSplitColumnNames the cvSplitColumnNames value to set. * @return the TableVertical object itself. */ @@ -97,7 +96,7 @@ public TableVertical withCvSplitColumnNames(List cvSplitColumnNames) { /** * Get the featurizationSettings property: Featurization inputs needed for AutoML job. - * + * * @return the featurizationSettings value. */ public TableVerticalFeaturizationSettings featurizationSettings() { @@ -106,7 +105,7 @@ public TableVerticalFeaturizationSettings featurizationSettings() { /** * Set the featurizationSettings property: Featurization inputs needed for AutoML job. - * + * * @param featurizationSettings the featurizationSettings value to set. * @return the TableVertical object itself. */ @@ -117,7 +116,7 @@ public TableVertical withFeaturizationSettings(TableVerticalFeaturizationSetting /** * Get the limitSettings property: Execution constraints for AutoMLJob. - * + * * @return the limitSettings value. */ public TableVerticalLimitSettings limitSettings() { @@ -126,7 +125,7 @@ public TableVerticalLimitSettings limitSettings() { /** * Set the limitSettings property: Execution constraints for AutoMLJob. - * + * * @param limitSettings the limitSettings value to set. * @return the TableVertical object itself. */ @@ -136,9 +135,9 @@ public TableVertical withLimitSettings(TableVerticalLimitSettings limitSettings) } /** - * Get the nCrossValidations property: Number of cross validation folds to be applied on training dataset when - * validation dataset is not provided. - * + * Get the nCrossValidations property: Number of cross validation folds to be applied on training dataset + * when validation dataset is not provided. + * * @return the nCrossValidations value. */ public NCrossValidations nCrossValidations() { @@ -146,9 +145,9 @@ public NCrossValidations nCrossValidations() { } /** - * Set the nCrossValidations property: Number of cross validation folds to be applied on training dataset when - * validation dataset is not provided. - * + * Set the nCrossValidations property: Number of cross validation folds to be applied on training dataset + * when validation dataset is not provided. + * * @param nCrossValidations the nCrossValidations value to set. * @return the TableVertical object itself. */ @@ -159,7 +158,7 @@ public TableVertical withNCrossValidations(NCrossValidations nCrossValidations) /** * Get the testData property: Test data input. - * + * * @return the testData value. */ public MLTableJobInput testData() { @@ -168,7 +167,7 @@ public MLTableJobInput testData() { /** * Set the testData property: Test data input. - * + * * @param testData the testData value to set. * @return the TableVertical object itself. */ @@ -179,8 +178,9 @@ public TableVertical withTestData(MLTableJobInput testData) { /** * Get the testDataSize property: 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. - * + * Values between (0.0 , 1.0) + * Applied when validation dataset is not provided. + * * @return the testDataSize value. */ public Double testDataSize() { @@ -189,8 +189,9 @@ public Double testDataSize() { /** * Set the testDataSize property: 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. - * + * Values between (0.0 , 1.0) + * Applied when validation dataset is not provided. + * * @param testDataSize the testDataSize value to set. * @return the TableVertical object itself. */ @@ -201,7 +202,7 @@ public TableVertical withTestDataSize(Double testDataSize) { /** * Get the validationData property: Validation data inputs. - * + * * @return the validationData value. */ public MLTableJobInput validationData() { @@ -210,7 +211,7 @@ public MLTableJobInput validationData() { /** * Set the validationData property: Validation data inputs. - * + * * @param validationData the validationData value to set. * @return the TableVertical object itself. */ @@ -221,8 +222,10 @@ public TableVertical withValidationData(MLTableJobInput validationData) { /** * Get the validationDataSize property: 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. - * + * purpose. + * Values between (0.0 , 1.0) + * Applied when validation dataset is not provided. + * * @return the validationDataSize value. */ public Double validationDataSize() { @@ -231,8 +234,10 @@ public Double validationDataSize() { /** * Set the validationDataSize property: 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. - * + * purpose. + * Values between (0.0 , 1.0) + * Applied when validation dataset is not provided. + * * @param validationDataSize the validationDataSize value to set. * @return the TableVertical object itself. */ @@ -244,7 +249,7 @@ public TableVertical withValidationDataSize(Double validationDataSize) { /** * Get the weightColumnName property: 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. - * + * * @return the weightColumnName value. */ public String weightColumnName() { @@ -254,7 +259,7 @@ public String weightColumnName() { /** * Set the weightColumnName property: 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. - * + * * @param weightColumnName the weightColumnName value to set. * @return the TableVertical object itself. */ @@ -265,7 +270,7 @@ public TableVertical withWeightColumnName(String weightColumnName) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -285,4 +290,67 @@ public void validate() { validationData().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("cvSplitColumnNames", this.cvSplitColumnNames, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("featurizationSettings", this.featurizationSettings); + jsonWriter.writeJsonField("limitSettings", this.limitSettings); + jsonWriter.writeJsonField("nCrossValidations", this.nCrossValidations); + jsonWriter.writeJsonField("testData", this.testData); + jsonWriter.writeNumberField("testDataSize", this.testDataSize); + jsonWriter.writeJsonField("validationData", this.validationData); + jsonWriter.writeNumberField("validationDataSize", this.validationDataSize); + jsonWriter.writeStringField("weightColumnName", this.weightColumnName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TableVertical from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TableVertical if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TableVertical. + */ + public static TableVertical fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TableVertical deserializedTableVertical = new TableVertical(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cvSplitColumnNames".equals(fieldName)) { + List cvSplitColumnNames = reader.readArray(reader1 -> reader1.getString()); + deserializedTableVertical.cvSplitColumnNames = cvSplitColumnNames; + } else if ("featurizationSettings".equals(fieldName)) { + deserializedTableVertical.featurizationSettings + = TableVerticalFeaturizationSettings.fromJson(reader); + } else if ("limitSettings".equals(fieldName)) { + deserializedTableVertical.limitSettings = TableVerticalLimitSettings.fromJson(reader); + } else if ("nCrossValidations".equals(fieldName)) { + deserializedTableVertical.nCrossValidations = NCrossValidations.fromJson(reader); + } else if ("testData".equals(fieldName)) { + deserializedTableVertical.testData = MLTableJobInput.fromJson(reader); + } else if ("testDataSize".equals(fieldName)) { + deserializedTableVertical.testDataSize = reader.getNullable(JsonReader::getDouble); + } else if ("validationData".equals(fieldName)) { + deserializedTableVertical.validationData = MLTableJobInput.fromJson(reader); + } else if ("validationDataSize".equals(fieldName)) { + deserializedTableVertical.validationDataSize = reader.getNullable(JsonReader::getDouble); + } else if ("weightColumnName".equals(fieldName)) { + deserializedTableVertical.weightColumnName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTableVertical; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TableVerticalFeaturizationSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TableVerticalFeaturizationSettings.java index d7ab964abe6df..4b9ada603d230 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TableVerticalFeaturizationSettings.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TableVerticalFeaturizationSettings.java @@ -5,31 +5,31 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; import java.util.Map; -/** Featurization Configuration. */ +/** + * Featurization Configuration. + */ @Fluent public final class TableVerticalFeaturizationSettings extends FeaturizationSettings { /* * These transformers shall not be used in featurization. */ - @JsonProperty(value = "blockedTransformers") private List blockedTransformers; /* * Dictionary of column name and its type (int, float, string, datetime etc). */ - @JsonProperty(value = "columnNameAndTypes") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map columnNameAndTypes; /* * Determines whether to use Dnn based featurizers for data featurization. */ - @JsonProperty(value = "enableDnnFeaturization") private Boolean enableDnnFeaturization; /* @@ -38,24 +38,23 @@ public final class TableVerticalFeaturizationSettings extends FeaturizationSetti * If 'Off' is selected then no featurization is done. * If 'Custom' is selected then user can specify additional inputs to customize how featurization is done. */ - @JsonProperty(value = "mode") private FeaturizationMode mode; /* * User can specify additional transformers to be used along with the columns to which it would be applied and * parameters for the transformer constructor. */ - @JsonProperty(value = "transformerParams") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map> transformerParams; - /** Creates an instance of TableVerticalFeaturizationSettings class. */ + /** + * Creates an instance of TableVerticalFeaturizationSettings class. + */ public TableVerticalFeaturizationSettings() { } /** * Get the blockedTransformers property: These transformers shall not be used in featurization. - * + * * @return the blockedTransformers value. */ public List blockedTransformers() { @@ -64,7 +63,7 @@ public List blockedTransformers() { /** * Set the blockedTransformers property: These transformers shall not be used in featurization. - * + * * @param blockedTransformers the blockedTransformers value to set. * @return the TableVerticalFeaturizationSettings object itself. */ @@ -75,7 +74,7 @@ public TableVerticalFeaturizationSettings withBlockedTransformers(List columnNameAndTypes() { @@ -84,7 +83,7 @@ public Map columnNameAndTypes() { /** * Set the columnNameAndTypes property: Dictionary of column name and its type (int, float, string, datetime etc). - * + * * @param columnNameAndTypes the columnNameAndTypes value to set. * @return the TableVerticalFeaturizationSettings object itself. */ @@ -95,7 +94,7 @@ public TableVerticalFeaturizationSettings withColumnNameAndTypes(Map> transformerParams() { @@ -150,17 +151,19 @@ public Map> transformerParams() { /** * Set the transformerParams property: User can specify additional transformers to be used along with the columns to * which it would be applied and parameters for the transformer constructor. - * + * * @param transformerParams the transformerParams value to set. * @return the TableVerticalFeaturizationSettings object itself. */ - public TableVerticalFeaturizationSettings withTransformerParams( - Map> transformerParams) { + public TableVerticalFeaturizationSettings + withTransformerParams(Map> transformerParams) { this.transformerParams = transformerParams; return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public TableVerticalFeaturizationSettings withDatasetLanguage(String datasetLanguage) { super.withDatasetLanguage(datasetLanguage); @@ -169,21 +172,80 @@ public TableVerticalFeaturizationSettings withDatasetLanguage(String datasetLang /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (transformerParams() != null) { - transformerParams() - .values() - .forEach( - e -> { - if (e != null) { - e.forEach(e1 -> e1.validate()); - } - }); + transformerParams().values().forEach(e -> { + if (e != null) { + e.forEach(e1 -> e1.validate()); + } + }); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("datasetLanguage", datasetLanguage()); + jsonWriter.writeArrayField("blockedTransformers", this.blockedTransformers, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeMapField("columnNameAndTypes", this.columnNameAndTypes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("enableDnnFeaturization", this.enableDnnFeaturization); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + jsonWriter.writeMapField("transformerParams", this.transformerParams, + (writer, element) -> writer.writeArray(element, (writer1, element1) -> writer1.writeJson(element1))); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TableVerticalFeaturizationSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TableVerticalFeaturizationSettings if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TableVerticalFeaturizationSettings. + */ + public static TableVerticalFeaturizationSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TableVerticalFeaturizationSettings deserializedTableVerticalFeaturizationSettings + = new TableVerticalFeaturizationSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("datasetLanguage".equals(fieldName)) { + deserializedTableVerticalFeaturizationSettings.withDatasetLanguage(reader.getString()); + } else if ("blockedTransformers".equals(fieldName)) { + List blockedTransformers + = reader.readArray(reader1 -> BlockedTransformers.fromString(reader1.getString())); + deserializedTableVerticalFeaturizationSettings.blockedTransformers = blockedTransformers; + } else if ("columnNameAndTypes".equals(fieldName)) { + Map columnNameAndTypes = reader.readMap(reader1 -> reader1.getString()); + deserializedTableVerticalFeaturizationSettings.columnNameAndTypes = columnNameAndTypes; + } else if ("enableDnnFeaturization".equals(fieldName)) { + deserializedTableVerticalFeaturizationSettings.enableDnnFeaturization + = reader.getNullable(JsonReader::getBoolean); + } else if ("mode".equals(fieldName)) { + deserializedTableVerticalFeaturizationSettings.mode + = FeaturizationMode.fromString(reader.getString()); + } else if ("transformerParams".equals(fieldName)) { + Map> transformerParams + = reader.readMap(reader1 -> reader1.readArray(reader2 -> ColumnTransformer.fromJson(reader2))); + deserializedTableVerticalFeaturizationSettings.transformerParams = transformerParams; + } else { + reader.skipChildren(); + } + } + + return deserializedTableVerticalFeaturizationSettings; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TableVerticalLimitSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TableVerticalLimitSettings.java index 92ee3e6cee9bb..a0e2cac0c12f6 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TableVerticalLimitSettings.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TableVerticalLimitSettings.java @@ -5,63 +5,65 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.Duration; -/** Job execution constraints. */ +/** + * Job execution constraints. + */ @Fluent -public final class TableVerticalLimitSettings { +public final class TableVerticalLimitSettings implements JsonSerializable { /* * Enable early termination, determines whether or not if AutoMLJob will terminate early if there is no score * improvement in last 20 iterations. */ - @JsonProperty(value = "enableEarlyTermination") private Boolean enableEarlyTermination; /* * Exit score for the AutoML job. */ - @JsonProperty(value = "exitScore") private Double exitScore; /* * Maximum Concurrent iterations. */ - @JsonProperty(value = "maxConcurrentTrials") private Integer maxConcurrentTrials; /* * Max cores per iteration. */ - @JsonProperty(value = "maxCoresPerTrial") private Integer maxCoresPerTrial; /* * Number of iterations. */ - @JsonProperty(value = "maxTrials") private Integer maxTrials; /* * AutoML job timeout. */ - @JsonProperty(value = "timeout") private Duration timeout; /* * Iteration timeout. */ - @JsonProperty(value = "trialTimeout") private Duration trialTimeout; - /** Creates an instance of TableVerticalLimitSettings class. */ + /** + * Creates an instance of TableVerticalLimitSettings class. + */ public TableVerticalLimitSettings() { } /** * Get the enableEarlyTermination property: Enable early termination, determines whether or not if AutoMLJob will * terminate early if there is no score improvement in last 20 iterations. - * + * * @return the enableEarlyTermination value. */ public Boolean enableEarlyTermination() { @@ -71,7 +73,7 @@ public Boolean enableEarlyTermination() { /** * Set the enableEarlyTermination property: Enable early termination, determines whether or not if AutoMLJob will * terminate early if there is no score improvement in last 20 iterations. - * + * * @param enableEarlyTermination the enableEarlyTermination value to set. * @return the TableVerticalLimitSettings object itself. */ @@ -82,7 +84,7 @@ public TableVerticalLimitSettings withEnableEarlyTermination(Boolean enableEarly /** * Get the exitScore property: Exit score for the AutoML job. - * + * * @return the exitScore value. */ public Double exitScore() { @@ -91,7 +93,7 @@ public Double exitScore() { /** * Set the exitScore property: Exit score for the AutoML job. - * + * * @param exitScore the exitScore value to set. * @return the TableVerticalLimitSettings object itself. */ @@ -102,7 +104,7 @@ public TableVerticalLimitSettings withExitScore(Double exitScore) { /** * Get the maxConcurrentTrials property: Maximum Concurrent iterations. - * + * * @return the maxConcurrentTrials value. */ public Integer maxConcurrentTrials() { @@ -111,7 +113,7 @@ public Integer maxConcurrentTrials() { /** * Set the maxConcurrentTrials property: Maximum Concurrent iterations. - * + * * @param maxConcurrentTrials the maxConcurrentTrials value to set. * @return the TableVerticalLimitSettings object itself. */ @@ -122,7 +124,7 @@ public TableVerticalLimitSettings withMaxConcurrentTrials(Integer maxConcurrentT /** * Get the maxCoresPerTrial property: Max cores per iteration. - * + * * @return the maxCoresPerTrial value. */ public Integer maxCoresPerTrial() { @@ -131,7 +133,7 @@ public Integer maxCoresPerTrial() { /** * Set the maxCoresPerTrial property: Max cores per iteration. - * + * * @param maxCoresPerTrial the maxCoresPerTrial value to set. * @return the TableVerticalLimitSettings object itself. */ @@ -142,7 +144,7 @@ public TableVerticalLimitSettings withMaxCoresPerTrial(Integer maxCoresPerTrial) /** * Get the maxTrials property: Number of iterations. - * + * * @return the maxTrials value. */ public Integer maxTrials() { @@ -151,7 +153,7 @@ public Integer maxTrials() { /** * Set the maxTrials property: Number of iterations. - * + * * @param maxTrials the maxTrials value to set. * @return the TableVerticalLimitSettings object itself. */ @@ -162,7 +164,7 @@ public TableVerticalLimitSettings withMaxTrials(Integer maxTrials) { /** * Get the timeout property: AutoML job timeout. - * + * * @return the timeout value. */ public Duration timeout() { @@ -171,7 +173,7 @@ public Duration timeout() { /** * Set the timeout property: AutoML job timeout. - * + * * @param timeout the timeout value to set. * @return the TableVerticalLimitSettings object itself. */ @@ -182,7 +184,7 @@ public TableVerticalLimitSettings withTimeout(Duration timeout) { /** * Get the trialTimeout property: Iteration timeout. - * + * * @return the trialTimeout value. */ public Duration trialTimeout() { @@ -191,7 +193,7 @@ public Duration trialTimeout() { /** * Set the trialTimeout property: Iteration timeout. - * + * * @param trialTimeout the trialTimeout value to set. * @return the TableVerticalLimitSettings object itself. */ @@ -202,9 +204,66 @@ public TableVerticalLimitSettings withTrialTimeout(Duration trialTimeout) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enableEarlyTermination", this.enableEarlyTermination); + jsonWriter.writeNumberField("exitScore", this.exitScore); + jsonWriter.writeNumberField("maxConcurrentTrials", this.maxConcurrentTrials); + jsonWriter.writeNumberField("maxCoresPerTrial", this.maxCoresPerTrial); + jsonWriter.writeNumberField("maxTrials", this.maxTrials); + jsonWriter.writeStringField("timeout", CoreUtils.durationToStringWithDays(this.timeout)); + jsonWriter.writeStringField("trialTimeout", CoreUtils.durationToStringWithDays(this.trialTimeout)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TableVerticalLimitSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TableVerticalLimitSettings if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TableVerticalLimitSettings. + */ + public static TableVerticalLimitSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TableVerticalLimitSettings deserializedTableVerticalLimitSettings = new TableVerticalLimitSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enableEarlyTermination".equals(fieldName)) { + deserializedTableVerticalLimitSettings.enableEarlyTermination + = reader.getNullable(JsonReader::getBoolean); + } else if ("exitScore".equals(fieldName)) { + deserializedTableVerticalLimitSettings.exitScore = reader.getNullable(JsonReader::getDouble); + } else if ("maxConcurrentTrials".equals(fieldName)) { + deserializedTableVerticalLimitSettings.maxConcurrentTrials = reader.getNullable(JsonReader::getInt); + } else if ("maxCoresPerTrial".equals(fieldName)) { + deserializedTableVerticalLimitSettings.maxCoresPerTrial = reader.getNullable(JsonReader::getInt); + } else if ("maxTrials".equals(fieldName)) { + deserializedTableVerticalLimitSettings.maxTrials = reader.getNullable(JsonReader::getInt); + } else if ("timeout".equals(fieldName)) { + deserializedTableVerticalLimitSettings.timeout + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else if ("trialTimeout".equals(fieldName)) { + deserializedTableVerticalLimitSettings.trialTimeout + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedTableVerticalLimitSettings; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TargetAggregationFunction.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TargetAggregationFunction.java index 49604b1815276..d0a6a1109c023 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TargetAggregationFunction.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TargetAggregationFunction.java @@ -5,29 +5,40 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Target aggregate function. */ +/** + * Target aggregate function. + */ public final class TargetAggregationFunction extends ExpandableStringEnum { - /** Static value None for TargetAggregationFunction. */ + /** + * Static value None for TargetAggregationFunction. + */ public static final TargetAggregationFunction NONE = fromString("None"); - /** Static value Sum for TargetAggregationFunction. */ + /** + * Static value Sum for TargetAggregationFunction. + */ public static final TargetAggregationFunction SUM = fromString("Sum"); - /** Static value Max for TargetAggregationFunction. */ + /** + * Static value Max for TargetAggregationFunction. + */ public static final TargetAggregationFunction MAX = fromString("Max"); - /** Static value Min for TargetAggregationFunction. */ + /** + * Static value Min for TargetAggregationFunction. + */ public static final TargetAggregationFunction MIN = fromString("Min"); - /** Static value Mean for TargetAggregationFunction. */ + /** + * Static value Mean for TargetAggregationFunction. + */ public static final TargetAggregationFunction MEAN = fromString("Mean"); /** * Creates a new instance of TargetAggregationFunction value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -36,18 +47,17 @@ public TargetAggregationFunction() { /** * Creates or finds a TargetAggregationFunction from its string representation. - * + * * @param name a name to look for. * @return the corresponding TargetAggregationFunction. */ - @JsonCreator public static TargetAggregationFunction fromString(String name) { return fromString(name, TargetAggregationFunction.class); } /** * Gets known TargetAggregationFunction values. - * + * * @return known TargetAggregationFunction values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TargetLags.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TargetLags.java index fccdc8d599ffe..3fb0813396560 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TargetLags.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TargetLags.java @@ -5,32 +5,105 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The number of past periods to lag from the target column. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "mode", - defaultImpl = TargetLags.class) -@JsonTypeName("TargetLags") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "Auto", value = AutoTargetLags.class), - @JsonSubTypes.Type(name = "Custom", value = CustomTargetLags.class) -}) +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The number of past periods to lag from the target column. + */ @Immutable -public class TargetLags { - /** Creates an instance of TargetLags class. */ +public class TargetLags implements JsonSerializable { + /* + * [Required] Set target lags mode - Auto/Custom + */ + private TargetLagsMode mode = TargetLagsMode.fromString("TargetLags"); + + /** + * Creates an instance of TargetLags class. + */ public TargetLags() { } + /** + * Get the mode property: [Required] Set target lags mode - Auto/Custom. + * + * @return the mode value. + */ + public TargetLagsMode mode() { + return this.mode; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TargetLags from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TargetLags if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the TargetLags. + */ + public static TargetLags fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("mode".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Auto".equals(discriminatorValue)) { + return AutoTargetLags.fromJson(readerToUse.reset()); + } else if ("Custom".equals(discriminatorValue)) { + return CustomTargetLags.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static TargetLags fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TargetLags deserializedTargetLags = new TargetLags(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("mode".equals(fieldName)) { + deserializedTargetLags.mode = TargetLagsMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedTargetLags; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TargetLagsMode.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TargetLagsMode.java index ef47b6b6d6b87..99105013ef132 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TargetLagsMode.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TargetLagsMode.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Target lags selection modes. */ +/** + * Target lags selection modes. + */ public final class TargetLagsMode extends ExpandableStringEnum { - /** Static value Auto for TargetLagsMode. */ + /** + * Static value Auto for TargetLagsMode. + */ public static final TargetLagsMode AUTO = fromString("Auto"); - /** Static value Custom for TargetLagsMode. */ + /** + * Static value Custom for TargetLagsMode. + */ public static final TargetLagsMode CUSTOM = fromString("Custom"); /** * Creates a new instance of TargetLagsMode value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public TargetLagsMode() { /** * Creates or finds a TargetLagsMode from its string representation. - * + * * @param name a name to look for. * @return the corresponding TargetLagsMode. */ - @JsonCreator public static TargetLagsMode fromString(String name) { return fromString(name, TargetLagsMode.class); } /** * Gets known TargetLagsMode values. - * + * * @return known TargetLagsMode values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TargetRollingWindowSize.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TargetRollingWindowSize.java index 3596ee80736e3..d3d2c38bfa5ac 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TargetRollingWindowSize.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TargetRollingWindowSize.java @@ -5,32 +5,106 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Forecasting target rolling window size. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "mode", - defaultImpl = TargetRollingWindowSize.class) -@JsonTypeName("TargetRollingWindowSize") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "Auto", value = AutoTargetRollingWindowSize.class), - @JsonSubTypes.Type(name = "Custom", value = CustomTargetRollingWindowSize.class) -}) +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Forecasting target rolling window size. + */ @Immutable -public class TargetRollingWindowSize { - /** Creates an instance of TargetRollingWindowSize class. */ +public class TargetRollingWindowSize implements JsonSerializable { + /* + * [Required] TargetRollingWindowSiz detection mode. + */ + private TargetRollingWindowSizeMode mode = TargetRollingWindowSizeMode.fromString("TargetRollingWindowSize"); + + /** + * Creates an instance of TargetRollingWindowSize class. + */ public TargetRollingWindowSize() { } + /** + * Get the mode property: [Required] TargetRollingWindowSiz detection mode. + * + * @return the mode value. + */ + public TargetRollingWindowSizeMode mode() { + return this.mode; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TargetRollingWindowSize from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TargetRollingWindowSize if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the TargetRollingWindowSize. + */ + public static TargetRollingWindowSize fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("mode".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Auto".equals(discriminatorValue)) { + return AutoTargetRollingWindowSize.fromJson(readerToUse.reset()); + } else if ("Custom".equals(discriminatorValue)) { + return CustomTargetRollingWindowSize.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static TargetRollingWindowSize fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TargetRollingWindowSize deserializedTargetRollingWindowSize = new TargetRollingWindowSize(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("mode".equals(fieldName)) { + deserializedTargetRollingWindowSize.mode + = TargetRollingWindowSizeMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedTargetRollingWindowSize; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TargetRollingWindowSizeMode.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TargetRollingWindowSizeMode.java index abd6fa5e2f673..7a87b9bc2256a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TargetRollingWindowSizeMode.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TargetRollingWindowSizeMode.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Target rolling windows size mode. */ +/** + * Target rolling windows size mode. + */ public final class TargetRollingWindowSizeMode extends ExpandableStringEnum { - /** Static value Auto for TargetRollingWindowSizeMode. */ + /** + * Static value Auto for TargetRollingWindowSizeMode. + */ public static final TargetRollingWindowSizeMode AUTO = fromString("Auto"); - /** Static value Custom for TargetRollingWindowSizeMode. */ + /** + * Static value Custom for TargetRollingWindowSizeMode. + */ public static final TargetRollingWindowSizeMode CUSTOM = fromString("Custom"); /** * Creates a new instance of TargetRollingWindowSizeMode value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public TargetRollingWindowSizeMode() { /** * Creates or finds a TargetRollingWindowSizeMode from its string representation. - * + * * @param name a name to look for. * @return the corresponding TargetRollingWindowSizeMode. */ - @JsonCreator public static TargetRollingWindowSizeMode fromString(String name) { return fromString(name, TargetRollingWindowSizeMode.class); } /** * Gets known TargetRollingWindowSizeMode values. - * + * * @return known TargetRollingWindowSizeMode values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TargetUtilizationScaleSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TargetUtilizationScaleSettings.java index c40f464a708f7..e1cefba56bab4 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TargetUtilizationScaleSettings.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TargetUtilizationScaleSettings.java @@ -5,48 +5,63 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.Duration; -/** The TargetUtilizationScaleSettings model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "scaleType") -@JsonTypeName("TargetUtilization") +/** + * The TargetUtilizationScaleSettings model. + */ @Fluent public final class TargetUtilizationScaleSettings extends OnlineScaleSettings { + /* + * [Required] Type of deployment scaling algorithm + */ + private ScaleType scaleType = ScaleType.TARGET_UTILIZATION; + /* * The maximum number of instances that the deployment can scale to. The quota will be reserved for max_instances. */ - @JsonProperty(value = "maxInstances") private Integer maxInstances; /* * The minimum number of instances to always be present. */ - @JsonProperty(value = "minInstances") private Integer minInstances; /* * The polling interval in ISO 8691 format. Only supports duration with precision as low as Seconds. */ - @JsonProperty(value = "pollingInterval") private Duration pollingInterval; /* * Target CPU usage for the autoscaler. */ - @JsonProperty(value = "targetUtilizationPercentage") private Integer targetUtilizationPercentage; - /** Creates an instance of TargetUtilizationScaleSettings class. */ + /** + * Creates an instance of TargetUtilizationScaleSettings class. + */ public TargetUtilizationScaleSettings() { } + /** + * Get the scaleType property: [Required] Type of deployment scaling algorithm. + * + * @return the scaleType value. + */ + @Override + public ScaleType scaleType() { + return this.scaleType; + } + /** * Get the maxInstances property: The maximum number of instances that the deployment can scale to. The quota will * be reserved for max_instances. - * + * * @return the maxInstances value. */ public Integer maxInstances() { @@ -56,7 +71,7 @@ public Integer maxInstances() { /** * Set the maxInstances property: The maximum number of instances that the deployment can scale to. The quota will * be reserved for max_instances. - * + * * @param maxInstances the maxInstances value to set. * @return the TargetUtilizationScaleSettings object itself. */ @@ -67,7 +82,7 @@ public TargetUtilizationScaleSettings withMaxInstances(Integer maxInstances) { /** * Get the minInstances property: The minimum number of instances to always be present. - * + * * @return the minInstances value. */ public Integer minInstances() { @@ -76,7 +91,7 @@ public Integer minInstances() { /** * Set the minInstances property: The minimum number of instances to always be present. - * + * * @param minInstances the minInstances value to set. * @return the TargetUtilizationScaleSettings object itself. */ @@ -88,7 +103,7 @@ public TargetUtilizationScaleSettings withMinInstances(Integer minInstances) { /** * Get the pollingInterval property: The polling interval in ISO 8691 format. Only supports duration with precision * as low as Seconds. - * + * * @return the pollingInterval value. */ public Duration pollingInterval() { @@ -98,7 +113,7 @@ public Duration pollingInterval() { /** * Set the pollingInterval property: The polling interval in ISO 8691 format. Only supports duration with precision * as low as Seconds. - * + * * @param pollingInterval the pollingInterval value to set. * @return the TargetUtilizationScaleSettings object itself. */ @@ -109,7 +124,7 @@ public TargetUtilizationScaleSettings withPollingInterval(Duration pollingInterv /** * Get the targetUtilizationPercentage property: Target CPU usage for the autoscaler. - * + * * @return the targetUtilizationPercentage value. */ public Integer targetUtilizationPercentage() { @@ -118,7 +133,7 @@ public Integer targetUtilizationPercentage() { /** * Set the targetUtilizationPercentage property: Target CPU usage for the autoscaler. - * + * * @param targetUtilizationPercentage the targetUtilizationPercentage value to set. * @return the TargetUtilizationScaleSettings object itself. */ @@ -129,11 +144,62 @@ public TargetUtilizationScaleSettings withTargetUtilizationPercentage(Integer ta /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("scaleType", this.scaleType == null ? null : this.scaleType.toString()); + jsonWriter.writeNumberField("maxInstances", this.maxInstances); + jsonWriter.writeNumberField("minInstances", this.minInstances); + jsonWriter.writeStringField("pollingInterval", CoreUtils.durationToStringWithDays(this.pollingInterval)); + jsonWriter.writeNumberField("targetUtilizationPercentage", this.targetUtilizationPercentage); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TargetUtilizationScaleSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TargetUtilizationScaleSettings if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TargetUtilizationScaleSettings. + */ + public static TargetUtilizationScaleSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TargetUtilizationScaleSettings deserializedTargetUtilizationScaleSettings + = new TargetUtilizationScaleSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("scaleType".equals(fieldName)) { + deserializedTargetUtilizationScaleSettings.scaleType = ScaleType.fromString(reader.getString()); + } else if ("maxInstances".equals(fieldName)) { + deserializedTargetUtilizationScaleSettings.maxInstances = reader.getNullable(JsonReader::getInt); + } else if ("minInstances".equals(fieldName)) { + deserializedTargetUtilizationScaleSettings.minInstances = reader.getNullable(JsonReader::getInt); + } else if ("pollingInterval".equals(fieldName)) { + deserializedTargetUtilizationScaleSettings.pollingInterval + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else if ("targetUtilizationPercentage".equals(fieldName)) { + deserializedTargetUtilizationScaleSettings.targetUtilizationPercentage + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedTargetUtilizationScaleSettings; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TaskType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TaskType.java index abf23d57afbba..994f19ec1b570 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TaskType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TaskType.java @@ -5,44 +5,65 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** AutoMLJob Task type. */ +/** + * AutoMLJob Task type. + */ public final class TaskType extends ExpandableStringEnum { - /** Static value Classification for TaskType. */ + /** + * Static value Classification for TaskType. + */ public static final TaskType CLASSIFICATION = fromString("Classification"); - /** Static value Regression for TaskType. */ + /** + * Static value Regression for TaskType. + */ public static final TaskType REGRESSION = fromString("Regression"); - /** Static value Forecasting for TaskType. */ + /** + * Static value Forecasting for TaskType. + */ public static final TaskType FORECASTING = fromString("Forecasting"); - /** Static value ImageClassification for TaskType. */ + /** + * Static value ImageClassification for TaskType. + */ public static final TaskType IMAGE_CLASSIFICATION = fromString("ImageClassification"); - /** Static value ImageClassificationMultilabel for TaskType. */ + /** + * Static value ImageClassificationMultilabel for TaskType. + */ public static final TaskType IMAGE_CLASSIFICATION_MULTILABEL = fromString("ImageClassificationMultilabel"); - /** Static value ImageObjectDetection for TaskType. */ + /** + * Static value ImageObjectDetection for TaskType. + */ public static final TaskType IMAGE_OBJECT_DETECTION = fromString("ImageObjectDetection"); - /** Static value ImageInstanceSegmentation for TaskType. */ + /** + * Static value ImageInstanceSegmentation for TaskType. + */ public static final TaskType IMAGE_INSTANCE_SEGMENTATION = fromString("ImageInstanceSegmentation"); - /** Static value TextClassification for TaskType. */ + /** + * Static value TextClassification for TaskType. + */ public static final TaskType TEXT_CLASSIFICATION = fromString("TextClassification"); - /** Static value TextClassificationMultilabel for TaskType. */ + /** + * Static value TextClassificationMultilabel for TaskType. + */ public static final TaskType TEXT_CLASSIFICATION_MULTILABEL = fromString("TextClassificationMultilabel"); - /** Static value TextNER for TaskType. */ + /** + * Static value TextNER for TaskType. + */ public static final TaskType TEXT_NER = fromString("TextNER"); /** * Creates a new instance of TaskType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -51,18 +72,17 @@ public TaskType() { /** * Creates or finds a TaskType from its string representation. - * + * * @param name a name to look for. * @return the corresponding TaskType. */ - @JsonCreator public static TaskType fromString(String name) { return fromString(name, TaskType.class); } /** * Gets known TaskType values. - * + * * @return known TaskType values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TensorFlow.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TensorFlow.java index 618e0345d142e..57cb1b427cad0 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TensorFlow.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TensorFlow.java @@ -5,34 +5,50 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** TensorFlow distribution configuration. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "distributionType") -@JsonTypeName("TensorFlow") +/** + * TensorFlow distribution configuration. + */ @Fluent public final class TensorFlow extends DistributionConfiguration { + /* + * [Required] Specifies the type of distribution framework. + */ + private DistributionType distributionType = DistributionType.TENSOR_FLOW; + /* * Number of parameter server tasks. */ - @JsonProperty(value = "parameterServerCount") private Integer parameterServerCount; /* * Number of workers. If not specified, will default to the instance count. */ - @JsonProperty(value = "workerCount") private Integer workerCount; - /** Creates an instance of TensorFlow class. */ + /** + * Creates an instance of TensorFlow class. + */ public TensorFlow() { } + /** + * Get the distributionType property: [Required] Specifies the type of distribution framework. + * + * @return the distributionType value. + */ + @Override + public DistributionType distributionType() { + return this.distributionType; + } + /** * Get the parameterServerCount property: Number of parameter server tasks. - * + * * @return the parameterServerCount value. */ public Integer parameterServerCount() { @@ -41,7 +57,7 @@ public Integer parameterServerCount() { /** * Set the parameterServerCount property: Number of parameter server tasks. - * + * * @param parameterServerCount the parameterServerCount value to set. * @return the TensorFlow object itself. */ @@ -52,7 +68,7 @@ public TensorFlow withParameterServerCount(Integer parameterServerCount) { /** * Get the workerCount property: Number of workers. If not specified, will default to the instance count. - * + * * @return the workerCount value. */ public Integer workerCount() { @@ -61,7 +77,7 @@ public Integer workerCount() { /** * Set the workerCount property: Number of workers. If not specified, will default to the instance count. - * + * * @param workerCount the workerCount value to set. * @return the TensorFlow object itself. */ @@ -72,11 +88,54 @@ public TensorFlow withWorkerCount(Integer workerCount) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("distributionType", + this.distributionType == null ? null : this.distributionType.toString()); + jsonWriter.writeNumberField("parameterServerCount", this.parameterServerCount); + jsonWriter.writeNumberField("workerCount", this.workerCount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TensorFlow from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TensorFlow if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the TensorFlow. + */ + public static TensorFlow fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TensorFlow deserializedTensorFlow = new TensorFlow(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("distributionType".equals(fieldName)) { + deserializedTensorFlow.distributionType = DistributionType.fromString(reader.getString()); + } else if ("parameterServerCount".equals(fieldName)) { + deserializedTensorFlow.parameterServerCount = reader.getNullable(JsonReader::getInt); + } else if ("workerCount".equals(fieldName)) { + deserializedTensorFlow.workerCount = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedTensorFlow; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TextClassification.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TextClassification.java index 72f0a652601ee..1bc2ab5c7ce78 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TextClassification.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TextClassification.java @@ -5,46 +5,61 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Text Classification task in AutoML NLP vertical. NLP - Natural Language Processing. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") -@JsonTypeName("TextClassification") +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Text Classification task in AutoML NLP vertical. + * NLP - Natural Language Processing. + */ @Fluent public final class TextClassification extends AutoMLVertical { + /* + * [Required] Task type for AutoMLJob. + */ + private TaskType taskType = TaskType.TEXT_CLASSIFICATION; + /* * Primary metric for Text-Classification task. */ - @JsonProperty(value = "primaryMetric") private ClassificationPrimaryMetrics primaryMetric; /* * Featurization inputs needed for AutoML job. */ - @JsonProperty(value = "featurizationSettings") private NlpVerticalFeaturizationSettings featurizationSettings; /* * Execution constraints for AutoMLJob. */ - @JsonProperty(value = "limitSettings") private NlpVerticalLimitSettings limitSettings; /* * Validation data inputs. */ - @JsonProperty(value = "validationData") private MLTableJobInput validationData; - /** Creates an instance of TextClassification class. */ + /** + * Creates an instance of TextClassification class. + */ public TextClassification() { } + /** + * Get the taskType property: [Required] Task type for AutoMLJob. + * + * @return the taskType value. + */ + @Override + public TaskType taskType() { + return this.taskType; + } + /** * Get the primaryMetric property: Primary metric for Text-Classification task. - * + * * @return the primaryMetric value. */ public ClassificationPrimaryMetrics primaryMetric() { @@ -53,7 +68,7 @@ public ClassificationPrimaryMetrics primaryMetric() { /** * Set the primaryMetric property: Primary metric for Text-Classification task. - * + * * @param primaryMetric the primaryMetric value to set. * @return the TextClassification object itself. */ @@ -64,7 +79,7 @@ public TextClassification withPrimaryMetric(ClassificationPrimaryMetrics primary /** * Get the featurizationSettings property: Featurization inputs needed for AutoML job. - * + * * @return the featurizationSettings value. */ public NlpVerticalFeaturizationSettings featurizationSettings() { @@ -73,7 +88,7 @@ public NlpVerticalFeaturizationSettings featurizationSettings() { /** * Set the featurizationSettings property: Featurization inputs needed for AutoML job. - * + * * @param featurizationSettings the featurizationSettings value to set. * @return the TextClassification object itself. */ @@ -84,7 +99,7 @@ public TextClassification withFeaturizationSettings(NlpVerticalFeaturizationSett /** * Get the limitSettings property: Execution constraints for AutoMLJob. - * + * * @return the limitSettings value. */ public NlpVerticalLimitSettings limitSettings() { @@ -93,7 +108,7 @@ public NlpVerticalLimitSettings limitSettings() { /** * Set the limitSettings property: Execution constraints for AutoMLJob. - * + * * @param limitSettings the limitSettings value to set. * @return the TextClassification object itself. */ @@ -104,7 +119,7 @@ public TextClassification withLimitSettings(NlpVerticalLimitSettings limitSettin /** * Get the validationData property: Validation data inputs. - * + * * @return the validationData value. */ public MLTableJobInput validationData() { @@ -113,7 +128,7 @@ public MLTableJobInput validationData() { /** * Set the validationData property: Validation data inputs. - * + * * @param validationData the validationData value to set. * @return the TextClassification object itself. */ @@ -122,21 +137,27 @@ public TextClassification withValidationData(MLTableJobInput validationData) { return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public TextClassification withLogVerbosity(LogVerbosity logVerbosity) { super.withLogVerbosity(logVerbosity); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public TextClassification withTargetColumnName(String targetColumnName) { super.withTargetColumnName(targetColumnName); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public TextClassification withTrainingData(MLTableJobInput trainingData) { super.withTrainingData(trainingData); @@ -145,7 +166,7 @@ public TextClassification withTrainingData(MLTableJobInput trainingData) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -161,4 +182,64 @@ public void validate() { validationData().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("trainingData", trainingData()); + jsonWriter.writeStringField("logVerbosity", logVerbosity() == null ? null : logVerbosity().toString()); + jsonWriter.writeStringField("targetColumnName", targetColumnName()); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); + jsonWriter.writeStringField("primaryMetric", this.primaryMetric == null ? null : this.primaryMetric.toString()); + jsonWriter.writeJsonField("featurizationSettings", this.featurizationSettings); + jsonWriter.writeJsonField("limitSettings", this.limitSettings); + jsonWriter.writeJsonField("validationData", this.validationData); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextClassification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextClassification if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextClassification. + */ + public static TextClassification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TextClassification deserializedTextClassification = new TextClassification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("trainingData".equals(fieldName)) { + deserializedTextClassification.withTrainingData(MLTableJobInput.fromJson(reader)); + } else if ("logVerbosity".equals(fieldName)) { + deserializedTextClassification.withLogVerbosity(LogVerbosity.fromString(reader.getString())); + } else if ("targetColumnName".equals(fieldName)) { + deserializedTextClassification.withTargetColumnName(reader.getString()); + } else if ("taskType".equals(fieldName)) { + deserializedTextClassification.taskType = TaskType.fromString(reader.getString()); + } else if ("primaryMetric".equals(fieldName)) { + deserializedTextClassification.primaryMetric + = ClassificationPrimaryMetrics.fromString(reader.getString()); + } else if ("featurizationSettings".equals(fieldName)) { + deserializedTextClassification.featurizationSettings + = NlpVerticalFeaturizationSettings.fromJson(reader); + } else if ("limitSettings".equals(fieldName)) { + deserializedTextClassification.limitSettings = NlpVerticalLimitSettings.fromJson(reader); + } else if ("validationData".equals(fieldName)) { + deserializedTextClassification.validationData = MLTableJobInput.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTextClassification; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TextClassificationMultilabel.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TextClassificationMultilabel.java index ceb85f9675e78..eeb3802a1676f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TextClassificationMultilabel.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TextClassificationMultilabel.java @@ -5,48 +5,63 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Text Classification Multilabel task in AutoML NLP vertical. NLP - Natural Language Processing. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") -@JsonTypeName("TextClassificationMultilabel") +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Text Classification Multilabel task in AutoML NLP vertical. + * NLP - Natural Language Processing. + */ @Fluent public final class TextClassificationMultilabel extends AutoMLVertical { + /* + * [Required] Task type for AutoMLJob. + */ + private TaskType taskType = TaskType.TEXT_CLASSIFICATION_MULTILABEL; + /* * Primary metric for Text-Classification-Multilabel task. * Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. */ - @JsonProperty(value = "primaryMetric", access = JsonProperty.Access.WRITE_ONLY) private ClassificationMultilabelPrimaryMetrics primaryMetric; /* * Featurization inputs needed for AutoML job. */ - @JsonProperty(value = "featurizationSettings") private NlpVerticalFeaturizationSettings featurizationSettings; /* * Execution constraints for AutoMLJob. */ - @JsonProperty(value = "limitSettings") private NlpVerticalLimitSettings limitSettings; /* * Validation data inputs. */ - @JsonProperty(value = "validationData") private MLTableJobInput validationData; - /** Creates an instance of TextClassificationMultilabel class. */ + /** + * Creates an instance of TextClassificationMultilabel class. + */ public TextClassificationMultilabel() { } /** - * Get the primaryMetric property: Primary metric for Text-Classification-Multilabel task. Currently only Accuracy - * is supported as primary metric, hence user need not set it explicitly. - * + * Get the taskType property: [Required] Task type for AutoMLJob. + * + * @return the taskType value. + */ + @Override + public TaskType taskType() { + return this.taskType; + } + + /** + * Get the primaryMetric property: Primary metric for Text-Classification-Multilabel task. + * Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. + * * @return the primaryMetric value. */ public ClassificationMultilabelPrimaryMetrics primaryMetric() { @@ -55,7 +70,7 @@ public ClassificationMultilabelPrimaryMetrics primaryMetric() { /** * Get the featurizationSettings property: Featurization inputs needed for AutoML job. - * + * * @return the featurizationSettings value. */ public NlpVerticalFeaturizationSettings featurizationSettings() { @@ -64,19 +79,19 @@ public NlpVerticalFeaturizationSettings featurizationSettings() { /** * Set the featurizationSettings property: Featurization inputs needed for AutoML job. - * + * * @param featurizationSettings the featurizationSettings value to set. * @return the TextClassificationMultilabel object itself. */ - public TextClassificationMultilabel withFeaturizationSettings( - NlpVerticalFeaturizationSettings featurizationSettings) { + public TextClassificationMultilabel + withFeaturizationSettings(NlpVerticalFeaturizationSettings featurizationSettings) { this.featurizationSettings = featurizationSettings; return this; } /** * Get the limitSettings property: Execution constraints for AutoMLJob. - * + * * @return the limitSettings value. */ public NlpVerticalLimitSettings limitSettings() { @@ -85,7 +100,7 @@ public NlpVerticalLimitSettings limitSettings() { /** * Set the limitSettings property: Execution constraints for AutoMLJob. - * + * * @param limitSettings the limitSettings value to set. * @return the TextClassificationMultilabel object itself. */ @@ -96,7 +111,7 @@ public TextClassificationMultilabel withLimitSettings(NlpVerticalLimitSettings l /** * Get the validationData property: Validation data inputs. - * + * * @return the validationData value. */ public MLTableJobInput validationData() { @@ -105,7 +120,7 @@ public MLTableJobInput validationData() { /** * Set the validationData property: Validation data inputs. - * + * * @param validationData the validationData value to set. * @return the TextClassificationMultilabel object itself. */ @@ -114,21 +129,27 @@ public TextClassificationMultilabel withValidationData(MLTableJobInput validatio return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public TextClassificationMultilabel withLogVerbosity(LogVerbosity logVerbosity) { super.withLogVerbosity(logVerbosity); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public TextClassificationMultilabel withTargetColumnName(String targetColumnName) { super.withTargetColumnName(targetColumnName); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public TextClassificationMultilabel withTrainingData(MLTableJobInput trainingData) { super.withTrainingData(trainingData); @@ -137,7 +158,7 @@ public TextClassificationMultilabel withTrainingData(MLTableJobInput trainingDat /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -153,4 +174,64 @@ public void validate() { validationData().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("trainingData", trainingData()); + jsonWriter.writeStringField("logVerbosity", logVerbosity() == null ? null : logVerbosity().toString()); + jsonWriter.writeStringField("targetColumnName", targetColumnName()); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); + jsonWriter.writeJsonField("featurizationSettings", this.featurizationSettings); + jsonWriter.writeJsonField("limitSettings", this.limitSettings); + jsonWriter.writeJsonField("validationData", this.validationData); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextClassificationMultilabel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextClassificationMultilabel if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextClassificationMultilabel. + */ + public static TextClassificationMultilabel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TextClassificationMultilabel deserializedTextClassificationMultilabel = new TextClassificationMultilabel(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("trainingData".equals(fieldName)) { + deserializedTextClassificationMultilabel.withTrainingData(MLTableJobInput.fromJson(reader)); + } else if ("logVerbosity".equals(fieldName)) { + deserializedTextClassificationMultilabel + .withLogVerbosity(LogVerbosity.fromString(reader.getString())); + } else if ("targetColumnName".equals(fieldName)) { + deserializedTextClassificationMultilabel.withTargetColumnName(reader.getString()); + } else if ("taskType".equals(fieldName)) { + deserializedTextClassificationMultilabel.taskType = TaskType.fromString(reader.getString()); + } else if ("primaryMetric".equals(fieldName)) { + deserializedTextClassificationMultilabel.primaryMetric + = ClassificationMultilabelPrimaryMetrics.fromString(reader.getString()); + } else if ("featurizationSettings".equals(fieldName)) { + deserializedTextClassificationMultilabel.featurizationSettings + = NlpVerticalFeaturizationSettings.fromJson(reader); + } else if ("limitSettings".equals(fieldName)) { + deserializedTextClassificationMultilabel.limitSettings = NlpVerticalLimitSettings.fromJson(reader); + } else if ("validationData".equals(fieldName)) { + deserializedTextClassificationMultilabel.validationData = MLTableJobInput.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTextClassificationMultilabel; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TextNer.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TextNer.java index ed17e1f9beb25..135e27281f704 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TextNer.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TextNer.java @@ -5,48 +5,64 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Text-NER task in AutoML NLP vertical. NER - Named Entity Recognition. NLP - Natural Language Processing. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") -@JsonTypeName("TextNER") +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Text-NER task in AutoML NLP vertical. + * NER - Named Entity Recognition. + * NLP - Natural Language Processing. + */ @Fluent public final class TextNer extends AutoMLVertical { + /* + * [Required] Task type for AutoMLJob. + */ + private TaskType taskType = TaskType.TEXT_NER; + /* * Primary metric for Text-NER task. * Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. */ - @JsonProperty(value = "primaryMetric", access = JsonProperty.Access.WRITE_ONLY) private ClassificationPrimaryMetrics primaryMetric; /* * Featurization inputs needed for AutoML job. */ - @JsonProperty(value = "featurizationSettings") private NlpVerticalFeaturizationSettings featurizationSettings; /* * Execution constraints for AutoMLJob. */ - @JsonProperty(value = "limitSettings") private NlpVerticalLimitSettings limitSettings; /* * Validation data inputs. */ - @JsonProperty(value = "validationData") private MLTableJobInput validationData; - /** Creates an instance of TextNer class. */ + /** + * Creates an instance of TextNer class. + */ public TextNer() { } /** - * Get the primaryMetric property: Primary metric for Text-NER task. Only 'Accuracy' is supported for Text-NER, so - * user need not set this explicitly. - * + * Get the taskType property: [Required] Task type for AutoMLJob. + * + * @return the taskType value. + */ + @Override + public TaskType taskType() { + return this.taskType; + } + + /** + * Get the primaryMetric property: Primary metric for Text-NER task. + * Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. + * * @return the primaryMetric value. */ public ClassificationPrimaryMetrics primaryMetric() { @@ -55,7 +71,7 @@ public ClassificationPrimaryMetrics primaryMetric() { /** * Get the featurizationSettings property: Featurization inputs needed for AutoML job. - * + * * @return the featurizationSettings value. */ public NlpVerticalFeaturizationSettings featurizationSettings() { @@ -64,7 +80,7 @@ public NlpVerticalFeaturizationSettings featurizationSettings() { /** * Set the featurizationSettings property: Featurization inputs needed for AutoML job. - * + * * @param featurizationSettings the featurizationSettings value to set. * @return the TextNer object itself. */ @@ -75,7 +91,7 @@ public TextNer withFeaturizationSettings(NlpVerticalFeaturizationSettings featur /** * Get the limitSettings property: Execution constraints for AutoMLJob. - * + * * @return the limitSettings value. */ public NlpVerticalLimitSettings limitSettings() { @@ -84,7 +100,7 @@ public NlpVerticalLimitSettings limitSettings() { /** * Set the limitSettings property: Execution constraints for AutoMLJob. - * + * * @param limitSettings the limitSettings value to set. * @return the TextNer object itself. */ @@ -95,7 +111,7 @@ public TextNer withLimitSettings(NlpVerticalLimitSettings limitSettings) { /** * Get the validationData property: Validation data inputs. - * + * * @return the validationData value. */ public MLTableJobInput validationData() { @@ -104,7 +120,7 @@ public MLTableJobInput validationData() { /** * Set the validationData property: Validation data inputs. - * + * * @param validationData the validationData value to set. * @return the TextNer object itself. */ @@ -113,21 +129,27 @@ public TextNer withValidationData(MLTableJobInput validationData) { return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public TextNer withLogVerbosity(LogVerbosity logVerbosity) { super.withLogVerbosity(logVerbosity); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public TextNer withTargetColumnName(String targetColumnName) { super.withTargetColumnName(targetColumnName); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public TextNer withTrainingData(MLTableJobInput trainingData) { super.withTrainingData(trainingData); @@ -136,7 +158,7 @@ public TextNer withTrainingData(MLTableJobInput trainingData) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -152,4 +174,61 @@ public void validate() { validationData().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("trainingData", trainingData()); + jsonWriter.writeStringField("logVerbosity", logVerbosity() == null ? null : logVerbosity().toString()); + jsonWriter.writeStringField("targetColumnName", targetColumnName()); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); + jsonWriter.writeJsonField("featurizationSettings", this.featurizationSettings); + jsonWriter.writeJsonField("limitSettings", this.limitSettings); + jsonWriter.writeJsonField("validationData", this.validationData); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextNer from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextNer if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextNer. + */ + public static TextNer fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TextNer deserializedTextNer = new TextNer(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("trainingData".equals(fieldName)) { + deserializedTextNer.withTrainingData(MLTableJobInput.fromJson(reader)); + } else if ("logVerbosity".equals(fieldName)) { + deserializedTextNer.withLogVerbosity(LogVerbosity.fromString(reader.getString())); + } else if ("targetColumnName".equals(fieldName)) { + deserializedTextNer.withTargetColumnName(reader.getString()); + } else if ("taskType".equals(fieldName)) { + deserializedTextNer.taskType = TaskType.fromString(reader.getString()); + } else if ("primaryMetric".equals(fieldName)) { + deserializedTextNer.primaryMetric = ClassificationPrimaryMetrics.fromString(reader.getString()); + } else if ("featurizationSettings".equals(fieldName)) { + deserializedTextNer.featurizationSettings = NlpVerticalFeaturizationSettings.fromJson(reader); + } else if ("limitSettings".equals(fieldName)) { + deserializedTextNer.limitSettings = NlpVerticalLimitSettings.fromJson(reader); + } else if ("validationData".equals(fieldName)) { + deserializedTextNer.validationData = MLTableJobInput.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTextNer; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TmpfsOptions.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TmpfsOptions.java new file mode 100644 index 0000000000000..2a9d74fb5bbd8 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TmpfsOptions.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes the tmpfs options for the container. + */ +@Fluent +public final class TmpfsOptions implements JsonSerializable { + /* + * Mention the Tmpfs size + */ + private Integer size; + + /** + * Creates an instance of TmpfsOptions class. + */ + public TmpfsOptions() { + } + + /** + * Get the size property: Mention the Tmpfs size. + * + * @return the size value. + */ + public Integer size() { + return this.size; + } + + /** + * Set the size property: Mention the Tmpfs size. + * + * @param size the size value to set. + * @return the TmpfsOptions object itself. + */ + public TmpfsOptions withSize(Integer size) { + this.size = size; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("size", this.size); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TmpfsOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TmpfsOptions if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TmpfsOptions. + */ + public static TmpfsOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TmpfsOptions deserializedTmpfsOptions = new TmpfsOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("size".equals(fieldName)) { + deserializedTmpfsOptions.size = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedTmpfsOptions; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TopNFeaturesByAttribution.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TopNFeaturesByAttribution.java new file mode 100644 index 0000000000000..8aa049e6d9a2d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TopNFeaturesByAttribution.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The TopNFeaturesByAttribution model. + */ +@Fluent +public final class TopNFeaturesByAttribution extends MonitoringFeatureFilterBase { + /* + * [Required] Specifies the feature filter to leverage when selecting features to calculate metrics over. + */ + private MonitoringFeatureFilterType filterType = MonitoringFeatureFilterType.TOP_NBY_ATTRIBUTION; + + /* + * The number of top features to include. + */ + private Integer top; + + /** + * Creates an instance of TopNFeaturesByAttribution class. + */ + public TopNFeaturesByAttribution() { + } + + /** + * Get the filterType property: [Required] Specifies the feature filter to leverage when selecting features to + * calculate metrics over. + * + * @return the filterType value. + */ + @Override + public MonitoringFeatureFilterType filterType() { + return this.filterType; + } + + /** + * Get the top property: The number of top features to include. + * + * @return the top value. + */ + public Integer top() { + return this.top; + } + + /** + * Set the top property: The number of top features to include. + * + * @param top the top value to set. + * @return the TopNFeaturesByAttribution object itself. + */ + public TopNFeaturesByAttribution withTop(Integer top) { + this.top = top; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("filterType", this.filterType == null ? null : this.filterType.toString()); + jsonWriter.writeNumberField("top", this.top); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TopNFeaturesByAttribution from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TopNFeaturesByAttribution if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TopNFeaturesByAttribution. + */ + public static TopNFeaturesByAttribution fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TopNFeaturesByAttribution deserializedTopNFeaturesByAttribution = new TopNFeaturesByAttribution(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("filterType".equals(fieldName)) { + deserializedTopNFeaturesByAttribution.filterType + = MonitoringFeatureFilterType.fromString(reader.getString()); + } else if ("top".equals(fieldName)) { + deserializedTopNFeaturesByAttribution.top = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedTopNFeaturesByAttribution; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TrainingSettings.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TrainingSettings.java index cade4da668652..f18dd25733f0a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TrainingSettings.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TrainingSettings.java @@ -5,63 +5,65 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.Duration; -/** Training related configuration. */ +/** + * Training related configuration. + */ @Fluent -public class TrainingSettings { +public class TrainingSettings implements JsonSerializable { /* * Enable recommendation of DNN models. */ - @JsonProperty(value = "enableDnnTraining") private Boolean enableDnnTraining; /* * Flag to turn on explainability on best model. */ - @JsonProperty(value = "enableModelExplainability") private Boolean enableModelExplainability; /* * Flag for enabling onnx compatible models. */ - @JsonProperty(value = "enableOnnxCompatibleModels") private Boolean enableOnnxCompatibleModels; /* * Enable stack ensemble run. */ - @JsonProperty(value = "enableStackEnsemble") private Boolean enableStackEnsemble; /* * Enable voting ensemble run. */ - @JsonProperty(value = "enableVoteEnsemble") private Boolean enableVoteEnsemble; /* - * During VotingEnsemble and StackEnsemble model generation, multiple fitted models from the previous child runs - * are downloaded. + * During VotingEnsemble and StackEnsemble model generation, multiple fitted models from the previous child runs are + * downloaded. * Configure this parameter with a higher value than 300 secs, if more time is needed. */ - @JsonProperty(value = "ensembleModelDownloadTimeout") private Duration ensembleModelDownloadTimeout; /* * Stack ensemble settings for stack ensemble run. */ - @JsonProperty(value = "stackEnsembleSettings") private StackEnsembleSettings stackEnsembleSettings; - /** Creates an instance of TrainingSettings class. */ + /** + * Creates an instance of TrainingSettings class. + */ public TrainingSettings() { } /** * Get the enableDnnTraining property: Enable recommendation of DNN models. - * + * * @return the enableDnnTraining value. */ public Boolean enableDnnTraining() { @@ -70,7 +72,7 @@ public Boolean enableDnnTraining() { /** * Set the enableDnnTraining property: Enable recommendation of DNN models. - * + * * @param enableDnnTraining the enableDnnTraining value to set. * @return the TrainingSettings object itself. */ @@ -81,7 +83,7 @@ public TrainingSettings withEnableDnnTraining(Boolean enableDnnTraining) { /** * Get the enableModelExplainability property: Flag to turn on explainability on best model. - * + * * @return the enableModelExplainability value. */ public Boolean enableModelExplainability() { @@ -90,7 +92,7 @@ public Boolean enableModelExplainability() { /** * Set the enableModelExplainability property: Flag to turn on explainability on best model. - * + * * @param enableModelExplainability the enableModelExplainability value to set. * @return the TrainingSettings object itself. */ @@ -101,7 +103,7 @@ public TrainingSettings withEnableModelExplainability(Boolean enableModelExplain /** * Get the enableOnnxCompatibleModels property: Flag for enabling onnx compatible models. - * + * * @return the enableOnnxCompatibleModels value. */ public Boolean enableOnnxCompatibleModels() { @@ -110,7 +112,7 @@ public Boolean enableOnnxCompatibleModels() { /** * Set the enableOnnxCompatibleModels property: Flag for enabling onnx compatible models. - * + * * @param enableOnnxCompatibleModels the enableOnnxCompatibleModels value to set. * @return the TrainingSettings object itself. */ @@ -121,7 +123,7 @@ public TrainingSettings withEnableOnnxCompatibleModels(Boolean enableOnnxCompati /** * Get the enableStackEnsemble property: Enable stack ensemble run. - * + * * @return the enableStackEnsemble value. */ public Boolean enableStackEnsemble() { @@ -130,7 +132,7 @@ public Boolean enableStackEnsemble() { /** * Set the enableStackEnsemble property: Enable stack ensemble run. - * + * * @param enableStackEnsemble the enableStackEnsemble value to set. * @return the TrainingSettings object itself. */ @@ -141,7 +143,7 @@ public TrainingSettings withEnableStackEnsemble(Boolean enableStackEnsemble) { /** * Get the enableVoteEnsemble property: Enable voting ensemble run. - * + * * @return the enableVoteEnsemble value. */ public Boolean enableVoteEnsemble() { @@ -150,7 +152,7 @@ public Boolean enableVoteEnsemble() { /** * Set the enableVoteEnsemble property: Enable voting ensemble run. - * + * * @param enableVoteEnsemble the enableVoteEnsemble value to set. * @return the TrainingSettings object itself. */ @@ -161,9 +163,9 @@ public TrainingSettings withEnableVoteEnsemble(Boolean enableVoteEnsemble) { /** * Get the ensembleModelDownloadTimeout property: During VotingEnsemble and StackEnsemble model generation, multiple - * fitted models from the previous child runs are downloaded. Configure this parameter with a higher value than 300 - * secs, if more time is needed. - * + * fitted models from the previous child runs are downloaded. + * Configure this parameter with a higher value than 300 secs, if more time is needed. + * * @return the ensembleModelDownloadTimeout value. */ public Duration ensembleModelDownloadTimeout() { @@ -172,9 +174,9 @@ public Duration ensembleModelDownloadTimeout() { /** * Set the ensembleModelDownloadTimeout property: During VotingEnsemble and StackEnsemble model generation, multiple - * fitted models from the previous child runs are downloaded. Configure this parameter with a higher value than 300 - * secs, if more time is needed. - * + * fitted models from the previous child runs are downloaded. + * Configure this parameter with a higher value than 300 secs, if more time is needed. + * * @param ensembleModelDownloadTimeout the ensembleModelDownloadTimeout value to set. * @return the TrainingSettings object itself. */ @@ -185,7 +187,7 @@ public TrainingSettings withEnsembleModelDownloadTimeout(Duration ensembleModelD /** * Get the stackEnsembleSettings property: Stack ensemble settings for stack ensemble run. - * + * * @return the stackEnsembleSettings value. */ public StackEnsembleSettings stackEnsembleSettings() { @@ -194,7 +196,7 @@ public StackEnsembleSettings stackEnsembleSettings() { /** * Set the stackEnsembleSettings property: Stack ensemble settings for stack ensemble run. - * + * * @param stackEnsembleSettings the stackEnsembleSettings value to set. * @return the TrainingSettings object itself. */ @@ -205,7 +207,7 @@ public TrainingSettings withStackEnsembleSettings(StackEnsembleSettings stackEns /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -213,4 +215,61 @@ public void validate() { stackEnsembleSettings().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enableDnnTraining", this.enableDnnTraining); + jsonWriter.writeBooleanField("enableModelExplainability", this.enableModelExplainability); + jsonWriter.writeBooleanField("enableOnnxCompatibleModels", this.enableOnnxCompatibleModels); + jsonWriter.writeBooleanField("enableStackEnsemble", this.enableStackEnsemble); + jsonWriter.writeBooleanField("enableVoteEnsemble", this.enableVoteEnsemble); + jsonWriter.writeStringField("ensembleModelDownloadTimeout", + CoreUtils.durationToStringWithDays(this.ensembleModelDownloadTimeout)); + jsonWriter.writeJsonField("stackEnsembleSettings", this.stackEnsembleSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TrainingSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TrainingSettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TrainingSettings. + */ + public static TrainingSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TrainingSettings deserializedTrainingSettings = new TrainingSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enableDnnTraining".equals(fieldName)) { + deserializedTrainingSettings.enableDnnTraining = reader.getNullable(JsonReader::getBoolean); + } else if ("enableModelExplainability".equals(fieldName)) { + deserializedTrainingSettings.enableModelExplainability = reader.getNullable(JsonReader::getBoolean); + } else if ("enableOnnxCompatibleModels".equals(fieldName)) { + deserializedTrainingSettings.enableOnnxCompatibleModels + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableStackEnsemble".equals(fieldName)) { + deserializedTrainingSettings.enableStackEnsemble = reader.getNullable(JsonReader::getBoolean); + } else if ("enableVoteEnsemble".equals(fieldName)) { + deserializedTrainingSettings.enableVoteEnsemble = reader.getNullable(JsonReader::getBoolean); + } else if ("ensembleModelDownloadTimeout".equals(fieldName)) { + deserializedTrainingSettings.ensembleModelDownloadTimeout + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else if ("stackEnsembleSettings".equals(fieldName)) { + deserializedTrainingSettings.stackEnsembleSettings = StackEnsembleSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTrainingSettings; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TrialComponent.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TrialComponent.java index 71293f3a75c85..eb17893e0e600 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TrialComponent.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TrialComponent.java @@ -6,57 +6,57 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Trial component definition. */ +/** + * Trial component definition. + */ @Fluent -public final class TrialComponent { +public final class TrialComponent implements JsonSerializable { /* * ARM resource ID of the code asset. */ - @JsonProperty(value = "codeId") private String codeId; /* * [Required] The command to execute on startup of the job. eg. "python train.py" */ - @JsonProperty(value = "command", required = true) private String command; /* * Distribution configuration of the job. If set, this should be one of Mpi, Tensorflow, PyTorch, or null. */ - @JsonProperty(value = "distribution") private DistributionConfiguration distribution; /* * [Required] The ARM resource ID of the Environment specification for the job. */ - @JsonProperty(value = "environmentId", required = true) private String environmentId; /* * Environment variables included in the job. */ - @JsonProperty(value = "environmentVariables") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map environmentVariables; /* * Compute Resource configuration for the job. */ - @JsonProperty(value = "resources") private JobResourceConfiguration resources; - /** Creates an instance of TrialComponent class. */ + /** + * Creates an instance of TrialComponent class. + */ public TrialComponent() { } /** * Get the codeId property: ARM resource ID of the code asset. - * + * * @return the codeId value. */ public String codeId() { @@ -65,7 +65,7 @@ public String codeId() { /** * Set the codeId property: ARM resource ID of the code asset. - * + * * @param codeId the codeId value to set. * @return the TrialComponent object itself. */ @@ -76,7 +76,7 @@ public TrialComponent withCodeId(String codeId) { /** * Get the command property: [Required] The command to execute on startup of the job. eg. "python train.py". - * + * * @return the command value. */ public String command() { @@ -85,7 +85,7 @@ public String command() { /** * Set the command property: [Required] The command to execute on startup of the job. eg. "python train.py". - * + * * @param command the command value to set. * @return the TrialComponent object itself. */ @@ -97,7 +97,7 @@ public TrialComponent withCommand(String command) { /** * Get the distribution property: Distribution configuration of the job. If set, this should be one of Mpi, * Tensorflow, PyTorch, or null. - * + * * @return the distribution value. */ public DistributionConfiguration distribution() { @@ -107,7 +107,7 @@ public DistributionConfiguration distribution() { /** * Set the distribution property: Distribution configuration of the job. If set, this should be one of Mpi, * Tensorflow, PyTorch, or null. - * + * * @param distribution the distribution value to set. * @return the TrialComponent object itself. */ @@ -118,7 +118,7 @@ public TrialComponent withDistribution(DistributionConfiguration distribution) { /** * Get the environmentId property: [Required] The ARM resource ID of the Environment specification for the job. - * + * * @return the environmentId value. */ public String environmentId() { @@ -127,7 +127,7 @@ public String environmentId() { /** * Set the environmentId property: [Required] The ARM resource ID of the Environment specification for the job. - * + * * @param environmentId the environmentId value to set. * @return the TrialComponent object itself. */ @@ -138,7 +138,7 @@ public TrialComponent withEnvironmentId(String environmentId) { /** * Get the environmentVariables property: Environment variables included in the job. - * + * * @return the environmentVariables value. */ public Map environmentVariables() { @@ -147,7 +147,7 @@ public Map environmentVariables() { /** * Set the environmentVariables property: Environment variables included in the job. - * + * * @param environmentVariables the environmentVariables value to set. * @return the TrialComponent object itself. */ @@ -158,7 +158,7 @@ public TrialComponent withEnvironmentVariables(Map environmentVa /** * Get the resources property: Compute Resource configuration for the job. - * + * * @return the resources value. */ public JobResourceConfiguration resources() { @@ -167,7 +167,7 @@ public JobResourceConfiguration resources() { /** * Set the resources property: Compute Resource configuration for the job. - * + * * @param resources the resources value to set. * @return the TrialComponent object itself. */ @@ -178,22 +178,20 @@ public TrialComponent withResources(JobResourceConfiguration resources) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (command() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property command in model TrialComponent")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property command in model TrialComponent")); } if (distribution() != null) { distribution().validate(); } if (environmentId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property environmentId in model TrialComponent")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property environmentId in model TrialComponent")); } if (resources() != null) { resources().validate(); @@ -201,4 +199,58 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(TrialComponent.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("command", this.command); + jsonWriter.writeStringField("environmentId", this.environmentId); + jsonWriter.writeStringField("codeId", this.codeId); + jsonWriter.writeJsonField("distribution", this.distribution); + jsonWriter.writeMapField("environmentVariables", this.environmentVariables, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("resources", this.resources); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TrialComponent from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TrialComponent if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TrialComponent. + */ + public static TrialComponent fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TrialComponent deserializedTrialComponent = new TrialComponent(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("command".equals(fieldName)) { + deserializedTrialComponent.command = reader.getString(); + } else if ("environmentId".equals(fieldName)) { + deserializedTrialComponent.environmentId = reader.getString(); + } else if ("codeId".equals(fieldName)) { + deserializedTrialComponent.codeId = reader.getString(); + } else if ("distribution".equals(fieldName)) { + deserializedTrialComponent.distribution = DistributionConfiguration.fromJson(reader); + } else if ("environmentVariables".equals(fieldName)) { + Map environmentVariables = reader.readMap(reader1 -> reader1.getString()); + deserializedTrialComponent.environmentVariables = environmentVariables; + } else if ("resources".equals(fieldName)) { + deserializedTrialComponent.resources = JobResourceConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTrialComponent; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TriggerBase.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TriggerBase.java index b7180fe49f25d..e95b0f4893599 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TriggerBase.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TriggerBase.java @@ -5,37 +5,33 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The TriggerBase model. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "triggerType", - defaultImpl = TriggerBase.class) -@JsonTypeName("TriggerBase") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "Recurrence", value = RecurrenceTrigger.class), - @JsonSubTypes.Type(name = "Cron", value = CronTrigger.class) -}) +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The TriggerBase model. + */ @Fluent -public class TriggerBase { +public class TriggerBase implements JsonSerializable { + /* + * [Required] + */ + private TriggerType triggerType = TriggerType.fromString("TriggerBase"); + /* * Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer * https://en.wikipedia.org/wiki/ISO_8601. * Recommented format would be "2022-06-01T00:00:01" * If not present, the schedule will run indefinitely */ - @JsonProperty(value = "endTime") private String endTime; /* * Specifies start time of schedule in ISO 8601 format, but without a UTC offset. */ - @JsonProperty(value = "startTime") private String startTime; /* @@ -43,18 +39,29 @@ public class TriggerBase { * TimeZone should follow Windows time zone format. Refer: * https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11 */ - @JsonProperty(value = "timeZone") private String timeZone; - /** Creates an instance of TriggerBase class. */ + /** + * Creates an instance of TriggerBase class. + */ public TriggerBase() { } + /** + * Get the triggerType property: [Required]. + * + * @return the triggerType value. + */ + public TriggerType triggerType() { + return this.triggerType; + } + /** * Get the endTime property: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - * https://en.wikipedia.org/wiki/ISO_8601. Recommented format would be "2022-06-01T00:00:01" If not present, the - * schedule will run indefinitely. - * + * https://en.wikipedia.org/wiki/ISO_8601. + * Recommented format would be "2022-06-01T00:00:01" + * If not present, the schedule will run indefinitely. + * * @return the endTime value. */ public String endTime() { @@ -63,9 +70,10 @@ public String endTime() { /** * Set the endTime property: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer - * https://en.wikipedia.org/wiki/ISO_8601. Recommented format would be "2022-06-01T00:00:01" If not present, the - * schedule will run indefinitely. - * + * https://en.wikipedia.org/wiki/ISO_8601. + * Recommented format would be "2022-06-01T00:00:01" + * If not present, the schedule will run indefinitely. + * * @param endTime the endTime value to set. * @return the TriggerBase object itself. */ @@ -76,7 +84,7 @@ public TriggerBase withEndTime(String endTime) { /** * Get the startTime property: Specifies start time of schedule in ISO 8601 format, but without a UTC offset. - * + * * @return the startTime value. */ public String startTime() { @@ -85,7 +93,7 @@ public String startTime() { /** * Set the startTime property: Specifies start time of schedule in ISO 8601 format, but without a UTC offset. - * + * * @param startTime the startTime value to set. * @return the TriggerBase object itself. */ @@ -95,10 +103,10 @@ public TriggerBase withStartTime(String startTime) { } /** - * Get the timeZone property: Specifies time zone in which the schedule runs. TimeZone should follow Windows time - * zone format. Refer: + * Get the timeZone property: 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. - * + * * @return the timeZone value. */ public String timeZone() { @@ -106,10 +114,10 @@ public String timeZone() { } /** - * Set the timeZone property: Specifies time zone in which the schedule runs. TimeZone should follow Windows time - * zone format. Refer: + * Set the timeZone property: 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. - * + * * @param timeZone the timeZone value to set. * @return the TriggerBase object itself. */ @@ -120,9 +128,81 @@ public TriggerBase withTimeZone(String timeZone) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("triggerType", this.triggerType == null ? null : this.triggerType.toString()); + jsonWriter.writeStringField("endTime", this.endTime); + jsonWriter.writeStringField("startTime", this.startTime); + jsonWriter.writeStringField("timeZone", this.timeZone); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TriggerBase from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TriggerBase if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TriggerBase. + */ + public static TriggerBase fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("triggerType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Recurrence".equals(discriminatorValue)) { + return RecurrenceTrigger.fromJson(readerToUse.reset()); + } else if ("Cron".equals(discriminatorValue)) { + return CronTrigger.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static TriggerBase fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TriggerBase deserializedTriggerBase = new TriggerBase(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("triggerType".equals(fieldName)) { + deserializedTriggerBase.triggerType = TriggerType.fromString(reader.getString()); + } else if ("endTime".equals(fieldName)) { + deserializedTriggerBase.endTime = reader.getString(); + } else if ("startTime".equals(fieldName)) { + deserializedTriggerBase.startTime = reader.getString(); + } else if ("timeZone".equals(fieldName)) { + deserializedTriggerBase.timeZone = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTriggerBase; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TriggerType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TriggerType.java index 4f9332d727acd..9e4c2133d3ff1 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TriggerType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TriggerType.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for TriggerType. */ +/** + * Defines values for TriggerType. + */ public final class TriggerType extends ExpandableStringEnum { - /** Static value Recurrence for TriggerType. */ + /** + * Static value Recurrence for TriggerType. + */ public static final TriggerType RECURRENCE = fromString("Recurrence"); - /** Static value Cron for TriggerType. */ + /** + * Static value Cron for TriggerType. + */ public static final TriggerType CRON = fromString("Cron"); /** * Creates a new instance of TriggerType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public TriggerType() { /** * Creates or finds a TriggerType from its string representation. - * + * * @param name a name to look for. * @return the corresponding TriggerType. */ - @JsonCreator public static TriggerType fromString(String name) { return fromString(name, TriggerType.class); } /** * Gets known TriggerType values. - * + * * @return known TriggerType values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TritonModelJobInput.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TritonModelJobInput.java index 44b616664524e..dfefdd0c6a5ce 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TritonModelJobInput.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TritonModelJobInput.java @@ -6,34 +6,50 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The TritonModelJobInput model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobInputType") -@JsonTypeName("triton_model") +/** + * The TritonModelJobInput model. + */ @Fluent public final class TritonModelJobInput extends JobInput { + /* + * [Required] Specifies the type of job. + */ + private JobInputType jobInputType = JobInputType.TRITON_MODEL; + /* * Input Asset Delivery Mode. */ - @JsonProperty(value = "mode") private InputDeliveryMode mode; /* * [Required] Input Asset URI. */ - @JsonProperty(value = "uri", required = true) private String uri; - /** Creates an instance of TritonModelJobInput class. */ + /** + * Creates an instance of TritonModelJobInput class. + */ public TritonModelJobInput() { } + /** + * Get the jobInputType property: [Required] Specifies the type of job. + * + * @return the jobInputType value. + */ + @Override + public JobInputType jobInputType() { + return this.jobInputType; + } + /** * Get the mode property: Input Asset Delivery Mode. - * + * * @return the mode value. */ public InputDeliveryMode mode() { @@ -42,7 +58,7 @@ public InputDeliveryMode mode() { /** * Set the mode property: Input Asset Delivery Mode. - * + * * @param mode the mode value to set. * @return the TritonModelJobInput object itself. */ @@ -53,7 +69,7 @@ public TritonModelJobInput withMode(InputDeliveryMode mode) { /** * Get the uri property: [Required] Input Asset URI. - * + * * @return the uri value. */ public String uri() { @@ -62,7 +78,7 @@ public String uri() { /** * Set the uri property: [Required] Input Asset URI. - * + * * @param uri the uri value to set. * @return the TritonModelJobInput object itself. */ @@ -71,7 +87,9 @@ public TritonModelJobInput withUri(String uri) { return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public TritonModelJobInput withDescription(String description) { super.withDescription(description); @@ -80,18 +98,63 @@ public TritonModelJobInput withDescription(String description) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (uri() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property uri in model TritonModelJobInput")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property uri in model TritonModelJobInput")); } } private static final ClientLogger LOGGER = new ClientLogger(TritonModelJobInput.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("uri", this.uri); + jsonWriter.writeStringField("jobInputType", this.jobInputType == null ? null : this.jobInputType.toString()); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TritonModelJobInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TritonModelJobInput if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TritonModelJobInput. + */ + public static TritonModelJobInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TritonModelJobInput deserializedTritonModelJobInput = new TritonModelJobInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedTritonModelJobInput.withDescription(reader.getString()); + } else if ("uri".equals(fieldName)) { + deserializedTritonModelJobInput.uri = reader.getString(); + } else if ("jobInputType".equals(fieldName)) { + deserializedTritonModelJobInput.jobInputType = JobInputType.fromString(reader.getString()); + } else if ("mode".equals(fieldName)) { + deserializedTritonModelJobInput.mode = InputDeliveryMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedTritonModelJobInput; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TritonModelJobOutput.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TritonModelJobOutput.java index f7630d5f5c709..8fd9601679a68 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TritonModelJobOutput.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TritonModelJobOutput.java @@ -5,34 +5,50 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The TritonModelJobOutput model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobOutputType") -@JsonTypeName("triton_model") +/** + * The TritonModelJobOutput model. + */ @Fluent public final class TritonModelJobOutput extends JobOutput { + /* + * [Required] Specifies the type of job. + */ + private JobOutputType jobOutputType = JobOutputType.TRITON_MODEL; + /* * Output Asset Delivery Mode. */ - @JsonProperty(value = "mode") private OutputDeliveryMode mode; /* * Output Asset URI. */ - @JsonProperty(value = "uri") private String uri; - /** Creates an instance of TritonModelJobOutput class. */ + /** + * Creates an instance of TritonModelJobOutput class. + */ public TritonModelJobOutput() { } + /** + * Get the jobOutputType property: [Required] Specifies the type of job. + * + * @return the jobOutputType value. + */ + @Override + public JobOutputType jobOutputType() { + return this.jobOutputType; + } + /** * Get the mode property: Output Asset Delivery Mode. - * + * * @return the mode value. */ public OutputDeliveryMode mode() { @@ -41,7 +57,7 @@ public OutputDeliveryMode mode() { /** * Set the mode property: Output Asset Delivery Mode. - * + * * @param mode the mode value to set. * @return the TritonModelJobOutput object itself. */ @@ -52,7 +68,7 @@ public TritonModelJobOutput withMode(OutputDeliveryMode mode) { /** * Get the uri property: Output Asset URI. - * + * * @return the uri value. */ public String uri() { @@ -61,7 +77,7 @@ public String uri() { /** * Set the uri property: Output Asset URI. - * + * * @param uri the uri value to set. * @return the TritonModelJobOutput object itself. */ @@ -70,7 +86,9 @@ public TritonModelJobOutput withUri(String uri) { return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public TritonModelJobOutput withDescription(String description) { super.withDescription(description); @@ -79,11 +97,56 @@ public TritonModelJobOutput withDescription(String description) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("jobOutputType", this.jobOutputType == null ? null : this.jobOutputType.toString()); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + jsonWriter.writeStringField("uri", this.uri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TritonModelJobOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TritonModelJobOutput if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the TritonModelJobOutput. + */ + public static TritonModelJobOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TritonModelJobOutput deserializedTritonModelJobOutput = new TritonModelJobOutput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedTritonModelJobOutput.withDescription(reader.getString()); + } else if ("jobOutputType".equals(fieldName)) { + deserializedTritonModelJobOutput.jobOutputType = JobOutputType.fromString(reader.getString()); + } else if ("mode".equals(fieldName)) { + deserializedTritonModelJobOutput.mode = OutputDeliveryMode.fromString(reader.getString()); + } else if ("uri".equals(fieldName)) { + deserializedTritonModelJobOutput.uri = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTritonModelJobOutput; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TruncationSelectionPolicy.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TruncationSelectionPolicy.java index 2399793310aad..2d62aaeec5253 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TruncationSelectionPolicy.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/TruncationSelectionPolicy.java @@ -5,28 +5,45 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Defines an early termination policy that cancels a given percentage of runs at each evaluation interval. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "policyType") -@JsonTypeName("TruncationSelection") +/** + * Defines an early termination policy that cancels a given percentage of runs at each evaluation interval. + */ @Fluent public final class TruncationSelectionPolicy extends EarlyTerminationPolicy { + /* + * [Required] Name of policy configuration + */ + private EarlyTerminationPolicyType policyType = EarlyTerminationPolicyType.TRUNCATION_SELECTION; + /* * The percentage of runs to cancel at each evaluation interval. */ - @JsonProperty(value = "truncationPercentage") private Integer truncationPercentage; - /** Creates an instance of TruncationSelectionPolicy class. */ + /** + * Creates an instance of TruncationSelectionPolicy class. + */ public TruncationSelectionPolicy() { } + /** + * Get the policyType property: [Required] Name of policy configuration. + * + * @return the policyType value. + */ + @Override + public EarlyTerminationPolicyType policyType() { + return this.policyType; + } + /** * Get the truncationPercentage property: The percentage of runs to cancel at each evaluation interval. - * + * * @return the truncationPercentage value. */ public Integer truncationPercentage() { @@ -35,7 +52,7 @@ public Integer truncationPercentage() { /** * Set the truncationPercentage property: The percentage of runs to cancel at each evaluation interval. - * + * * @param truncationPercentage the truncationPercentage value to set. * @return the TruncationSelectionPolicy object itself. */ @@ -44,14 +61,18 @@ public TruncationSelectionPolicy withTruncationPercentage(Integer truncationPerc return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public TruncationSelectionPolicy withDelayEvaluation(Integer delayEvaluation) { super.withDelayEvaluation(delayEvaluation); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public TruncationSelectionPolicy withEvaluationInterval(Integer evaluationInterval) { super.withEvaluationInterval(evaluationInterval); @@ -60,11 +81,58 @@ public TruncationSelectionPolicy withEvaluationInterval(Integer evaluationInterv /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("delayEvaluation", delayEvaluation()); + jsonWriter.writeNumberField("evaluationInterval", evaluationInterval()); + jsonWriter.writeStringField("policyType", this.policyType == null ? null : this.policyType.toString()); + jsonWriter.writeNumberField("truncationPercentage", this.truncationPercentage); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TruncationSelectionPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TruncationSelectionPolicy if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TruncationSelectionPolicy. + */ + public static TruncationSelectionPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TruncationSelectionPolicy deserializedTruncationSelectionPolicy = new TruncationSelectionPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("delayEvaluation".equals(fieldName)) { + deserializedTruncationSelectionPolicy.withDelayEvaluation(reader.getNullable(JsonReader::getInt)); + } else if ("evaluationInterval".equals(fieldName)) { + deserializedTruncationSelectionPolicy + .withEvaluationInterval(reader.getNullable(JsonReader::getInt)); + } else if ("policyType".equals(fieldName)) { + deserializedTruncationSelectionPolicy.policyType + = EarlyTerminationPolicyType.fromString(reader.getString()); + } else if ("truncationPercentage".equals(fieldName)) { + deserializedTruncationSelectionPolicy.truncationPercentage = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedTruncationSelectionPolicy; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UnderlyingResourceAction.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UnderlyingResourceAction.java index f9bb3d7df5966..00e2aa9bf2c38 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UnderlyingResourceAction.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UnderlyingResourceAction.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for UnderlyingResourceAction. */ +/** + * Defines values for UnderlyingResourceAction. + */ public final class UnderlyingResourceAction extends ExpandableStringEnum { - /** Static value Delete for UnderlyingResourceAction. */ + /** + * Static value Delete for UnderlyingResourceAction. + */ public static final UnderlyingResourceAction DELETE = fromString("Delete"); - /** Static value Detach for UnderlyingResourceAction. */ + /** + * Static value Detach for UnderlyingResourceAction. + */ public static final UnderlyingResourceAction DETACH = fromString("Detach"); /** * Creates a new instance of UnderlyingResourceAction value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public UnderlyingResourceAction() { /** * Creates or finds a UnderlyingResourceAction from its string representation. - * + * * @param name a name to look for. * @return the corresponding UnderlyingResourceAction. */ - @JsonCreator public static UnderlyingResourceAction fromString(String name) { return fromString(name, UnderlyingResourceAction.class); } /** * Gets known UnderlyingResourceAction values. - * + * * @return known UnderlyingResourceAction values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UnitOfMeasure.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UnitOfMeasure.java index 05ae959e99b83..d99290f412219 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UnitOfMeasure.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UnitOfMeasure.java @@ -5,21 +5,22 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** * Unit of time measure - * - *

The unit of time measurement for the specified VM price. Example: OneHour. + * + * The unit of time measurement for the specified VM price. Example: OneHour. */ public final class UnitOfMeasure extends ExpandableStringEnum { - /** Static value OneHour for UnitOfMeasure. */ + /** + * Static value OneHour for UnitOfMeasure. + */ public static final UnitOfMeasure ONE_HOUR = fromString("OneHour"); /** * Creates a new instance of UnitOfMeasure value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -28,18 +29,17 @@ public UnitOfMeasure() { /** * Creates or finds a UnitOfMeasure from its string representation. - * + * * @param name a name to look for. * @return the corresponding UnitOfMeasure. */ - @JsonCreator public static UnitOfMeasure fromString(String name) { return fromString(name, UnitOfMeasure.class); } /** * Gets known UnitOfMeasure values. - * + * * @return known UnitOfMeasure values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UpdateWorkspaceQuotas.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UpdateWorkspaceQuotas.java index 88d2a8f9fa55a..35ca7760247d5 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UpdateWorkspaceQuotas.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UpdateWorkspaceQuotas.java @@ -5,52 +5,51 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties for update Quota response. */ +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties for update Quota response. + */ @Fluent -public final class UpdateWorkspaceQuotas { +public final class UpdateWorkspaceQuotas implements JsonSerializable { /* * Specifies the resource ID. */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; /* * Specifies the resource type. */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) private String type; /* - * Limit. - * * The maximum permitted quota of the resource. */ - @JsonProperty(value = "limit") private Long limit; /* * An enum describing the unit of quota measurement. */ - @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) private QuotaUnit unit; /* - * Update Workspace Quota Status. - * * Status of update workspace quota. */ - @JsonProperty(value = "status") private Status status; - /** Creates an instance of UpdateWorkspaceQuotas class. */ + /** + * Creates an instance of UpdateWorkspaceQuotas class. + */ public UpdateWorkspaceQuotas() { } /** * Get the id property: Specifies the resource ID. - * + * * @return the id value. */ public String id() { @@ -59,7 +58,7 @@ public String id() { /** * Get the type property: Specifies the resource type. - * + * * @return the type value. */ public String type() { @@ -67,10 +66,8 @@ public String type() { } /** - * Get the limit property: Limit. - * - *

The maximum permitted quota of the resource. - * + * Get the limit property: The maximum permitted quota of the resource. + * * @return the limit value. */ public Long limit() { @@ -78,10 +75,8 @@ public Long limit() { } /** - * Set the limit property: Limit. - * - *

The maximum permitted quota of the resource. - * + * Set the limit property: The maximum permitted quota of the resource. + * * @param limit the limit value to set. * @return the UpdateWorkspaceQuotas object itself. */ @@ -92,7 +87,7 @@ public UpdateWorkspaceQuotas withLimit(Long limit) { /** * Get the unit property: An enum describing the unit of quota measurement. - * + * * @return the unit value. */ public QuotaUnit unit() { @@ -100,10 +95,8 @@ public QuotaUnit unit() { } /** - * Get the status property: Update Workspace Quota Status. - * - *

Status of update workspace quota. - * + * Get the status property: Status of update workspace quota. + * * @return the status value. */ public Status status() { @@ -111,10 +104,8 @@ public Status status() { } /** - * Set the status property: Update Workspace Quota Status. - * - *

Status of update workspace quota. - * + * Set the status property: Status of update workspace quota. + * * @param status the status value to set. * @return the UpdateWorkspaceQuotas object itself. */ @@ -125,9 +116,54 @@ public UpdateWorkspaceQuotas withStatus(Status status) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("limit", this.limit); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateWorkspaceQuotas from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateWorkspaceQuotas if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the UpdateWorkspaceQuotas. + */ + public static UpdateWorkspaceQuotas fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateWorkspaceQuotas deserializedUpdateWorkspaceQuotas = new UpdateWorkspaceQuotas(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedUpdateWorkspaceQuotas.id = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedUpdateWorkspaceQuotas.type = reader.getString(); + } else if ("limit".equals(fieldName)) { + deserializedUpdateWorkspaceQuotas.limit = reader.getNullable(JsonReader::getLong); + } else if ("unit".equals(fieldName)) { + deserializedUpdateWorkspaceQuotas.unit = QuotaUnit.fromString(reader.getString()); + } else if ("status".equals(fieldName)) { + deserializedUpdateWorkspaceQuotas.status = Status.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedUpdateWorkspaceQuotas; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UpdateWorkspaceQuotasResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UpdateWorkspaceQuotasResult.java index 9315ebeaa797a..ed71dd79a1d02 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UpdateWorkspaceQuotasResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UpdateWorkspaceQuotasResult.java @@ -7,11 +7,13 @@ import com.azure.resourcemanager.machinelearning.fluent.models.UpdateWorkspaceQuotasResultInner; import java.util.List; -/** An immutable client-side representation of UpdateWorkspaceQuotasResult. */ +/** + * An immutable client-side representation of UpdateWorkspaceQuotasResult. + */ public interface UpdateWorkspaceQuotasResult { /** * Gets the value property: The list of workspace quota update result. - * + * * @return the value value. */ List value(); @@ -19,14 +21,14 @@ public interface UpdateWorkspaceQuotasResult { /** * Gets the nextLink property: The URI to fetch the next page of workspace quota update result. Call ListNext() with * this to fetch the next page of Workspace Quota update result. - * + * * @return the nextLink value. */ String nextLink(); /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.UpdateWorkspaceQuotasResultInner object. - * + * * @return the inner object. */ UpdateWorkspaceQuotasResultInner innerModel(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFileDataVersion.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFileDataVersion.java index 0fe62c32561ae..7fa71515a48f9 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFileDataVersion.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFileDataVersion.java @@ -5,55 +5,86 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** uri-file data version entity. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "dataType") -@JsonTypeName("uri_file") +/** + * uri-file data version entity. + */ @Fluent public final class UriFileDataVersion extends DataVersionBaseProperties { - /** Creates an instance of UriFileDataVersion class. */ + /* + * [Required] Specifies the type of data. + */ + private DataType dataType = DataType.URI_FILE; + + /** + * Creates an instance of UriFileDataVersion class. + */ public UriFileDataVersion() { } - /** {@inheritDoc} */ + /** + * Get the dataType property: [Required] Specifies the type of data. + * + * @return the dataType value. + */ + @Override + public DataType dataType() { + return this.dataType; + } + + /** + * {@inheritDoc} + */ @Override public UriFileDataVersion withDataUri(String dataUri) { super.withDataUri(dataUri); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public UriFileDataVersion withIsAnonymous(Boolean isAnonymous) { super.withIsAnonymous(isAnonymous); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public UriFileDataVersion withIsArchived(Boolean isArchived) { super.withIsArchived(isArchived); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public UriFileDataVersion withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public UriFileDataVersion withProperties(Map properties) { super.withProperties(properties); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public UriFileDataVersion withTags(Map tags) { super.withTags(tags); @@ -62,11 +93,68 @@ public UriFileDataVersion withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("dataUri", dataUri()); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("isAnonymous", isAnonymous()); + jsonWriter.writeBooleanField("isArchived", isArchived()); + jsonWriter.writeStringField("dataType", this.dataType == null ? null : this.dataType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UriFileDataVersion from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UriFileDataVersion if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UriFileDataVersion. + */ + public static UriFileDataVersion fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UriFileDataVersion deserializedUriFileDataVersion = new UriFileDataVersion(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dataUri".equals(fieldName)) { + deserializedUriFileDataVersion.withDataUri(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedUriFileDataVersion.withDescription(reader.getString()); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedUriFileDataVersion.withProperties(properties); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedUriFileDataVersion.withTags(tags); + } else if ("isAnonymous".equals(fieldName)) { + deserializedUriFileDataVersion.withIsAnonymous(reader.getNullable(JsonReader::getBoolean)); + } else if ("isArchived".equals(fieldName)) { + deserializedUriFileDataVersion.withIsArchived(reader.getNullable(JsonReader::getBoolean)); + } else if ("dataType".equals(fieldName)) { + deserializedUriFileDataVersion.dataType = DataType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedUriFileDataVersion; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFileJobInput.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFileJobInput.java index c52666009a7f3..c0ae5637309e8 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFileJobInput.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFileJobInput.java @@ -6,34 +6,50 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The UriFileJobInput model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobInputType") -@JsonTypeName("uri_file") +/** + * The UriFileJobInput model. + */ @Fluent public final class UriFileJobInput extends JobInput { + /* + * [Required] Specifies the type of job. + */ + private JobInputType jobInputType = JobInputType.URI_FILE; + /* * Input Asset Delivery Mode. */ - @JsonProperty(value = "mode") private InputDeliveryMode mode; /* * [Required] Input Asset URI. */ - @JsonProperty(value = "uri", required = true) private String uri; - /** Creates an instance of UriFileJobInput class. */ + /** + * Creates an instance of UriFileJobInput class. + */ public UriFileJobInput() { } + /** + * Get the jobInputType property: [Required] Specifies the type of job. + * + * @return the jobInputType value. + */ + @Override + public JobInputType jobInputType() { + return this.jobInputType; + } + /** * Get the mode property: Input Asset Delivery Mode. - * + * * @return the mode value. */ public InputDeliveryMode mode() { @@ -42,7 +58,7 @@ public InputDeliveryMode mode() { /** * Set the mode property: Input Asset Delivery Mode. - * + * * @param mode the mode value to set. * @return the UriFileJobInput object itself. */ @@ -53,7 +69,7 @@ public UriFileJobInput withMode(InputDeliveryMode mode) { /** * Get the uri property: [Required] Input Asset URI. - * + * * @return the uri value. */ public String uri() { @@ -62,7 +78,7 @@ public String uri() { /** * Set the uri property: [Required] Input Asset URI. - * + * * @param uri the uri value to set. * @return the UriFileJobInput object itself. */ @@ -71,7 +87,9 @@ public UriFileJobInput withUri(String uri) { return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public UriFileJobInput withDescription(String description) { super.withDescription(description); @@ -80,18 +98,63 @@ public UriFileJobInput withDescription(String description) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (uri() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property uri in model UriFileJobInput")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property uri in model UriFileJobInput")); } } private static final ClientLogger LOGGER = new ClientLogger(UriFileJobInput.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("uri", this.uri); + jsonWriter.writeStringField("jobInputType", this.jobInputType == null ? null : this.jobInputType.toString()); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UriFileJobInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UriFileJobInput if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UriFileJobInput. + */ + public static UriFileJobInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UriFileJobInput deserializedUriFileJobInput = new UriFileJobInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedUriFileJobInput.withDescription(reader.getString()); + } else if ("uri".equals(fieldName)) { + deserializedUriFileJobInput.uri = reader.getString(); + } else if ("jobInputType".equals(fieldName)) { + deserializedUriFileJobInput.jobInputType = JobInputType.fromString(reader.getString()); + } else if ("mode".equals(fieldName)) { + deserializedUriFileJobInput.mode = InputDeliveryMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedUriFileJobInput; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFileJobOutput.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFileJobOutput.java index e59ccfb629ef3..1ee99a0f60e4c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFileJobOutput.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFileJobOutput.java @@ -5,34 +5,50 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The UriFileJobOutput model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobOutputType") -@JsonTypeName("uri_file") +/** + * The UriFileJobOutput model. + */ @Fluent public final class UriFileJobOutput extends JobOutput { + /* + * [Required] Specifies the type of job. + */ + private JobOutputType jobOutputType = JobOutputType.URI_FILE; + /* * Output Asset Delivery Mode. */ - @JsonProperty(value = "mode") private OutputDeliveryMode mode; /* * Output Asset URI. */ - @JsonProperty(value = "uri") private String uri; - /** Creates an instance of UriFileJobOutput class. */ + /** + * Creates an instance of UriFileJobOutput class. + */ public UriFileJobOutput() { } + /** + * Get the jobOutputType property: [Required] Specifies the type of job. + * + * @return the jobOutputType value. + */ + @Override + public JobOutputType jobOutputType() { + return this.jobOutputType; + } + /** * Get the mode property: Output Asset Delivery Mode. - * + * * @return the mode value. */ public OutputDeliveryMode mode() { @@ -41,7 +57,7 @@ public OutputDeliveryMode mode() { /** * Set the mode property: Output Asset Delivery Mode. - * + * * @param mode the mode value to set. * @return the UriFileJobOutput object itself. */ @@ -52,7 +68,7 @@ public UriFileJobOutput withMode(OutputDeliveryMode mode) { /** * Get the uri property: Output Asset URI. - * + * * @return the uri value. */ public String uri() { @@ -61,7 +77,7 @@ public String uri() { /** * Set the uri property: Output Asset URI. - * + * * @param uri the uri value to set. * @return the UriFileJobOutput object itself. */ @@ -70,7 +86,9 @@ public UriFileJobOutput withUri(String uri) { return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public UriFileJobOutput withDescription(String description) { super.withDescription(description); @@ -79,11 +97,56 @@ public UriFileJobOutput withDescription(String description) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("jobOutputType", this.jobOutputType == null ? null : this.jobOutputType.toString()); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + jsonWriter.writeStringField("uri", this.uri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UriFileJobOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UriFileJobOutput if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the UriFileJobOutput. + */ + public static UriFileJobOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UriFileJobOutput deserializedUriFileJobOutput = new UriFileJobOutput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedUriFileJobOutput.withDescription(reader.getString()); + } else if ("jobOutputType".equals(fieldName)) { + deserializedUriFileJobOutput.jobOutputType = JobOutputType.fromString(reader.getString()); + } else if ("mode".equals(fieldName)) { + deserializedUriFileJobOutput.mode = OutputDeliveryMode.fromString(reader.getString()); + } else if ("uri".equals(fieldName)) { + deserializedUriFileJobOutput.uri = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUriFileJobOutput; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFolderDataVersion.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFolderDataVersion.java index 5904ef425eb8c..a3910e58471dc 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFolderDataVersion.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFolderDataVersion.java @@ -5,55 +5,86 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** uri-folder data version entity. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "dataType") -@JsonTypeName("uri_folder") +/** + * uri-folder data version entity. + */ @Fluent public final class UriFolderDataVersion extends DataVersionBaseProperties { - /** Creates an instance of UriFolderDataVersion class. */ + /* + * [Required] Specifies the type of data. + */ + private DataType dataType = DataType.URI_FOLDER; + + /** + * Creates an instance of UriFolderDataVersion class. + */ public UriFolderDataVersion() { } - /** {@inheritDoc} */ + /** + * Get the dataType property: [Required] Specifies the type of data. + * + * @return the dataType value. + */ + @Override + public DataType dataType() { + return this.dataType; + } + + /** + * {@inheritDoc} + */ @Override public UriFolderDataVersion withDataUri(String dataUri) { super.withDataUri(dataUri); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public UriFolderDataVersion withIsAnonymous(Boolean isAnonymous) { super.withIsAnonymous(isAnonymous); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public UriFolderDataVersion withIsArchived(Boolean isArchived) { super.withIsArchived(isArchived); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public UriFolderDataVersion withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public UriFolderDataVersion withProperties(Map properties) { super.withProperties(properties); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public UriFolderDataVersion withTags(Map tags) { super.withTags(tags); @@ -62,11 +93,68 @@ public UriFolderDataVersion withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("dataUri", dataUri()); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeMapField("properties", properties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("isAnonymous", isAnonymous()); + jsonWriter.writeBooleanField("isArchived", isArchived()); + jsonWriter.writeStringField("dataType", this.dataType == null ? null : this.dataType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UriFolderDataVersion from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UriFolderDataVersion if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UriFolderDataVersion. + */ + public static UriFolderDataVersion fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UriFolderDataVersion deserializedUriFolderDataVersion = new UriFolderDataVersion(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dataUri".equals(fieldName)) { + deserializedUriFolderDataVersion.withDataUri(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedUriFolderDataVersion.withDescription(reader.getString()); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedUriFolderDataVersion.withProperties(properties); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedUriFolderDataVersion.withTags(tags); + } else if ("isAnonymous".equals(fieldName)) { + deserializedUriFolderDataVersion.withIsAnonymous(reader.getNullable(JsonReader::getBoolean)); + } else if ("isArchived".equals(fieldName)) { + deserializedUriFolderDataVersion.withIsArchived(reader.getNullable(JsonReader::getBoolean)); + } else if ("dataType".equals(fieldName)) { + deserializedUriFolderDataVersion.dataType = DataType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedUriFolderDataVersion; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFolderJobInput.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFolderJobInput.java index 1434274fa4f7b..612bd2db3ca3d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFolderJobInput.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFolderJobInput.java @@ -6,34 +6,50 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The UriFolderJobInput model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobInputType") -@JsonTypeName("uri_folder") +/** + * The UriFolderJobInput model. + */ @Fluent public final class UriFolderJobInput extends JobInput { + /* + * [Required] Specifies the type of job. + */ + private JobInputType jobInputType = JobInputType.URI_FOLDER; + /* * Input Asset Delivery Mode. */ - @JsonProperty(value = "mode") private InputDeliveryMode mode; /* * [Required] Input Asset URI. */ - @JsonProperty(value = "uri", required = true) private String uri; - /** Creates an instance of UriFolderJobInput class. */ + /** + * Creates an instance of UriFolderJobInput class. + */ public UriFolderJobInput() { } + /** + * Get the jobInputType property: [Required] Specifies the type of job. + * + * @return the jobInputType value. + */ + @Override + public JobInputType jobInputType() { + return this.jobInputType; + } + /** * Get the mode property: Input Asset Delivery Mode. - * + * * @return the mode value. */ public InputDeliveryMode mode() { @@ -42,7 +58,7 @@ public InputDeliveryMode mode() { /** * Set the mode property: Input Asset Delivery Mode. - * + * * @param mode the mode value to set. * @return the UriFolderJobInput object itself. */ @@ -53,7 +69,7 @@ public UriFolderJobInput withMode(InputDeliveryMode mode) { /** * Get the uri property: [Required] Input Asset URI. - * + * * @return the uri value. */ public String uri() { @@ -62,7 +78,7 @@ public String uri() { /** * Set the uri property: [Required] Input Asset URI. - * + * * @param uri the uri value to set. * @return the UriFolderJobInput object itself. */ @@ -71,7 +87,9 @@ public UriFolderJobInput withUri(String uri) { return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public UriFolderJobInput withDescription(String description) { super.withDescription(description); @@ -80,18 +98,63 @@ public UriFolderJobInput withDescription(String description) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (uri() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property uri in model UriFolderJobInput")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property uri in model UriFolderJobInput")); } } private static final ClientLogger LOGGER = new ClientLogger(UriFolderJobInput.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("uri", this.uri); + jsonWriter.writeStringField("jobInputType", this.jobInputType == null ? null : this.jobInputType.toString()); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UriFolderJobInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UriFolderJobInput if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UriFolderJobInput. + */ + public static UriFolderJobInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UriFolderJobInput deserializedUriFolderJobInput = new UriFolderJobInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedUriFolderJobInput.withDescription(reader.getString()); + } else if ("uri".equals(fieldName)) { + deserializedUriFolderJobInput.uri = reader.getString(); + } else if ("jobInputType".equals(fieldName)) { + deserializedUriFolderJobInput.jobInputType = JobInputType.fromString(reader.getString()); + } else if ("mode".equals(fieldName)) { + deserializedUriFolderJobInput.mode = InputDeliveryMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedUriFolderJobInput; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFolderJobOutput.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFolderJobOutput.java index c0a7ef31b48ff..b25f67cd2f6d3 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFolderJobOutput.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UriFolderJobOutput.java @@ -5,34 +5,50 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The UriFolderJobOutput model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobOutputType") -@JsonTypeName("uri_folder") +/** + * The UriFolderJobOutput model. + */ @Fluent public final class UriFolderJobOutput extends JobOutput { + /* + * [Required] Specifies the type of job. + */ + private JobOutputType jobOutputType = JobOutputType.URI_FOLDER; + /* * Output Asset Delivery Mode. */ - @JsonProperty(value = "mode") private OutputDeliveryMode mode; /* * Output Asset URI. */ - @JsonProperty(value = "uri") private String uri; - /** Creates an instance of UriFolderJobOutput class. */ + /** + * Creates an instance of UriFolderJobOutput class. + */ public UriFolderJobOutput() { } + /** + * Get the jobOutputType property: [Required] Specifies the type of job. + * + * @return the jobOutputType value. + */ + @Override + public JobOutputType jobOutputType() { + return this.jobOutputType; + } + /** * Get the mode property: Output Asset Delivery Mode. - * + * * @return the mode value. */ public OutputDeliveryMode mode() { @@ -41,7 +57,7 @@ public OutputDeliveryMode mode() { /** * Set the mode property: Output Asset Delivery Mode. - * + * * @param mode the mode value to set. * @return the UriFolderJobOutput object itself. */ @@ -52,7 +68,7 @@ public UriFolderJobOutput withMode(OutputDeliveryMode mode) { /** * Get the uri property: Output Asset URI. - * + * * @return the uri value. */ public String uri() { @@ -61,7 +77,7 @@ public String uri() { /** * Set the uri property: Output Asset URI. - * + * * @param uri the uri value to set. * @return the UriFolderJobOutput object itself. */ @@ -70,7 +86,9 @@ public UriFolderJobOutput withUri(String uri) { return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public UriFolderJobOutput withDescription(String description) { super.withDescription(description); @@ -79,11 +97,56 @@ public UriFolderJobOutput withDescription(String description) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("jobOutputType", this.jobOutputType == null ? null : this.jobOutputType.toString()); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + jsonWriter.writeStringField("uri", this.uri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UriFolderJobOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UriFolderJobOutput if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the UriFolderJobOutput. + */ + public static UriFolderJobOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UriFolderJobOutput deserializedUriFolderJobOutput = new UriFolderJobOutput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedUriFolderJobOutput.withDescription(reader.getString()); + } else if ("jobOutputType".equals(fieldName)) { + deserializedUriFolderJobOutput.jobOutputType = JobOutputType.fromString(reader.getString()); + } else if ("mode".equals(fieldName)) { + deserializedUriFolderJobOutput.mode = OutputDeliveryMode.fromString(reader.getString()); + } else if ("uri".equals(fieldName)) { + deserializedUriFolderJobOutput.uri = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUriFolderJobOutput; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Usage.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Usage.java index c98ae6d128078..7ba869f98e85a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Usage.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Usage.java @@ -6,60 +6,62 @@ import com.azure.resourcemanager.machinelearning.fluent.models.UsageInner; -/** An immutable client-side representation of Usage. */ +/** + * An immutable client-side representation of Usage. + */ public interface Usage { /** * Gets the id property: Specifies the resource ID. - * + * * @return the id value. */ String id(); /** * Gets the amlWorkspaceLocation property: Region of the AML workspace in the id. - * + * * @return the amlWorkspaceLocation value. */ String amlWorkspaceLocation(); /** * Gets the type property: Specifies the resource type. - * + * * @return the type value. */ String type(); /** * Gets the unit property: An enum describing the unit of usage measurement. - * + * * @return the unit value. */ UsageUnit unit(); /** * Gets the currentValue property: The current usage of the resource. - * + * * @return the currentValue value. */ Long currentValue(); /** * Gets the limit property: The maximum permitted usage of the resource. - * + * * @return the limit value. */ Long limit(); /** * Gets the name property: The name of the type of usage. - * + * * @return the name value. */ UsageName name(); /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.UsageInner object. - * + * * @return the inner object. */ UsageInner innerModel(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UsageName.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UsageName.java index de4afdbbbac5a..a93cbc5c3571d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UsageName.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UsageName.java @@ -5,30 +5,36 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The Usage Names. */ +/** + * The Usage Names. + */ @Immutable -public final class UsageName { +public final class UsageName implements JsonSerializable { /* * The name of the resource. */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private String value; /* * The localized name of the resource. */ - @JsonProperty(value = "localizedValue", access = JsonProperty.Access.WRITE_ONLY) private String localizedValue; - /** Creates an instance of UsageName class. */ + /** + * Creates an instance of UsageName class. + */ public UsageName() { } /** * Get the value property: The name of the resource. - * + * * @return the value value. */ public String value() { @@ -37,7 +43,7 @@ public String value() { /** * Get the localizedValue property: The localized name of the resource. - * + * * @return the localizedValue value. */ public String localizedValue() { @@ -46,9 +52,46 @@ public String localizedValue() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UsageName from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UsageName if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the UsageName. + */ + public static UsageName fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UsageName deserializedUsageName = new UsageName(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedUsageName.value = reader.getString(); + } else if ("localizedValue".equals(fieldName)) { + deserializedUsageName.localizedValue = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUsageName; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UsageUnit.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UsageUnit.java index a9cc9108faf8c..19c10a7367021 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UsageUnit.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UsageUnit.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** An enum describing the unit of usage measurement. */ +/** + * An enum describing the unit of usage measurement. + */ public final class UsageUnit extends ExpandableStringEnum { - /** Static value Count for UsageUnit. */ + /** + * Static value Count for UsageUnit. + */ public static final UsageUnit COUNT = fromString("Count"); /** * Creates a new instance of UsageUnit value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -24,18 +27,17 @@ public UsageUnit() { /** * Creates or finds a UsageUnit from its string representation. - * + * * @param name a name to look for. * @return the corresponding UsageUnit. */ - @JsonCreator public static UsageUnit fromString(String name) { return fromString(name, UsageUnit.class); } /** * Gets known UsageUnit values. - * + * * @return known UsageUnit values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Usages.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Usages.java index 829c32dc42506..ac79b69d00ed0 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Usages.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Usages.java @@ -7,30 +7,32 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -/** Resource collection API of Usages. */ +/** + * Resource collection API of Usages. + */ public interface Usages { /** * Gets the current usage information as well as limits for AML resources for given subscription and location. - * + * * @param location The location for which resource usage is queried. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current usage information as well as limits for AML resources for given subscription and location as - * paginated response with {@link PagedIterable}. + * paginated response with {@link PagedIterable}. */ PagedIterable list(String location); /** * Gets the current usage information as well as limits for AML resources for given subscription and location. - * + * * @param location The location for which resource usage is queried. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current usage information as well as limits for AML resources for given subscription and location as - * paginated response with {@link PagedIterable}. + * paginated response with {@link PagedIterable}. */ PagedIterable list(String location, Context context); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UseStl.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UseStl.java index 25769eb8e8b47..3f489592a3cb9 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UseStl.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UseStl.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Configure STL Decomposition of the time-series target column. */ +/** + * Configure STL Decomposition of the time-series target column. + */ public final class UseStl extends ExpandableStringEnum { - /** Static value None for UseStl. */ + /** + * Static value None for UseStl. + */ public static final UseStl NONE = fromString("None"); - /** Static value Season for UseStl. */ + /** + * Static value Season for UseStl. + */ public static final UseStl SEASON = fromString("Season"); - /** Static value SeasonTrend for UseStl. */ + /** + * Static value SeasonTrend for UseStl. + */ public static final UseStl SEASON_TREND = fromString("SeasonTrend"); /** * Creates a new instance of UseStl value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public UseStl() { /** * Creates or finds a UseStl from its string representation. - * + * * @param name a name to look for. * @return the corresponding UseStl. */ - @JsonCreator public static UseStl fromString(String name) { return fromString(name, UseStl.class); } /** * Gets known UseStl values. - * + * * @return known UseStl values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UserAccountCredentials.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UserAccountCredentials.java index 617f6a6e5ec26..414e4693e2a64 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UserAccountCredentials.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UserAccountCredentials.java @@ -6,44 +6,41 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Settings for user account that gets created on each on the nodes of a compute. */ +/** + * Settings for user account that gets created on each on the nodes of a compute. + */ @Fluent -public final class UserAccountCredentials { +public final class UserAccountCredentials implements JsonSerializable { /* - * User name. - * * Name of the administrator user account which can be used to SSH to nodes. */ - @JsonProperty(value = "adminUserName", required = true) private String adminUsername; /* - * SSH public key. - * * SSH public key of the administrator user account. */ - @JsonProperty(value = "adminUserSshPublicKey") private String adminUserSshPublicKey; /* - * Password. - * * Password of the administrator user account. */ - @JsonProperty(value = "adminUserPassword") private String adminUserPassword; - /** Creates an instance of UserAccountCredentials class. */ + /** + * Creates an instance of UserAccountCredentials class. + */ public UserAccountCredentials() { } /** - * Get the adminUsername property: User name. - * - *

Name of the administrator user account which can be used to SSH to nodes. - * + * Get the adminUsername property: Name of the administrator user account which can be used to SSH to nodes. + * * @return the adminUsername value. */ public String adminUsername() { @@ -51,10 +48,8 @@ public String adminUsername() { } /** - * Set the adminUsername property: User name. - * - *

Name of the administrator user account which can be used to SSH to nodes. - * + * Set the adminUsername property: Name of the administrator user account which can be used to SSH to nodes. + * * @param adminUsername the adminUsername value to set. * @return the UserAccountCredentials object itself. */ @@ -64,10 +59,8 @@ public UserAccountCredentials withAdminUsername(String adminUsername) { } /** - * Get the adminUserSshPublicKey property: SSH public key. - * - *

SSH public key of the administrator user account. - * + * Get the adminUserSshPublicKey property: SSH public key of the administrator user account. + * * @return the adminUserSshPublicKey value. */ public String adminUserSshPublicKey() { @@ -75,10 +68,8 @@ public String adminUserSshPublicKey() { } /** - * Set the adminUserSshPublicKey property: SSH public key. - * - *

SSH public key of the administrator user account. - * + * Set the adminUserSshPublicKey property: SSH public key of the administrator user account. + * * @param adminUserSshPublicKey the adminUserSshPublicKey value to set. * @return the UserAccountCredentials object itself. */ @@ -88,10 +79,8 @@ public UserAccountCredentials withAdminUserSshPublicKey(String adminUserSshPubli } /** - * Get the adminUserPassword property: Password. - * - *

Password of the administrator user account. - * + * Get the adminUserPassword property: Password of the administrator user account. + * * @return the adminUserPassword value. */ public String adminUserPassword() { @@ -99,10 +88,8 @@ public String adminUserPassword() { } /** - * Set the adminUserPassword property: Password. - * - *

Password of the administrator user account. - * + * Set the adminUserPassword property: Password of the administrator user account. + * * @param adminUserPassword the adminUserPassword value to set. * @return the UserAccountCredentials object itself. */ @@ -113,17 +100,59 @@ public UserAccountCredentials withAdminUserPassword(String adminUserPassword) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (adminUsername() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property adminUsername in model UserAccountCredentials")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property adminUsername in model UserAccountCredentials")); } } private static final ClientLogger LOGGER = new ClientLogger(UserAccountCredentials.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("adminUserName", this.adminUsername); + jsonWriter.writeStringField("adminUserSshPublicKey", this.adminUserSshPublicKey); + jsonWriter.writeStringField("adminUserPassword", this.adminUserPassword); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserAccountCredentials from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserAccountCredentials if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UserAccountCredentials. + */ + public static UserAccountCredentials fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserAccountCredentials deserializedUserAccountCredentials = new UserAccountCredentials(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("adminUserName".equals(fieldName)) { + deserializedUserAccountCredentials.adminUsername = reader.getString(); + } else if ("adminUserSshPublicKey".equals(fieldName)) { + deserializedUserAccountCredentials.adminUserSshPublicKey = reader.getString(); + } else if ("adminUserPassword".equals(fieldName)) { + deserializedUserAccountCredentials.adminUserPassword = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUserAccountCredentials; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UserAssignedIdentity.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UserAssignedIdentity.java index efc6c81be31d6..b667345fc50ba 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UserAssignedIdentity.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UserAssignedIdentity.java @@ -5,31 +5,37 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.UUID; -/** User assigned identity properties. */ +/** + * User assigned identity properties. + */ @Immutable -public class UserAssignedIdentity { +public final class UserAssignedIdentity implements JsonSerializable { /* * The principal ID of the assigned identity. */ - @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) private UUID principalId; /* * The client ID of the assigned identity. */ - @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) private UUID clientId; - /** Creates an instance of UserAssignedIdentity class. */ + /** + * Creates an instance of UserAssignedIdentity class. + */ public UserAssignedIdentity() { } /** * Get the principalId property: The principal ID of the assigned identity. - * + * * @return the principalId value. */ public UUID principalId() { @@ -38,7 +44,7 @@ public UUID principalId() { /** * Get the clientId property: The client ID of the assigned identity. - * + * * @return the clientId value. */ public UUID clientId() { @@ -47,9 +53,48 @@ public UUID clientId() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserAssignedIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserAssignedIdentity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the UserAssignedIdentity. + */ + public static UserAssignedIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserAssignedIdentity deserializedUserAssignedIdentity = new UserAssignedIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedUserAssignedIdentity.principalId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("clientId".equals(fieldName)) { + deserializedUserAssignedIdentity.clientId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedUserAssignedIdentity; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UserCreatedAcrAccount.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UserCreatedAcrAccount.java new file mode 100644 index 0000000000000..de673e1f3855a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UserCreatedAcrAccount.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The UserCreatedAcrAccount model. + */ +@Fluent +public final class UserCreatedAcrAccount implements JsonSerializable { + /* + * ARM ResourceId of a resource + */ + private ArmResourceId armResourceId; + + /** + * Creates an instance of UserCreatedAcrAccount class. + */ + public UserCreatedAcrAccount() { + } + + /** + * Get the armResourceId property: ARM ResourceId of a resource. + * + * @return the armResourceId value. + */ + public ArmResourceId armResourceId() { + return this.armResourceId; + } + + /** + * Set the armResourceId property: ARM ResourceId of a resource. + * + * @param armResourceId the armResourceId value to set. + * @return the UserCreatedAcrAccount object itself. + */ + public UserCreatedAcrAccount withArmResourceId(ArmResourceId armResourceId) { + this.armResourceId = armResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (armResourceId() != null) { + armResourceId().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("armResourceId", this.armResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserCreatedAcrAccount from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserCreatedAcrAccount if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the UserCreatedAcrAccount. + */ + public static UserCreatedAcrAccount fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserCreatedAcrAccount deserializedUserCreatedAcrAccount = new UserCreatedAcrAccount(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("armResourceId".equals(fieldName)) { + deserializedUserCreatedAcrAccount.armResourceId = ArmResourceId.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedUserCreatedAcrAccount; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UserCreatedStorageAccount.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UserCreatedStorageAccount.java new file mode 100644 index 0000000000000..0845b3254b454 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UserCreatedStorageAccount.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The UserCreatedStorageAccount model. + */ +@Fluent +public final class UserCreatedStorageAccount implements JsonSerializable { + /* + * ARM ResourceId of a resource + */ + private ArmResourceId armResourceId; + + /** + * Creates an instance of UserCreatedStorageAccount class. + */ + public UserCreatedStorageAccount() { + } + + /** + * Get the armResourceId property: ARM ResourceId of a resource. + * + * @return the armResourceId value. + */ + public ArmResourceId armResourceId() { + return this.armResourceId; + } + + /** + * Set the armResourceId property: ARM ResourceId of a resource. + * + * @param armResourceId the armResourceId value to set. + * @return the UserCreatedStorageAccount object itself. + */ + public UserCreatedStorageAccount withArmResourceId(ArmResourceId armResourceId) { + this.armResourceId = armResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (armResourceId() != null) { + armResourceId().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("armResourceId", this.armResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserCreatedStorageAccount from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserCreatedStorageAccount if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the UserCreatedStorageAccount. + */ + public static UserCreatedStorageAccount fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserCreatedStorageAccount deserializedUserCreatedStorageAccount = new UserCreatedStorageAccount(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("armResourceId".equals(fieldName)) { + deserializedUserCreatedStorageAccount.armResourceId = ArmResourceId.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedUserCreatedStorageAccount; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UserIdentity.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UserIdentity.java index bd76cf17193eb..ea36d31e153e0 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UserIdentity.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UserIdentity.java @@ -5,25 +5,80 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** User identity configuration. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "identityType") -@JsonTypeName("UserIdentity") +/** + * User identity configuration. + */ @Immutable -public class UserIdentity extends IdentityConfiguration { - /** Creates an instance of UserIdentity class. */ +public final class UserIdentity extends IdentityConfiguration { + /* + * [Required] Specifies the type of identity framework. + */ + private IdentityConfigurationType identityType = IdentityConfigurationType.USER_IDENTITY; + + /** + * Creates an instance of UserIdentity class. + */ public UserIdentity() { } + /** + * Get the identityType property: [Required] Specifies the type of identity framework. + * + * @return the identityType value. + */ + @Override + public IdentityConfigurationType identityType() { + return this.identityType; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("identityType", this.identityType == null ? null : this.identityType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserIdentity if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the UserIdentity. + */ + public static UserIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserIdentity deserializedUserIdentity = new UserIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("identityType".equals(fieldName)) { + deserializedUserIdentity.identityType = IdentityConfigurationType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedUserIdentity; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UsernamePasswordAuthTypeWorkspaceConnectionProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UsernamePasswordAuthTypeWorkspaceConnectionProperties.java index c63b03a2f6017..8877b608e63ca 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UsernamePasswordAuthTypeWorkspaceConnectionProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/UsernamePasswordAuthTypeWorkspaceConnectionProperties.java @@ -5,28 +5,60 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; -/** The UsernamePasswordAuthTypeWorkspaceConnectionProperties model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "authType") -@JsonTypeName("UsernamePassword") +/** + * The UsernamePasswordAuthTypeWorkspaceConnectionProperties model. + */ @Fluent public final class UsernamePasswordAuthTypeWorkspaceConnectionProperties extends WorkspaceConnectionPropertiesV2 { + /* + * Authentication type of the connection target + */ + private ConnectionAuthType authType = ConnectionAuthType.USERNAME_PASSWORD; + /* * The credentials property. */ - @JsonProperty(value = "credentials") private WorkspaceConnectionUsernamePassword credentials; - /** Creates an instance of UsernamePasswordAuthTypeWorkspaceConnectionProperties class. */ + /* + * The createdByWorkspaceArmId property. + */ + private String createdByWorkspaceArmId; + + /* + * Group based on connection category + */ + private ConnectionGroup group; + + /** + * Creates an instance of UsernamePasswordAuthTypeWorkspaceConnectionProperties class. + */ public UsernamePasswordAuthTypeWorkspaceConnectionProperties() { } + /** + * Get the authType property: Authentication type of the connection target. + * + * @return the authType value. + */ + @Override + public ConnectionAuthType authType() { + return this.authType; + } + /** * Get the credentials property: The credentials property. - * + * * @return the credentials value. */ public WorkspaceConnectionUsernamePassword credentials() { @@ -35,38 +67,102 @@ public WorkspaceConnectionUsernamePassword credentials() { /** * Set the credentials property: The credentials property. - * + * * @param credentials the credentials value to set. * @return the UsernamePasswordAuthTypeWorkspaceConnectionProperties object itself. */ - public UsernamePasswordAuthTypeWorkspaceConnectionProperties withCredentials( - WorkspaceConnectionUsernamePassword credentials) { + public UsernamePasswordAuthTypeWorkspaceConnectionProperties + withCredentials(WorkspaceConnectionUsernamePassword credentials) { this.credentials = credentials; return this; } - /** {@inheritDoc} */ + /** + * Get the createdByWorkspaceArmId property: The createdByWorkspaceArmId property. + * + * @return the createdByWorkspaceArmId value. + */ + @Override + public String createdByWorkspaceArmId() { + return this.createdByWorkspaceArmId; + } + + /** + * Get the group property: Group based on connection category. + * + * @return the group value. + */ + @Override + public ConnectionGroup group() { + return this.group; + } + + /** + * {@inheritDoc} + */ @Override public UsernamePasswordAuthTypeWorkspaceConnectionProperties withCategory(ConnectionCategory category) { super.withCategory(category); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ + @Override + public UsernamePasswordAuthTypeWorkspaceConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { + super.withExpiryTime(expiryTime); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public UsernamePasswordAuthTypeWorkspaceConnectionProperties withIsSharedToAll(Boolean isSharedToAll) { + super.withIsSharedToAll(isSharedToAll); + return this; + } + + /** + * {@inheritDoc} + */ @Override public UsernamePasswordAuthTypeWorkspaceConnectionProperties withTarget(String target) { super.withTarget(target); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ + @Override + public UsernamePasswordAuthTypeWorkspaceConnectionProperties withMetadata(Map metadata) { + super.withMetadata(metadata); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public UsernamePasswordAuthTypeWorkspaceConnectionProperties withSharedUserList(List sharedUserList) { + super.withSharedUserList(sharedUserList); + return this; + } + + /** + * {@inheritDoc} + */ @Override public UsernamePasswordAuthTypeWorkspaceConnectionProperties withValue(String value) { super.withValue(value); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public UsernamePasswordAuthTypeWorkspaceConnectionProperties withValueFormat(ValueFormat valueFormat) { super.withValueFormat(valueFormat); @@ -75,7 +171,7 @@ public UsernamePasswordAuthTypeWorkspaceConnectionProperties withValueFormat(Val /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -85,4 +181,86 @@ public void validate() { credentials().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", category() == null ? null : category().toString()); + jsonWriter.writeStringField("expiryTime", + expiryTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expiryTime())); + jsonWriter.writeBooleanField("isSharedToAll", isSharedToAll()); + jsonWriter.writeStringField("target", target()); + jsonWriter.writeMapField("metadata", metadata(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("sharedUserList", sharedUserList(), + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("value", value()); + jsonWriter.writeStringField("valueFormat", valueFormat() == null ? null : valueFormat().toString()); + jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); + jsonWriter.writeJsonField("credentials", this.credentials); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UsernamePasswordAuthTypeWorkspaceConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UsernamePasswordAuthTypeWorkspaceConnectionProperties if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the UsernamePasswordAuthTypeWorkspaceConnectionProperties. + */ + public static UsernamePasswordAuthTypeWorkspaceConnectionProperties fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + UsernamePasswordAuthTypeWorkspaceConnectionProperties deserializedUsernamePasswordAuthTypeWorkspaceConnectionProperties + = new UsernamePasswordAuthTypeWorkspaceConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedUsernamePasswordAuthTypeWorkspaceConnectionProperties + .withCategory(ConnectionCategory.fromString(reader.getString())); + } else if ("createdByWorkspaceArmId".equals(fieldName)) { + deserializedUsernamePasswordAuthTypeWorkspaceConnectionProperties.createdByWorkspaceArmId + = reader.getString(); + } else if ("expiryTime".equals(fieldName)) { + deserializedUsernamePasswordAuthTypeWorkspaceConnectionProperties.withExpiryTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("group".equals(fieldName)) { + deserializedUsernamePasswordAuthTypeWorkspaceConnectionProperties.group + = ConnectionGroup.fromString(reader.getString()); + } else if ("isSharedToAll".equals(fieldName)) { + deserializedUsernamePasswordAuthTypeWorkspaceConnectionProperties + .withIsSharedToAll(reader.getNullable(JsonReader::getBoolean)); + } else if ("target".equals(fieldName)) { + deserializedUsernamePasswordAuthTypeWorkspaceConnectionProperties.withTarget(reader.getString()); + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedUsernamePasswordAuthTypeWorkspaceConnectionProperties.withMetadata(metadata); + } else if ("sharedUserList".equals(fieldName)) { + List sharedUserList = reader.readArray(reader1 -> reader1.getString()); + deserializedUsernamePasswordAuthTypeWorkspaceConnectionProperties + .withSharedUserList(sharedUserList); + } else if ("value".equals(fieldName)) { + deserializedUsernamePasswordAuthTypeWorkspaceConnectionProperties.withValue(reader.getString()); + } else if ("valueFormat".equals(fieldName)) { + deserializedUsernamePasswordAuthTypeWorkspaceConnectionProperties + .withValueFormat(ValueFormat.fromString(reader.getString())); + } else if ("authType".equals(fieldName)) { + deserializedUsernamePasswordAuthTypeWorkspaceConnectionProperties.authType + = ConnectionAuthType.fromString(reader.getString()); + } else if ("credentials".equals(fieldName)) { + deserializedUsernamePasswordAuthTypeWorkspaceConnectionProperties.credentials + = WorkspaceConnectionUsernamePassword.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedUsernamePasswordAuthTypeWorkspaceConnectionProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VMPriceOSType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VMPriceOSType.java index 3b9e225d7d15c..901828b9bb87d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VMPriceOSType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VMPriceOSType.java @@ -5,24 +5,27 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** * OS type - * - *

Operating system type used by the VM. + * + * Operating system type used by the VM. */ public final class VMPriceOSType extends ExpandableStringEnum { - /** Static value Linux for VMPriceOSType. */ + /** + * Static value Linux for VMPriceOSType. + */ public static final VMPriceOSType LINUX = fromString("Linux"); - /** Static value Windows for VMPriceOSType. */ + /** + * Static value Windows for VMPriceOSType. + */ public static final VMPriceOSType WINDOWS = fromString("Windows"); /** * Creates a new instance of VMPriceOSType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -31,18 +34,17 @@ public VMPriceOSType() { /** * Creates or finds a VMPriceOSType from its string representation. - * + * * @param name a name to look for. * @return the corresponding VMPriceOSType. */ - @JsonCreator public static VMPriceOSType fromString(String name) { return fromString(name, VMPriceOSType.class); } /** * Gets known VMPriceOSType values. - * + * * @return known VMPriceOSType values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VMTier.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VMTier.java index d7b857e72c846..9238b23803a25 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VMTier.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VMTier.java @@ -5,27 +5,32 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** * VM tier - * - *

The type of the VM. + * + * The type of the VM. */ public final class VMTier extends ExpandableStringEnum { - /** Static value Standard for VMTier. */ + /** + * Static value Standard for VMTier. + */ public static final VMTier STANDARD = fromString("Standard"); - /** Static value LowPriority for VMTier. */ + /** + * Static value LowPriority for VMTier. + */ public static final VMTier LOW_PRIORITY = fromString("LowPriority"); - /** Static value Spot for VMTier. */ + /** + * Static value Spot for VMTier. + */ public static final VMTier SPOT = fromString("Spot"); /** * Creates a new instance of VMTier value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -34,18 +39,17 @@ public VMTier() { /** * Creates or finds a VMTier from its string representation. - * + * * @param name a name to look for. * @return the corresponding VMTier. */ - @JsonCreator public static VMTier fromString(String name) { return fromString(name, VMTier.class); } /** * Gets known VMTier values. - * + * * @return known VMTier values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ValidationMetricType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ValidationMetricType.java index d7c8e2c6bc5df..f38129e5f7722 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ValidationMetricType.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ValidationMetricType.java @@ -5,26 +5,35 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Metric computation method to use for validation metrics in image tasks. */ +/** + * Metric computation method to use for validation metrics in image tasks. + */ public final class ValidationMetricType extends ExpandableStringEnum { - /** Static value None for ValidationMetricType. */ + /** + * Static value None for ValidationMetricType. + */ public static final ValidationMetricType NONE = fromString("None"); - /** Static value Coco for ValidationMetricType. */ + /** + * Static value Coco for ValidationMetricType. + */ public static final ValidationMetricType COCO = fromString("Coco"); - /** Static value Voc for ValidationMetricType. */ + /** + * Static value Voc for ValidationMetricType. + */ public static final ValidationMetricType VOC = fromString("Voc"); - /** Static value CocoVoc for ValidationMetricType. */ + /** + * Static value CocoVoc for ValidationMetricType. + */ public static final ValidationMetricType COCO_VOC = fromString("CocoVoc"); /** * Creates a new instance of ValidationMetricType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,18 +42,17 @@ public ValidationMetricType() { /** * Creates or finds a ValidationMetricType from its string representation. - * + * * @param name a name to look for. * @return the corresponding ValidationMetricType. */ - @JsonCreator public static ValidationMetricType fromString(String name) { return fromString(name, ValidationMetricType.class); } /** * Gets known ValidationMetricType values. - * + * * @return known ValidationMetricType values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ValueFormat.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ValueFormat.java index 336be0e494447..38e4b67e45df8 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ValueFormat.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/ValueFormat.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** format for the workspace connection value. */ +/** + * format for the workspace connection value. + */ public final class ValueFormat extends ExpandableStringEnum { - /** Static value JSON for ValueFormat. */ + /** + * Static value JSON for ValueFormat. + */ public static final ValueFormat JSON = fromString("JSON"); /** * Creates a new instance of ValueFormat value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -24,18 +27,17 @@ public ValueFormat() { /** * Creates or finds a ValueFormat from its string representation. - * + * * @param name a name to look for. * @return the corresponding ValueFormat. */ - @JsonCreator public static ValueFormat fromString(String name) { return fromString(name, ValueFormat.class); } /** * Gets known ValueFormat values. - * + * * @return known ValueFormat values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachine.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachine.java index ace46f7abc11d..976a0b7576b7b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachine.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachine.java @@ -5,28 +5,75 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; -/** A Machine Learning compute based on Azure Virtual Machines. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "computeType") -@JsonTypeName("VirtualMachine") +/** + * A Machine Learning compute based on Azure Virtual Machines. + */ @Fluent public final class VirtualMachine extends Compute { + /* + * The type of compute + */ + private ComputeType computeType = ComputeType.VIRTUAL_MACHINE; + /* * The properties property. */ - @JsonProperty(value = "properties") private VirtualMachineSchemaProperties properties; - /** Creates an instance of VirtualMachine class. */ + /* + * The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. + */ + private ProvisioningState provisioningState; + + /* + * The time at which the compute was created. + */ + private OffsetDateTime createdOn; + + /* + * The time at which the compute was last modified. + */ + private OffsetDateTime modifiedOn; + + /* + * Errors during provisioning + */ + private List provisioningErrors; + + /* + * Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning + * service provisioned it if false. + */ + private Boolean isAttachedCompute; + + /** + * Creates an instance of VirtualMachine class. + */ public VirtualMachine() { } + /** + * Get the computeType property: The type of compute. + * + * @return the computeType value. + */ + @Override + public ComputeType computeType() { + return this.computeType; + } + /** * Get the properties property: The properties property. - * + * * @return the properties value. */ public VirtualMachineSchemaProperties properties() { @@ -35,7 +82,7 @@ public VirtualMachineSchemaProperties properties() { /** * Set the properties property: The properties property. - * + * * @param properties the properties value to set. * @return the VirtualMachine object itself. */ @@ -44,28 +91,88 @@ public VirtualMachine withProperties(VirtualMachineSchemaProperties properties) return this; } - /** {@inheritDoc} */ + /** + * Get the provisioningState property: The provision state of the cluster. Valid values are Unknown, Updating, + * Provisioning, Succeeded, and Failed. + * + * @return the provisioningState value. + */ + @Override + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the createdOn property: The time at which the compute was created. + * + * @return the createdOn value. + */ + @Override + public OffsetDateTime createdOn() { + return this.createdOn; + } + + /** + * Get the modifiedOn property: The time at which the compute was last modified. + * + * @return the modifiedOn value. + */ + @Override + public OffsetDateTime modifiedOn() { + return this.modifiedOn; + } + + /** + * Get the provisioningErrors property: Errors during provisioning. + * + * @return the provisioningErrors value. + */ + @Override + public List provisioningErrors() { + return this.provisioningErrors; + } + + /** + * Get the isAttachedCompute property: Indicating whether the compute was provisioned by user and brought from + * outside if true, or machine learning service provisioned it if false. + * + * @return the isAttachedCompute value. + */ + @Override + public Boolean isAttachedCompute() { + return this.isAttachedCompute; + } + + /** + * {@inheritDoc} + */ @Override public VirtualMachine withComputeLocation(String computeLocation) { super.withComputeLocation(computeLocation); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public VirtualMachine withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public VirtualMachine withResourceId(String resourceId) { super.withResourceId(resourceId); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public VirtualMachine withDisableLocalAuth(Boolean disableLocalAuth) { super.withDisableLocalAuth(disableLocalAuth); @@ -74,7 +181,7 @@ public VirtualMachine withDisableLocalAuth(Boolean disableLocalAuth) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -84,4 +191,69 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("computeLocation", computeLocation()); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("resourceId", resourceId()); + jsonWriter.writeBooleanField("disableLocalAuth", disableLocalAuth()); + jsonWriter.writeStringField("computeType", this.computeType == null ? null : this.computeType.toString()); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachine from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachine if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualMachine. + */ + public static VirtualMachine fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachine deserializedVirtualMachine = new VirtualMachine(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("computeLocation".equals(fieldName)) { + deserializedVirtualMachine.withComputeLocation(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedVirtualMachine.provisioningState = ProvisioningState.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedVirtualMachine.withDescription(reader.getString()); + } else if ("createdOn".equals(fieldName)) { + deserializedVirtualMachine.createdOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("modifiedOn".equals(fieldName)) { + deserializedVirtualMachine.modifiedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("resourceId".equals(fieldName)) { + deserializedVirtualMachine.withResourceId(reader.getString()); + } else if ("provisioningErrors".equals(fieldName)) { + List provisioningErrors + = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); + deserializedVirtualMachine.provisioningErrors = provisioningErrors; + } else if ("isAttachedCompute".equals(fieldName)) { + deserializedVirtualMachine.isAttachedCompute = reader.getNullable(JsonReader::getBoolean); + } else if ("disableLocalAuth".equals(fieldName)) { + deserializedVirtualMachine.withDisableLocalAuth(reader.getNullable(JsonReader::getBoolean)); + } else if ("computeType".equals(fieldName)) { + deserializedVirtualMachine.computeType = ComputeType.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedVirtualMachine.properties = VirtualMachineSchemaProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachine; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachineImage.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachineImage.java index bbbf91671967d..4c26378b85de8 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachineImage.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachineImage.java @@ -6,24 +6,31 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Virtual Machine image for Windows AML Compute. */ +/** + * Virtual Machine image for Windows AML Compute. + */ @Fluent -public final class VirtualMachineImage { +public final class VirtualMachineImage implements JsonSerializable { /* * Virtual Machine image path */ - @JsonProperty(value = "id", required = true) private String id; - /** Creates an instance of VirtualMachineImage class. */ + /** + * Creates an instance of VirtualMachineImage class. + */ public VirtualMachineImage() { } /** * Get the id property: Virtual Machine image path. - * + * * @return the id value. */ public String id() { @@ -32,7 +39,7 @@ public String id() { /** * Set the id property: Virtual Machine image path. - * + * * @param id the id value to set. * @return the VirtualMachineImage object itself. */ @@ -43,16 +50,52 @@ public VirtualMachineImage withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (id() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property id in model VirtualMachineImage")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property id in model VirtualMachineImage")); } } private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineImage.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineImage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineImage if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VirtualMachineImage. + */ + public static VirtualMachineImage fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineImage deserializedVirtualMachineImage = new VirtualMachineImage(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVirtualMachineImage.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineImage; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachineSchema.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachineSchema.java index b519477bcd6ec..e138d3304576b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachineSchema.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachineSchema.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The VirtualMachineSchema model. */ +/** + * The VirtualMachineSchema model. + */ @Fluent -public class VirtualMachineSchema { +public class VirtualMachineSchema implements JsonSerializable { /* * The properties property. */ - @JsonProperty(value = "properties") private VirtualMachineSchemaProperties properties; - /** Creates an instance of VirtualMachineSchema class. */ + /** + * Creates an instance of VirtualMachineSchema class. + */ public VirtualMachineSchema() { } /** * Get the properties property: The properties property. - * + * * @return the properties value. */ public VirtualMachineSchemaProperties properties() { @@ -31,7 +38,7 @@ public VirtualMachineSchemaProperties properties() { /** * Set the properties property: The properties property. - * + * * @param properties the properties value to set. * @return the VirtualMachineSchema object itself. */ @@ -42,7 +49,7 @@ public VirtualMachineSchema withProperties(VirtualMachineSchemaProperties proper /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -50,4 +57,40 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineSchema from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineSchema if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualMachineSchema. + */ + public static VirtualMachineSchema fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineSchema deserializedVirtualMachineSchema = new VirtualMachineSchema(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedVirtualMachineSchema.properties = VirtualMachineSchemaProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineSchema; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachineSchemaProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachineSchemaProperties.java index 2b5d333a7a08e..8e6a7a887e1b1 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachineSchemaProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachineSchemaProperties.java @@ -5,54 +5,56 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The VirtualMachineSchemaProperties model. */ +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The VirtualMachineSchemaProperties model. + */ @Fluent -public final class VirtualMachineSchemaProperties { +public final class VirtualMachineSchemaProperties implements JsonSerializable { /* * Virtual Machine size */ - @JsonProperty(value = "virtualMachineSize") private String virtualMachineSize; /* * Port open for ssh connections. */ - @JsonProperty(value = "sshPort") private Integer sshPort; /* * Notebook server port open for ssh connections. */ - @JsonProperty(value = "notebookServerPort") private Integer notebookServerPort; /* * Public IP address of the virtual machine. */ - @JsonProperty(value = "address") private String address; /* * Admin credentials for virtual machine */ - @JsonProperty(value = "administratorAccount") private VirtualMachineSshCredentials administratorAccount; /* * Indicates whether this compute will be used for running notebooks. */ - @JsonProperty(value = "isNotebookInstanceCompute") private Boolean isNotebookInstanceCompute; - /** Creates an instance of VirtualMachineSchemaProperties class. */ + /** + * Creates an instance of VirtualMachineSchemaProperties class. + */ public VirtualMachineSchemaProperties() { } /** * Get the virtualMachineSize property: Virtual Machine size. - * + * * @return the virtualMachineSize value. */ public String virtualMachineSize() { @@ -61,7 +63,7 @@ public String virtualMachineSize() { /** * Set the virtualMachineSize property: Virtual Machine size. - * + * * @param virtualMachineSize the virtualMachineSize value to set. * @return the VirtualMachineSchemaProperties object itself. */ @@ -72,7 +74,7 @@ public VirtualMachineSchemaProperties withVirtualMachineSize(String virtualMachi /** * Get the sshPort property: Port open for ssh connections. - * + * * @return the sshPort value. */ public Integer sshPort() { @@ -81,7 +83,7 @@ public Integer sshPort() { /** * Set the sshPort property: Port open for ssh connections. - * + * * @param sshPort the sshPort value to set. * @return the VirtualMachineSchemaProperties object itself. */ @@ -92,7 +94,7 @@ public VirtualMachineSchemaProperties withSshPort(Integer sshPort) { /** * Get the notebookServerPort property: Notebook server port open for ssh connections. - * + * * @return the notebookServerPort value. */ public Integer notebookServerPort() { @@ -101,7 +103,7 @@ public Integer notebookServerPort() { /** * Set the notebookServerPort property: Notebook server port open for ssh connections. - * + * * @param notebookServerPort the notebookServerPort value to set. * @return the VirtualMachineSchemaProperties object itself. */ @@ -112,7 +114,7 @@ public VirtualMachineSchemaProperties withNotebookServerPort(Integer notebookSer /** * Get the address property: Public IP address of the virtual machine. - * + * * @return the address value. */ public String address() { @@ -121,7 +123,7 @@ public String address() { /** * Set the address property: Public IP address of the virtual machine. - * + * * @param address the address value to set. * @return the VirtualMachineSchemaProperties object itself. */ @@ -132,7 +134,7 @@ public VirtualMachineSchemaProperties withAddress(String address) { /** * Get the administratorAccount property: Admin credentials for virtual machine. - * + * * @return the administratorAccount value. */ public VirtualMachineSshCredentials administratorAccount() { @@ -141,7 +143,7 @@ public VirtualMachineSshCredentials administratorAccount() { /** * Set the administratorAccount property: Admin credentials for virtual machine. - * + * * @param administratorAccount the administratorAccount value to set. * @return the VirtualMachineSchemaProperties object itself. */ @@ -152,7 +154,7 @@ public VirtualMachineSchemaProperties withAdministratorAccount(VirtualMachineSsh /** * Get the isNotebookInstanceCompute property: Indicates whether this compute will be used for running notebooks. - * + * * @return the isNotebookInstanceCompute value. */ public Boolean isNotebookInstanceCompute() { @@ -161,7 +163,7 @@ public Boolean isNotebookInstanceCompute() { /** * Set the isNotebookInstanceCompute property: Indicates whether this compute will be used for running notebooks. - * + * * @param isNotebookInstanceCompute the isNotebookInstanceCompute value to set. * @return the VirtualMachineSchemaProperties object itself. */ @@ -172,7 +174,7 @@ public VirtualMachineSchemaProperties withIsNotebookInstanceCompute(Boolean isNo /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -180,4 +182,59 @@ public void validate() { administratorAccount().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("virtualMachineSize", this.virtualMachineSize); + jsonWriter.writeNumberField("sshPort", this.sshPort); + jsonWriter.writeNumberField("notebookServerPort", this.notebookServerPort); + jsonWriter.writeStringField("address", this.address); + jsonWriter.writeJsonField("administratorAccount", this.administratorAccount); + jsonWriter.writeBooleanField("isNotebookInstanceCompute", this.isNotebookInstanceCompute); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineSchemaProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineSchemaProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualMachineSchemaProperties. + */ + public static VirtualMachineSchemaProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineSchemaProperties deserializedVirtualMachineSchemaProperties + = new VirtualMachineSchemaProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("virtualMachineSize".equals(fieldName)) { + deserializedVirtualMachineSchemaProperties.virtualMachineSize = reader.getString(); + } else if ("sshPort".equals(fieldName)) { + deserializedVirtualMachineSchemaProperties.sshPort = reader.getNullable(JsonReader::getInt); + } else if ("notebookServerPort".equals(fieldName)) { + deserializedVirtualMachineSchemaProperties.notebookServerPort + = reader.getNullable(JsonReader::getInt); + } else if ("address".equals(fieldName)) { + deserializedVirtualMachineSchemaProperties.address = reader.getString(); + } else if ("administratorAccount".equals(fieldName)) { + deserializedVirtualMachineSchemaProperties.administratorAccount + = VirtualMachineSshCredentials.fromJson(reader); + } else if ("isNotebookInstanceCompute".equals(fieldName)) { + deserializedVirtualMachineSchemaProperties.isNotebookInstanceCompute + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineSchemaProperties; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachineSecrets.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachineSecrets.java index 3d8b393e3060e..a83c8ed0eb09f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachineSecrets.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachineSecrets.java @@ -5,29 +5,46 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.fluent.models.ComputeSecretsInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.IOException; -/** Secrets related to a Machine Learning compute based on AKS. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "computeType") -@JsonTypeName("VirtualMachine") +/** + * Secrets related to a Machine Learning compute based on AKS. + */ @Fluent public final class VirtualMachineSecrets extends ComputeSecretsInner { + /* + * The type of compute + */ + private ComputeType computeType = ComputeType.VIRTUAL_MACHINE; + /* * Admin credentials for virtual machine. */ - @JsonProperty(value = "administratorAccount") private VirtualMachineSshCredentials administratorAccount; - /** Creates an instance of VirtualMachineSecrets class. */ + /** + * Creates an instance of VirtualMachineSecrets class. + */ public VirtualMachineSecrets() { } + /** + * Get the computeType property: The type of compute. + * + * @return the computeType value. + */ + @Override + public ComputeType computeType() { + return this.computeType; + } + /** * Get the administratorAccount property: Admin credentials for virtual machine. - * + * * @return the administratorAccount value. */ public VirtualMachineSshCredentials administratorAccount() { @@ -36,7 +53,7 @@ public VirtualMachineSshCredentials administratorAccount() { /** * Set the administratorAccount property: Admin credentials for virtual machine. - * + * * @param administratorAccount the administratorAccount value to set. * @return the VirtualMachineSecrets object itself. */ @@ -47,7 +64,7 @@ public VirtualMachineSecrets withAdministratorAccount(VirtualMachineSshCredentia /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -57,4 +74,44 @@ public void validate() { administratorAccount().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("computeType", this.computeType == null ? null : this.computeType.toString()); + jsonWriter.writeJsonField("administratorAccount", this.administratorAccount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineSecrets from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineSecrets if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualMachineSecrets. + */ + public static VirtualMachineSecrets fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineSecrets deserializedVirtualMachineSecrets = new VirtualMachineSecrets(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("computeType".equals(fieldName)) { + deserializedVirtualMachineSecrets.computeType = ComputeType.fromString(reader.getString()); + } else if ("administratorAccount".equals(fieldName)) { + deserializedVirtualMachineSecrets.administratorAccount + = VirtualMachineSshCredentials.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineSecrets; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachineSecretsSchema.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachineSecretsSchema.java index f4554787497ef..36e593c1553e4 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachineSecretsSchema.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachineSecretsSchema.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The VirtualMachineSecretsSchema model. */ +/** + * The VirtualMachineSecretsSchema model. + */ @Fluent -public class VirtualMachineSecretsSchema { +public class VirtualMachineSecretsSchema implements JsonSerializable { /* * Admin credentials for virtual machine. */ - @JsonProperty(value = "administratorAccount") private VirtualMachineSshCredentials administratorAccount; - /** Creates an instance of VirtualMachineSecretsSchema class. */ + /** + * Creates an instance of VirtualMachineSecretsSchema class. + */ public VirtualMachineSecretsSchema() { } /** * Get the administratorAccount property: Admin credentials for virtual machine. - * + * * @return the administratorAccount value. */ public VirtualMachineSshCredentials administratorAccount() { @@ -31,7 +38,7 @@ public VirtualMachineSshCredentials administratorAccount() { /** * Set the administratorAccount property: Admin credentials for virtual machine. - * + * * @param administratorAccount the administratorAccount value to set. * @return the VirtualMachineSecretsSchema object itself. */ @@ -42,7 +49,7 @@ public VirtualMachineSecretsSchema withAdministratorAccount(VirtualMachineSshCre /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -50,4 +57,41 @@ public void validate() { administratorAccount().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("administratorAccount", this.administratorAccount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineSecretsSchema from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineSecretsSchema if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualMachineSecretsSchema. + */ + public static VirtualMachineSecretsSchema fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineSecretsSchema deserializedVirtualMachineSecretsSchema = new VirtualMachineSecretsSchema(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("administratorAccount".equals(fieldName)) { + deserializedVirtualMachineSecretsSchema.administratorAccount + = VirtualMachineSshCredentials.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineSecretsSchema; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachineSize.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachineSize.java index bc6f900306324..16c7cd03dd416 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachineSize.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachineSize.java @@ -5,107 +5,82 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** Describes the properties of a VM size. */ +/** + * Describes the properties of a VM size. + */ @Fluent -public final class VirtualMachineSize { +public final class VirtualMachineSize implements JsonSerializable { /* - * Virtual Machine size name - * * The name of the virtual machine size. */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* - * Virtual Machine family name - * * The family name of the virtual machine size. */ - @JsonProperty(value = "family", access = JsonProperty.Access.WRITE_ONLY) private String family; /* - * Number of vPUs - * * The number of vCPUs supported by the virtual machine size. */ - @JsonProperty(value = "vCPUs", access = JsonProperty.Access.WRITE_ONLY) private Integer vCPUs; /* - * Number of gPUs - * * The number of gPUs supported by the virtual machine size. */ - @JsonProperty(value = "gpus", access = JsonProperty.Access.WRITE_ONLY) private Integer gpus; /* - * OS VHD Disk size - * * The OS VHD disk size, in MB, allowed by the virtual machine size. */ - @JsonProperty(value = "osVhdSizeMB", access = JsonProperty.Access.WRITE_ONLY) private Integer osVhdSizeMB; /* - * Resource volume size - * * The resource volume size, in MB, allowed by the virtual machine size. */ - @JsonProperty(value = "maxResourceVolumeMB", access = JsonProperty.Access.WRITE_ONLY) private Integer maxResourceVolumeMB; /* - * Memory size - * * The amount of memory, in GB, supported by the virtual machine size. */ - @JsonProperty(value = "memoryGB", access = JsonProperty.Access.WRITE_ONLY) private Double memoryGB; /* - * Low priority capable - * * Specifies if the virtual machine size supports low priority VMs. */ - @JsonProperty(value = "lowPriorityCapable", access = JsonProperty.Access.WRITE_ONLY) private Boolean lowPriorityCapable; /* - * Premium IO supported - * * Specifies if the virtual machine size supports premium IO. */ - @JsonProperty(value = "premiumIO", access = JsonProperty.Access.WRITE_ONLY) private Boolean premiumIO; /* * The estimated price information for using a VM. */ - @JsonProperty(value = "estimatedVMPrices") private EstimatedVMPrices estimatedVMPrices; /* - * Supported Compute Types - * * Specifies the compute types supported by the virtual machine size. */ - @JsonProperty(value = "supportedComputeTypes") private List supportedComputeTypes; - /** Creates an instance of VirtualMachineSize class. */ + /** + * Creates an instance of VirtualMachineSize class. + */ public VirtualMachineSize() { } /** - * Get the name property: Virtual Machine size name - * - *

The name of the virtual machine size. - * + * Get the name property: The name of the virtual machine size. + * * @return the name value. */ public String name() { @@ -113,10 +88,8 @@ public String name() { } /** - * Get the family property: Virtual Machine family name - * - *

The family name of the virtual machine size. - * + * Get the family property: The family name of the virtual machine size. + * * @return the family value. */ public String family() { @@ -124,10 +97,8 @@ public String family() { } /** - * Get the vCPUs property: Number of vPUs - * - *

The number of vCPUs supported by the virtual machine size. - * + * Get the vCPUs property: The number of vCPUs supported by the virtual machine size. + * * @return the vCPUs value. */ public Integer vCPUs() { @@ -135,10 +106,8 @@ public Integer vCPUs() { } /** - * Get the gpus property: Number of gPUs - * - *

The number of gPUs supported by the virtual machine size. - * + * Get the gpus property: The number of gPUs supported by the virtual machine size. + * * @return the gpus value. */ public Integer gpus() { @@ -146,10 +115,8 @@ public Integer gpus() { } /** - * Get the osVhdSizeMB property: OS VHD Disk size - * - *

The OS VHD disk size, in MB, allowed by the virtual machine size. - * + * Get the osVhdSizeMB property: The OS VHD disk size, in MB, allowed by the virtual machine size. + * * @return the osVhdSizeMB value. */ public Integer osVhdSizeMB() { @@ -157,10 +124,8 @@ public Integer osVhdSizeMB() { } /** - * Get the maxResourceVolumeMB property: Resource volume size - * - *

The resource volume size, in MB, allowed by the virtual machine size. - * + * Get the maxResourceVolumeMB property: The resource volume size, in MB, allowed by the virtual machine size. + * * @return the maxResourceVolumeMB value. */ public Integer maxResourceVolumeMB() { @@ -168,10 +133,8 @@ public Integer maxResourceVolumeMB() { } /** - * Get the memoryGB property: Memory size - * - *

The amount of memory, in GB, supported by the virtual machine size. - * + * Get the memoryGB property: The amount of memory, in GB, supported by the virtual machine size. + * * @return the memoryGB value. */ public Double memoryGB() { @@ -179,10 +142,8 @@ public Double memoryGB() { } /** - * Get the lowPriorityCapable property: Low priority capable - * - *

Specifies if the virtual machine size supports low priority VMs. - * + * Get the lowPriorityCapable property: Specifies if the virtual machine size supports low priority VMs. + * * @return the lowPriorityCapable value. */ public Boolean lowPriorityCapable() { @@ -190,10 +151,8 @@ public Boolean lowPriorityCapable() { } /** - * Get the premiumIO property: Premium IO supported - * - *

Specifies if the virtual machine size supports premium IO. - * + * Get the premiumIO property: Specifies if the virtual machine size supports premium IO. + * * @return the premiumIO value. */ public Boolean premiumIO() { @@ -202,7 +161,7 @@ public Boolean premiumIO() { /** * Get the estimatedVMPrices property: The estimated price information for using a VM. - * + * * @return the estimatedVMPrices value. */ public EstimatedVMPrices estimatedVMPrices() { @@ -211,7 +170,7 @@ public EstimatedVMPrices estimatedVMPrices() { /** * Set the estimatedVMPrices property: The estimated price information for using a VM. - * + * * @param estimatedVMPrices the estimatedVMPrices value to set. * @return the VirtualMachineSize object itself. */ @@ -221,10 +180,8 @@ public VirtualMachineSize withEstimatedVMPrices(EstimatedVMPrices estimatedVMPri } /** - * Get the supportedComputeTypes property: Supported Compute Types - * - *

Specifies the compute types supported by the virtual machine size. - * + * Get the supportedComputeTypes property: Specifies the compute types supported by the virtual machine size. + * * @return the supportedComputeTypes value. */ public List supportedComputeTypes() { @@ -232,10 +189,8 @@ public List supportedComputeTypes() { } /** - * Set the supportedComputeTypes property: Supported Compute Types - * - *

Specifies the compute types supported by the virtual machine size. - * + * Set the supportedComputeTypes property: Specifies the compute types supported by the virtual machine size. + * * @param supportedComputeTypes the supportedComputeTypes value to set. * @return the VirtualMachineSize object itself. */ @@ -246,7 +201,7 @@ public VirtualMachineSize withSupportedComputeTypes(List supportedComput /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -254,4 +209,63 @@ public void validate() { estimatedVMPrices().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("estimatedVMPrices", this.estimatedVMPrices); + jsonWriter.writeArrayField("supportedComputeTypes", this.supportedComputeTypes, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineSize from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineSize if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualMachineSize. + */ + public static VirtualMachineSize fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineSize deserializedVirtualMachineSize = new VirtualMachineSize(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedVirtualMachineSize.name = reader.getString(); + } else if ("family".equals(fieldName)) { + deserializedVirtualMachineSize.family = reader.getString(); + } else if ("vCPUs".equals(fieldName)) { + deserializedVirtualMachineSize.vCPUs = reader.getNullable(JsonReader::getInt); + } else if ("gpus".equals(fieldName)) { + deserializedVirtualMachineSize.gpus = reader.getNullable(JsonReader::getInt); + } else if ("osVhdSizeMB".equals(fieldName)) { + deserializedVirtualMachineSize.osVhdSizeMB = reader.getNullable(JsonReader::getInt); + } else if ("maxResourceVolumeMB".equals(fieldName)) { + deserializedVirtualMachineSize.maxResourceVolumeMB = reader.getNullable(JsonReader::getInt); + } else if ("memoryGB".equals(fieldName)) { + deserializedVirtualMachineSize.memoryGB = reader.getNullable(JsonReader::getDouble); + } else if ("lowPriorityCapable".equals(fieldName)) { + deserializedVirtualMachineSize.lowPriorityCapable = reader.getNullable(JsonReader::getBoolean); + } else if ("premiumIO".equals(fieldName)) { + deserializedVirtualMachineSize.premiumIO = reader.getNullable(JsonReader::getBoolean); + } else if ("estimatedVMPrices".equals(fieldName)) { + deserializedVirtualMachineSize.estimatedVMPrices = EstimatedVMPrices.fromJson(reader); + } else if ("supportedComputeTypes".equals(fieldName)) { + List supportedComputeTypes = reader.readArray(reader1 -> reader1.getString()); + deserializedVirtualMachineSize.supportedComputeTypes = supportedComputeTypes; + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineSize; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachineSizeListResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachineSizeListResult.java index ea06dd868660a..12fcd41fc97ab 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachineSizeListResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachineSizeListResult.java @@ -7,18 +7,20 @@ import com.azure.resourcemanager.machinelearning.fluent.models.VirtualMachineSizeListResultInner; import java.util.List; -/** An immutable client-side representation of VirtualMachineSizeListResult. */ +/** + * An immutable client-side representation of VirtualMachineSizeListResult. + */ public interface VirtualMachineSizeListResult { /** * Gets the value property: The list of virtual machine sizes supported by AmlCompute. - * + * * @return the value value. */ List value(); /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.VirtualMachineSizeListResultInner object. - * + * * @return the inner object. */ VirtualMachineSizeListResultInner innerModel(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachineSizes.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachineSizes.java index e1c429840f0fd..64fff606cc2ce 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachineSizes.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachineSizes.java @@ -7,11 +7,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of VirtualMachineSizes. */ +/** + * Resource collection API of VirtualMachineSizes. + */ public interface VirtualMachineSizes { /** * Returns supported VM Sizes in a location. - * + * * @param location The location upon which virtual-machine-sizes is queried. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -23,7 +25,7 @@ public interface VirtualMachineSizes { /** * Returns supported VM Sizes in a location. - * + * * @param location The location upon which virtual-machine-sizes is queried. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachineSshCredentials.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachineSshCredentials.java index a29f0542a20b1..dc74b7811d463 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachineSshCredentials.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VirtualMachineSshCredentials.java @@ -5,42 +5,46 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Admin credentials for virtual machine. */ +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Admin credentials for virtual machine. + */ @Fluent -public final class VirtualMachineSshCredentials { +public final class VirtualMachineSshCredentials implements JsonSerializable { /* * Username of admin account */ - @JsonProperty(value = "username") private String username; /* * Password of admin account */ - @JsonProperty(value = "password") private String password; /* * Public key data */ - @JsonProperty(value = "publicKeyData") private String publicKeyData; /* * Private key data */ - @JsonProperty(value = "privateKeyData") private String privateKeyData; - /** Creates an instance of VirtualMachineSshCredentials class. */ + /** + * Creates an instance of VirtualMachineSshCredentials class. + */ public VirtualMachineSshCredentials() { } /** * Get the username property: Username of admin account. - * + * * @return the username value. */ public String username() { @@ -49,7 +53,7 @@ public String username() { /** * Set the username property: Username of admin account. - * + * * @param username the username value to set. * @return the VirtualMachineSshCredentials object itself. */ @@ -60,7 +64,7 @@ public VirtualMachineSshCredentials withUsername(String username) { /** * Get the password property: Password of admin account. - * + * * @return the password value. */ public String password() { @@ -69,7 +73,7 @@ public String password() { /** * Set the password property: Password of admin account. - * + * * @param password the password value to set. * @return the VirtualMachineSshCredentials object itself. */ @@ -80,7 +84,7 @@ public VirtualMachineSshCredentials withPassword(String password) { /** * Get the publicKeyData property: Public key data. - * + * * @return the publicKeyData value. */ public String publicKeyData() { @@ -89,7 +93,7 @@ public String publicKeyData() { /** * Set the publicKeyData property: Public key data. - * + * * @param publicKeyData the publicKeyData value to set. * @return the VirtualMachineSshCredentials object itself. */ @@ -100,7 +104,7 @@ public VirtualMachineSshCredentials withPublicKeyData(String publicKeyData) { /** * Get the privateKeyData property: Private key data. - * + * * @return the privateKeyData value. */ public String privateKeyData() { @@ -109,7 +113,7 @@ public String privateKeyData() { /** * Set the privateKeyData property: Private key data. - * + * * @param privateKeyData the privateKeyData value to set. * @return the VirtualMachineSshCredentials object itself. */ @@ -120,9 +124,54 @@ public VirtualMachineSshCredentials withPrivateKeyData(String privateKeyData) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("username", this.username); + jsonWriter.writeStringField("password", this.password); + jsonWriter.writeStringField("publicKeyData", this.publicKeyData); + jsonWriter.writeStringField("privateKeyData", this.privateKeyData); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineSshCredentials from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineSshCredentials if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualMachineSshCredentials. + */ + public static VirtualMachineSshCredentials fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineSshCredentials deserializedVirtualMachineSshCredentials = new VirtualMachineSshCredentials(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("username".equals(fieldName)) { + deserializedVirtualMachineSshCredentials.username = reader.getString(); + } else if ("password".equals(fieldName)) { + deserializedVirtualMachineSshCredentials.password = reader.getString(); + } else if ("publicKeyData".equals(fieldName)) { + deserializedVirtualMachineSshCredentials.publicKeyData = reader.getString(); + } else if ("privateKeyData".equals(fieldName)) { + deserializedVirtualMachineSshCredentials.privateKeyData = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineSshCredentials; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VmPriority.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VmPriority.java index 4b5823d0d7423..5752ee71ae0f8 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VmPriority.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VmPriority.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Virtual Machine priority. */ +/** + * Virtual Machine priority. + */ public final class VmPriority extends ExpandableStringEnum { - /** Static value Dedicated for VmPriority. */ + /** + * Static value Dedicated for VmPriority. + */ public static final VmPriority DEDICATED = fromString("Dedicated"); - /** Static value LowPriority for VmPriority. */ + /** + * Static value LowPriority for VmPriority. + */ public static final VmPriority LOW_PRIORITY = fromString("LowPriority"); /** * Creates a new instance of VmPriority value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public VmPriority() { /** * Creates or finds a VmPriority from its string representation. - * + * * @param name a name to look for. * @return the corresponding VmPriority. */ - @JsonCreator public static VmPriority fromString(String name) { return fromString(name, VmPriority.class); } /** * Gets known VmPriority values. - * + * * @return known VmPriority values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VolumeDefinition.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VolumeDefinition.java new file mode 100644 index 0000000000000..feb8f9f5cb4cb --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VolumeDefinition.java @@ -0,0 +1,298 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes the volume configuration for the container. + */ +@Fluent +public final class VolumeDefinition implements JsonSerializable { + /* + * Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe + */ + private VolumeDefinitionType type; + + /* + * Indicate whether to mount volume as readOnly. Default value for this is false. + */ + private Boolean readOnly; + + /* + * Source of the mount. For bind mounts this is the host path. + */ + private String source; + + /* + * Target of the mount. For bind mounts this is the path in the container. + */ + private String target; + + /* + * Consistency of the volume + */ + private String consistency; + + /* + * Bind Options of the mount + */ + private BindOptions bind; + + /* + * Volume Options of the mount + */ + private VolumeOptions volume; + + /* + * tmpfs option of the mount + */ + private TmpfsOptions tmpfs; + + /** + * Creates an instance of VolumeDefinition class. + */ + public VolumeDefinition() { + } + + /** + * Get the type property: Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe. + * + * @return the type value. + */ + public VolumeDefinitionType type() { + return this.type; + } + + /** + * Set the type property: Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe. + * + * @param type the type value to set. + * @return the VolumeDefinition object itself. + */ + public VolumeDefinition withType(VolumeDefinitionType type) { + this.type = type; + return this; + } + + /** + * Get the readOnly property: Indicate whether to mount volume as readOnly. Default value for this is false. + * + * @return the readOnly value. + */ + public Boolean readOnly() { + return this.readOnly; + } + + /** + * Set the readOnly property: Indicate whether to mount volume as readOnly. Default value for this is false. + * + * @param readOnly the readOnly value to set. + * @return the VolumeDefinition object itself. + */ + public VolumeDefinition withReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + return this; + } + + /** + * Get the source property: Source of the mount. For bind mounts this is the host path. + * + * @return the source value. + */ + public String source() { + return this.source; + } + + /** + * Set the source property: Source of the mount. For bind mounts this is the host path. + * + * @param source the source value to set. + * @return the VolumeDefinition object itself. + */ + public VolumeDefinition withSource(String source) { + this.source = source; + return this; + } + + /** + * Get the target property: Target of the mount. For bind mounts this is the path in the container. + * + * @return the target value. + */ + public String target() { + return this.target; + } + + /** + * Set the target property: Target of the mount. For bind mounts this is the path in the container. + * + * @param target the target value to set. + * @return the VolumeDefinition object itself. + */ + public VolumeDefinition withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get the consistency property: Consistency of the volume. + * + * @return the consistency value. + */ + public String consistency() { + return this.consistency; + } + + /** + * Set the consistency property: Consistency of the volume. + * + * @param consistency the consistency value to set. + * @return the VolumeDefinition object itself. + */ + public VolumeDefinition withConsistency(String consistency) { + this.consistency = consistency; + return this; + } + + /** + * Get the bind property: Bind Options of the mount. + * + * @return the bind value. + */ + public BindOptions bind() { + return this.bind; + } + + /** + * Set the bind property: Bind Options of the mount. + * + * @param bind the bind value to set. + * @return the VolumeDefinition object itself. + */ + public VolumeDefinition withBind(BindOptions bind) { + this.bind = bind; + return this; + } + + /** + * Get the volume property: Volume Options of the mount. + * + * @return the volume value. + */ + public VolumeOptions volume() { + return this.volume; + } + + /** + * Set the volume property: Volume Options of the mount. + * + * @param volume the volume value to set. + * @return the VolumeDefinition object itself. + */ + public VolumeDefinition withVolume(VolumeOptions volume) { + this.volume = volume; + return this; + } + + /** + * Get the tmpfs property: tmpfs option of the mount. + * + * @return the tmpfs value. + */ + public TmpfsOptions tmpfs() { + return this.tmpfs; + } + + /** + * Set the tmpfs property: tmpfs option of the mount. + * + * @param tmpfs the tmpfs value to set. + * @return the VolumeDefinition object itself. + */ + public VolumeDefinition withTmpfs(TmpfsOptions tmpfs) { + this.tmpfs = tmpfs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (bind() != null) { + bind().validate(); + } + if (volume() != null) { + volume().validate(); + } + if (tmpfs() != null) { + tmpfs().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeBooleanField("readOnly", this.readOnly); + jsonWriter.writeStringField("source", this.source); + jsonWriter.writeStringField("target", this.target); + jsonWriter.writeStringField("consistency", this.consistency); + jsonWriter.writeJsonField("bind", this.bind); + jsonWriter.writeJsonField("volume", this.volume); + jsonWriter.writeJsonField("tmpfs", this.tmpfs); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VolumeDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VolumeDefinition if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the VolumeDefinition. + */ + public static VolumeDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VolumeDefinition deserializedVolumeDefinition = new VolumeDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedVolumeDefinition.type = VolumeDefinitionType.fromString(reader.getString()); + } else if ("readOnly".equals(fieldName)) { + deserializedVolumeDefinition.readOnly = reader.getNullable(JsonReader::getBoolean); + } else if ("source".equals(fieldName)) { + deserializedVolumeDefinition.source = reader.getString(); + } else if ("target".equals(fieldName)) { + deserializedVolumeDefinition.target = reader.getString(); + } else if ("consistency".equals(fieldName)) { + deserializedVolumeDefinition.consistency = reader.getString(); + } else if ("bind".equals(fieldName)) { + deserializedVolumeDefinition.bind = BindOptions.fromJson(reader); + } else if ("volume".equals(fieldName)) { + deserializedVolumeDefinition.volume = VolumeOptions.fromJson(reader); + } else if ("tmpfs".equals(fieldName)) { + deserializedVolumeDefinition.tmpfs = TmpfsOptions.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVolumeDefinition; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VolumeDefinitionType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VolumeDefinitionType.java new file mode 100644 index 0000000000000..531e3e6627237 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VolumeDefinitionType.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of Volume Definition + * + * Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe. + */ +public final class VolumeDefinitionType extends ExpandableStringEnum { + /** + * Static value bind for VolumeDefinitionType. + */ + public static final VolumeDefinitionType BIND = fromString("bind"); + + /** + * Static value volume for VolumeDefinitionType. + */ + public static final VolumeDefinitionType VOLUME = fromString("volume"); + + /** + * Static value tmpfs for VolumeDefinitionType. + */ + public static final VolumeDefinitionType TMPFS = fromString("tmpfs"); + + /** + * Static value npipe for VolumeDefinitionType. + */ + public static final VolumeDefinitionType NPIPE = fromString("npipe"); + + /** + * Creates a new instance of VolumeDefinitionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VolumeDefinitionType() { + } + + /** + * Creates or finds a VolumeDefinitionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding VolumeDefinitionType. + */ + public static VolumeDefinitionType fromString(String name) { + return fromString(name, VolumeDefinitionType.class); + } + + /** + * Gets known VolumeDefinitionType values. + * + * @return known VolumeDefinitionType values. + */ + public static Collection values() { + return values(VolumeDefinitionType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VolumeOptions.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VolumeOptions.java new file mode 100644 index 0000000000000..3dd898251bce8 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/VolumeOptions.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes the volume options for the container. + */ +@Fluent +public final class VolumeOptions implements JsonSerializable { + /* + * Indicate whether volume is nocopy + */ + private Boolean nocopy; + + /** + * Creates an instance of VolumeOptions class. + */ + public VolumeOptions() { + } + + /** + * Get the nocopy property: Indicate whether volume is nocopy. + * + * @return the nocopy value. + */ + public Boolean nocopy() { + return this.nocopy; + } + + /** + * Set the nocopy property: Indicate whether volume is nocopy. + * + * @param nocopy the nocopy value to set. + * @return the VolumeOptions object itself. + */ + public VolumeOptions withNocopy(Boolean nocopy) { + this.nocopy = nocopy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("nocopy", this.nocopy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VolumeOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VolumeOptions if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the VolumeOptions. + */ + public static VolumeOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VolumeOptions deserializedVolumeOptions = new VolumeOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nocopy".equals(fieldName)) { + deserializedVolumeOptions.nocopy = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedVolumeOptions; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Webhook.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Webhook.java new file mode 100644 index 0000000000000..d651cec6663b3 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Webhook.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Webhook base. + */ +@Fluent +public class Webhook implements JsonSerializable { + /* + * [Required] Specifies the type of service to send a callback + */ + private WebhookType webhookType = WebhookType.fromString("Webhook"); + + /* + * Send callback on a specified notification event + */ + private String eventType; + + /** + * Creates an instance of Webhook class. + */ + public Webhook() { + } + + /** + * Get the webhookType property: [Required] Specifies the type of service to send a callback. + * + * @return the webhookType value. + */ + public WebhookType webhookType() { + return this.webhookType; + } + + /** + * Get the eventType property: Send callback on a specified notification event. + * + * @return the eventType value. + */ + public String eventType() { + return this.eventType; + } + + /** + * Set the eventType property: Send callback on a specified notification event. + * + * @param eventType the eventType value to set. + * @return the Webhook object itself. + */ + public Webhook withEventType(String eventType) { + this.eventType = eventType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("webhookType", this.webhookType == null ? null : this.webhookType.toString()); + jsonWriter.writeStringField("eventType", this.eventType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Webhook from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Webhook if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Webhook. + */ + public static Webhook fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("webhookType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("AzureDevOps".equals(discriminatorValue)) { + return AzureDevOpsWebhook.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static Webhook fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Webhook deserializedWebhook = new Webhook(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("webhookType".equals(fieldName)) { + deserializedWebhook.webhookType = WebhookType.fromString(reader.getString()); + } else if ("eventType".equals(fieldName)) { + deserializedWebhook.eventType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWebhook; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WebhookType.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WebhookType.java new file mode 100644 index 0000000000000..cd619bcfcb412 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WebhookType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum to determine the webhook callback service type. + */ +public final class WebhookType extends ExpandableStringEnum { + /** + * Static value AzureDevOps for WebhookType. + */ + public static final WebhookType AZURE_DEV_OPS = fromString("AzureDevOps"); + + /** + * Creates a new instance of WebhookType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WebhookType() { + } + + /** + * Creates or finds a WebhookType from its string representation. + * + * @param name a name to look for. + * @return the corresponding WebhookType. + */ + public static WebhookType fromString(String name) { + return fromString(name, WebhookType.class); + } + + /** + * Gets known WebhookType values. + * + * @return known WebhookType values. + */ + public static Collection values() { + return values(WebhookType.class); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WeekDay.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WeekDay.java index 20afef84d8eab..61743ceadefa7 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WeekDay.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WeekDay.java @@ -5,35 +5,50 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Enum of weekday. */ +/** + * Enum of weekday. + */ public final class WeekDay extends ExpandableStringEnum { - /** Static value Monday for WeekDay. */ + /** + * Static value Monday for WeekDay. + */ public static final WeekDay MONDAY = fromString("Monday"); - /** Static value Tuesday for WeekDay. */ + /** + * Static value Tuesday for WeekDay. + */ public static final WeekDay TUESDAY = fromString("Tuesday"); - /** Static value Wednesday for WeekDay. */ + /** + * Static value Wednesday for WeekDay. + */ public static final WeekDay WEDNESDAY = fromString("Wednesday"); - /** Static value Thursday for WeekDay. */ + /** + * Static value Thursday for WeekDay. + */ public static final WeekDay THURSDAY = fromString("Thursday"); - /** Static value Friday for WeekDay. */ + /** + * Static value Friday for WeekDay. + */ public static final WeekDay FRIDAY = fromString("Friday"); - /** Static value Saturday for WeekDay. */ + /** + * Static value Saturday for WeekDay. + */ public static final WeekDay SATURDAY = fromString("Saturday"); - /** Static value Sunday for WeekDay. */ + /** + * Static value Sunday for WeekDay. + */ public static final WeekDay SUNDAY = fromString("Sunday"); /** * Creates a new instance of WeekDay value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -42,18 +57,17 @@ public WeekDay() { /** * Creates or finds a WeekDay from its string representation. - * + * * @param name a name to look for. * @return the corresponding WeekDay. */ - @JsonCreator public static WeekDay fromString(String name) { return fromString(name, WeekDay.class); } /** * Gets known WeekDay values. - * + * * @return known WeekDay values. */ public static Collection values() { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Workspace.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Workspace.java index 42e253da0269e..6b1658e955b33 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Workspace.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Workspace.java @@ -8,85 +8,95 @@ import com.azure.core.management.Region; import com.azure.core.management.SystemData; import com.azure.core.util.Context; +import com.azure.resourcemanager.machinelearning.fluent.models.ManagedNetworkSettingsInner; import com.azure.resourcemanager.machinelearning.fluent.models.WorkspaceInner; import java.util.List; import java.util.Map; -/** An immutable client-side representation of Workspace. */ +/** + * An immutable client-side representation of Workspace. + */ public interface Workspace { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the identity property: The identity of the resource. - * + * * @return the identity value. */ ManagedServiceIdentity identity(); + /** + * Gets the kind property: The kind property. + * + * @return the kind value. + */ + String kind(); + /** * Gets the location property: Specifies the location of the resource. - * + * * @return the location value. */ String location(); /** * Gets the tags property: Contains resource tags defined as key/value pairs. - * + * * @return the tags value. */ Map tags(); /** * Gets the sku property: The sku of the workspace. - * + * * @return the sku value. */ Sku sku(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the workspaceId property: The immutable id associated with this workspace. - * + * * @return the workspaceId value. */ String workspaceId(); /** * Gets the description property: The description of this workspace. - * + * * @return the description value. */ String description(); /** * Gets the friendlyName property: The friendly name for this workspace. This name in mutable. - * + * * @return the friendlyName value. */ String friendlyName(); @@ -94,21 +104,21 @@ public interface Workspace { /** * Gets the keyVault property: ARM id of the key vault associated with this workspace. This cannot be changed once * the workspace has been created. - * + * * @return the keyVault value. */ String keyVault(); /** * Gets the applicationInsights property: ARM id of the application insights associated with this workspace. - * + * * @return the applicationInsights value. */ String applicationInsights(); /** * Gets the containerRegistry property: ARM id of the container registry associated with this workspace. - * + * * @return the containerRegistry value. */ String containerRegistry(); @@ -116,7 +126,7 @@ public interface Workspace { /** * Gets the storageAccount property: ARM id of the storage account associated with this workspace. This cannot be * changed once the workspace has been created. - * + * * @return the storageAccount value. */ String storageAccount(); @@ -124,7 +134,7 @@ public interface Workspace { /** * Gets the discoveryUrl property: Url for the discovery service to identify regional endpoints for machine learning * experimentation services. - * + * * @return the discoveryUrl value. */ String discoveryUrl(); @@ -132,14 +142,14 @@ public interface Workspace { /** * Gets the provisioningState property: The current deployment state of workspace resource. The provisioningState is * to indicate states for resource provisioning. - * + * * @return the provisioningState value. */ ProvisioningState provisioningState(); /** * Gets the encryption property: The encryption settings of Azure ML workspace. - * + * * @return the encryption value. */ EncryptionProperty encryption(); @@ -147,7 +157,7 @@ public interface Workspace { /** * Gets the hbiWorkspace property: The flag to signal HBI data in the workspace and reduce diagnostic data collected * by the service. - * + * * @return the hbiWorkspace value. */ Boolean hbiWorkspace(); @@ -155,21 +165,21 @@ public interface Workspace { /** * Gets the serviceProvisionedResourceGroup property: The name of the managed resource group created by workspace RP * in customer subscription if the workspace is CMK workspace. - * + * * @return the serviceProvisionedResourceGroup value. */ String serviceProvisionedResourceGroup(); /** * Gets the privateLinkCount property: Count of private connections in the workspace. - * + * * @return the privateLinkCount value. */ Integer privateLinkCount(); /** * Gets the imageBuildCompute property: The compute name for image build. - * + * * @return the imageBuildCompute value. */ String imageBuildCompute(); @@ -177,42 +187,49 @@ public interface Workspace { /** * Gets the allowPublicAccessWhenBehindVnet property: The flag to indicate whether to allow public access when * behind VNet. - * + * * @return the allowPublicAccessWhenBehindVnet value. */ Boolean allowPublicAccessWhenBehindVnet(); /** * Gets the publicNetworkAccess property: Whether requests from Public Network are allowed. - * + * * @return the publicNetworkAccess value. */ PublicNetworkAccess publicNetworkAccess(); /** * Gets the privateEndpointConnections property: The list of private endpoint connections in the workspace. - * + * * @return the privateEndpointConnections value. */ List privateEndpointConnections(); + /** + * Gets the serverlessComputeSettings property: Settings for serverless compute created in the workspace. + * + * @return the serverlessComputeSettings value. + */ + ServerlessComputeSettings serverlessComputeSettings(); + /** * Gets the sharedPrivateLinkResources property: The list of shared private link resources in this workspace. - * + * * @return the sharedPrivateLinkResources value. */ List sharedPrivateLinkResources(); /** * Gets the notebookInfo property: The notebook info of Azure ML workspace. - * + * * @return the notebookInfo value. */ NotebookResourceInfo notebookInfo(); /** * Gets the serviceManagedResourcesSettings property: The service managed resource settings. - * + * * @return the serviceManagedResourcesSettings value. */ ServiceManagedResourcesSettings serviceManagedResourcesSettings(); @@ -220,14 +237,14 @@ public interface Workspace { /** * Gets the primaryUserAssignedIdentity property: The user assigned identity resource id that represents the * workspace identity. - * + * * @return the primaryUserAssignedIdentity value. */ String primaryUserAssignedIdentity(); /** * Gets the tenantId property: The tenant id associated with this workspace. - * + * * @return the tenantId value. */ String tenantId(); @@ -235,7 +252,7 @@ public interface Workspace { /** * Gets the storageHnsEnabled property: If the storage associated with the workspace has hierarchical namespace(HNS) * enabled. - * + * * @return the storageHnsEnabled value. */ Boolean storageHnsEnabled(); @@ -243,7 +260,7 @@ public interface Workspace { /** * Gets the mlFlowTrackingUri property: The URI associated with this workspace that machine learning flow must point * at to set up tracking. - * + * * @return the mlFlowTrackingUri value. */ String mlFlowTrackingUri(); @@ -251,103 +268,151 @@ public interface Workspace { /** * Gets the v1LegacyMode property: Enabling v1_legacy_mode may prevent you from using features provided by the v2 * API. - * + * * @return the v1LegacyMode value. */ Boolean v1LegacyMode(); + /** + * Gets the managedNetwork property: Managed Network settings for a machine learning workspace. + * + * @return the managedNetwork value. + */ + ManagedNetworkSettings managedNetwork(); + + /** + * Gets the featureStoreSettings property: Settings for feature store type workspace. + * + * @return the featureStoreSettings value. + */ + FeatureStoreSettings featureStoreSettings(); + + /** + * Gets the associatedWorkspaces property: The associatedWorkspaces property. + * + * @return the associatedWorkspaces value. + */ + List associatedWorkspaces(); + + /** + * Gets the enableDataIsolation property: The enableDataIsolation property. + * + * @return the enableDataIsolation value. + */ + Boolean enableDataIsolation(); + + /** + * Gets the hubResourceId property: The hubResourceId property. + * + * @return the hubResourceId value. + */ + String hubResourceId(); + + /** + * Gets the workspaceHubConfig property: WorkspaceHub's configuration object. + * + * @return the workspaceHubConfig value. + */ + WorkspaceHubConfig workspaceHubConfig(); + /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.WorkspaceInner object. - * + * * @return the inner object. */ WorkspaceInner innerModel(); - /** The entirety of the Workspace definition. */ + /** + * The entirety of the Workspace definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } - /** The Workspace definition stages. */ + + /** + * The Workspace definition stages. + */ interface DefinitionStages { - /** The first stage of the Workspace definition. */ + /** + * The first stage of the Workspace definition. + */ interface Blank extends WithResourceGroup { } - /** The stage of the Workspace definition allowing to specify parent resource. */ + + /** + * The stage of the Workspace definition allowing to specify parent resource. + */ interface WithResourceGroup { /** * Specifies resourceGroupName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ WithCreate withExistingResourceGroup(String resourceGroupName); } + /** * The stage of the Workspace definition which contains all the minimum required properties for the resource to * be created, but also allows for any other optional properties to be specified. */ interface WithCreate - extends DefinitionStages.WithLocation, - DefinitionStages.WithTags, - DefinitionStages.WithIdentity, - DefinitionStages.WithSku, - DefinitionStages.WithDescription, - DefinitionStages.WithFriendlyName, - DefinitionStages.WithKeyVault, - DefinitionStages.WithApplicationInsights, - DefinitionStages.WithContainerRegistry, - DefinitionStages.WithStorageAccount, - DefinitionStages.WithDiscoveryUrl, - DefinitionStages.WithEncryption, - DefinitionStages.WithHbiWorkspace, - DefinitionStages.WithImageBuildCompute, - DefinitionStages.WithAllowPublicAccessWhenBehindVnet, - DefinitionStages.WithPublicNetworkAccess, - DefinitionStages.WithSharedPrivateLinkResources, - DefinitionStages.WithServiceManagedResourcesSettings, - DefinitionStages.WithPrimaryUserAssignedIdentity, - DefinitionStages.WithV1LegacyMode { + extends DefinitionStages.WithLocation, DefinitionStages.WithTags, DefinitionStages.WithIdentity, + DefinitionStages.WithKind, DefinitionStages.WithSku, DefinitionStages.WithDescription, + DefinitionStages.WithFriendlyName, DefinitionStages.WithKeyVault, DefinitionStages.WithApplicationInsights, + DefinitionStages.WithContainerRegistry, DefinitionStages.WithStorageAccount, + DefinitionStages.WithDiscoveryUrl, DefinitionStages.WithEncryption, DefinitionStages.WithHbiWorkspace, + DefinitionStages.WithImageBuildCompute, DefinitionStages.WithAllowPublicAccessWhenBehindVnet, + DefinitionStages.WithPublicNetworkAccess, DefinitionStages.WithServerlessComputeSettings, + DefinitionStages.WithSharedPrivateLinkResources, DefinitionStages.WithServiceManagedResourcesSettings, + DefinitionStages.WithPrimaryUserAssignedIdentity, DefinitionStages.WithV1LegacyMode, + DefinitionStages.WithManagedNetwork, DefinitionStages.WithFeatureStoreSettings, + DefinitionStages.WithAssociatedWorkspaces, DefinitionStages.WithEnableDataIsolation, + DefinitionStages.WithHubResourceId, DefinitionStages.WithWorkspaceHubConfig { /** * Executes the create request. - * + * * @return the created resource. */ Workspace create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ Workspace create(Context context); } - /** The stage of the Workspace definition allowing to specify location. */ + + /** + * The stage of the Workspace definition allowing to specify location. + */ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location Specifies the location of the resource. * @return the next definition stage. */ @@ -355,382 +420,658 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location Specifies the location of the resource. * @return the next definition stage. */ WithCreate withRegion(String location); } - /** The stage of the Workspace definition allowing to specify tags. */ + + /** + * The stage of the Workspace definition allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Contains resource tags defined as key/value pairs.. - * + * * @param tags Contains resource tags defined as key/value pairs. * @return the next definition stage. */ WithCreate withTags(Map tags); } - /** The stage of the Workspace definition allowing to specify identity. */ + + /** + * The stage of the Workspace definition allowing to specify identity. + */ interface WithIdentity { /** * Specifies the identity property: The identity of the resource.. - * + * * @param identity The identity of the resource. * @return the next definition stage. */ WithCreate withIdentity(ManagedServiceIdentity identity); } - /** The stage of the Workspace definition allowing to specify sku. */ + + /** + * The stage of the Workspace definition allowing to specify kind. + */ + interface WithKind { + /** + * Specifies the kind property: The kind property.. + * + * @param kind The kind property. + * @return the next definition stage. + */ + WithCreate withKind(String kind); + } + + /** + * The stage of the Workspace definition allowing to specify sku. + */ interface WithSku { /** * Specifies the sku property: The sku of the workspace.. - * + * * @param sku The sku of the workspace. * @return the next definition stage. */ WithCreate withSku(Sku sku); } - /** The stage of the Workspace definition allowing to specify description. */ + + /** + * The stage of the Workspace definition allowing to specify description. + */ interface WithDescription { /** * Specifies the description property: The description of this workspace.. - * + * * @param description The description of this workspace. * @return the next definition stage. */ WithCreate withDescription(String description); } - /** The stage of the Workspace definition allowing to specify friendlyName. */ + + /** + * The stage of the Workspace definition allowing to specify friendlyName. + */ interface WithFriendlyName { /** * Specifies the friendlyName property: The friendly name for this workspace. This name in mutable. - * + * * @param friendlyName The friendly name for this workspace. This name in mutable. * @return the next definition stage. */ WithCreate withFriendlyName(String friendlyName); } - /** The stage of the Workspace definition allowing to specify keyVault. */ + + /** + * The stage of the Workspace definition allowing to specify keyVault. + */ interface WithKeyVault { /** * Specifies the keyVault property: ARM id of the key vault associated with this workspace. This cannot be * changed once the workspace has been created. - * + * * @param keyVault ARM id of the key vault associated with this workspace. This cannot be changed once the - * workspace has been created. + * workspace has been created. * @return the next definition stage. */ WithCreate withKeyVault(String keyVault); } - /** The stage of the Workspace definition allowing to specify applicationInsights. */ + + /** + * The stage of the Workspace definition allowing to specify applicationInsights. + */ interface WithApplicationInsights { /** * Specifies the applicationInsights property: ARM id of the application insights associated with this * workspace.. - * + * * @param applicationInsights ARM id of the application insights associated with this workspace. * @return the next definition stage. */ WithCreate withApplicationInsights(String applicationInsights); } - /** The stage of the Workspace definition allowing to specify containerRegistry. */ + + /** + * The stage of the Workspace definition allowing to specify containerRegistry. + */ interface WithContainerRegistry { /** * Specifies the containerRegistry property: ARM id of the container registry associated with this * workspace.. - * + * * @param containerRegistry ARM id of the container registry associated with this workspace. * @return the next definition stage. */ WithCreate withContainerRegistry(String containerRegistry); } - /** The stage of the Workspace definition allowing to specify storageAccount. */ + + /** + * The stage of the Workspace definition allowing to specify storageAccount. + */ interface WithStorageAccount { /** * Specifies the storageAccount property: ARM id of the storage account associated with this workspace. This * cannot be changed once the workspace has been created. - * + * * @param storageAccount ARM id of the storage account associated with this workspace. This cannot be - * changed once the workspace has been created. + * changed once the workspace has been created. * @return the next definition stage. */ WithCreate withStorageAccount(String storageAccount); } - /** The stage of the Workspace definition allowing to specify discoveryUrl. */ + + /** + * The stage of the Workspace definition allowing to specify discoveryUrl. + */ interface WithDiscoveryUrl { /** * Specifies the discoveryUrl property: Url for the discovery service to identify regional endpoints for * machine learning experimentation services. - * + * * @param discoveryUrl Url for the discovery service to identify regional endpoints for machine learning - * experimentation services. + * experimentation services. * @return the next definition stage. */ WithCreate withDiscoveryUrl(String discoveryUrl); } - /** The stage of the Workspace definition allowing to specify encryption. */ + + /** + * The stage of the Workspace definition allowing to specify encryption. + */ interface WithEncryption { /** * Specifies the encryption property: The encryption settings of Azure ML workspace.. - * + * * @param encryption The encryption settings of Azure ML workspace. * @return the next definition stage. */ WithCreate withEncryption(EncryptionProperty encryption); } - /** The stage of the Workspace definition allowing to specify hbiWorkspace. */ + + /** + * The stage of the Workspace definition allowing to specify hbiWorkspace. + */ interface WithHbiWorkspace { /** * Specifies the hbiWorkspace property: The flag to signal HBI data in the workspace and reduce diagnostic * data collected by the service. - * + * * @param hbiWorkspace The flag to signal HBI data in the workspace and reduce diagnostic data collected by - * the service. + * the service. * @return the next definition stage. */ WithCreate withHbiWorkspace(Boolean hbiWorkspace); } - /** The stage of the Workspace definition allowing to specify imageBuildCompute. */ + + /** + * The stage of the Workspace definition allowing to specify imageBuildCompute. + */ interface WithImageBuildCompute { /** * Specifies the imageBuildCompute property: The compute name for image build. - * + * * @param imageBuildCompute The compute name for image build. * @return the next definition stage. */ WithCreate withImageBuildCompute(String imageBuildCompute); } - /** The stage of the Workspace definition allowing to specify allowPublicAccessWhenBehindVnet. */ + + /** + * The stage of the Workspace definition allowing to specify allowPublicAccessWhenBehindVnet. + */ interface WithAllowPublicAccessWhenBehindVnet { /** * Specifies the allowPublicAccessWhenBehindVnet property: The flag to indicate whether to allow public * access when behind VNet.. - * + * * @param allowPublicAccessWhenBehindVnet The flag to indicate whether to allow public access when behind - * VNet. + * VNet. * @return the next definition stage. */ WithCreate withAllowPublicAccessWhenBehindVnet(Boolean allowPublicAccessWhenBehindVnet); } - /** The stage of the Workspace definition allowing to specify publicNetworkAccess. */ + + /** + * The stage of the Workspace definition allowing to specify publicNetworkAccess. + */ interface WithPublicNetworkAccess { /** * Specifies the publicNetworkAccess property: Whether requests from Public Network are allowed.. - * + * * @param publicNetworkAccess Whether requests from Public Network are allowed. * @return the next definition stage. */ WithCreate withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); } - /** The stage of the Workspace definition allowing to specify sharedPrivateLinkResources. */ + + /** + * The stage of the Workspace definition allowing to specify serverlessComputeSettings. + */ + interface WithServerlessComputeSettings { + /** + * Specifies the serverlessComputeSettings property: Settings for serverless compute created in the + * workspace. + * + * @param serverlessComputeSettings Settings for serverless compute created in the workspace. + * @return the next definition stage. + */ + WithCreate withServerlessComputeSettings(ServerlessComputeSettings serverlessComputeSettings); + } + + /** + * The stage of the Workspace definition allowing to specify sharedPrivateLinkResources. + */ interface WithSharedPrivateLinkResources { /** * Specifies the sharedPrivateLinkResources property: The list of shared private link resources in this * workspace.. - * + * * @param sharedPrivateLinkResources The list of shared private link resources in this workspace. * @return the next definition stage. */ WithCreate withSharedPrivateLinkResources(List sharedPrivateLinkResources); } - /** The stage of the Workspace definition allowing to specify serviceManagedResourcesSettings. */ + + /** + * The stage of the Workspace definition allowing to specify serviceManagedResourcesSettings. + */ interface WithServiceManagedResourcesSettings { /** * Specifies the serviceManagedResourcesSettings property: The service managed resource settings.. - * + * * @param serviceManagedResourcesSettings The service managed resource settings. * @return the next definition stage. */ - WithCreate withServiceManagedResourcesSettings( - ServiceManagedResourcesSettings serviceManagedResourcesSettings); + WithCreate + withServiceManagedResourcesSettings(ServiceManagedResourcesSettings serviceManagedResourcesSettings); } - /** The stage of the Workspace definition allowing to specify primaryUserAssignedIdentity. */ + + /** + * The stage of the Workspace definition allowing to specify primaryUserAssignedIdentity. + */ interface WithPrimaryUserAssignedIdentity { /** * Specifies the primaryUserAssignedIdentity property: The user assigned identity resource id that * represents the workspace identity.. - * + * * @param primaryUserAssignedIdentity The user assigned identity resource id that represents the workspace - * identity. + * identity. * @return the next definition stage. */ WithCreate withPrimaryUserAssignedIdentity(String primaryUserAssignedIdentity); } - /** The stage of the Workspace definition allowing to specify v1LegacyMode. */ + + /** + * The stage of the Workspace definition allowing to specify v1LegacyMode. + */ interface WithV1LegacyMode { /** * Specifies the v1LegacyMode property: Enabling v1_legacy_mode may prevent you from using features provided * by the v2 API.. - * + * * @param v1LegacyMode Enabling v1_legacy_mode may prevent you from using features provided by the v2 API. * @return the next definition stage. */ WithCreate withV1LegacyMode(Boolean v1LegacyMode); } + + /** + * The stage of the Workspace definition allowing to specify managedNetwork. + */ + interface WithManagedNetwork { + /** + * Specifies the managedNetwork property: Managed Network settings for a machine learning workspace.. + * + * @param managedNetwork Managed Network settings for a machine learning workspace. + * @return the next definition stage. + */ + WithCreate withManagedNetwork(ManagedNetworkSettingsInner managedNetwork); + } + + /** + * The stage of the Workspace definition allowing to specify featureStoreSettings. + */ + interface WithFeatureStoreSettings { + /** + * Specifies the featureStoreSettings property: Settings for feature store type workspace.. + * + * @param featureStoreSettings Settings for feature store type workspace. + * @return the next definition stage. + */ + WithCreate withFeatureStoreSettings(FeatureStoreSettings featureStoreSettings); + } + + /** + * The stage of the Workspace definition allowing to specify associatedWorkspaces. + */ + interface WithAssociatedWorkspaces { + /** + * Specifies the associatedWorkspaces property: The associatedWorkspaces property.. + * + * @param associatedWorkspaces The associatedWorkspaces property. + * @return the next definition stage. + */ + WithCreate withAssociatedWorkspaces(List associatedWorkspaces); + } + + /** + * The stage of the Workspace definition allowing to specify enableDataIsolation. + */ + interface WithEnableDataIsolation { + /** + * Specifies the enableDataIsolation property: The enableDataIsolation property.. + * + * @param enableDataIsolation The enableDataIsolation property. + * @return the next definition stage. + */ + WithCreate withEnableDataIsolation(Boolean enableDataIsolation); + } + + /** + * The stage of the Workspace definition allowing to specify hubResourceId. + */ + interface WithHubResourceId { + /** + * Specifies the hubResourceId property: The hubResourceId property.. + * + * @param hubResourceId The hubResourceId property. + * @return the next definition stage. + */ + WithCreate withHubResourceId(String hubResourceId); + } + + /** + * The stage of the Workspace definition allowing to specify workspaceHubConfig. + */ + interface WithWorkspaceHubConfig { + /** + * Specifies the workspaceHubConfig property: WorkspaceHub's configuration object.. + * + * @param workspaceHubConfig WorkspaceHub's configuration object. + * @return the next definition stage. + */ + WithCreate withWorkspaceHubConfig(WorkspaceHubConfig workspaceHubConfig); + } } + /** * Begins update for the Workspace resource. - * + * * @return the stage of resource update. */ Workspace.Update update(); - /** The template for Workspace update. */ - interface Update - extends UpdateStages.WithTags, - UpdateStages.WithSku, - UpdateStages.WithIdentity, - UpdateStages.WithDescription, - UpdateStages.WithFriendlyName, - UpdateStages.WithImageBuildCompute, - UpdateStages.WithServiceManagedResourcesSettings, - UpdateStages.WithPrimaryUserAssignedIdentity, - UpdateStages.WithPublicNetworkAccess, - UpdateStages.WithApplicationInsights, - UpdateStages.WithContainerRegistry { + /** + * The template for Workspace update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithSku, UpdateStages.WithIdentity, + UpdateStages.WithDescription, UpdateStages.WithFriendlyName, UpdateStages.WithImageBuildCompute, + UpdateStages.WithServiceManagedResourcesSettings, UpdateStages.WithPrimaryUserAssignedIdentity, + UpdateStages.WithServerlessComputeSettings, UpdateStages.WithPublicNetworkAccess, + UpdateStages.WithApplicationInsights, UpdateStages.WithContainerRegistry, UpdateStages.WithFeatureStoreSettings, + UpdateStages.WithManagedNetwork, UpdateStages.WithEnableDataIsolation, UpdateStages.WithV1LegacyMode, + UpdateStages.WithEncryption { /** * Executes the update request. - * + * * @return the updated resource. */ Workspace apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ Workspace apply(Context context); } - /** The Workspace update stages. */ + + /** + * The Workspace update stages. + */ interface UpdateStages { - /** The stage of the Workspace update allowing to specify tags. */ + /** + * The stage of the Workspace update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: The resource tags for the machine learning workspace.. - * + * * @param tags The resource tags for the machine learning workspace. * @return the next definition stage. */ Update withTags(Map tags); } - /** The stage of the Workspace update allowing to specify sku. */ + + /** + * The stage of the Workspace update allowing to specify sku. + */ interface WithSku { /** * Specifies the sku property: The sku of the workspace.. - * + * * @param sku The sku of the workspace. * @return the next definition stage. */ Update withSku(Sku sku); } - /** The stage of the Workspace update allowing to specify identity. */ + + /** + * The stage of the Workspace update allowing to specify identity. + */ interface WithIdentity { /** * Specifies the identity property: The identity of the resource.. - * + * * @param identity The identity of the resource. * @return the next definition stage. */ Update withIdentity(ManagedServiceIdentity identity); } - /** The stage of the Workspace update allowing to specify description. */ + + /** + * The stage of the Workspace update allowing to specify description. + */ interface WithDescription { /** * Specifies the description property: The description of this workspace.. - * + * * @param description The description of this workspace. * @return the next definition stage. */ Update withDescription(String description); } - /** The stage of the Workspace update allowing to specify friendlyName. */ + + /** + * The stage of the Workspace update allowing to specify friendlyName. + */ interface WithFriendlyName { /** * Specifies the friendlyName property: The friendly name for this workspace.. - * + * * @param friendlyName The friendly name for this workspace. * @return the next definition stage. */ Update withFriendlyName(String friendlyName); } - /** The stage of the Workspace update allowing to specify imageBuildCompute. */ + + /** + * The stage of the Workspace update allowing to specify imageBuildCompute. + */ interface WithImageBuildCompute { /** * Specifies the imageBuildCompute property: The compute name for image build. - * + * * @param imageBuildCompute The compute name for image build. * @return the next definition stage. */ Update withImageBuildCompute(String imageBuildCompute); } - /** The stage of the Workspace update allowing to specify serviceManagedResourcesSettings. */ + + /** + * The stage of the Workspace update allowing to specify serviceManagedResourcesSettings. + */ interface WithServiceManagedResourcesSettings { /** * Specifies the serviceManagedResourcesSettings property: The service managed resource settings.. - * + * * @param serviceManagedResourcesSettings The service managed resource settings. * @return the next definition stage. */ Update withServiceManagedResourcesSettings(ServiceManagedResourcesSettings serviceManagedResourcesSettings); } - /** The stage of the Workspace update allowing to specify primaryUserAssignedIdentity. */ + + /** + * The stage of the Workspace update allowing to specify primaryUserAssignedIdentity. + */ interface WithPrimaryUserAssignedIdentity { /** * Specifies the primaryUserAssignedIdentity property: The user assigned identity resource id that * represents the workspace identity.. - * + * * @param primaryUserAssignedIdentity The user assigned identity resource id that represents the workspace - * identity. + * identity. * @return the next definition stage. */ Update withPrimaryUserAssignedIdentity(String primaryUserAssignedIdentity); } - /** The stage of the Workspace update allowing to specify publicNetworkAccess. */ + + /** + * The stage of the Workspace update allowing to specify serverlessComputeSettings. + */ + interface WithServerlessComputeSettings { + /** + * Specifies the serverlessComputeSettings property: Settings for serverless compute created in the + * workspace. + * + * @param serverlessComputeSettings Settings for serverless compute created in the workspace. + * @return the next definition stage. + */ + Update withServerlessComputeSettings(ServerlessComputeSettings serverlessComputeSettings); + } + + /** + * The stage of the Workspace update allowing to specify publicNetworkAccess. + */ interface WithPublicNetworkAccess { /** * Specifies the publicNetworkAccess property: Whether requests from Public Network are allowed.. - * + * * @param publicNetworkAccess Whether requests from Public Network are allowed. * @return the next definition stage. */ Update withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); } - /** The stage of the Workspace update allowing to specify applicationInsights. */ + + /** + * The stage of the Workspace update allowing to specify applicationInsights. + */ interface WithApplicationInsights { /** * Specifies the applicationInsights property: ARM id of the application insights associated with this * workspace.. - * + * * @param applicationInsights ARM id of the application insights associated with this workspace. * @return the next definition stage. */ Update withApplicationInsights(String applicationInsights); } - /** The stage of the Workspace update allowing to specify containerRegistry. */ + + /** + * The stage of the Workspace update allowing to specify containerRegistry. + */ interface WithContainerRegistry { /** * Specifies the containerRegistry property: ARM id of the container registry associated with this * workspace.. - * + * * @param containerRegistry ARM id of the container registry associated with this workspace. * @return the next definition stage. */ Update withContainerRegistry(String containerRegistry); } + + /** + * The stage of the Workspace update allowing to specify featureStoreSettings. + */ + interface WithFeatureStoreSettings { + /** + * Specifies the featureStoreSettings property: Settings for feature store type workspace.. + * + * @param featureStoreSettings Settings for feature store type workspace. + * @return the next definition stage. + */ + Update withFeatureStoreSettings(FeatureStoreSettings featureStoreSettings); + } + + /** + * The stage of the Workspace update allowing to specify managedNetwork. + */ + interface WithManagedNetwork { + /** + * Specifies the managedNetwork property: Managed Network settings for a machine learning workspace.. + * + * @param managedNetwork Managed Network settings for a machine learning workspace. + * @return the next definition stage. + */ + Update withManagedNetwork(ManagedNetworkSettingsInner managedNetwork); + } + + /** + * The stage of the Workspace update allowing to specify enableDataIsolation. + */ + interface WithEnableDataIsolation { + /** + * Specifies the enableDataIsolation property: The enableDataIsolation property.. + * + * @param enableDataIsolation The enableDataIsolation property. + * @return the next definition stage. + */ + Update withEnableDataIsolation(Boolean enableDataIsolation); + } + + /** + * The stage of the Workspace update allowing to specify v1LegacyMode. + */ + interface WithV1LegacyMode { + /** + * Specifies the v1LegacyMode property: Enabling v1_legacy_mode may prevent you from using features provided + * by the v2 API.. + * + * @param v1LegacyMode Enabling v1_legacy_mode may prevent you from using features provided by the v2 API. + * @return the next definition stage. + */ + Update withV1LegacyMode(Boolean v1LegacyMode); + } + + /** + * The stage of the Workspace update allowing to specify encryption. + */ + interface WithEncryption { + /** + * Specifies the encryption property: The encryption property.. + * + * @param encryption The encryption property. + * @return the next definition stage. + */ + Update withEncryption(EncryptionUpdateProperties encryption); + } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ Workspace refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ @@ -738,7 +1079,7 @@ interface WithContainerRegistry { /** * Diagnose workspace setup issue. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. @@ -747,7 +1088,7 @@ interface WithContainerRegistry { /** * Diagnose workspace setup issue. - * + * * @param parameters The parameter of diagnosing workspace health. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -760,7 +1101,7 @@ interface WithContainerRegistry { /** * Lists all the keys associated with this workspace. This includes keys for the storage account, app insights and * password for container registry. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -772,7 +1113,7 @@ interface WithContainerRegistry { /** * Lists all the keys associated with this workspace. This includes keys for the storage account, app insights and * password for container registry. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. @@ -782,7 +1123,7 @@ interface WithContainerRegistry { /** * Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and * password for container registry. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @@ -791,7 +1132,7 @@ interface WithContainerRegistry { /** * Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and * password for container registry. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -801,7 +1142,7 @@ interface WithContainerRegistry { /** * return notebook access token and refresh token. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -812,7 +1153,7 @@ interface WithContainerRegistry { /** * return notebook access token and refresh token. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. @@ -821,7 +1162,7 @@ interface WithContainerRegistry { /** * Prepare a notebook. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. @@ -830,7 +1171,7 @@ interface WithContainerRegistry { /** * Prepare a notebook. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -841,7 +1182,7 @@ interface WithContainerRegistry { /** * List storage account keys of a workspace. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -852,7 +1193,7 @@ interface WithContainerRegistry { /** * List storage account keys of a workspace. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. @@ -861,7 +1202,7 @@ interface WithContainerRegistry { /** * List keys of a notebook. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -872,7 +1213,7 @@ interface WithContainerRegistry { /** * List keys of a notebook. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionAccessKey.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionAccessKey.java new file mode 100644 index 0000000000000..263d51da49839 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionAccessKey.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The WorkspaceConnectionAccessKey model. + */ +@Fluent +public final class WorkspaceConnectionAccessKey implements JsonSerializable { + /* + * The accessKeyId property. + */ + private String accessKeyId; + + /* + * The secretAccessKey property. + */ + private String secretAccessKey; + + /** + * Creates an instance of WorkspaceConnectionAccessKey class. + */ + public WorkspaceConnectionAccessKey() { + } + + /** + * Get the accessKeyId property: The accessKeyId property. + * + * @return the accessKeyId value. + */ + public String accessKeyId() { + return this.accessKeyId; + } + + /** + * Set the accessKeyId property: The accessKeyId property. + * + * @param accessKeyId the accessKeyId value to set. + * @return the WorkspaceConnectionAccessKey object itself. + */ + public WorkspaceConnectionAccessKey withAccessKeyId(String accessKeyId) { + this.accessKeyId = accessKeyId; + return this; + } + + /** + * Get the secretAccessKey property: The secretAccessKey property. + * + * @return the secretAccessKey value. + */ + public String secretAccessKey() { + return this.secretAccessKey; + } + + /** + * Set the secretAccessKey property: The secretAccessKey property. + * + * @param secretAccessKey the secretAccessKey value to set. + * @return the WorkspaceConnectionAccessKey object itself. + */ + public WorkspaceConnectionAccessKey withSecretAccessKey(String secretAccessKey) { + this.secretAccessKey = secretAccessKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("accessKeyId", this.accessKeyId); + jsonWriter.writeStringField("secretAccessKey", this.secretAccessKey); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceConnectionAccessKey from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceConnectionAccessKey if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the WorkspaceConnectionAccessKey. + */ + public static WorkspaceConnectionAccessKey fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceConnectionAccessKey deserializedWorkspaceConnectionAccessKey = new WorkspaceConnectionAccessKey(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("accessKeyId".equals(fieldName)) { + deserializedWorkspaceConnectionAccessKey.accessKeyId = reader.getString(); + } else if ("secretAccessKey".equals(fieldName)) { + deserializedWorkspaceConnectionAccessKey.secretAccessKey = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceConnectionAccessKey; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionAccountKey.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionAccountKey.java new file mode 100644 index 0000000000000..8ef9051a71657 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionAccountKey.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The WorkspaceConnectionAccountKey model. + */ +@Fluent +public final class WorkspaceConnectionAccountKey implements JsonSerializable { + /* + * The key property. + */ + private String key; + + /** + * Creates an instance of WorkspaceConnectionAccountKey class. + */ + public WorkspaceConnectionAccountKey() { + } + + /** + * Get the key property: The key property. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The key property. + * + * @param key the key value to set. + * @return the WorkspaceConnectionAccountKey object itself. + */ + public WorkspaceConnectionAccountKey withKey(String key) { + this.key = key; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceConnectionAccountKey from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceConnectionAccountKey if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the WorkspaceConnectionAccountKey. + */ + public static WorkspaceConnectionAccountKey fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceConnectionAccountKey deserializedWorkspaceConnectionAccountKey + = new WorkspaceConnectionAccountKey(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedWorkspaceConnectionAccountKey.key = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceConnectionAccountKey; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionApiKey.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionApiKey.java new file mode 100644 index 0000000000000..68ca9ba9b2795 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionApiKey.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Api key object for workspace connection credential. + */ +@Fluent +public final class WorkspaceConnectionApiKey implements JsonSerializable { + /* + * The key property. + */ + private String key; + + /** + * Creates an instance of WorkspaceConnectionApiKey class. + */ + public WorkspaceConnectionApiKey() { + } + + /** + * Get the key property: The key property. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The key property. + * + * @param key the key value to set. + * @return the WorkspaceConnectionApiKey object itself. + */ + public WorkspaceConnectionApiKey withKey(String key) { + this.key = key; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceConnectionApiKey from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceConnectionApiKey if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the WorkspaceConnectionApiKey. + */ + public static WorkspaceConnectionApiKey fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceConnectionApiKey deserializedWorkspaceConnectionApiKey = new WorkspaceConnectionApiKey(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedWorkspaceConnectionApiKey.key = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceConnectionApiKey; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionManagedIdentity.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionManagedIdentity.java index 8f7d813b83b87..8868888c833fc 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionManagedIdentity.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionManagedIdentity.java @@ -5,30 +5,36 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The WorkspaceConnectionManagedIdentity model. */ +/** + * The WorkspaceConnectionManagedIdentity model. + */ @Fluent -public class WorkspaceConnectionManagedIdentity { +public final class WorkspaceConnectionManagedIdentity implements JsonSerializable { /* * The resourceId property. */ - @JsonProperty(value = "resourceId") private String resourceId; /* * The clientId property. */ - @JsonProperty(value = "clientId") private String clientId; - /** Creates an instance of WorkspaceConnectionManagedIdentity class. */ + /** + * Creates an instance of WorkspaceConnectionManagedIdentity class. + */ public WorkspaceConnectionManagedIdentity() { } /** * Get the resourceId property: The resourceId property. - * + * * @return the resourceId value. */ public String resourceId() { @@ -37,7 +43,7 @@ public String resourceId() { /** * Set the resourceId property: The resourceId property. - * + * * @param resourceId the resourceId value to set. * @return the WorkspaceConnectionManagedIdentity object itself. */ @@ -48,7 +54,7 @@ public WorkspaceConnectionManagedIdentity withResourceId(String resourceId) { /** * Get the clientId property: The clientId property. - * + * * @return the clientId value. */ public String clientId() { @@ -57,7 +63,7 @@ public String clientId() { /** * Set the clientId property: The clientId property. - * + * * @param clientId the clientId value to set. * @return the WorkspaceConnectionManagedIdentity object itself. */ @@ -68,9 +74,49 @@ public WorkspaceConnectionManagedIdentity withClientId(String clientId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("clientId", this.clientId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceConnectionManagedIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceConnectionManagedIdentity if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the WorkspaceConnectionManagedIdentity. + */ + public static WorkspaceConnectionManagedIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceConnectionManagedIdentity deserializedWorkspaceConnectionManagedIdentity + = new WorkspaceConnectionManagedIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedWorkspaceConnectionManagedIdentity.resourceId = reader.getString(); + } else if ("clientId".equals(fieldName)) { + deserializedWorkspaceConnectionManagedIdentity.clientId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceConnectionManagedIdentity; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionOAuth2.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionOAuth2.java new file mode 100644 index 0000000000000..bf543303d6e91 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionOAuth2.java @@ -0,0 +1,299 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Objects; +import java.util.UUID; + +/** + * ClientId and ClientSecret are required. Other properties are optional + * depending on each OAuth2 provider's implementation. + */ +@Fluent +public final class WorkspaceConnectionOAuth2 implements JsonSerializable { + /* + * Required by Concur connection category + */ + private String authUrl; + + /* + * Client id in the format of UUID + */ + private UUID clientId; + + /* + * The clientSecret property. + */ + private String clientSecret; + + /* + * Required by GoogleAdWords connection category + */ + private String developerToken; + + /* + * The password property. + */ + private String password; + + /* + * Required by GoogleBigQuery, GoogleAdWords, Hubspot, QuickBooks, Square, Xero, Zoho + * where user needs to get RefreshToken offline + */ + private String refreshToken; + + /* + * Required by QuickBooks and Xero connection categories + */ + private String tenantId; + + /* + * Concur, ServiceNow auth server AccessToken grant type is 'Password' + * which requires UsernamePassword + */ + private String username; + + /** + * Creates an instance of WorkspaceConnectionOAuth2 class. + */ + public WorkspaceConnectionOAuth2() { + } + + /** + * Get the authUrl property: Required by Concur connection category. + * + * @return the authUrl value. + */ + public String authUrl() { + return this.authUrl; + } + + /** + * Set the authUrl property: Required by Concur connection category. + * + * @param authUrl the authUrl value to set. + * @return the WorkspaceConnectionOAuth2 object itself. + */ + public WorkspaceConnectionOAuth2 withAuthUrl(String authUrl) { + this.authUrl = authUrl; + return this; + } + + /** + * Get the clientId property: Client id in the format of UUID. + * + * @return the clientId value. + */ + public UUID clientId() { + return this.clientId; + } + + /** + * Set the clientId property: Client id in the format of UUID. + * + * @param clientId the clientId value to set. + * @return the WorkspaceConnectionOAuth2 object itself. + */ + public WorkspaceConnectionOAuth2 withClientId(UUID clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the clientSecret property: The clientSecret property. + * + * @return the clientSecret value. + */ + public String clientSecret() { + return this.clientSecret; + } + + /** + * Set the clientSecret property: The clientSecret property. + * + * @param clientSecret the clientSecret value to set. + * @return the WorkspaceConnectionOAuth2 object itself. + */ + public WorkspaceConnectionOAuth2 withClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Get the developerToken property: Required by GoogleAdWords connection category. + * + * @return the developerToken value. + */ + public String developerToken() { + return this.developerToken; + } + + /** + * Set the developerToken property: Required by GoogleAdWords connection category. + * + * @param developerToken the developerToken value to set. + * @return the WorkspaceConnectionOAuth2 object itself. + */ + public WorkspaceConnectionOAuth2 withDeveloperToken(String developerToken) { + this.developerToken = developerToken; + return this; + } + + /** + * Get the password property: The password property. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: The password property. + * + * @param password the password value to set. + * @return the WorkspaceConnectionOAuth2 object itself. + */ + public WorkspaceConnectionOAuth2 withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the refreshToken property: Required by GoogleBigQuery, GoogleAdWords, Hubspot, QuickBooks, Square, Xero, Zoho + * where user needs to get RefreshToken offline. + * + * @return the refreshToken value. + */ + public String refreshToken() { + return this.refreshToken; + } + + /** + * Set the refreshToken property: Required by GoogleBigQuery, GoogleAdWords, Hubspot, QuickBooks, Square, Xero, Zoho + * where user needs to get RefreshToken offline. + * + * @param refreshToken the refreshToken value to set. + * @return the WorkspaceConnectionOAuth2 object itself. + */ + public WorkspaceConnectionOAuth2 withRefreshToken(String refreshToken) { + this.refreshToken = refreshToken; + return this; + } + + /** + * Get the tenantId property: Required by QuickBooks and Xero connection categories. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: Required by QuickBooks and Xero connection categories. + * + * @param tenantId the tenantId value to set. + * @return the WorkspaceConnectionOAuth2 object itself. + */ + public WorkspaceConnectionOAuth2 withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the username property: Concur, ServiceNow auth server AccessToken grant type is 'Password' + * which requires UsernamePassword. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: Concur, ServiceNow auth server AccessToken grant type is 'Password' + * which requires UsernamePassword. + * + * @param username the username value to set. + * @return the WorkspaceConnectionOAuth2 object itself. + */ + public WorkspaceConnectionOAuth2 withUsername(String username) { + this.username = username; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("authUrl", this.authUrl); + jsonWriter.writeStringField("clientId", Objects.toString(this.clientId, null)); + jsonWriter.writeStringField("clientSecret", this.clientSecret); + jsonWriter.writeStringField("developerToken", this.developerToken); + jsonWriter.writeStringField("password", this.password); + jsonWriter.writeStringField("refreshToken", this.refreshToken); + jsonWriter.writeStringField("tenantId", this.tenantId); + jsonWriter.writeStringField("username", this.username); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceConnectionOAuth2 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceConnectionOAuth2 if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the WorkspaceConnectionOAuth2. + */ + public static WorkspaceConnectionOAuth2 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceConnectionOAuth2 deserializedWorkspaceConnectionOAuth2 = new WorkspaceConnectionOAuth2(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("authUrl".equals(fieldName)) { + deserializedWorkspaceConnectionOAuth2.authUrl = reader.getString(); + } else if ("clientId".equals(fieldName)) { + deserializedWorkspaceConnectionOAuth2.clientId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("clientSecret".equals(fieldName)) { + deserializedWorkspaceConnectionOAuth2.clientSecret = reader.getString(); + } else if ("developerToken".equals(fieldName)) { + deserializedWorkspaceConnectionOAuth2.developerToken = reader.getString(); + } else if ("password".equals(fieldName)) { + deserializedWorkspaceConnectionOAuth2.password = reader.getString(); + } else if ("refreshToken".equals(fieldName)) { + deserializedWorkspaceConnectionOAuth2.refreshToken = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedWorkspaceConnectionOAuth2.tenantId = reader.getString(); + } else if ("username".equals(fieldName)) { + deserializedWorkspaceConnectionOAuth2.username = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceConnectionOAuth2; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionPersonalAccessToken.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionPersonalAccessToken.java index 67e3cac9d34e8..9dbd7d76251c3 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionPersonalAccessToken.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionPersonalAccessToken.java @@ -5,24 +5,32 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The WorkspaceConnectionPersonalAccessToken model. */ +/** + * The WorkspaceConnectionPersonalAccessToken model. + */ @Fluent -public final class WorkspaceConnectionPersonalAccessToken { +public final class WorkspaceConnectionPersonalAccessToken + implements JsonSerializable { /* * The pat property. */ - @JsonProperty(value = "pat") private String pat; - /** Creates an instance of WorkspaceConnectionPersonalAccessToken class. */ + /** + * Creates an instance of WorkspaceConnectionPersonalAccessToken class. + */ public WorkspaceConnectionPersonalAccessToken() { } /** * Get the pat property: The pat property. - * + * * @return the pat value. */ public String pat() { @@ -31,7 +39,7 @@ public String pat() { /** * Set the pat property: The pat property. - * + * * @param pat the pat value to set. * @return the WorkspaceConnectionPersonalAccessToken object itself. */ @@ -42,9 +50,46 @@ public WorkspaceConnectionPersonalAccessToken withPat(String pat) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("pat", this.pat); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceConnectionPersonalAccessToken from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceConnectionPersonalAccessToken if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the WorkspaceConnectionPersonalAccessToken. + */ + public static WorkspaceConnectionPersonalAccessToken fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceConnectionPersonalAccessToken deserializedWorkspaceConnectionPersonalAccessToken + = new WorkspaceConnectionPersonalAccessToken(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("pat".equals(fieldName)) { + deserializedWorkspaceConnectionPersonalAccessToken.pat = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceConnectionPersonalAccessToken; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionPropertiesV2.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionPropertiesV2.java index a0a871c9c248b..23ddc52564034 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionPropertiesV2.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionPropertiesV2.java @@ -5,58 +5,95 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The WorkspaceConnectionPropertiesV2 model. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "authType", - defaultImpl = WorkspaceConnectionPropertiesV2.class) -@JsonTypeName("WorkspaceConnectionPropertiesV2") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "PAT", value = PatAuthTypeWorkspaceConnectionProperties.class), - @JsonSubTypes.Type(name = "SAS", value = SasAuthTypeWorkspaceConnectionProperties.class), - @JsonSubTypes.Type(name = "UsernamePassword", value = UsernamePasswordAuthTypeWorkspaceConnectionProperties.class), - @JsonSubTypes.Type(name = "None", value = NoneAuthTypeWorkspaceConnectionProperties.class), - @JsonSubTypes.Type(name = "ManagedIdentity", value = ManagedIdentityAuthTypeWorkspaceConnectionProperties.class) -}) +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; + +/** + * The WorkspaceConnectionPropertiesV2 model. + */ @Fluent -public class WorkspaceConnectionPropertiesV2 { +public class WorkspaceConnectionPropertiesV2 implements JsonSerializable { + /* + * Authentication type of the connection target + */ + private ConnectionAuthType authType = ConnectionAuthType.fromString("WorkspaceConnectionPropertiesV2"); + /* * Category of the connection */ - @JsonProperty(value = "category") private ConnectionCategory category; + /* + * The createdByWorkspaceArmId property. + */ + private String createdByWorkspaceArmId; + + /* + * The expiryTime property. + */ + private OffsetDateTime expiryTime; + + /* + * Group based on connection category + */ + private ConnectionGroup group; + + /* + * The isSharedToAll property. + */ + private Boolean isSharedToAll; + /* * The target property. */ - @JsonProperty(value = "target") private String target; + /* + * Store user metadata for this connection + */ + private Map metadata; + + /* + * The sharedUserList property. + */ + private List sharedUserList; + /* * Value details of the workspace connection. */ - @JsonProperty(value = "value") private String value; /* * format for the workspace connection value */ - @JsonProperty(value = "valueFormat") private ValueFormat valueFormat; - /** Creates an instance of WorkspaceConnectionPropertiesV2 class. */ + /** + * Creates an instance of WorkspaceConnectionPropertiesV2 class. + */ public WorkspaceConnectionPropertiesV2() { } + /** + * Get the authType property: Authentication type of the connection target. + * + * @return the authType value. + */ + public ConnectionAuthType authType() { + return this.authType; + } + /** * Get the category property: Category of the connection. - * + * * @return the category value. */ public ConnectionCategory category() { @@ -65,7 +102,7 @@ public ConnectionCategory category() { /** * Set the category property: Category of the connection. - * + * * @param category the category value to set. * @return the WorkspaceConnectionPropertiesV2 object itself. */ @@ -74,9 +111,89 @@ public WorkspaceConnectionPropertiesV2 withCategory(ConnectionCategory category) return this; } + /** + * Get the createdByWorkspaceArmId property: The createdByWorkspaceArmId property. + * + * @return the createdByWorkspaceArmId value. + */ + public String createdByWorkspaceArmId() { + return this.createdByWorkspaceArmId; + } + + /** + * Set the createdByWorkspaceArmId property: The createdByWorkspaceArmId property. + * + * @param createdByWorkspaceArmId the createdByWorkspaceArmId value to set. + * @return the WorkspaceConnectionPropertiesV2 object itself. + */ + WorkspaceConnectionPropertiesV2 withCreatedByWorkspaceArmId(String createdByWorkspaceArmId) { + this.createdByWorkspaceArmId = createdByWorkspaceArmId; + return this; + } + + /** + * Get the expiryTime property: The expiryTime property. + * + * @return the expiryTime value. + */ + public OffsetDateTime expiryTime() { + return this.expiryTime; + } + + /** + * Set the expiryTime property: The expiryTime property. + * + * @param expiryTime the expiryTime value to set. + * @return the WorkspaceConnectionPropertiesV2 object itself. + */ + public WorkspaceConnectionPropertiesV2 withExpiryTime(OffsetDateTime expiryTime) { + this.expiryTime = expiryTime; + return this; + } + + /** + * Get the group property: Group based on connection category. + * + * @return the group value. + */ + public ConnectionGroup group() { + return this.group; + } + + /** + * Set the group property: Group based on connection category. + * + * @param group the group value to set. + * @return the WorkspaceConnectionPropertiesV2 object itself. + */ + WorkspaceConnectionPropertiesV2 withGroup(ConnectionGroup group) { + this.group = group; + return this; + } + + /** + * Get the isSharedToAll property: The isSharedToAll property. + * + * @return the isSharedToAll value. + */ + public Boolean isSharedToAll() { + return this.isSharedToAll; + } + + /** + * Set the isSharedToAll property: The isSharedToAll property. + * + * @param isSharedToAll the isSharedToAll value to set. + * @return the WorkspaceConnectionPropertiesV2 object itself. + */ + public WorkspaceConnectionPropertiesV2 withIsSharedToAll(Boolean isSharedToAll) { + this.isSharedToAll = isSharedToAll; + return this; + } + /** * Get the target property: The target property. - * + * * @return the target value. */ public String target() { @@ -85,7 +202,7 @@ public String target() { /** * Set the target property: The target property. - * + * * @param target the target value to set. * @return the WorkspaceConnectionPropertiesV2 object itself. */ @@ -94,9 +211,49 @@ public WorkspaceConnectionPropertiesV2 withTarget(String target) { return this; } + /** + * Get the metadata property: Store user metadata for this connection. + * + * @return the metadata value. + */ + public Map metadata() { + return this.metadata; + } + + /** + * Set the metadata property: Store user metadata for this connection. + * + * @param metadata the metadata value to set. + * @return the WorkspaceConnectionPropertiesV2 object itself. + */ + public WorkspaceConnectionPropertiesV2 withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the sharedUserList property: The sharedUserList property. + * + * @return the sharedUserList value. + */ + public List sharedUserList() { + return this.sharedUserList; + } + + /** + * Set the sharedUserList property: The sharedUserList property. + * + * @param sharedUserList the sharedUserList value to set. + * @return the WorkspaceConnectionPropertiesV2 object itself. + */ + public WorkspaceConnectionPropertiesV2 withSharedUserList(List sharedUserList) { + this.sharedUserList = sharedUserList; + return this; + } + /** * Get the value property: Value details of the workspace connection. - * + * * @return the value value. */ public String value() { @@ -105,7 +262,7 @@ public String value() { /** * Set the value property: Value details of the workspace connection. - * + * * @param value the value value to set. * @return the WorkspaceConnectionPropertiesV2 object itself. */ @@ -116,7 +273,7 @@ public WorkspaceConnectionPropertiesV2 withValue(String value) { /** * Get the valueFormat property: format for the workspace connection value. - * + * * @return the valueFormat value. */ public ValueFormat valueFormat() { @@ -125,7 +282,7 @@ public ValueFormat valueFormat() { /** * Set the valueFormat property: format for the workspace connection value. - * + * * @param valueFormat the valueFormat value to set. * @return the WorkspaceConnectionPropertiesV2 object itself. */ @@ -136,9 +293,130 @@ public WorkspaceConnectionPropertiesV2 withValueFormat(ValueFormat valueFormat) /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); + jsonWriter.writeStringField("category", this.category == null ? null : this.category.toString()); + jsonWriter.writeStringField("expiryTime", + this.expiryTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expiryTime)); + jsonWriter.writeBooleanField("isSharedToAll", this.isSharedToAll); + jsonWriter.writeStringField("target", this.target); + jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("sharedUserList", this.sharedUserList, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("value", this.value); + jsonWriter.writeStringField("valueFormat", this.valueFormat == null ? null : this.valueFormat.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceConnectionPropertiesV2 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceConnectionPropertiesV2 if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the WorkspaceConnectionPropertiesV2. + */ + public static WorkspaceConnectionPropertiesV2 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("authType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("PAT".equals(discriminatorValue)) { + return PatAuthTypeWorkspaceConnectionProperties.fromJson(readerToUse.reset()); + } else if ("SAS".equals(discriminatorValue)) { + return SasAuthTypeWorkspaceConnectionProperties.fromJson(readerToUse.reset()); + } else if ("UsernamePassword".equals(discriminatorValue)) { + return UsernamePasswordAuthTypeWorkspaceConnectionProperties.fromJson(readerToUse.reset()); + } else if ("None".equals(discriminatorValue)) { + return NoneAuthTypeWorkspaceConnectionProperties.fromJson(readerToUse.reset()); + } else if ("ManagedIdentity".equals(discriminatorValue)) { + return ManagedIdentityAuthTypeWorkspaceConnectionProperties.fromJson(readerToUse.reset()); + } else if ("AAD".equals(discriminatorValue)) { + return AadAuthTypeWorkspaceConnectionProperties.fromJson(readerToUse.reset()); + } else if ("AccessKey".equals(discriminatorValue)) { + return AccessKeyAuthTypeWorkspaceConnectionProperties.fromJson(readerToUse.reset()); + } else if ("AccountKey".equals(discriminatorValue)) { + return AccountKeyAuthTypeWorkspaceConnectionProperties.fromJson(readerToUse.reset()); + } else if ("ApiKey".equals(discriminatorValue)) { + return ApiKeyAuthWorkspaceConnectionProperties.fromJson(readerToUse.reset()); + } else if ("CustomKeys".equals(discriminatorValue)) { + return CustomKeysWorkspaceConnectionProperties.fromJson(readerToUse.reset()); + } else if ("OAuth2".equals(discriminatorValue)) { + return OAuth2AuthTypeWorkspaceConnectionProperties.fromJson(readerToUse.reset()); + } else if ("ServicePrincipal".equals(discriminatorValue)) { + return ServicePrincipalAuthTypeWorkspaceConnectionProperties.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static WorkspaceConnectionPropertiesV2 fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceConnectionPropertiesV2 deserializedWorkspaceConnectionPropertiesV2 + = new WorkspaceConnectionPropertiesV2(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("authType".equals(fieldName)) { + deserializedWorkspaceConnectionPropertiesV2.authType + = ConnectionAuthType.fromString(reader.getString()); + } else if ("category".equals(fieldName)) { + deserializedWorkspaceConnectionPropertiesV2.category + = ConnectionCategory.fromString(reader.getString()); + } else if ("createdByWorkspaceArmId".equals(fieldName)) { + deserializedWorkspaceConnectionPropertiesV2.createdByWorkspaceArmId = reader.getString(); + } else if ("expiryTime".equals(fieldName)) { + deserializedWorkspaceConnectionPropertiesV2.expiryTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("group".equals(fieldName)) { + deserializedWorkspaceConnectionPropertiesV2.group = ConnectionGroup.fromString(reader.getString()); + } else if ("isSharedToAll".equals(fieldName)) { + deserializedWorkspaceConnectionPropertiesV2.isSharedToAll + = reader.getNullable(JsonReader::getBoolean); + } else if ("target".equals(fieldName)) { + deserializedWorkspaceConnectionPropertiesV2.target = reader.getString(); + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedWorkspaceConnectionPropertiesV2.metadata = metadata; + } else if ("sharedUserList".equals(fieldName)) { + List sharedUserList = reader.readArray(reader1 -> reader1.getString()); + deserializedWorkspaceConnectionPropertiesV2.sharedUserList = sharedUserList; + } else if ("value".equals(fieldName)) { + deserializedWorkspaceConnectionPropertiesV2.value = reader.getString(); + } else if ("valueFormat".equals(fieldName)) { + deserializedWorkspaceConnectionPropertiesV2.valueFormat + = ValueFormat.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceConnectionPropertiesV2; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionPropertiesV2BasicResource.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionPropertiesV2BasicResource.java index 22ef3cb48926e..b5033785919a2 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionPropertiesV2BasicResource.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionPropertiesV2BasicResource.java @@ -4,43 +4,46 @@ package com.azure.resourcemanager.machinelearning.models; +import com.azure.core.http.rest.Response; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.machinelearning.fluent.models.WorkspaceConnectionPropertiesV2BasicResourceInner; -/** An immutable client-side representation of WorkspaceConnectionPropertiesV2BasicResource. */ +/** + * An immutable client-side representation of WorkspaceConnectionPropertiesV2BasicResource. + */ public interface WorkspaceConnectionPropertiesV2BasicResource { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the properties property: The properties property. - * + * * @return the properties value. */ WorkspaceConnectionPropertiesV2 properties(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); @@ -48,46 +51,55 @@ public interface WorkspaceConnectionPropertiesV2BasicResource { /** * Gets the inner * com.azure.resourcemanager.machinelearning.fluent.models.WorkspaceConnectionPropertiesV2BasicResourceInner object. - * + * * @return the inner object. */ WorkspaceConnectionPropertiesV2BasicResourceInner innerModel(); - /** The entirety of the WorkspaceConnectionPropertiesV2BasicResource definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithParentResource, - DefinitionStages.WithProperties, - DefinitionStages.WithCreate { + /** + * The entirety of the WorkspaceConnectionPropertiesV2BasicResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, DefinitionStages.WithCreate { } - /** The WorkspaceConnectionPropertiesV2BasicResource definition stages. */ + + /** + * The WorkspaceConnectionPropertiesV2BasicResource definition stages. + */ interface DefinitionStages { - /** The first stage of the WorkspaceConnectionPropertiesV2BasicResource definition. */ + /** + * The first stage of the WorkspaceConnectionPropertiesV2BasicResource definition. + */ interface Blank extends WithParentResource { } + /** * The stage of the WorkspaceConnectionPropertiesV2BasicResource definition allowing to specify parent resource. */ interface WithParentResource { /** * Specifies resourceGroupName, workspaceName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @return the next definition stage. */ WithProperties withExistingWorkspace(String resourceGroupName, String workspaceName); } - /** The stage of the WorkspaceConnectionPropertiesV2BasicResource definition allowing to specify properties. */ + + /** + * The stage of the WorkspaceConnectionPropertiesV2BasicResource definition allowing to specify properties. + */ interface WithProperties { /** * Specifies the properties property: The properties property.. - * + * * @param properties The properties property. * @return the next definition stage. */ WithCreate withProperties(WorkspaceConnectionPropertiesV2 properties); } + /** * The stage of the WorkspaceConnectionPropertiesV2BasicResource definition which contains all the minimum * required properties for the resource to be created, but also allows for any other optional properties to be @@ -96,32 +108,53 @@ interface WithProperties { interface WithCreate { /** * Executes the create request. - * + * * @return the created resource. */ WorkspaceConnectionPropertiesV2BasicResource create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ WorkspaceConnectionPropertiesV2BasicResource create(Context context); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ WorkspaceConnectionPropertiesV2BasicResource refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ WorkspaceConnectionPropertiesV2BasicResource refresh(Context context); + + /** + * List all the secrets of a machine learning workspaces connections. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + Response listSecretsWithResponse(Context context); + + /** + * List all the secrets of a machine learning workspaces connections. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + WorkspaceConnectionPropertiesV2BasicResource listSecrets(); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult.java index 96ab1a4a1025f..6b396ac6ae206 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult.java @@ -5,32 +5,39 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.fluent.models.WorkspaceConnectionPropertiesV2BasicResourceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** The WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult model. */ +/** + * The WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult model. + */ @Fluent -public final class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult { +public final class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult + implements JsonSerializable { /* * The value property. */ - @JsonProperty(value = "value") private List value; /* * The nextLink property. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult class. */ + /** + * Creates an instance of WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult class. + */ public WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult() { } /** * Get the value property: The value property. - * + * * @return the value value. */ public List value() { @@ -39,19 +46,19 @@ public List value() { /** * Set the value property: The value property. - * + * * @param value the value value to set. * @return the WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult object itself. */ - public WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult withValue( - List value) { + public WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult + withValue(List value) { this.value = value; return this; } /** * Get the nextLink property: The nextLink property. - * + * * @return the nextLink value. */ public String nextLink() { @@ -60,7 +67,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -68,4 +75,48 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult if the JsonReader was + * pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult. + */ + public static WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult deserializedWorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult + = new WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader + .readArray(reader1 -> WorkspaceConnectionPropertiesV2BasicResourceInner.fromJson(reader1)); + deserializedWorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedWorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult.nextLink + = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionServicePrincipal.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionServicePrincipal.java new file mode 100644 index 0000000000000..0f05a562276fa --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionServicePrincipal.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The WorkspaceConnectionServicePrincipal model. + */ +@Fluent +public final class WorkspaceConnectionServicePrincipal + implements JsonSerializable { + /* + * The clientId property. + */ + private String clientId; + + /* + * The clientSecret property. + */ + private String clientSecret; + + /* + * The tenantId property. + */ + private String tenantId; + + /** + * Creates an instance of WorkspaceConnectionServicePrincipal class. + */ + public WorkspaceConnectionServicePrincipal() { + } + + /** + * Get the clientId property: The clientId property. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: The clientId property. + * + * @param clientId the clientId value to set. + * @return the WorkspaceConnectionServicePrincipal object itself. + */ + public WorkspaceConnectionServicePrincipal withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the clientSecret property: The clientSecret property. + * + * @return the clientSecret value. + */ + public String clientSecret() { + return this.clientSecret; + } + + /** + * Set the clientSecret property: The clientSecret property. + * + * @param clientSecret the clientSecret value to set. + * @return the WorkspaceConnectionServicePrincipal object itself. + */ + public WorkspaceConnectionServicePrincipal withClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Get the tenantId property: The tenantId property. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: The tenantId property. + * + * @param tenantId the tenantId value to set. + * @return the WorkspaceConnectionServicePrincipal object itself. + */ + public WorkspaceConnectionServicePrincipal withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("clientId", this.clientId); + jsonWriter.writeStringField("clientSecret", this.clientSecret); + jsonWriter.writeStringField("tenantId", this.tenantId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceConnectionServicePrincipal from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceConnectionServicePrincipal if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the WorkspaceConnectionServicePrincipal. + */ + public static WorkspaceConnectionServicePrincipal fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceConnectionServicePrincipal deserializedWorkspaceConnectionServicePrincipal + = new WorkspaceConnectionServicePrincipal(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clientId".equals(fieldName)) { + deserializedWorkspaceConnectionServicePrincipal.clientId = reader.getString(); + } else if ("clientSecret".equals(fieldName)) { + deserializedWorkspaceConnectionServicePrincipal.clientSecret = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedWorkspaceConnectionServicePrincipal.tenantId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceConnectionServicePrincipal; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionSharedAccessSignature.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionSharedAccessSignature.java index 2bbccdb326645..f323a4d2b92bd 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionSharedAccessSignature.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionSharedAccessSignature.java @@ -5,24 +5,32 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The WorkspaceConnectionSharedAccessSignature model. */ +/** + * The WorkspaceConnectionSharedAccessSignature model. + */ @Fluent -public final class WorkspaceConnectionSharedAccessSignature { +public final class WorkspaceConnectionSharedAccessSignature + implements JsonSerializable { /* * The sas property. */ - @JsonProperty(value = "sas") private String sas; - /** Creates an instance of WorkspaceConnectionSharedAccessSignature class. */ + /** + * Creates an instance of WorkspaceConnectionSharedAccessSignature class. + */ public WorkspaceConnectionSharedAccessSignature() { } /** * Get the sas property: The sas property. - * + * * @return the sas value. */ public String sas() { @@ -31,7 +39,7 @@ public String sas() { /** * Set the sas property: The sas property. - * + * * @param sas the sas value to set. * @return the WorkspaceConnectionSharedAccessSignature object itself. */ @@ -42,9 +50,46 @@ public WorkspaceConnectionSharedAccessSignature withSas(String sas) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sas", this.sas); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceConnectionSharedAccessSignature from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceConnectionSharedAccessSignature if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the WorkspaceConnectionSharedAccessSignature. + */ + public static WorkspaceConnectionSharedAccessSignature fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceConnectionSharedAccessSignature deserializedWorkspaceConnectionSharedAccessSignature + = new WorkspaceConnectionSharedAccessSignature(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sas".equals(fieldName)) { + deserializedWorkspaceConnectionSharedAccessSignature.sas = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceConnectionSharedAccessSignature; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionUsernamePassword.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionUsernamePassword.java index 3f8e8255feba9..6f9aa0d5ce367 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionUsernamePassword.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnectionUsernamePassword.java @@ -5,30 +5,42 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The WorkspaceConnectionUsernamePassword model. */ +/** + * The WorkspaceConnectionUsernamePassword model. + */ @Fluent -public final class WorkspaceConnectionUsernamePassword { +public final class WorkspaceConnectionUsernamePassword + implements JsonSerializable { /* * The username property. */ - @JsonProperty(value = "username") private String username; /* * The password property. */ - @JsonProperty(value = "password") private String password; - /** Creates an instance of WorkspaceConnectionUsernamePassword class. */ + /* + * Optional, required by connections like SalesForce for extra security in addition to UsernamePassword + */ + private String securityToken; + + /** + * Creates an instance of WorkspaceConnectionUsernamePassword class. + */ public WorkspaceConnectionUsernamePassword() { } /** * Get the username property: The username property. - * + * * @return the username value. */ public String username() { @@ -37,7 +49,7 @@ public String username() { /** * Set the username property: The username property. - * + * * @param username the username value to set. * @return the WorkspaceConnectionUsernamePassword object itself. */ @@ -48,7 +60,7 @@ public WorkspaceConnectionUsernamePassword withUsername(String username) { /** * Get the password property: The password property. - * + * * @return the password value. */ public String password() { @@ -57,7 +69,7 @@ public String password() { /** * Set the password property: The password property. - * + * * @param password the password value to set. * @return the WorkspaceConnectionUsernamePassword object itself. */ @@ -66,11 +78,76 @@ public WorkspaceConnectionUsernamePassword withPassword(String password) { return this; } + /** + * Get the securityToken property: Optional, required by connections like SalesForce for extra security in addition + * to UsernamePassword. + * + * @return the securityToken value. + */ + public String securityToken() { + return this.securityToken; + } + + /** + * Set the securityToken property: Optional, required by connections like SalesForce for extra security in addition + * to UsernamePassword. + * + * @param securityToken the securityToken value to set. + * @return the WorkspaceConnectionUsernamePassword object itself. + */ + public WorkspaceConnectionUsernamePassword withSecurityToken(String securityToken) { + this.securityToken = securityToken; + return this; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("username", this.username); + jsonWriter.writeStringField("password", this.password); + jsonWriter.writeStringField("securityToken", this.securityToken); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceConnectionUsernamePassword from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceConnectionUsernamePassword if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the WorkspaceConnectionUsernamePassword. + */ + public static WorkspaceConnectionUsernamePassword fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceConnectionUsernamePassword deserializedWorkspaceConnectionUsernamePassword + = new WorkspaceConnectionUsernamePassword(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("username".equals(fieldName)) { + deserializedWorkspaceConnectionUsernamePassword.username = reader.getString(); + } else if ("password".equals(fieldName)) { + deserializedWorkspaceConnectionUsernamePassword.password = reader.getString(); + } else if ("securityToken".equals(fieldName)) { + deserializedWorkspaceConnectionUsernamePassword.securityToken = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceConnectionUsernamePassword; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnections.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnections.java index 2f00285075d10..8cb1ea5814cbe 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnections.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceConnections.java @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of WorkspaceConnections. */ +/** + * Resource collection API of WorkspaceConnections. + */ public interface WorkspaceConnections { /** * The get operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param connectionName Friendly name of the workspace connection. @@ -22,12 +24,12 @@ public interface WorkspaceConnections { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response body along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String connectionName, Context context); + Response getWithResponse(String resourceGroupName, + String workspaceName, String connectionName, Context context); /** * The get operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param connectionName Friendly name of the workspace connection. @@ -36,12 +38,12 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ - WorkspaceConnectionPropertiesV2BasicResource get( - String resourceGroupName, String workspaceName, String connectionName); + WorkspaceConnectionPropertiesV2BasicResource get(String resourceGroupName, String workspaceName, + String connectionName); /** * The delete operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param connectionName Friendly name of the workspace connection. @@ -51,12 +53,12 @@ WorkspaceConnectionPropertiesV2BasicResource get( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ - Response deleteWithResponse( - String resourceGroupName, String workspaceName, String connectionName, Context context); + Response deleteWithResponse(String resourceGroupName, String workspaceName, String connectionName, + Context context); /** * The delete operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param connectionName Friendly name of the workspace connection. @@ -68,7 +70,7 @@ Response deleteWithResponse( /** * The list operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -80,7 +82,7 @@ Response deleteWithResponse( /** * The list operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param target Target of the workspace connection. @@ -91,12 +93,41 @@ Response deleteWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the paginated response with {@link PagedIterable}. */ - PagedIterable list( - String resourceGroupName, String workspaceName, String target, String category, Context context); + PagedIterable list(String resourceGroupName, String workspaceName, + String target, String category, Context context); + + /** + * List all the secrets of a machine learning workspaces connections. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param connectionName Friendly name of the workspace connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + Response listSecretsWithResponse(String resourceGroupName, + String workspaceName, String connectionName, Context context); + + /** + * List all the secrets of a machine learning workspaces connections. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName Name of Azure Machine Learning workspace. + * @param connectionName Friendly name of the workspace connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + WorkspaceConnectionPropertiesV2BasicResource listSecrets(String resourceGroupName, String workspaceName, + String connectionName); /** * The get operation. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -107,7 +138,7 @@ PagedIterable list( /** * The get operation. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -119,7 +150,7 @@ PagedIterable list( /** * The delete operation. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -129,7 +160,7 @@ PagedIterable list( /** * The delete operation. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -141,7 +172,7 @@ PagedIterable list( /** * Begins definition for a new WorkspaceConnectionPropertiesV2BasicResource resource. - * + * * @param name resource name. * @return the first stage of the new WorkspaceConnectionPropertiesV2BasicResource definition. */ diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceFeatures.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceFeatures.java index cbbbae1274d2c..3e150cf9c9655 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceFeatures.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceFeatures.java @@ -7,11 +7,13 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -/** Resource collection API of WorkspaceFeatures. */ +/** + * Resource collection API of WorkspaceFeatures. + */ public interface WorkspaceFeatures { /** * Lists all enabled features for a workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -23,7 +25,7 @@ public interface WorkspaceFeatures { /** * Lists all enabled features for a workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceHubConfig.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceHubConfig.java new file mode 100644 index 0000000000000..b28e29616d6a4 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceHubConfig.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * WorkspaceHub's configuration object. + */ +@Fluent +public final class WorkspaceHubConfig implements JsonSerializable { + /* + * The additionalWorkspaceStorageAccounts property. + */ + private List additionalWorkspaceStorageAccounts; + + /* + * The defaultWorkspaceResourceGroup property. + */ + private String defaultWorkspaceResourceGroup; + + /** + * Creates an instance of WorkspaceHubConfig class. + */ + public WorkspaceHubConfig() { + } + + /** + * Get the additionalWorkspaceStorageAccounts property: The additionalWorkspaceStorageAccounts property. + * + * @return the additionalWorkspaceStorageAccounts value. + */ + public List additionalWorkspaceStorageAccounts() { + return this.additionalWorkspaceStorageAccounts; + } + + /** + * Set the additionalWorkspaceStorageAccounts property: The additionalWorkspaceStorageAccounts property. + * + * @param additionalWorkspaceStorageAccounts the additionalWorkspaceStorageAccounts value to set. + * @return the WorkspaceHubConfig object itself. + */ + public WorkspaceHubConfig withAdditionalWorkspaceStorageAccounts(List additionalWorkspaceStorageAccounts) { + this.additionalWorkspaceStorageAccounts = additionalWorkspaceStorageAccounts; + return this; + } + + /** + * Get the defaultWorkspaceResourceGroup property: The defaultWorkspaceResourceGroup property. + * + * @return the defaultWorkspaceResourceGroup value. + */ + public String defaultWorkspaceResourceGroup() { + return this.defaultWorkspaceResourceGroup; + } + + /** + * Set the defaultWorkspaceResourceGroup property: The defaultWorkspaceResourceGroup property. + * + * @param defaultWorkspaceResourceGroup the defaultWorkspaceResourceGroup value to set. + * @return the WorkspaceHubConfig object itself. + */ + public WorkspaceHubConfig withDefaultWorkspaceResourceGroup(String defaultWorkspaceResourceGroup) { + this.defaultWorkspaceResourceGroup = defaultWorkspaceResourceGroup; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("additionalWorkspaceStorageAccounts", this.additionalWorkspaceStorageAccounts, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("defaultWorkspaceResourceGroup", this.defaultWorkspaceResourceGroup); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceHubConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceHubConfig if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the WorkspaceHubConfig. + */ + public static WorkspaceHubConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceHubConfig deserializedWorkspaceHubConfig = new WorkspaceHubConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("additionalWorkspaceStorageAccounts".equals(fieldName)) { + List additionalWorkspaceStorageAccounts = reader.readArray(reader1 -> reader1.getString()); + deserializedWorkspaceHubConfig.additionalWorkspaceStorageAccounts + = additionalWorkspaceStorageAccounts; + } else if ("defaultWorkspaceResourceGroup".equals(fieldName)) { + deserializedWorkspaceHubConfig.defaultWorkspaceResourceGroup = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceHubConfig; + }); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceListResult.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceListResult.java index 074c218cf7c56..1969d8e6e869e 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceListResult.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceListResult.java @@ -5,34 +5,40 @@ package com.azure.resourcemanager.machinelearning.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.machinelearning.fluent.models.WorkspaceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** The result of a request to list machine learning workspaces. */ +/** + * The result of a request to list machine learning workspaces. + */ @Fluent -public final class WorkspaceListResult { +public final class WorkspaceListResult implements JsonSerializable { /* * 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. */ - @JsonProperty(value = "value") private List value; /* * The URI that can be used to request the next list of machine learning workspaces. */ - @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of WorkspaceListResult class. */ + /** + * Creates an instance of WorkspaceListResult class. + */ public WorkspaceListResult() { } /** * Get the value property: 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. - * + * * @return the value value. */ public List value() { @@ -42,7 +48,7 @@ public List value() { /** * Set the value property: 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. - * + * * @param value the value value to set. * @return the WorkspaceListResult object itself. */ @@ -53,7 +59,7 @@ public WorkspaceListResult withValue(List value) { /** * Get the nextLink property: The URI that can be used to request the next list of machine learning workspaces. - * + * * @return the nextLink value. */ public String nextLink() { @@ -62,7 +68,7 @@ public String nextLink() { /** * Set the nextLink property: The URI that can be used to request the next list of machine learning workspaces. - * + * * @param nextLink the nextLink value to set. * @return the WorkspaceListResult object itself. */ @@ -73,7 +79,7 @@ public WorkspaceListResult withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -81,4 +87,44 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the WorkspaceListResult. + */ + public static WorkspaceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceListResult deserializedWorkspaceListResult = new WorkspaceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> WorkspaceInner.fromJson(reader1)); + deserializedWorkspaceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedWorkspaceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceListResult; + }); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceProperties.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceProperties.java index 41e6d8c3f5a00..1bbaf7348fa1a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceProperties.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceProperties.java @@ -7,25 +7,27 @@ import com.azure.resourcemanager.machinelearning.fluent.models.WorkspacePropertiesInner; import java.util.List; -/** An immutable client-side representation of WorkspaceProperties. */ +/** + * An immutable client-side representation of WorkspaceProperties. + */ public interface WorkspaceProperties { /** * Gets the workspaceId property: The immutable id associated with this workspace. - * + * * @return the workspaceId value. */ String workspaceId(); /** * Gets the description property: The description of this workspace. - * + * * @return the description value. */ String description(); /** * Gets the friendlyName property: The friendly name for this workspace. This name in mutable. - * + * * @return the friendlyName value. */ String friendlyName(); @@ -33,21 +35,21 @@ public interface WorkspaceProperties { /** * Gets the keyVault property: ARM id of the key vault associated with this workspace. This cannot be changed once * the workspace has been created. - * + * * @return the keyVault value. */ String keyVault(); /** * Gets the applicationInsights property: ARM id of the application insights associated with this workspace. - * + * * @return the applicationInsights value. */ String applicationInsights(); /** * Gets the containerRegistry property: ARM id of the container registry associated with this workspace. - * + * * @return the containerRegistry value. */ String containerRegistry(); @@ -55,7 +57,7 @@ public interface WorkspaceProperties { /** * Gets the storageAccount property: ARM id of the storage account associated with this workspace. This cannot be * changed once the workspace has been created. - * + * * @return the storageAccount value. */ String storageAccount(); @@ -63,7 +65,7 @@ public interface WorkspaceProperties { /** * Gets the discoveryUrl property: Url for the discovery service to identify regional endpoints for machine learning * experimentation services. - * + * * @return the discoveryUrl value. */ String discoveryUrl(); @@ -71,14 +73,14 @@ public interface WorkspaceProperties { /** * Gets the provisioningState property: The current deployment state of workspace resource. The provisioningState is * to indicate states for resource provisioning. - * + * * @return the provisioningState value. */ ProvisioningState provisioningState(); /** * Gets the encryption property: The encryption settings of Azure ML workspace. - * + * * @return the encryption value. */ EncryptionProperty encryption(); @@ -86,7 +88,7 @@ public interface WorkspaceProperties { /** * Gets the hbiWorkspace property: The flag to signal HBI data in the workspace and reduce diagnostic data collected * by the service. - * + * * @return the hbiWorkspace value. */ Boolean hbiWorkspace(); @@ -94,21 +96,21 @@ public interface WorkspaceProperties { /** * Gets the serviceProvisionedResourceGroup property: The name of the managed resource group created by workspace RP * in customer subscription if the workspace is CMK workspace. - * + * * @return the serviceProvisionedResourceGroup value. */ String serviceProvisionedResourceGroup(); /** * Gets the privateLinkCount property: Count of private connections in the workspace. - * + * * @return the privateLinkCount value. */ Integer privateLinkCount(); /** * Gets the imageBuildCompute property: The compute name for image build. - * + * * @return the imageBuildCompute value. */ String imageBuildCompute(); @@ -116,42 +118,49 @@ public interface WorkspaceProperties { /** * Gets the allowPublicAccessWhenBehindVnet property: The flag to indicate whether to allow public access when * behind VNet. - * + * * @return the allowPublicAccessWhenBehindVnet value. */ Boolean allowPublicAccessWhenBehindVnet(); /** * Gets the publicNetworkAccess property: Whether requests from Public Network are allowed. - * + * * @return the publicNetworkAccess value. */ PublicNetworkAccess publicNetworkAccess(); /** * Gets the privateEndpointConnections property: The list of private endpoint connections in the workspace. - * + * * @return the privateEndpointConnections value. */ List privateEndpointConnections(); + /** + * Gets the serverlessComputeSettings property: Settings for serverless compute created in the workspace. + * + * @return the serverlessComputeSettings value. + */ + ServerlessComputeSettings serverlessComputeSettings(); + /** * Gets the sharedPrivateLinkResources property: The list of shared private link resources in this workspace. - * + * * @return the sharedPrivateLinkResources value. */ List sharedPrivateLinkResources(); /** * Gets the notebookInfo property: The notebook info of Azure ML workspace. - * + * * @return the notebookInfo value. */ NotebookResourceInfo notebookInfo(); /** * Gets the serviceManagedResourcesSettings property: The service managed resource settings. - * + * * @return the serviceManagedResourcesSettings value. */ ServiceManagedResourcesSettings serviceManagedResourcesSettings(); @@ -159,14 +168,14 @@ public interface WorkspaceProperties { /** * Gets the primaryUserAssignedIdentity property: The user assigned identity resource id that represents the * workspace identity. - * + * * @return the primaryUserAssignedIdentity value. */ String primaryUserAssignedIdentity(); /** * Gets the tenantId property: The tenant id associated with this workspace. - * + * * @return the tenantId value. */ String tenantId(); @@ -174,7 +183,7 @@ public interface WorkspaceProperties { /** * Gets the storageHnsEnabled property: If the storage associated with the workspace has hierarchical namespace(HNS) * enabled. - * + * * @return the storageHnsEnabled value. */ Boolean storageHnsEnabled(); @@ -182,7 +191,7 @@ public interface WorkspaceProperties { /** * Gets the mlFlowTrackingUri property: The URI associated with this workspace that machine learning flow must point * at to set up tracking. - * + * * @return the mlFlowTrackingUri value. */ String mlFlowTrackingUri(); @@ -190,14 +199,56 @@ public interface WorkspaceProperties { /** * Gets the v1LegacyMode property: Enabling v1_legacy_mode may prevent you from using features provided by the v2 * API. - * + * * @return the v1LegacyMode value. */ Boolean v1LegacyMode(); + /** + * Gets the managedNetwork property: Managed Network settings for a machine learning workspace. + * + * @return the managedNetwork value. + */ + ManagedNetworkSettings managedNetwork(); + + /** + * Gets the featureStoreSettings property: Settings for feature store type workspace. + * + * @return the featureStoreSettings value. + */ + FeatureStoreSettings featureStoreSettings(); + + /** + * Gets the associatedWorkspaces property: The associatedWorkspaces property. + * + * @return the associatedWorkspaces value. + */ + List associatedWorkspaces(); + + /** + * Gets the enableDataIsolation property: The enableDataIsolation property. + * + * @return the enableDataIsolation value. + */ + Boolean enableDataIsolation(); + + /** + * Gets the hubResourceId property: The hubResourceId property. + * + * @return the hubResourceId value. + */ + String hubResourceId(); + + /** + * Gets the workspaceHubConfig property: WorkspaceHub's configuration object. + * + * @return the workspaceHubConfig value. + */ + WorkspaceHubConfig workspaceHubConfig(); + /** * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.WorkspacePropertiesInner object. - * + * * @return the inner object. */ WorkspacePropertiesInner innerModel(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspacePropertiesUpdateParameters.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspacePropertiesUpdateParameters.java new file mode 100644 index 0000000000000..08fc15798bd3d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspacePropertiesUpdateParameters.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.models; + +import com.azure.resourcemanager.machinelearning.fluent.models.WorkspacePropertiesUpdateParametersInner; + +/** + * An immutable client-side representation of WorkspacePropertiesUpdateParameters. + */ +public interface WorkspacePropertiesUpdateParameters { + /** + * Gets the description property: The description of this workspace. + * + * @return the description value. + */ + String description(); + + /** + * Gets the friendlyName property: The friendly name for this workspace. + * + * @return the friendlyName value. + */ + String friendlyName(); + + /** + * Gets the imageBuildCompute property: The compute name for image build. + * + * @return the imageBuildCompute value. + */ + String imageBuildCompute(); + + /** + * Gets the serviceManagedResourcesSettings property: The service managed resource settings. + * + * @return the serviceManagedResourcesSettings value. + */ + ServiceManagedResourcesSettings serviceManagedResourcesSettings(); + + /** + * Gets the primaryUserAssignedIdentity property: The user assigned identity resource id that represents the + * workspace identity. + * + * @return the primaryUserAssignedIdentity value. + */ + String primaryUserAssignedIdentity(); + + /** + * Gets the serverlessComputeSettings property: Settings for serverless compute created in the workspace. + * + * @return the serverlessComputeSettings value. + */ + ServerlessComputeSettings serverlessComputeSettings(); + + /** + * Gets the publicNetworkAccess property: Whether requests from Public Network are allowed. + * + * @return the publicNetworkAccess value. + */ + PublicNetworkAccess publicNetworkAccess(); + + /** + * Gets the applicationInsights property: ARM id of the application insights associated with this workspace. + * + * @return the applicationInsights value. + */ + String applicationInsights(); + + /** + * Gets the containerRegistry property: ARM id of the container registry associated with this workspace. + * + * @return the containerRegistry value. + */ + String containerRegistry(); + + /** + * Gets the featureStoreSettings property: Settings for feature store type workspace. + * + * @return the featureStoreSettings value. + */ + FeatureStoreSettings featureStoreSettings(); + + /** + * Gets the managedNetwork property: Managed Network settings for a machine learning workspace. + * + * @return the managedNetwork value. + */ + ManagedNetworkSettings managedNetwork(); + + /** + * Gets the enableDataIsolation property: The enableDataIsolation property. + * + * @return the enableDataIsolation value. + */ + Boolean enableDataIsolation(); + + /** + * Gets the v1LegacyMode property: Enabling v1_legacy_mode may prevent you from using features provided by the v2 + * API. + * + * @return the v1LegacyMode value. + */ + Boolean v1LegacyMode(); + + /** + * Gets the encryption property: The encryption property. + * + * @return the encryption value. + */ + EncryptionUpdateProperties encryption(); + + /** + * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.WorkspacePropertiesUpdateParametersInner + * object. + * + * @return the inner object. + */ + WorkspacePropertiesUpdateParametersInner innerModel(); +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceUpdateParameters.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceUpdateParameters.java index 7d7ada04b8eed..80ad045e321bf 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceUpdateParameters.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/WorkspaceUpdateParameters.java @@ -4,314 +4,138 @@ package com.azure.resourcemanager.machinelearning.models; -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.machinelearning.fluent.models.WorkspacePropertiesUpdateParameters; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.resourcemanager.machinelearning.fluent.models.WorkspaceUpdateParametersInner; import java.util.Map; -/** The parameters for updating a machine learning workspace. */ -@Fluent -public final class WorkspaceUpdateParameters { - /* - * The resource tags for the machine learning workspace. - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - - /* - * The sku of the workspace. - */ - @JsonProperty(value = "sku") - private Sku sku; - - /* - * The identity of the resource. - */ - @JsonProperty(value = "identity") - private ManagedServiceIdentity identity; - - /* - * The properties that the machine learning workspace will be updated with. - */ - @JsonProperty(value = "properties") - private WorkspacePropertiesUpdateParameters innerProperties; - - /** Creates an instance of WorkspaceUpdateParameters class. */ - public WorkspaceUpdateParameters() { - } - +/** + * An immutable client-side representation of WorkspaceUpdateParameters. + */ +public interface WorkspaceUpdateParameters { /** - * Get the tags property: The resource tags for the machine learning workspace. - * + * Gets the tags property: The resource tags for the machine learning workspace. + * * @return the tags value. */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: The resource tags for the machine learning workspace. - * - * @param tags the tags value to set. - * @return the WorkspaceUpdateParameters object itself. - */ - public WorkspaceUpdateParameters withTags(Map tags) { - this.tags = tags; - return this; - } + Map tags(); /** - * Get the sku property: The sku of the workspace. - * + * Gets the sku property: The sku of the workspace. + * * @return the sku value. */ - public Sku sku() { - return this.sku; - } - - /** - * Set the sku property: The sku of the workspace. - * - * @param sku the sku value to set. - * @return the WorkspaceUpdateParameters object itself. - */ - public WorkspaceUpdateParameters withSku(Sku sku) { - this.sku = sku; - return this; - } + Sku sku(); /** - * Get the identity property: The identity of the resource. - * + * Gets the identity property: The identity of the resource. + * * @return the identity value. */ - public ManagedServiceIdentity identity() { - return this.identity; - } - - /** - * Set the identity property: The identity of the resource. - * - * @param identity the identity value to set. - * @return the WorkspaceUpdateParameters object itself. - */ - public WorkspaceUpdateParameters withIdentity(ManagedServiceIdentity identity) { - this.identity = identity; - return this; - } - - /** - * Get the innerProperties property: The properties that the machine learning workspace will be updated with. - * - * @return the innerProperties value. - */ - private WorkspacePropertiesUpdateParameters innerProperties() { - return this.innerProperties; - } + ManagedServiceIdentity identity(); /** - * Get the description property: The description of this workspace. - * + * Gets the description property: The description of this workspace. + * * @return the description value. */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } + String description(); /** - * Set the description property: The description of this workspace. - * - * @param description the description value to set. - * @return the WorkspaceUpdateParameters object itself. - */ - public WorkspaceUpdateParameters withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkspacePropertiesUpdateParameters(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the friendlyName property: The friendly name for this workspace. - * + * Gets the friendlyName property: The friendly name for this workspace. + * * @return the friendlyName value. */ - public String friendlyName() { - return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); - } - - /** - * Set the friendlyName property: The friendly name for this workspace. - * - * @param friendlyName the friendlyName value to set. - * @return the WorkspaceUpdateParameters object itself. - */ - public WorkspaceUpdateParameters withFriendlyName(String friendlyName) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkspacePropertiesUpdateParameters(); - } - this.innerProperties().withFriendlyName(friendlyName); - return this; - } + String friendlyName(); /** - * Get the imageBuildCompute property: The compute name for image build. - * + * Gets the imageBuildCompute property: The compute name for image build. + * * @return the imageBuildCompute value. */ - public String imageBuildCompute() { - return this.innerProperties() == null ? null : this.innerProperties().imageBuildCompute(); - } + String imageBuildCompute(); /** - * Set the imageBuildCompute property: The compute name for image build. - * - * @param imageBuildCompute the imageBuildCompute value to set. - * @return the WorkspaceUpdateParameters object itself. + * Gets the serviceManagedResourcesSettings property: The service managed resource settings. + * + * @return the serviceManagedResourcesSettings value. */ - public WorkspaceUpdateParameters withImageBuildCompute(String imageBuildCompute) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkspacePropertiesUpdateParameters(); - } - this.innerProperties().withImageBuildCompute(imageBuildCompute); - return this; - } + ServiceManagedResourcesSettings serviceManagedResourcesSettings(); /** - * Get the serviceManagedResourcesSettings property: The service managed resource settings. - * - * @return the serviceManagedResourcesSettings value. + * Gets the primaryUserAssignedIdentity property: The user assigned identity resource id that represents the + * workspace identity. + * + * @return the primaryUserAssignedIdentity value. */ - public ServiceManagedResourcesSettings serviceManagedResourcesSettings() { - return this.innerProperties() == null ? null : this.innerProperties().serviceManagedResourcesSettings(); - } + String primaryUserAssignedIdentity(); /** - * Set the serviceManagedResourcesSettings property: The service managed resource settings. - * - * @param serviceManagedResourcesSettings the serviceManagedResourcesSettings value to set. - * @return the WorkspaceUpdateParameters object itself. + * Gets the serverlessComputeSettings property: Settings for serverless compute created in the workspace. + * + * @return the serverlessComputeSettings value. */ - public WorkspaceUpdateParameters withServiceManagedResourcesSettings( - ServiceManagedResourcesSettings serviceManagedResourcesSettings) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkspacePropertiesUpdateParameters(); - } - this.innerProperties().withServiceManagedResourcesSettings(serviceManagedResourcesSettings); - return this; - } + ServerlessComputeSettings serverlessComputeSettings(); /** - * Get the primaryUserAssignedIdentity property: The user assigned identity resource id that represents the - * workspace identity. - * - * @return the primaryUserAssignedIdentity value. + * Gets the publicNetworkAccess property: Whether requests from Public Network are allowed. + * + * @return the publicNetworkAccess value. */ - public String primaryUserAssignedIdentity() { - return this.innerProperties() == null ? null : this.innerProperties().primaryUserAssignedIdentity(); - } + PublicNetworkAccess publicNetworkAccess(); /** - * Set the primaryUserAssignedIdentity property: The user assigned identity resource id that represents the - * workspace identity. - * - * @param primaryUserAssignedIdentity the primaryUserAssignedIdentity value to set. - * @return the WorkspaceUpdateParameters object itself. + * Gets the applicationInsights property: ARM id of the application insights associated with this workspace. + * + * @return the applicationInsights value. */ - public WorkspaceUpdateParameters withPrimaryUserAssignedIdentity(String primaryUserAssignedIdentity) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkspacePropertiesUpdateParameters(); - } - this.innerProperties().withPrimaryUserAssignedIdentity(primaryUserAssignedIdentity); - return this; - } + String applicationInsights(); /** - * Get the publicNetworkAccess property: Whether requests from Public Network are allowed. - * - * @return the publicNetworkAccess value. + * Gets the containerRegistry property: ARM id of the container registry associated with this workspace. + * + * @return the containerRegistry value. */ - public PublicNetworkAccess publicNetworkAccess() { - return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); - } + String containerRegistry(); /** - * Set the publicNetworkAccess property: Whether requests from Public Network are allowed. - * - * @param publicNetworkAccess the publicNetworkAccess value to set. - * @return the WorkspaceUpdateParameters object itself. + * Gets the featureStoreSettings property: Settings for feature store type workspace. + * + * @return the featureStoreSettings value. */ - public WorkspaceUpdateParameters withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkspacePropertiesUpdateParameters(); - } - this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); - return this; - } + FeatureStoreSettings featureStoreSettings(); /** - * Get the applicationInsights property: ARM id of the application insights associated with this workspace. - * - * @return the applicationInsights value. + * Gets the managedNetwork property: Managed Network settings for a machine learning workspace. + * + * @return the managedNetwork value. */ - public String applicationInsights() { - return this.innerProperties() == null ? null : this.innerProperties().applicationInsights(); - } + ManagedNetworkSettings managedNetwork(); /** - * Set the applicationInsights property: ARM id of the application insights associated with this workspace. - * - * @param applicationInsights the applicationInsights value to set. - * @return the WorkspaceUpdateParameters object itself. + * Gets the enableDataIsolation property: The enableDataIsolation property. + * + * @return the enableDataIsolation value. */ - public WorkspaceUpdateParameters withApplicationInsights(String applicationInsights) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkspacePropertiesUpdateParameters(); - } - this.innerProperties().withApplicationInsights(applicationInsights); - return this; - } + Boolean enableDataIsolation(); /** - * Get the containerRegistry property: ARM id of the container registry associated with this workspace. - * - * @return the containerRegistry value. + * Gets the v1LegacyMode property: Enabling v1_legacy_mode may prevent you from using features provided by the v2 + * API. + * + * @return the v1LegacyMode value. */ - public String containerRegistry() { - return this.innerProperties() == null ? null : this.innerProperties().containerRegistry(); - } + Boolean v1LegacyMode(); /** - * Set the containerRegistry property: ARM id of the container registry associated with this workspace. - * - * @param containerRegistry the containerRegistry value to set. - * @return the WorkspaceUpdateParameters object itself. + * Gets the encryption property: The encryption property. + * + * @return the encryption value. */ - public WorkspaceUpdateParameters withContainerRegistry(String containerRegistry) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkspacePropertiesUpdateParameters(); - } - this.innerProperties().withContainerRegistry(containerRegistry); - return this; - } + EncryptionUpdateProperties encryption(); /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. + * Gets the inner com.azure.resourcemanager.machinelearning.fluent.models.WorkspaceUpdateParametersInner object. + * + * @return the inner object. */ - public void validate() { - if (sku() != null) { - sku().validate(); - } - if (identity() != null) { - identity().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - } + WorkspaceUpdateParametersInner innerModel(); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Workspaces.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Workspaces.java index 3d21925cc55f9..f80403ae6d760 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Workspaces.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/Workspaces.java @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Workspaces. */ +/** + * Resource collection API of Workspaces. + */ public interface Workspaces { /** * Gets the properties of the specified machine learning workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -25,7 +27,7 @@ public interface Workspaces { /** * Gets the properties of the specified machine learning workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -37,56 +39,57 @@ public interface Workspaces { /** * Deletes a machine learning workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void deleteByResourceGroup(String resourceGroupName, String workspaceName); + void delete(String resourceGroupName, String workspaceName); /** * Deletes a machine learning workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. + * @param forceToPurge Flag to indicate delete is a purge request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void delete(String resourceGroupName, String workspaceName, Context context); + void delete(String resourceGroupName, String workspaceName, Boolean forceToPurge, Context context); /** * Lists all the available machine learning workspaces under the specified resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list machine learning workspaces as paginated response with {@link - * PagedIterable}. + * @return the result of a request to list machine learning workspaces as paginated response with + * {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); /** * Lists all the available machine learning workspaces under the specified resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param skip Continuation token for pagination. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list machine learning workspaces as paginated response with {@link - * PagedIterable}. + * @return the result of a request to list machine learning workspaces as paginated response with + * {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, String skip, Context context); /** * Diagnose workspace setup issue. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -98,7 +101,7 @@ public interface Workspaces { /** * Diagnose workspace setup issue. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param parameters The parameter of diagnosing workspace health. @@ -108,13 +111,13 @@ public interface Workspaces { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ - DiagnoseResponseResult diagnose( - String resourceGroupName, String workspaceName, DiagnoseWorkspaceParameters parameters, Context context); + DiagnoseResponseResult diagnose(String resourceGroupName, String workspaceName, + DiagnoseWorkspaceParameters parameters, Context context); /** * Lists all the keys associated with this workspace. This includes keys for the storage account, app insights and * password for container registry. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -123,13 +126,13 @@ DiagnoseResponseResult diagnose( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response body along with {@link Response}. */ - Response listKeysWithResponse( - String resourceGroupName, String workspaceName, Context context); + Response listKeysWithResponse(String resourceGroupName, String workspaceName, + Context context); /** * Lists all the keys associated with this workspace. This includes keys for the storage account, app insights and * password for container registry. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -142,7 +145,7 @@ Response listKeysWithResponse( /** * Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and * password for container registry. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -154,7 +157,7 @@ Response listKeysWithResponse( /** * Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and * password for container registry. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -166,30 +169,30 @@ Response listKeysWithResponse( /** * Lists all the available machine learning workspaces under the specified subscription. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list machine learning workspaces as paginated response with {@link - * PagedIterable}. + * @return the result of a request to list machine learning workspaces as paginated response with + * {@link PagedIterable}. */ PagedIterable list(); /** * Lists all the available machine learning workspaces under the specified subscription. - * + * * @param skip Continuation token for pagination. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list machine learning workspaces as paginated response with {@link - * PagedIterable}. + * @return the result of a request to list machine learning workspaces as paginated response with + * {@link PagedIterable}. */ PagedIterable list(String skip, Context context); /** * return notebook access token and refresh token. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -198,12 +201,12 @@ Response listKeysWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response body along with {@link Response}. */ - Response listNotebookAccessTokenWithResponse( - String resourceGroupName, String workspaceName, Context context); + Response listNotebookAccessTokenWithResponse(String resourceGroupName, + String workspaceName, Context context); /** * return notebook access token and refresh token. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -215,7 +218,7 @@ Response listNotebookAccessTokenWithResponse( /** * Prepare a notebook. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -227,7 +230,7 @@ Response listNotebookAccessTokenWithResponse( /** * Prepare a notebook. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -240,7 +243,7 @@ Response listNotebookAccessTokenWithResponse( /** * List storage account keys of a workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -249,12 +252,12 @@ Response listNotebookAccessTokenWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response body along with {@link Response}. */ - Response listStorageAccountKeysWithResponse( - String resourceGroupName, String workspaceName, Context context); + Response listStorageAccountKeysWithResponse(String resourceGroupName, + String workspaceName, Context context); /** * List storage account keys of a workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -266,7 +269,7 @@ Response listStorageAccountKeysWithResponse( /** * List keys of a notebook. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -275,12 +278,12 @@ Response listStorageAccountKeysWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response body along with {@link Response}. */ - Response listNotebookKeysWithResponse( - String resourceGroupName, String workspaceName, Context context); + Response listNotebookKeysWithResponse(String resourceGroupName, String workspaceName, + Context context); /** * List keys of a notebook. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -292,7 +295,7 @@ Response listNotebookKeysWithResponse( /** * Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @param context The context to associate with this operation. @@ -301,12 +304,12 @@ Response listNotebookKeysWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response body along with {@link Response}. */ - Response listOutboundNetworkDependenciesEndpointsWithResponse( - String resourceGroupName, String workspaceName, Context context); + Response listOutboundNetworkDependenciesEndpointsWithResponse(String resourceGroupName, + String workspaceName, Context context); /** * Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName Name of Azure Machine Learning workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -318,7 +321,7 @@ Response listOutboundNetworkDependenciesEndpointsWithRespo /** * Gets the properties of the specified machine learning workspace. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -329,7 +332,7 @@ Response listOutboundNetworkDependenciesEndpointsWithRespo /** * Gets the properties of the specified machine learning workspace. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -341,7 +344,7 @@ Response listOutboundNetworkDependenciesEndpointsWithRespo /** * Deletes a machine learning workspace. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -351,18 +354,19 @@ Response listOutboundNetworkDependenciesEndpointsWithRespo /** * Deletes a machine learning workspace. - * + * * @param id the resource ID. + * @param forceToPurge Flag to indicate delete is a purge request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void deleteByIdWithResponse(String id, Context context); + void deleteByIdWithResponse(String id, Boolean forceToPurge, Context context); /** * Begins definition for a new Workspace resource. - * + * * @param name resource name. * @return the first stage of the new Workspace definition. */ diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/package-info.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/package-info.java index 2577043eada6c..6818156717e73 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/package-info.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/models/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the data models for AzureMachineLearningWorkspaces. These APIs allow end users to operate on Azure - * Machine Learning Workspace resources. + * Package containing the data models for AzureMachineLearningServices. + * These APIs allow end users to operate on Azure Machine Learning Workspace resources. */ package com.azure.resourcemanager.machinelearning.models; diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/package-info.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/package-info.java index a318a1e7d76bb..952b21346248a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/package-info.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/com/azure/resourcemanager/machinelearning/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the classes for AzureMachineLearningWorkspaces. These APIs allow end users to operate on Azure - * Machine Learning Workspace resources. + * Package containing the classes for AzureMachineLearningServices. + * These APIs allow end users to operate on Azure Machine Learning Workspace resources. */ package com.azure.resourcemanager.machinelearning; diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/module-info.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/module-info.java index dd9aa25ecf834..5083061c7b6e7 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/module-info.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/java/module-info.java @@ -4,16 +4,10 @@ module com.azure.resourcemanager.machinelearning { requires transitive com.azure.core.management; - exports com.azure.resourcemanager.machinelearning; exports com.azure.resourcemanager.machinelearning.fluent; exports com.azure.resourcemanager.machinelearning.fluent.models; exports com.azure.resourcemanager.machinelearning.models; - - opens com.azure.resourcemanager.machinelearning.fluent.models to - com.azure.core, - com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.machinelearning.models to - com.azure.core, - com.fasterxml.jackson.databind; -} + opens com.azure.resourcemanager.machinelearning.fluent.models to com.azure.core, com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.machinelearning.models to com.azure.core, com.fasterxml.jackson.databind; +} \ No newline at end of file diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-machinelearning/proxy-config.json b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-machinelearning/proxy-config.json new file mode 100644 index 0000000000000..5a3fc479ca6cd --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-machinelearning/proxy-config.json @@ -0,0 +1 @@ +[ [ "com.azure.resourcemanager.machinelearning.implementation.BatchDeploymentsClientImpl$BatchDeploymentsService" ], [ "com.azure.resourcemanager.machinelearning.implementation.BatchEndpointsClientImpl$BatchEndpointsService" ], [ "com.azure.resourcemanager.machinelearning.implementation.CodeContainersClientImpl$CodeContainersService" ], [ "com.azure.resourcemanager.machinelearning.implementation.CodeVersionsClientImpl$CodeVersionsService" ], [ "com.azure.resourcemanager.machinelearning.implementation.ComponentContainersClientImpl$ComponentContainersService" ], [ "com.azure.resourcemanager.machinelearning.implementation.ComponentVersionsClientImpl$ComponentVersionsService" ], [ "com.azure.resourcemanager.machinelearning.implementation.ComputesClientImpl$ComputesService" ], [ "com.azure.resourcemanager.machinelearning.implementation.DataContainersClientImpl$DataContainersService" ], [ "com.azure.resourcemanager.machinelearning.implementation.DataVersionsClientImpl$DataVersionsService" ], [ "com.azure.resourcemanager.machinelearning.implementation.DatastoresClientImpl$DatastoresService" ], [ "com.azure.resourcemanager.machinelearning.implementation.EnvironmentContainersClientImpl$EnvironmentContainersService" ], [ "com.azure.resourcemanager.machinelearning.implementation.EnvironmentVersionsClientImpl$EnvironmentVersionsService" ], [ "com.azure.resourcemanager.machinelearning.implementation.FeaturesClientImpl$FeaturesService" ], [ "com.azure.resourcemanager.machinelearning.implementation.FeaturesetContainersClientImpl$FeaturesetContainersService" ], [ "com.azure.resourcemanager.machinelearning.implementation.FeaturesetVersionsClientImpl$FeaturesetVersionsService" ], [ "com.azure.resourcemanager.machinelearning.implementation.FeaturestoreEntityContainersClientImpl$FeaturestoreEntityContainersService" ], [ "com.azure.resourcemanager.machinelearning.implementation.FeaturestoreEntityVersionsClientImpl$FeaturestoreEntityVersionsService" ], [ "com.azure.resourcemanager.machinelearning.implementation.JobsClientImpl$JobsService" ], [ "com.azure.resourcemanager.machinelearning.implementation.ManagedNetworkProvisionsClientImpl$ManagedNetworkProvisionsService" ], [ "com.azure.resourcemanager.machinelearning.implementation.ManagedNetworkSettingsRulesClientImpl$ManagedNetworkSettingsRulesService" ], [ "com.azure.resourcemanager.machinelearning.implementation.MarketplaceSubscriptionsClientImpl$MarketplaceSubscriptionsService" ], [ "com.azure.resourcemanager.machinelearning.implementation.ModelContainersClientImpl$ModelContainersService" ], [ "com.azure.resourcemanager.machinelearning.implementation.ModelVersionsClientImpl$ModelVersionsService" ], [ "com.azure.resourcemanager.machinelearning.implementation.OnlineDeploymentsClientImpl$OnlineDeploymentsService" ], [ "com.azure.resourcemanager.machinelearning.implementation.OnlineEndpointsClientImpl$OnlineEndpointsService" ], [ "com.azure.resourcemanager.machinelearning.implementation.OperationsClientImpl$OperationsService" ], [ "com.azure.resourcemanager.machinelearning.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService" ], [ "com.azure.resourcemanager.machinelearning.implementation.PrivateLinkResourcesClientImpl$PrivateLinkResourcesService" ], [ "com.azure.resourcemanager.machinelearning.implementation.QuotasClientImpl$QuotasService" ], [ "com.azure.resourcemanager.machinelearning.implementation.RegistriesClientImpl$RegistriesService" ], [ "com.azure.resourcemanager.machinelearning.implementation.RegistryCodeContainersClientImpl$RegistryCodeContainersService" ], [ "com.azure.resourcemanager.machinelearning.implementation.RegistryCodeVersionsClientImpl$RegistryCodeVersionsService" ], [ "com.azure.resourcemanager.machinelearning.implementation.RegistryComponentContainersClientImpl$RegistryComponentContainersService" ], [ "com.azure.resourcemanager.machinelearning.implementation.RegistryComponentVersionsClientImpl$RegistryComponentVersionsService" ], [ "com.azure.resourcemanager.machinelearning.implementation.RegistryDataContainersClientImpl$RegistryDataContainersService" ], [ "com.azure.resourcemanager.machinelearning.implementation.RegistryDataReferencesClientImpl$RegistryDataReferencesService" ], [ "com.azure.resourcemanager.machinelearning.implementation.RegistryDataVersionsClientImpl$RegistryDataVersionsService" ], [ "com.azure.resourcemanager.machinelearning.implementation.RegistryEnvironmentContainersClientImpl$RegistryEnvironmentContainersService" ], [ "com.azure.resourcemanager.machinelearning.implementation.RegistryEnvironmentVersionsClientImpl$RegistryEnvironmentVersionsService" ], [ "com.azure.resourcemanager.machinelearning.implementation.RegistryModelContainersClientImpl$RegistryModelContainersService" ], [ "com.azure.resourcemanager.machinelearning.implementation.RegistryModelVersionsClientImpl$RegistryModelVersionsService" ], [ "com.azure.resourcemanager.machinelearning.implementation.SchedulesClientImpl$SchedulesService" ], [ "com.azure.resourcemanager.machinelearning.implementation.ServerlessEndpointsClientImpl$ServerlessEndpointsService" ], [ "com.azure.resourcemanager.machinelearning.implementation.UsagesClientImpl$UsagesService" ], [ "com.azure.resourcemanager.machinelearning.implementation.VirtualMachineSizesClientImpl$VirtualMachineSizesService" ], [ "com.azure.resourcemanager.machinelearning.implementation.WorkspaceConnectionsClientImpl$WorkspaceConnectionsService" ], [ "com.azure.resourcemanager.machinelearning.implementation.WorkspaceFeaturesClientImpl$WorkspaceFeaturesService" ], [ "com.azure.resourcemanager.machinelearning.implementation.WorkspacesClientImpl$WorkspacesService" ] ] \ No newline at end of file diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-machinelearning/reflect-config.json b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-machinelearning/reflect-config.json new file mode 100644 index 0000000000000..8878e547a7984 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-machinelearning/reflect-config.json @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsCreateOrUpdateSamples.java index fb21453d26444..966a042df7da3 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsCreateOrUpdateSamples.java @@ -23,69 +23,61 @@ import java.util.HashMap; import java.util.Map; -/** Samples for BatchDeployments CreateOrUpdate. */ +/** + * Samples for BatchDeployments CreateOrUpdate. + */ public final class BatchDeploymentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchDeployment/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/BatchDeployment/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Batch Deployment. - * + * Sample code: CreateOrUpdate Workspace Batch Deployment. + * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateBatchDeployment( + public static void createOrUpdateWorkspaceBatchDeployment( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) throws IOException { - manager - .batchDeployments() + manager.batchDeployments() .define("testDeploymentName") .withRegion("string") .withExistingBatchEndpoint("test-rg", "my-aml-workspace", "testEndpointName") - .withProperties( - new BatchDeploymentProperties() - .withCodeConfiguration( - new CodeConfiguration().withCodeId("fakeTokenPlaceholder").withScoringScript("string")) - .withDescription("string") - .withEnvironmentId("string") - .withEnvironmentVariables(mapOf("string", "string")) - .withProperties(mapOf("string", "string")) - .withCompute("string") - .withErrorThreshold(1) - .withLoggingLevel(BatchLoggingLevel.INFO) - .withMaxConcurrencyPerInstance(1) - .withMiniBatchSize(1L) - .withModel(new IdAssetReference().withAssetId("string")) - .withOutputAction(BatchOutputAction.SUMMARY_ONLY) - .withOutputFileName("string") - .withResources( - new DeploymentResourceConfiguration() - .withInstanceCount(1) - .withInstanceType("string") - .withProperties( - mapOf( - "string", - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"cd3c37dc-2876-4ca4-8a54-21bd7619724a\":null}", - Object.class, - SerializerEncoding.JSON)))) - .withRetrySettings(new BatchRetrySettings().withMaxRetries(1).withTimeout(Duration.parse("PT5M")))) + .withProperties(new BatchDeploymentProperties() + .withCodeConfiguration( + new CodeConfiguration().withCodeId("fakeTokenPlaceholder").withScoringScript("string")) + .withDescription("string") + .withEnvironmentId("string") + .withEnvironmentVariables(mapOf("string", "string")) + .withProperties(mapOf("string", "string")) + .withCompute("string") + .withErrorThreshold(1) + .withLoggingLevel(BatchLoggingLevel.INFO) + .withMaxConcurrencyPerInstance(1) + .withMiniBatchSize(1L) + .withModel(new IdAssetReference().withAssetId("string")) + .withOutputAction(BatchOutputAction.SUMMARY_ONLY) + .withOutputFileName("string") + .withResources(new DeploymentResourceConfiguration().withInstanceCount(1) + .withInstanceType("string") + .withProperties(mapOf("string", + SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"cd3c37dc-2876-4ca4-8a54-21bd7619724a\":null}", Object.class, + SerializerEncoding.JSON)))) + .withRetrySettings(new BatchRetrySettings().withMaxRetries(1).withTimeout(Duration.parse("PT5M")))) .withTags(mapOf()) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) .withKind("string") - .withSku( - new Sku() - .withName("string") - .withTier(SkuTier.FREE) - .withSize("string") - .withFamily("string") - .withCapacity(1)) + .withSku(new Sku().withName("string") + .withTier(SkuTier.FREE) + .withSize("string") + .withFamily("string") + .withCapacity(1)) .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsDeleteSamples.java index 7b39c6096d2c9..d7b755d82f7c5 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsDeleteSamples.java @@ -4,24 +4,24 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for BatchDeployments Delete. */ +/** + * Samples for BatchDeployments Delete. + */ public final class BatchDeploymentsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchDeployment/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/BatchDeployment/delete.json */ /** - * Sample code: Delete Batch Deployment. - * + * Sample code: Delete Workspace Batch Deployment. + * * @param manager Entry point to MachineLearningManager. */ - public static void deleteBatchDeployment(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .batchDeployments() - .delete( - "test-rg", - "my-aml-workspace", - "testEndpointName", - "testDeploymentName", + public static void + deleteWorkspaceBatchDeployment(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.batchDeployments() + .delete("test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsGetSamples.java index c1b47f7e527f9..f3de7ac7c261c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsGetSamples.java @@ -4,24 +4,24 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for BatchDeployments Get. */ +/** + * Samples for BatchDeployments Get. + */ public final class BatchDeploymentsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchDeployment/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/BatchDeployment/get.json */ /** - * Sample code: Get Batch Deployment. - * + * Sample code: Get Workspace Batch Deployment. + * * @param manager Entry point to MachineLearningManager. */ - public static void getBatchDeployment(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .batchDeployments() - .getWithResponse( - "test-rg", - "my-aml-workspace", - "testEndpointName", - "testDeploymentName", + public static void + getWorkspaceBatchDeployment(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.batchDeployments() + .getWithResponse("test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsListSamples.java index b5fff0eb963bb..6c18a9f1681a1 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsListSamples.java @@ -4,20 +4,24 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for BatchDeployments List. */ +/** + * Samples for BatchDeployments List. + */ public final class BatchDeploymentsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchDeployment/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/BatchDeployment/list.json */ /** - * Sample code: List Batch Deployment. - * + * Sample code: List Workspace Batch Deployment. + * * @param manager Entry point to MachineLearningManager. */ - public static void listBatchDeployment(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .batchDeployments() - .list( - "test-rg", "my-aml-workspace", "testEndpointName", "string", 1, null, com.azure.core.util.Context.NONE); + public static void + listWorkspaceBatchDeployment(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.batchDeployments() + .list("test-rg", "my-aml-workspace", "testEndpointName", "string", 1, null, + com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsUpdateSamples.java index 847ffdcac6c71..b623317287127 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsUpdateSamples.java @@ -9,34 +9,33 @@ import java.util.HashMap; import java.util.Map; -/** Samples for BatchDeployments Update. */ +/** + * Samples for BatchDeployments Update. + */ public final class BatchDeploymentsUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchDeployment/update.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/BatchDeployment/update.json */ /** - * Sample code: Update Batch Deployment. - * + * Sample code: Update Workspace Batch Deployment. + * * @param manager Entry point to MachineLearningManager. */ - public static void updateBatchDeployment(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - BatchDeployment resource = - manager - .batchDeployments() - .getWithResponse( - "test-rg", - "my-aml-workspace", - "testEndpointName", - "testDeploymentName", - com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + public static void + updateWorkspaceBatchDeployment(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + BatchDeployment resource = manager.batchDeployments() + .getWithResponse("test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf()) .withProperties(new PartialBatchDeployment().withDescription("string")) .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsCreateOrUpdateSamples.java index 456f30a703bec..6e43a11d35a49 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsCreateOrUpdateSamples.java @@ -15,45 +15,43 @@ import java.util.HashMap; import java.util.Map; -/** Samples for BatchEndpoints CreateOrUpdate. */ +/** + * Samples for BatchEndpoints CreateOrUpdate. + */ public final class BatchEndpointsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchEndpoint/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/BatchEndpoint/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Batch Endpoint. - * + * Sample code: CreateOrUpdate Workspace Batch Endpoint. + * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateBatchEndpoint( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .batchEndpoints() + public static void + createOrUpdateWorkspaceBatchEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.batchEndpoints() .define("testEndpointName") .withRegion("string") .withExistingWorkspace("test-rg", "my-aml-workspace") - .withProperties( - new BatchEndpointProperties() - .withAuthMode(EndpointAuthMode.AMLTOKEN) - .withDescription("string") - .withProperties(mapOf("string", "string")) - .withDefaults(new BatchEndpointDefaults().withDeploymentName("string"))) + .withProperties(new BatchEndpointProperties().withAuthMode(EndpointAuthMode.AMLTOKEN) + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withDefaults(new BatchEndpointDefaults().withDeploymentName("string"))) .withTags(mapOf()) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) .withKind("string") - .withSku( - new Sku() - .withName("string") - .withTier(SkuTier.FREE) - .withSize("string") - .withFamily("string") - .withCapacity(1)) + .withSku(new Sku().withName("string") + .withTier(SkuTier.FREE) + .withSize("string") + .withFamily("string") + .withCapacity(1)) .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsDeleteSamples.java index 6456c727fcc49..e7902b65fbc86 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsDeleteSamples.java @@ -4,19 +4,23 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for BatchEndpoints Delete. */ +/** + * Samples for BatchEndpoints Delete. + */ public final class BatchEndpointsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchEndpoint/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/BatchEndpoint/delete.json */ /** - * Sample code: Delete Batch Endpoint. - * + * Sample code: Delete Workspace Batch Endpoint. + * * @param manager Entry point to MachineLearningManager. */ - public static void deleteBatchEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .batchEndpoints() + public static void + deleteWorkspaceBatchEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.batchEndpoints() .delete("resourceGroup-1234", "testworkspace", "testBatchEndpoint", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsGetSamples.java index 9daf7b13cfeef..6a33d20fc7e06 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsGetSamples.java @@ -4,19 +4,23 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for BatchEndpoints Get. */ +/** + * Samples for BatchEndpoints Get. + */ public final class BatchEndpointsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchEndpoint/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/BatchEndpoint/get.json */ /** - * Sample code: Get Batch Endpoint. - * + * Sample code: Get Workspace Batch Endpoint. + * * @param manager Entry point to MachineLearningManager. */ - public static void getBatchEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .batchEndpoints() + public static void + getWorkspaceBatchEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.batchEndpoints() .getWithResponse("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsListKeysSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsListKeysSamples.java index 5d0685fd73105..80de0a32e4b1c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsListKeysSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsListKeysSamples.java @@ -4,19 +4,23 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for BatchEndpoints ListKeys. */ +/** + * Samples for BatchEndpoints ListKeys. + */ public final class BatchEndpointsListKeysSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchEndpoint/listKeys.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/BatchEndpoint/listKeys.json */ /** - * Sample code: ListKeys Batch Endpoint. - * + * Sample code: ListKeys Workspace Batch Endpoint. + * * @param manager Entry point to MachineLearningManager. */ - public static void listKeysBatchEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .batchEndpoints() + public static void + listKeysWorkspaceBatchEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.batchEndpoints() .listKeysWithResponse("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsListSamples.java index 6ab315093f3db..c43258d132b85 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsListSamples.java @@ -4,17 +4,22 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for BatchEndpoints List. */ +/** + * Samples for BatchEndpoints List. + */ public final class BatchEndpointsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchEndpoint/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/BatchEndpoint/list.json */ /** - * Sample code: List Batch Endpoint. - * + * Sample code: List Workspace Batch Endpoint. + * * @param manager Entry point to MachineLearningManager. */ - public static void listBatchEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void + listWorkspaceBatchEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager.batchEndpoints().list("test-rg", "my-aml-workspace", 1, null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsUpdateSamples.java index 4a7fd23152fe1..05b946ec7c2ad 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsUpdateSamples.java @@ -13,38 +13,35 @@ import java.util.HashMap; import java.util.Map; -/** Samples for BatchEndpoints Update. */ +/** + * Samples for BatchEndpoints Update. + */ public final class BatchEndpointsUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchEndpoint/update.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/BatchEndpoint/update.json */ /** - * Sample code: Update Batch Endpoint. - * + * Sample code: Update Workspace Batch Endpoint. + * * @param manager Entry point to MachineLearningManager. */ - public static void updateBatchEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) - throws IOException { - BatchEndpoint resource = - manager - .batchEndpoints() - .getWithResponse("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + public static void updateWorkspaceBatchEndpoint( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) throws IOException { + BatchEndpoint resource = manager.batchEndpoints() + .getWithResponse("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf()) - .withIdentity( - new PartialManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities( - mapOf( - "string", - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize("{}", Object.class, SerializerEncoding.JSON)))) + .withIdentity(new PartialManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities(mapOf("string", + SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)))) .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersCreateOrUpdateSamples.java index 99ad6bdb20be5..5a5220596991b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersCreateOrUpdateSamples.java @@ -4,33 +4,35 @@ package com.azure.resourcemanager.machinelearning.generated; +import com.azure.resourcemanager.machinelearning.fluent.models.CodeContainerInner; import com.azure.resourcemanager.machinelearning.models.CodeContainerProperties; import java.util.HashMap; import java.util.Map; -/** Samples for CodeContainers CreateOrUpdate. */ +/** + * Samples for CodeContainers CreateOrUpdate. + */ public final class CodeContainersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeContainer/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/CodeContainer/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Code Container. - * + * Sample code: CreateOrUpdate Workspace Code Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateCodeContainer( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .codeContainers() - .define("testContainer") - .withExistingWorkspace("testrg123", "testworkspace") - .withProperties( - new CodeContainerProperties() - .withDescription("string") - .withTags(mapOf("tag1", "value1", "tag2", "value2"))) - .create(); + public static void + createOrUpdateWorkspaceCodeContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.codeContainers() + .createOrUpdateWithResponse("testrg123", "testworkspace", "testContainer", + new CodeContainerInner().withProperties(new CodeContainerProperties().withDescription("string") + .withTags(mapOf("tag1", "value1", "tag2", "value2"))), + com.azure.core.util.Context.NONE); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersDeleteSamples.java index f1db0a949fa49..ebb1dd15d7850 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersDeleteSamples.java @@ -4,19 +4,23 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for CodeContainers Delete. */ +/** + * Samples for CodeContainers Delete. + */ public final class CodeContainersDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeContainer/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/CodeContainer/delete.json */ /** - * Sample code: Delete Code Container. - * + * Sample code: Delete Workspace Code Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void deleteCodeContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .codeContainers() + public static void + deleteWorkspaceCodeContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.codeContainers() .deleteWithResponse("testrg123", "testworkspace", "testContainer", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersGetSamples.java index 8bc80b6fe906a..a9c4de565a03d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersGetSamples.java @@ -4,19 +4,23 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for CodeContainers Get. */ +/** + * Samples for CodeContainers Get. + */ public final class CodeContainersGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeContainer/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/CodeContainer/get.json */ /** - * Sample code: Get Code Container. - * + * Sample code: Get Workspace Code Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void getCodeContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .codeContainers() + public static void + getWorkspaceCodeContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.codeContainers() .getWithResponse("testrg123", "testworkspace", "testContainer", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersListSamples.java index fd3cd97cad525..ae7a0adab2194 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersListSamples.java @@ -4,17 +4,22 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for CodeContainers List. */ +/** + * Samples for CodeContainers List. + */ public final class CodeContainersListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeContainer/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/CodeContainer/list.json */ /** - * Sample code: List Code Container. - * + * Sample code: List Workspace Code Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void listCodeContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void + listWorkspaceCodeContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager.codeContainers().list("testrg123", "testworkspace", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsCreateOrGetStartPendingUploadSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsCreateOrGetStartPendingUploadSamples.java new file mode 100644 index 0000000000000..59f21dfee7d6a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsCreateOrGetStartPendingUploadSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; +import com.azure.resourcemanager.machinelearning.models.PendingUploadType; + +/** + * Samples for CodeVersions CreateOrGetStartPendingUpload. + */ +public final class CodeVersionsCreateOrGetStartPendingUploadSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/CodeVersion/createOrGetStartPendingUpload.json + */ + /** + * Sample code: CreateOrGetStartPendingUpload Workspace Code Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrGetStartPendingUploadWorkspaceCodeVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.codeVersions() + .createOrGetStartPendingUploadWithResponse("test-rg", "my-aml-workspace", "string", "string", + new PendingUploadRequestDto().withPendingUploadId("string") + .withPendingUploadType(PendingUploadType.NONE), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsCreateOrUpdateSamples.java index 92534796defae..a21108d499b62 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsCreateOrUpdateSamples.java @@ -4,36 +4,38 @@ package com.azure.resourcemanager.machinelearning.generated; +import com.azure.resourcemanager.machinelearning.fluent.models.CodeVersionInner; import com.azure.resourcemanager.machinelearning.models.CodeVersionProperties; import java.util.HashMap; import java.util.Map; -/** Samples for CodeVersions CreateOrUpdate. */ +/** + * Samples for CodeVersions CreateOrUpdate. + */ public final class CodeVersionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeVersion/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/CodeVersion/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Code Version. - * + * Sample code: CreateOrUpdate Workspace Code Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateCodeVersion( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .codeVersions() - .define("string") - .withExistingCode("test-rg", "my-aml-workspace", "string") - .withProperties( - new CodeVersionProperties() - .withDescription("string") + public static void + createOrUpdateWorkspaceCodeVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.codeVersions() + .createOrUpdateWithResponse("test-rg", "my-aml-workspace", "string", "string", + new CodeVersionInner().withProperties(new CodeVersionProperties().withDescription("string") .withProperties(mapOf("string", "string")) .withTags(mapOf("string", "string")) .withIsAnonymous(false) - .withCodeUri("fakeTokenPlaceholder")) - .create(); + .withCodeUri("fakeTokenPlaceholder")), + com.azure.core.util.Context.NONE); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsDeleteSamples.java index d933ba22b21ac..966e47f2f5217 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsDeleteSamples.java @@ -4,19 +4,23 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for CodeVersions Delete. */ +/** + * Samples for CodeVersions Delete. + */ public final class CodeVersionsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeVersion/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/CodeVersion/delete.json */ /** - * Sample code: Delete Code Version. - * + * Sample code: Delete Workspace Code Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void deleteCodeVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .codeVersions() + public static void + deleteWorkspaceCodeVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.codeVersions() .deleteWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsGetSamples.java index 61640e5ec45f2..bb4db0bb0beca 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsGetSamples.java @@ -4,19 +4,23 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for CodeVersions Get. */ +/** + * Samples for CodeVersions Get. + */ public final class CodeVersionsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeVersion/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/CodeVersion/get.json */ /** - * Sample code: Get Code Version. - * + * Sample code: Get Workspace Code Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void getCodeVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .codeVersions() + public static void + getWorkspaceCodeVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.codeVersions() .getWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsListSamples.java index 779bbf653004e..94f616897cd01 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsListSamples.java @@ -4,19 +4,24 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for CodeVersions List. */ +/** + * Samples for CodeVersions List. + */ public final class CodeVersionsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeVersion/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/CodeVersion/list.json */ /** - * Sample code: List Code Version. - * + * Sample code: List Workspace Code Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void listCodeVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .codeVersions() - .list("test-rg", "my-aml-workspace", "string", "string", 1, null, com.azure.core.util.Context.NONE); + public static void + listWorkspaceCodeVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.codeVersions() + .list("test-rg", "my-aml-workspace", "string", "string", 1, null, null, null, + com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsPublishSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsPublishSamples.java new file mode 100644 index 0000000000000..1de00d9ea44e6 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsPublishSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.DestinationAsset; + +/** + * Samples for CodeVersions Publish. + */ +public final class CodeVersionsPublishSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/CodeVersion/publish.json + */ + /** + * Sample code: Publish Workspace Code Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + publishWorkspaceCodeVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.codeVersions() + .publish("test-rg", "my-aml-workspace", "string", "string", + new DestinationAsset().withDestinationName("string") + .withDestinationVersion("string") + .withRegistryName("string"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersCreateOrUpdateSamples.java index cef6af5f93a33..227581cc1ab5a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersCreateOrUpdateSamples.java @@ -4,34 +4,37 @@ package com.azure.resourcemanager.machinelearning.generated; +import com.azure.resourcemanager.machinelearning.fluent.models.ComponentContainerInner; import com.azure.resourcemanager.machinelearning.models.ComponentContainerProperties; import java.util.HashMap; import java.util.Map; -/** Samples for ComponentContainers CreateOrUpdate. */ +/** + * Samples for ComponentContainers CreateOrUpdate. + */ public final class ComponentContainersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentContainer/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ComponentContainer/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Component Container. - * + * Sample code: CreateOrUpdate Workspace Component Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateComponentContainer( + public static void createOrUpdateWorkspaceComponentContainer( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .componentContainers() - .define("string") - .withExistingWorkspace("test-rg", "my-aml-workspace") - .withProperties( - new ComponentContainerProperties() - .withDescription("string") - .withProperties(mapOf("string", "string")) - .withTags(mapOf("string", "string"))) - .create(); + manager.componentContainers() + .createOrUpdateWithResponse("test-rg", "my-aml-workspace", "string", + new ComponentContainerInner() + .withProperties(new ComponentContainerProperties().withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string"))), + com.azure.core.util.Context.NONE); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersDeleteSamples.java index c6b1f50305847..9e3552a8da624 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersDeleteSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for ComponentContainers Delete. */ +/** + * Samples for ComponentContainers Delete. + */ public final class ComponentContainersDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentContainer/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ComponentContainer/delete.json */ /** - * Sample code: Delete Component Container. - * + * Sample code: Delete Workspace Component Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void deleteComponentContainer( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .componentContainers() + public static void + deleteWorkspaceComponentContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.componentContainers() .deleteWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersGetSamples.java index a3370c8ca451a..e70bda97b4cfb 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersGetSamples.java @@ -4,19 +4,23 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for ComponentContainers Get. */ +/** + * Samples for ComponentContainers Get. + */ public final class ComponentContainersGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentContainer/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ComponentContainer/get.json */ /** - * Sample code: Get Component Container. - * + * Sample code: Get Workspace Component Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void getComponentContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .componentContainers() + public static void + getWorkspaceComponentContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.componentContainers() .getWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersListSamples.java index bd2af0671ad33..ee161709c97fb 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersListSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for ComponentContainers List. */ +/** + * Samples for ComponentContainers List. + */ public final class ComponentContainersListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentContainer/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ComponentContainer/list.json */ /** - * Sample code: List Component Container. - * + * Sample code: List Workspace Component Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void listComponentContainer( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void + listWorkspaceComponentContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager.componentContainers().list("test-rg", "my-aml-workspace", null, null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsCreateOrUpdateSamples.java index dfb4e061dd7d0..74ed667f49de8 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsCreateOrUpdateSamples.java @@ -6,43 +6,41 @@ import com.azure.core.management.serializer.SerializerFactory; import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.machinelearning.fluent.models.ComponentVersionInner; import com.azure.resourcemanager.machinelearning.models.ComponentVersionProperties; import java.io.IOException; import java.util.HashMap; import java.util.Map; -/** Samples for ComponentVersions CreateOrUpdate. */ +/** + * Samples for ComponentVersions CreateOrUpdate. + */ public final class ComponentVersionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentVersion/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ComponentVersion/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Component Version. - * + * Sample code: CreateOrUpdate Workspace Component Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateComponentVersion( + public static void createOrUpdateWorkspaceComponentVersion( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) throws IOException { - manager - .componentVersions() - .define("string") - .withExistingComponent("test-rg", "my-aml-workspace", "string") - .withProperties( - new ComponentVersionProperties() - .withDescription("string") + manager.componentVersions() + .createOrUpdateWithResponse("test-rg", "my-aml-workspace", "string", "string", + new ComponentVersionInner().withProperties(new ComponentVersionProperties().withDescription("string") .withProperties(mapOf("string", "string")) .withTags(mapOf("string", "string")) .withIsAnonymous(false) - .withComponentSpec( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"8ced901b-d826-477d-bfef-329da9672513\":null}", - Object.class, - SerializerEncoding.JSON))) - .create(); + .withComponentSpec(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"8ced901b-d826-477d-bfef-329da9672513\":null}", Object.class, + SerializerEncoding.JSON))), + com.azure.core.util.Context.NONE); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsDeleteSamples.java index d20b0d247f326..4f3582d957bc3 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsDeleteSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for ComponentVersions Delete. */ +/** + * Samples for ComponentVersions Delete. + */ public final class ComponentVersionsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentVersion/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ComponentVersion/delete.json */ /** - * Sample code: Delete Component Version. - * + * Sample code: Delete Workspace Component Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void deleteComponentVersion( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .componentVersions() + public static void + deleteWorkspaceComponentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.componentVersions() .deleteWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsGetSamples.java index fde41af2e3051..3448103a7c46f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsGetSamples.java @@ -4,19 +4,23 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for ComponentVersions Get. */ +/** + * Samples for ComponentVersions Get. + */ public final class ComponentVersionsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentVersion/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ComponentVersion/get.json */ /** - * Sample code: Get Component Version. - * + * Sample code: Get Workspace Component Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void getComponentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .componentVersions() + public static void + getWorkspaceComponentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.componentVersions() .getWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsListSamples.java index 19a8b1a2ac811..1d0d3a2caa90a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsListSamples.java @@ -4,19 +4,23 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for ComponentVersions List. */ +/** + * Samples for ComponentVersions List. + */ public final class ComponentVersionsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentVersion/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ComponentVersion/list.json */ /** - * Sample code: List Component Version. - * + * Sample code: List Workspace Component Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void listComponentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .componentVersions() + public static void + listWorkspaceComponentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.componentVersions() .list("test-rg", "my-aml-workspace", "string", "string", 1, null, null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsPublishSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsPublishSamples.java new file mode 100644 index 0000000000000..9500212a285b3 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsPublishSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.DestinationAsset; + +/** + * Samples for ComponentVersions Publish. + */ +public final class ComponentVersionsPublishSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ComponentVersion/publish.json + */ + /** + * Sample code: Publish Workspace Component Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + publishWorkspaceComponentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.componentVersions() + .publish("test-rg", "my-aml-workspace", "string", "string", + new DestinationAsset().withDestinationName("string") + .withDestinationVersion("string") + .withRegistryName("string"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeCreateOrUpdateSamples.java index 943186937135e..73f4cecc5d61d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeCreateOrUpdateSamples.java @@ -14,36 +14,56 @@ import com.azure.resourcemanager.machinelearning.models.ComputeInstanceAuthorizationType; import com.azure.resourcemanager.machinelearning.models.ComputeInstanceProperties; import com.azure.resourcemanager.machinelearning.models.ComputeInstanceSshSettings; +import com.azure.resourcemanager.machinelearning.models.ComputePowerAction; +import com.azure.resourcemanager.machinelearning.models.ComputeSchedules; +import com.azure.resourcemanager.machinelearning.models.ComputeStartStopSchedule; +import com.azure.resourcemanager.machinelearning.models.ComputeTriggerType; +import com.azure.resourcemanager.machinelearning.models.Cron; +import com.azure.resourcemanager.machinelearning.models.CustomService; import com.azure.resourcemanager.machinelearning.models.DataFactory; +import com.azure.resourcemanager.machinelearning.models.Docker; +import com.azure.resourcemanager.machinelearning.models.Endpoint; +import com.azure.resourcemanager.machinelearning.models.EnvironmentVariable; +import com.azure.resourcemanager.machinelearning.models.EnvironmentVariableType; +import com.azure.resourcemanager.machinelearning.models.Image; +import com.azure.resourcemanager.machinelearning.models.ImageType; import com.azure.resourcemanager.machinelearning.models.InstanceTypeSchema; import com.azure.resourcemanager.machinelearning.models.InstanceTypeSchemaResources; import com.azure.resourcemanager.machinelearning.models.Kubernetes; import com.azure.resourcemanager.machinelearning.models.KubernetesProperties; import com.azure.resourcemanager.machinelearning.models.OsType; import com.azure.resourcemanager.machinelearning.models.PersonalComputeInstanceSettings; +import com.azure.resourcemanager.machinelearning.models.Protocol; import com.azure.resourcemanager.machinelearning.models.RemoteLoginPortPublicAccess; import com.azure.resourcemanager.machinelearning.models.ResourceId; import com.azure.resourcemanager.machinelearning.models.ScaleSettings; +import com.azure.resourcemanager.machinelearning.models.ScheduleStatus; import com.azure.resourcemanager.machinelearning.models.SshPublicAccess; import com.azure.resourcemanager.machinelearning.models.VirtualMachineImage; import com.azure.resourcemanager.machinelearning.models.VmPriority; +import com.azure.resourcemanager.machinelearning.models.VolumeDefinition; +import com.azure.resourcemanager.machinelearning.models.VolumeDefinitionType; import java.time.Duration; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for Compute CreateOrUpdate. */ +/** + * Samples for Compute CreateOrUpdate. + */ public final class ComputeCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/BasicAKSCompute.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/createOrUpdate/BasicAKSCompute.json */ /** * Sample code: Create an AKS Compute. - * + * * @param manager Entry point to MachineLearningManager. */ public static void createAnAKSCompute(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .computes() + manager.computes() .define("compute123") .withExistingWorkspace("testrg123", "workspaces123") .withRegion("eastus") @@ -52,180 +72,177 @@ public static void createAnAKSCompute(com.azure.resourcemanager.machinelearning. } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/AKSCompute.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/createOrUpdate/AKSCompute.json */ /** * Sample code: Update an AKS Compute. - * + * * @param manager Entry point to MachineLearningManager. */ public static void updateAnAKSCompute(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .computes() + manager.computes() .define("compute123") .withExistingWorkspace("testrg123", "workspaces123") .withRegion("eastus") - .withProperties( - new Aks() - .withDescription("some compute") - .withResourceId( - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/testrg123/providers/Microsoft.ContainerService/managedClusters/compute123-56826-c9b00420020b2") - .withProperties(new AksSchemaProperties().withAgentCount(4))) + .withProperties(new Aks().withDescription("some compute") + .withResourceId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/testrg123/providers/Microsoft.ContainerService/managedClusters/compute123-56826-c9b00420020b2") + .withProperties(new AksSchemaProperties().withAgentCount(4))) .create(); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/KubernetesCompute.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/createOrUpdate/KubernetesCompute.json */ /** * Sample code: Attach a Kubernetes Compute. - * + * * @param manager Entry point to MachineLearningManager. */ - public static void attachAKubernetesCompute( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .computes() + public static void + attachAKubernetesCompute(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.computes() .define("compute123") .withExistingWorkspace("testrg123", "workspaces123") .withRegion("eastus") - .withProperties( - new Kubernetes() - .withDescription("some compute") - .withResourceId( - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/testrg123/providers/Microsoft.ContainerService/managedClusters/compute123-56826-c9b00420020b2") - .withProperties( - new KubernetesProperties() - .withNamespace("default") - .withDefaultInstanceType("defaultInstanceType") - .withInstanceTypes( - mapOf( - "defaultInstanceType", - new InstanceTypeSchema() - .withResources( - new InstanceTypeSchemaResources() - .withRequests( - mapOf("cpu", "1", "memory", "4Gi", "nvidia.com/gpu", null)) - .withLimits( - mapOf("cpu", "1", "memory", "4Gi", "nvidia.com/gpu", null))))))) + .withProperties(new Kubernetes().withDescription("some compute") + .withResourceId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/testrg123/providers/Microsoft.ContainerService/managedClusters/compute123-56826-c9b00420020b2") + .withProperties(new KubernetesProperties().withNamespace("default") + .withDefaultInstanceType("defaultInstanceType") + .withInstanceTypes(mapOf("defaultInstanceType", + new InstanceTypeSchema().withResources(new InstanceTypeSchemaResources() + .withRequests(mapOf("cpu", "1", "memory", "4Gi", "nvidia.com/gpu", null)) + .withLimits(mapOf("cpu", "1", "memory", "4Gi", "nvidia.com/gpu", null))))))) .create(); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/ComputeInstanceWithSchedules.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/createOrUpdate/ComputeInstanceWithSchedules.json */ /** * Sample code: Create an ComputeInstance Compute with Schedules. - * + * * @param manager Entry point to MachineLearningManager. */ public static void createAnComputeInstanceComputeWithSchedules( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .computes() + manager.computes() .define("compute123") .withExistingWorkspace("testrg123", "workspaces123") .withRegion("eastus") .withProperties( - new ComputeInstance() - .withProperties( - new ComputeInstanceProperties() - .withVmSize("STANDARD_NC6") - .withApplicationSharingPolicy(ApplicationSharingPolicy.PERSONAL) - .withSshSettings( - new ComputeInstanceSshSettings().withSshPublicAccess(SshPublicAccess.DISABLED)) - .withComputeInstanceAuthorizationType(ComputeInstanceAuthorizationType.PERSONAL) - .withPersonalComputeInstanceSettings( - new PersonalComputeInstanceSettings() - .withAssignedUser( - new AssignedUser() - .withObjectId("00000000-0000-0000-0000-000000000000") - .withTenantId("00000000-0000-0000-0000-000000000000"))))) + new ComputeInstance().withProperties(new ComputeInstanceProperties().withVmSize("STANDARD_NC6") + .withApplicationSharingPolicy(ApplicationSharingPolicy.PERSONAL) + .withSshSettings(new ComputeInstanceSshSettings().withSshPublicAccess(SshPublicAccess.DISABLED)) + .withComputeInstanceAuthorizationType(ComputeInstanceAuthorizationType.PERSONAL) + .withPersonalComputeInstanceSettings(new PersonalComputeInstanceSettings() + .withAssignedUser(new AssignedUser().withObjectId("00000000-0000-0000-0000-000000000000") + .withTenantId("00000000-0000-0000-0000-000000000000"))) + .withSchedules(new ComputeSchedules().withComputeStartStop( + Arrays.asList(new ComputeStartStopSchedule().withStatus(ScheduleStatus.ENABLED) + .withAction(ComputePowerAction.STOP) + .withTriggerType(ComputeTriggerType.CRON) + .withCron(new Cron().withStartTime("2021-04-23T01:30:00") + .withTimeZone("Pacific Standard Time") + .withExpression("0 18 * * *"))))))) .create(); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/BasicAmlCompute.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/createOrUpdate/BasicAmlCompute.json */ /** * Sample code: Create a AML Compute. - * + * * @param manager Entry point to MachineLearningManager. */ public static void createAAMLCompute(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .computes() + manager.computes() .define("compute123") .withExistingWorkspace("testrg123", "workspaces123") .withRegion("eastus") - .withProperties( - new AmlCompute() - .withProperties( - new AmlComputeProperties() - .withOsType(OsType.WINDOWS) - .withVmSize("STANDARD_NC6") - .withVmPriority(VmPriority.DEDICATED) - .withVirtualMachineImage( - new VirtualMachineImage() - .withId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myImageGallery/images/myImageDefinition/versions/0.0.1")) - .withIsolatedNetwork(false) - .withScaleSettings( - new ScaleSettings() - .withMaxNodeCount(1) - .withMinNodeCount(0) - .withNodeIdleTimeBeforeScaleDown(Duration.parse("PT5M"))) - .withRemoteLoginPortPublicAccess(RemoteLoginPortPublicAccess.NOT_SPECIFIED) - .withEnableNodePublicIp(true))) + .withProperties(new AmlCompute().withProperties(new AmlComputeProperties().withOsType(OsType.WINDOWS) + .withVmSize("STANDARD_NC6") + .withVmPriority(VmPriority.DEDICATED) + .withVirtualMachineImage(new VirtualMachineImage().withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myImageGallery/images/myImageDefinition/versions/0.0.1")) + .withIsolatedNetwork(false) + .withScaleSettings(new ScaleSettings().withMaxNodeCount(1) + .withMinNodeCount(0) + .withNodeIdleTimeBeforeScaleDown(Duration.parse("PT5M"))) + .withRemoteLoginPortPublicAccess(RemoteLoginPortPublicAccess.NOT_SPECIFIED) + .withEnableNodePublicIp(true))) .create(); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/ComputeInstance.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/createOrUpdate/ComputeInstance.json */ /** * Sample code: Create an ComputeInstance Compute. - * + * * @param manager Entry point to MachineLearningManager. */ - public static void createAnComputeInstanceCompute( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .computes() + public static void + createAnComputeInstanceCompute(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.computes() .define("compute123") .withExistingWorkspace("testrg123", "workspaces123") .withRegion("eastus") .withProperties( - new ComputeInstance() - .withProperties( - new ComputeInstanceProperties() - .withVmSize("STANDARD_NC6") - .withSubnet(new ResourceId().withId("test-subnet-resource-id")) - .withApplicationSharingPolicy(ApplicationSharingPolicy.PERSONAL) - .withSshSettings( - new ComputeInstanceSshSettings().withSshPublicAccess(SshPublicAccess.DISABLED)) - .withComputeInstanceAuthorizationType(ComputeInstanceAuthorizationType.PERSONAL) - .withPersonalComputeInstanceSettings( - new PersonalComputeInstanceSettings() - .withAssignedUser( - new AssignedUser() - .withObjectId("00000000-0000-0000-0000-000000000000") - .withTenantId("00000000-0000-0000-0000-000000000000"))))) + new ComputeInstance().withProperties(new ComputeInstanceProperties().withVmSize("STANDARD_NC6") + .withSubnet(new ResourceId().withId("test-subnet-resource-id")) + .withApplicationSharingPolicy(ApplicationSharingPolicy.PERSONAL) + .withSshSettings(new ComputeInstanceSshSettings().withSshPublicAccess(SshPublicAccess.DISABLED)) + .withCustomServices(Arrays.asList(new CustomService().withName("rstudio") + .withImage(new Image().withType(ImageType.DOCKER) + .withReference("ghcr.io/azure/rocker-rstudio-ml-verse:latest") + .withAdditionalProperties(mapOf())) + .withEnvironmentVariables(mapOf("test_variable", + new EnvironmentVariable().withType(EnvironmentVariableType.LOCAL) + .withValue("test_value") + .withAdditionalProperties(mapOf()))) + .withDocker(new Docker().withPrivileged(true).withAdditionalProperties(mapOf())) + .withEndpoints(Arrays.asList(new Endpoint().withProtocol(Protocol.HTTP) + .withName("connect") + .withTarget(8787) + .withPublished(8787))) + .withVolumes(Arrays.asList(new VolumeDefinition().withType(VolumeDefinitionType.BIND) + .withReadOnly(false) + .withSource("/home/azureuser/cloudfiles") + .withTarget("/home/azureuser/cloudfiles"))) + .withAdditionalProperties(mapOf()))) + .withComputeInstanceAuthorizationType(ComputeInstanceAuthorizationType.PERSONAL) + .withPersonalComputeInstanceSettings(new PersonalComputeInstanceSettings() + .withAssignedUser(new AssignedUser().withObjectId("00000000-0000-0000-0000-000000000000") + .withTenantId("00000000-0000-0000-0000-000000000000"))))) .create(); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/ComputeInstanceMinimal.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/createOrUpdate/ComputeInstanceMinimal.json */ /** * Sample code: Create an ComputeInstance Compute with minimal inputs. - * + * * @param manager Entry point to MachineLearningManager. */ public static void createAnComputeInstanceComputeWithMinimalInputs( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .computes() + manager.computes() .define("compute123") .withExistingWorkspace("testrg123", "workspaces123") .withRegion("eastus") @@ -235,44 +252,40 @@ public static void createAnComputeInstanceComputeWithMinimalInputs( } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/AmlCompute.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/createOrUpdate/AmlCompute.json */ /** * Sample code: Update a AML Compute. - * + * * @param manager Entry point to MachineLearningManager. */ public static void updateAAMLCompute(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .computes() + manager.computes() .define("compute123") .withExistingWorkspace("testrg123", "workspaces123") .withRegion("eastus") - .withProperties( - new AmlCompute() - .withDescription("some compute") - .withProperties( - new AmlComputeProperties() - .withScaleSettings( - new ScaleSettings() - .withMaxNodeCount(4) - .withMinNodeCount(4) - .withNodeIdleTimeBeforeScaleDown(Duration.parse("PT5M"))))) + .withProperties(new AmlCompute().withDescription("some compute") + .withProperties(new AmlComputeProperties().withScaleSettings(new ScaleSettings().withMaxNodeCount(4) + .withMinNodeCount(4) + .withNodeIdleTimeBeforeScaleDown(Duration.parse("PT5M"))))) .create(); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/BasicDataFactoryCompute.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/createOrUpdate/BasicDataFactoryCompute.json */ /** * Sample code: Create a DataFactory Compute. - * + * * @param manager Entry point to MachineLearningManager. */ - public static void createADataFactoryCompute( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .computes() + public static void + createADataFactoryCompute(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.computes() .define("compute123") .withExistingWorkspace("testrg123", "workspaces123") .withRegion("eastus") @@ -280,6 +293,7 @@ public static void createADataFactoryCompute( .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeDeleteSamples.java index ee6c38e168ead..a45bdcfd02c44 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeDeleteSamples.java @@ -6,24 +6,23 @@ import com.azure.resourcemanager.machinelearning.models.UnderlyingResourceAction; -/** Samples for Compute Delete. */ +/** + * Samples for Compute Delete. + */ public final class ComputeDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/delete.json */ /** * Sample code: Delete Compute. - * + * * @param manager Entry point to MachineLearningManager. */ public static void deleteCompute(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .computes() - .delete( - "testrg123", - "workspaces123", - "compute123", - UnderlyingResourceAction.DELETE, + manager.computes() + .delete("testrg123", "workspaces123", "compute123", UnderlyingResourceAction.DELETE, com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeGetSamples.java index eeb1c6dfefd94..df22046cf0178 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeGetSamples.java @@ -4,61 +4,67 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for Compute Get. */ +/** + * Samples for Compute Get. + */ public final class ComputeGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/get/AKSCompute.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/get/AKSCompute.json */ /** * Sample code: Get a AKS Compute. - * + * * @param manager Entry point to MachineLearningManager. */ public static void getAAKSCompute(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .computes() + manager.computes() .getWithResponse("testrg123", "workspaces123", "compute123", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/get/KubernetesCompute.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/get/KubernetesCompute.json */ /** * Sample code: Get a Kubernetes Compute. - * + * * @param manager Entry point to MachineLearningManager. */ public static void getAKubernetesCompute(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .computes() + manager.computes() .getWithResponse("testrg123", "workspaces123", "compute123", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/get/ComputeInstance.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/get/ComputeInstance.json */ /** * Sample code: Get an ComputeInstance. - * + * * @param manager Entry point to MachineLearningManager. */ public static void getAnComputeInstance(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .computes() + manager.computes() .getWithResponse("testrg123", "workspaces123", "compute123", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/get/AmlCompute.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/get/AmlCompute.json */ /** * Sample code: Get a AML Compute. - * + * * @param manager Entry point to MachineLearningManager. */ public static void getAAMLCompute(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .computes() + manager.computes() .getWithResponse("testrg123", "workspaces123", "compute123", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeListKeysSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeListKeysSamples.java index 2591bf4e8cf7d..f8a0d248a6d87 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeListKeysSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeListKeysSamples.java @@ -4,19 +4,22 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for Compute ListKeys. */ +/** + * Samples for Compute ListKeys. + */ public final class ComputeListKeysSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/listKeys.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/listKeys.json */ /** * Sample code: List AKS Compute Keys. - * + * * @param manager Entry point to MachineLearningManager. */ public static void listAKSComputeKeys(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .computes() + manager.computes() .listKeysWithResponse("testrg123", "workspaces123", "compute123", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeListNodesSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeListNodesSamples.java index 6a76b986c2c8c..78bc238caf007 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeListNodesSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeListNodesSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for Compute ListNodes. */ +/** + * Samples for Compute ListNodes. + */ public final class ComputeListNodesSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/listNodes.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/listNodes.json */ /** * Sample code: Get compute nodes information for a compute. - * + * * @param manager Entry point to MachineLearningManager. */ public static void getComputeNodesInformationForACompute( diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeListSamples.java index 76569fd48bfb8..143db7f78cf64 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeListSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for Compute List. */ +/** + * Samples for Compute List. + */ public final class ComputeListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/list.json */ /** * Sample code: Get Computes. - * + * * @param manager Entry point to MachineLearningManager. */ public static void getComputes(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeRestartSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeRestartSamples.java index f4e3d4904b1ce..f1648a79a1aa7 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeRestartSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeRestartSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for Compute Restart. */ +/** + * Samples for Compute Restart. + */ public final class ComputeRestartSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/restart.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/restart.json */ /** * Sample code: Restart ComputeInstance Compute. - * + * * @param manager Entry point to MachineLearningManager. */ - public static void restartComputeInstanceCompute( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void + restartComputeInstanceCompute(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager.computes().restart("testrg123", "workspaces123", "compute123", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeStartSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeStartSamples.java index a27b9dd8f911d..83c689ad8368a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeStartSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeStartSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for Compute Start. */ +/** + * Samples for Compute Start. + */ public final class ComputeStartSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/start.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/start.json */ /** * Sample code: Start ComputeInstance Compute. - * + * * @param manager Entry point to MachineLearningManager. */ - public static void startComputeInstanceCompute( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void + startComputeInstanceCompute(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager.computes().start("testrg123", "workspaces123", "compute123", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeStopSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeStopSamples.java index 9b9d0be34a8cc..5384571ae4376 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeStopSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeStopSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for Compute Stop. */ +/** + * Samples for Compute Stop. + */ public final class ComputeStopSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/stop.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/stop.json */ /** * Sample code: Stop ComputeInstance Compute. - * + * * @param manager Entry point to MachineLearningManager. */ - public static void stopComputeInstanceCompute( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void + stopComputeInstanceCompute(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager.computes().stop("testrg123", "workspaces123", "compute123", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeUpdateSamples.java index 6ae1b51588f65..bea37e7341f11 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ComputeUpdateSamples.java @@ -9,32 +9,29 @@ import com.azure.resourcemanager.machinelearning.models.ScaleSettingsInformation; import java.time.Duration; -/** Samples for Compute Update. */ +/** + * Samples for Compute Update. + */ public final class ComputeUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/patch.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Compute/patch.json */ /** * Sample code: Update a AmlCompute Compute. - * + * * @param manager Entry point to MachineLearningManager. */ - public static void updateAAmlComputeCompute( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - ComputeResource resource = - manager - .computes() - .getWithResponse("testrg123", "workspaces123", "compute123", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() - .withProperties( - new ScaleSettingsInformation() - .withScaleSettings( - new ScaleSettings() - .withMaxNodeCount(4) - .withMinNodeCount(4) - .withNodeIdleTimeBeforeScaleDown(Duration.parse("PT5M")))) + public static void + updateAAmlComputeCompute(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + ComputeResource resource = manager.computes() + .getWithResponse("testrg123", "workspaces123", "compute123", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new ScaleSettingsInformation().withScaleSettings(new ScaleSettings().withMaxNodeCount(4) + .withMinNodeCount(4) + .withNodeIdleTimeBeforeScaleDown(Duration.parse("PT5M")))) .apply(); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataContainersCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataContainersCreateOrUpdateSamples.java index 470d585fbac73..9bafb372cea84 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataContainersCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataContainersCreateOrUpdateSamples.java @@ -4,36 +4,38 @@ package com.azure.resourcemanager.machinelearning.generated; +import com.azure.resourcemanager.machinelearning.fluent.models.DataContainerInner; import com.azure.resourcemanager.machinelearning.models.DataContainerProperties; import com.azure.resourcemanager.machinelearning.models.DataType; import java.util.HashMap; import java.util.Map; -/** Samples for DataContainers CreateOrUpdate. */ +/** + * Samples for DataContainers CreateOrUpdate. + */ public final class DataContainersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataContainer/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/DataContainer/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Data Container. - * + * Sample code: CreateOrUpdate Workspace Data Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateDataContainer( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .dataContainers() - .define("datacontainer123") - .withExistingWorkspace("testrg123", "workspace123") - .withProperties( - new DataContainerProperties() - .withDescription("string") + public static void + createOrUpdateWorkspaceDataContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.dataContainers() + .createOrUpdateWithResponse("testrg123", "workspace123", "datacontainer123", + new DataContainerInner().withProperties(new DataContainerProperties().withDescription("string") .withProperties(mapOf("properties1", "value1", "properties2", "value2")) .withTags(mapOf("tag1", "value1", "tag2", "value2")) - .withDataType(DataType.fromString("UriFile"))) - .create(); + .withDataType(DataType.fromString("UriFile"))), + com.azure.core.util.Context.NONE); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataContainersDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataContainersDeleteSamples.java index 43273b2c9c5bf..5bc84d55f1503 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataContainersDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataContainersDeleteSamples.java @@ -4,19 +4,23 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for DataContainers Delete. */ +/** + * Samples for DataContainers Delete. + */ public final class DataContainersDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataContainer/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/DataContainer/delete.json */ /** - * Sample code: Delete Data Container. - * + * Sample code: Delete Workspace Data Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void deleteDataContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .dataContainers() + public static void + deleteWorkspaceDataContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.dataContainers() .deleteWithResponse("testrg123", "workspace123", "datacontainer123", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataContainersGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataContainersGetSamples.java index 43692b7b234fe..a1dcdbe925984 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataContainersGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataContainersGetSamples.java @@ -4,19 +4,23 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for DataContainers Get. */ +/** + * Samples for DataContainers Get. + */ public final class DataContainersGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataContainer/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/DataContainer/get.json */ /** - * Sample code: Get Data Container. - * + * Sample code: Get Workspace Data Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void getDataContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .dataContainers() + public static void + getWorkspaceDataContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.dataContainers() .getWithResponse("testrg123", "workspace123", "datacontainer123", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataContainersListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataContainersListSamples.java index 497053036fa39..850ad9378b36e 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataContainersListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataContainersListSamples.java @@ -4,17 +4,22 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for DataContainers List. */ +/** + * Samples for DataContainers List. + */ public final class DataContainersListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataContainer/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/DataContainer/list.json */ /** - * Sample code: List Data Container. - * + * Sample code: List Workspace Data Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void listDataContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void + listWorkspaceDataContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager.dataContainers().list("testrg123", "workspace123", null, null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsCreateOrUpdateSamples.java index d90fcdc2db269..2507272507b2d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsCreateOrUpdateSamples.java @@ -4,36 +4,38 @@ package com.azure.resourcemanager.machinelearning.generated; +import com.azure.resourcemanager.machinelearning.fluent.models.DataVersionBaseInner; import com.azure.resourcemanager.machinelearning.models.UriFileDataVersion; import java.util.HashMap; import java.util.Map; -/** Samples for DataVersions CreateOrUpdate. */ +/** + * Samples for DataVersions CreateOrUpdate. + */ public final class DataVersionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataVersionBase/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/DataVersionBase/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Data Version Base. - * + * Sample code: CreateOrUpdate Workspace Data Version Base. + * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateDataVersionBase( + public static void createOrUpdateWorkspaceDataVersionBase( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .dataVersions() - .define("string") - .withExistingData("test-rg", "my-aml-workspace", "string") - .withProperties( - new UriFileDataVersion() - .withDescription("string") + manager.dataVersions() + .createOrUpdateWithResponse("test-rg", "my-aml-workspace", "string", "string", + new DataVersionBaseInner().withProperties(new UriFileDataVersion().withDescription("string") .withProperties(mapOf("string", "string")) .withTags(mapOf("string", "string")) .withIsAnonymous(false) - .withDataUri("string")) - .create(); + .withDataUri("string")), + com.azure.core.util.Context.NONE); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsDeleteSamples.java index 79c9624287da9..4f1114fce7447 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsDeleteSamples.java @@ -4,19 +4,23 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for DataVersions Delete. */ +/** + * Samples for DataVersions Delete. + */ public final class DataVersionsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataVersionBase/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/DataVersionBase/delete.json */ /** - * Sample code: Delete Data Version Base. - * + * Sample code: Delete Workspace Data Version Base. + * * @param manager Entry point to MachineLearningManager. */ - public static void deleteDataVersionBase(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .dataVersions() + public static void + deleteWorkspaceDataVersionBase(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.dataVersions() .deleteWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsGetSamples.java index c0ed4ee30644a..9156f7b2a8691 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsGetSamples.java @@ -4,19 +4,23 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for DataVersions Get. */ +/** + * Samples for DataVersions Get. + */ public final class DataVersionsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataVersionBase/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/DataVersionBase/get.json */ /** - * Sample code: Get Data Version Base. - * + * Sample code: Get Workspace Data Version Base. + * * @param manager Entry point to MachineLearningManager. */ - public static void getDataVersionBase(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .dataVersions() + public static void + getWorkspaceDataVersionBase(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.dataVersions() .getWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsListSamples.java index 62ce47598970b..e4e19f37bdeb4 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsListSamples.java @@ -4,28 +4,24 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for DataVersions List. */ +/** + * Samples for DataVersions List. + */ public final class DataVersionsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataVersionBase/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/DataVersionBase/list.json */ /** - * Sample code: List Data Version Base. - * + * Sample code: List Workspace Data Version Base. + * * @param manager Entry point to MachineLearningManager. */ - public static void listDataVersionBase(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .dataVersions() - .list( - "test-rg", - "my-aml-workspace", - "string", - "string", - 1, - null, - "string", - null, + public static void + listWorkspaceDataVersionBase(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.dataVersions() + .list("test-rg", "my-aml-workspace", "string", "string", 1, null, "string", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsPublishSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsPublishSamples.java new file mode 100644 index 0000000000000..592ebbe5adb6e --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsPublishSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.DestinationAsset; + +/** + * Samples for DataVersions Publish. + */ +public final class DataVersionsPublishSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/DataVersionBase/publish.json + */ + /** + * Sample code: Publish Workspace Data Version Base. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + publishWorkspaceDataVersionBase(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.dataVersions() + .publish("test-rg", "my-aml-workspace", "string", "string", + new DestinationAsset().withDestinationName("string") + .withDestinationVersion("string") + .withRegistryName("string"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresCreateOrUpdateSamples.java index 1ec4a1f1c4ea6..44efa98d5248e 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresCreateOrUpdateSamples.java @@ -16,131 +16,122 @@ import java.util.Map; import java.util.UUID; -/** Samples for Datastores CreateOrUpdate. */ +/** + * Samples for Datastores CreateOrUpdate. + */ public final class DatastoresCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/AzureDataLakeGen1WServicePrincipal/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Datastore/AzureDataLakeGen1WServicePrincipal/createOrUpdate.json */ /** * Sample code: CreateOrUpdate datastore (Azure Data Lake Gen1 w/ ServicePrincipal). - * + * * @param manager Entry point to MachineLearningManager. */ public static void createOrUpdateDatastoreAzureDataLakeGen1WServicePrincipal( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .datastores() + manager.datastores() .define("string") .withExistingWorkspace("test-rg", "my-aml-workspace") - .withProperties( - new AzureDataLakeGen1Datastore() - .withDescription("string") - .withTags(mapOf("string", "string")) - .withCredentials( - new ServicePrincipalDatastoreCredentials() - .withAuthorityUrl("string") - .withClientId(UUID.fromString("00000000-1111-2222-3333-444444444444")) - .withResourceUrl("string") - .withSecrets( - new ServicePrincipalDatastoreSecrets().withClientSecret("fakeTokenPlaceholder")) - .withTenantId(UUID.fromString("00000000-1111-2222-3333-444444444444"))) - .withStoreName("string")) + .withProperties(new AzureDataLakeGen1Datastore().withDescription("string") + .withTags(mapOf("string", "string")) + .withCredentials(new ServicePrincipalDatastoreCredentials().withAuthorityUrl("string") + .withClientId(UUID.fromString("00000000-1111-2222-3333-444444444444")) + .withResourceUrl("string") + .withSecrets(new ServicePrincipalDatastoreSecrets().withClientSecret("fakeTokenPlaceholder")) + .withTenantId(UUID.fromString("00000000-1111-2222-3333-444444444444"))) + .withStoreName("string")) .withSkipValidation(false) .create(); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/AzureDataLakeGen2WServicePrincipal/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Datastore/AzureDataLakeGen2WServicePrincipal/createOrUpdate.json */ /** * Sample code: CreateOrUpdate datastore (Azure Data Lake Gen2 w/ Service Principal). - * + * * @param manager Entry point to MachineLearningManager. */ public static void createOrUpdateDatastoreAzureDataLakeGen2WServicePrincipal( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .datastores() + manager.datastores() .define("string") .withExistingWorkspace("test-rg", "my-aml-workspace") - .withProperties( - new AzureDataLakeGen2Datastore() - .withDescription("string") - .withTags(mapOf("string", "string")) - .withCredentials( - new ServicePrincipalDatastoreCredentials() - .withAuthorityUrl("string") - .withClientId(UUID.fromString("00000000-1111-2222-3333-444444444444")) - .withResourceUrl("string") - .withSecrets( - new ServicePrincipalDatastoreSecrets().withClientSecret("fakeTokenPlaceholder")) - .withTenantId(UUID.fromString("00000000-1111-2222-3333-444444444444"))) - .withAccountName("string") - .withEndpoint("string") - .withFilesystem("string") - .withProtocol("string")) + .withProperties(new AzureDataLakeGen2Datastore().withDescription("string") + .withTags(mapOf("string", "string")) + .withCredentials(new ServicePrincipalDatastoreCredentials().withAuthorityUrl("string") + .withClientId(UUID.fromString("00000000-1111-2222-3333-444444444444")) + .withResourceUrl("string") + .withSecrets(new ServicePrincipalDatastoreSecrets().withClientSecret("fakeTokenPlaceholder")) + .withTenantId(UUID.fromString("00000000-1111-2222-3333-444444444444"))) + .withAccountName("string") + .withEndpoint("string") + .withFilesystem("string") + .withProtocol("string")) .withSkipValidation(false) .create(); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/AzureBlobWAccountKey/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Datastore/AzureBlobWAccountKey/createOrUpdate.json */ /** * Sample code: CreateOrUpdate datastore (AzureBlob w/ AccountKey). - * + * * @param manager Entry point to MachineLearningManager. */ public static void createOrUpdateDatastoreAzureBlobWAccountKey( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .datastores() + manager.datastores() .define("string") .withExistingWorkspace("test-rg", "my-aml-workspace") - .withProperties( - new AzureBlobDatastore() - .withDescription("string") - .withTags(mapOf("string", "string")) - .withCredentials( - new AccountKeyDatastoreCredentials() - .withSecrets(new AccountKeyDatastoreSecrets().withKey("fakeTokenPlaceholder"))) - .withAccountName("string") - .withContainerName("string") - .withEndpoint("core.windows.net") - .withProtocol("https")) + .withProperties(new AzureBlobDatastore().withDescription("string") + .withTags(mapOf("string", "string")) + .withCredentials(new AccountKeyDatastoreCredentials() + .withSecrets(new AccountKeyDatastoreSecrets().withKey("fakeTokenPlaceholder"))) + .withAccountName("string") + .withContainerName("string") + .withEndpoint("core.windows.net") + .withProtocol("https")) .withSkipValidation(false) .create(); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/AzureFileWAccountKey/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Datastore/AzureFileWAccountKey/createOrUpdate.json */ /** * Sample code: CreateOrUpdate datastore (Azure File store w/ AccountKey). - * + * * @param manager Entry point to MachineLearningManager. */ public static void createOrUpdateDatastoreAzureFileStoreWAccountKey( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .datastores() + manager.datastores() .define("string") .withExistingWorkspace("test-rg", "my-aml-workspace") - .withProperties( - new AzureFileDatastore() - .withDescription("string") - .withTags(mapOf("string", "string")) - .withCredentials( - new AccountKeyDatastoreCredentials() - .withSecrets(new AccountKeyDatastoreSecrets().withKey("fakeTokenPlaceholder"))) - .withAccountName("string") - .withEndpoint("string") - .withFileShareName("string") - .withProtocol("string")) + .withProperties(new AzureFileDatastore().withDescription("string") + .withTags(mapOf("string", "string")) + .withCredentials(new AccountKeyDatastoreCredentials() + .withSecrets(new AccountKeyDatastoreSecrets().withKey("fakeTokenPlaceholder"))) + .withAccountName("string") + .withEndpoint("string") + .withFileShareName("string") + .withProtocol("string")) .withSkipValidation(false) .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresDeleteSamples.java index 74ee3e5e79053..17bbacca4c112 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresDeleteSamples.java @@ -4,19 +4,22 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for Datastores Delete. */ +/** + * Samples for Datastores Delete. + */ public final class DatastoresDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Datastore/delete.json */ /** * Sample code: Delete datastore. - * + * * @param manager Entry point to MachineLearningManager. */ public static void deleteDatastore(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .datastores() + manager.datastores() .deleteWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresGetSamples.java index 8bd81700eff59..1741cace77277 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresGetSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for Datastores Get. */ +/** + * Samples for Datastores Get. + */ public final class DatastoresGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Datastore/get.json */ /** * Sample code: Get datastore. - * + * * @param manager Entry point to MachineLearningManager. */ public static void getDatastore(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresListSamples.java index 6f768bffac33c..a838c2d8af2bd 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresListSamples.java @@ -6,29 +6,23 @@ import java.util.Arrays; -/** Samples for Datastores List. */ +/** + * Samples for Datastores List. + */ public final class DatastoresListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Datastore/list.json */ /** * Sample code: List datastores. - * + * * @param manager Entry point to MachineLearningManager. */ public static void listDatastores(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .datastores() - .list( - "test-rg", - "my-aml-workspace", - null, - 1, - false, - Arrays.asList("string"), - "string", - "string", - false, + manager.datastores() + .list("test-rg", "my-aml-workspace", null, 1, false, Arrays.asList("string"), "string", "string", false, com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresListSecretsSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresListSecretsSamples.java index 4e9a8c6857a50..534d69d881503 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresListSecretsSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/DatastoresListSecretsSamples.java @@ -4,19 +4,26 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for Datastores ListSecrets. */ +import com.azure.resourcemanager.machinelearning.models.SecretExpiry; + +/** + * Samples for Datastores ListSecrets. + */ public final class DatastoresListSecretsSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/listSecrets.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Datastore/listSecrets.json */ /** * Sample code: Get datastore secrets. - * + * * @param manager Entry point to MachineLearningManager. */ public static void getDatastoreSecrets(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .datastores() - .listSecretsWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + manager.datastores() + .listSecretsWithResponse("test-rg", "my-aml-workspace", "string", + new SecretExpiry().withExpirableSecret(false).withExpireAfterHours(1), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersCreateOrUpdateSamples.java index 09f24071f65e9..0cc7cb6827b7f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersCreateOrUpdateSamples.java @@ -4,36 +4,39 @@ package com.azure.resourcemanager.machinelearning.generated; +import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentContainerInner; import com.azure.resourcemanager.machinelearning.models.EnvironmentContainerProperties; import java.util.HashMap; import java.util.Map; -/** Samples for EnvironmentContainers CreateOrUpdate. */ +/** + * Samples for EnvironmentContainers CreateOrUpdate. + */ public final class EnvironmentContainersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentContainer/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/EnvironmentContainer/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Environment Container. - * + * Sample code: CreateOrUpdate Workspace Environment Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateEnvironmentContainer( + public static void createOrUpdateWorkspaceEnvironmentContainer( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .environmentContainers() - .define("testEnvironment") - .withExistingWorkspace("testrg123", "testworkspace") - .withProperties( - new EnvironmentContainerProperties() + manager.environmentContainers() + .createOrUpdateWithResponse("testrg123", "testworkspace", "testEnvironment", + new EnvironmentContainerInner().withProperties(new EnvironmentContainerProperties() .withDescription("string") .withProperties( mapOf("additionalProp1", "string", "additionalProp2", "string", "additionalProp3", "string")) .withTags( - mapOf("additionalProp1", "string", "additionalProp2", "string", "additionalProp3", "string"))) - .create(); + mapOf("additionalProp1", "string", "additionalProp2", "string", "additionalProp3", "string"))), + com.azure.core.util.Context.NONE); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersDeleteSamples.java index 62f26c6e966f3..5c62a77b83fc5 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersDeleteSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for EnvironmentContainers Delete. */ +/** + * Samples for EnvironmentContainers Delete. + */ public final class EnvironmentContainersDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentContainer/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/EnvironmentContainer/delete.json */ /** - * Sample code: Delete Environment Container. - * + * Sample code: Delete Workspace Environment Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void deleteEnvironmentContainer( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .environmentContainers() + public static void + deleteWorkspaceEnvironmentContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.environmentContainers() .deleteWithResponse("testrg123", "testworkspace", "testContainer", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersGetSamples.java index 4fa48edf026f5..3d48984626647 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersGetSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for EnvironmentContainers Get. */ +/** + * Samples for EnvironmentContainers Get. + */ public final class EnvironmentContainersGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentContainer/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/EnvironmentContainer/get.json */ /** - * Sample code: Get Environment Container. - * + * Sample code: Get Workspace Environment Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void getEnvironmentContainer( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .environmentContainers() + public static void + getWorkspaceEnvironmentContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.environmentContainers() .getWithResponse("testrg123", "testworkspace", "testEnvironment", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersListSamples.java index 85a7bf57bd459..ed2e1ece6157d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersListSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for EnvironmentContainers List. */ +/** + * Samples for EnvironmentContainers List. + */ public final class EnvironmentContainersListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentContainer/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/EnvironmentContainer/list.json */ /** - * Sample code: List Environment Container. - * + * Sample code: List Workspace Environment Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void listEnvironmentContainer( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .environmentContainers() + public static void + listWorkspaceEnvironmentContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.environmentContainers() .list("testrg123", "testworkspace", null, null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsCreateOrUpdateSamples.java index a8c7e309af906..d0f6d630f735f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsCreateOrUpdateSamples.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.machinelearning.generated; +import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentVersionInner; import com.azure.resourcemanager.machinelearning.models.BuildContext; import com.azure.resourcemanager.machinelearning.models.EnvironmentVersionProperties; import com.azure.resourcemanager.machinelearning.models.InferenceContainerProperties; @@ -11,43 +12,42 @@ import java.util.HashMap; import java.util.Map; -/** Samples for EnvironmentVersions CreateOrUpdate. */ +/** + * Samples for EnvironmentVersions CreateOrUpdate. + */ public final class EnvironmentVersionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentVersion/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/EnvironmentVersion/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Environment Version. - * + * Sample code: CreateOrUpdate Workspace Environment Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateEnvironmentVersion( + public static void createOrUpdateWorkspaceEnvironmentVersion( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .environmentVersions() - .define("string") - .withExistingEnvironment("test-rg", "my-aml-workspace", "string") - .withProperties( - new EnvironmentVersionProperties() + manager.environmentVersions() + .createOrUpdateWithResponse("test-rg", "my-aml-workspace", "string", "string", + new EnvironmentVersionInner().withProperties(new EnvironmentVersionProperties() .withDescription("string") .withProperties(mapOf("string", "string")) .withTags(mapOf("string", "string")) .withIsAnonymous(false) - .withBuild( - new BuildContext() - .withContextUri( - "https://storage-account.blob.core.windows.net/azureml/DockerBuildContext/95ddede6b9b8c4e90472db3acd0a8d28/") - .withDockerfilePath("prod/Dockerfile")) + .withBuild(new BuildContext().withContextUri( + "https://storage-account.blob.core.windows.net/azureml/DockerBuildContext/95ddede6b9b8c4e90472db3acd0a8d28/") + .withDockerfilePath("prod/Dockerfile")) .withCondaFile("string") .withImage("docker.io/tensorflow/serving:latest") .withInferenceConfig( - new InferenceContainerProperties() - .withLivenessRoute(new Route().withPath("string").withPort(1)) + new InferenceContainerProperties().withLivenessRoute(new Route().withPath("string").withPort(1)) .withReadinessRoute(new Route().withPath("string").withPort(1)) - .withScoringRoute(new Route().withPath("string").withPort(1)))) - .create(); + .withScoringRoute(new Route().withPath("string").withPort(1)))), + com.azure.core.util.Context.NONE); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsDeleteSamples.java index 972e72140e300..000bebdb775d6 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsDeleteSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for EnvironmentVersions Delete. */ +/** + * Samples for EnvironmentVersions Delete. + */ public final class EnvironmentVersionsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentVersion/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/EnvironmentVersion/delete.json */ /** - * Sample code: Delete Environment Version. - * + * Sample code: Delete Workspace Environment Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void deleteEnvironmentVersion( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .environmentVersions() + public static void + deleteWorkspaceEnvironmentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.environmentVersions() .deleteWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsGetSamples.java index 04673d4e041d6..dd3b164012ec8 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsGetSamples.java @@ -4,19 +4,23 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for EnvironmentVersions Get. */ +/** + * Samples for EnvironmentVersions Get. + */ public final class EnvironmentVersionsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentVersion/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/EnvironmentVersion/get.json */ /** - * Sample code: Get Environment Version. - * + * Sample code: Get Workspace Environment Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void getEnvironmentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .environmentVersions() + public static void + getWorkspaceEnvironmentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.environmentVersions() .getWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsListSamples.java index 9aa3338d518f8..cb9771351e27d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsListSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for EnvironmentVersions List. */ +/** + * Samples for EnvironmentVersions List. + */ public final class EnvironmentVersionsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentVersion/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/EnvironmentVersion/list.json */ /** - * Sample code: List Environment Version. - * + * Sample code: List Workspace Environment Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void listEnvironmentVersion( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .environmentVersions() + public static void + listWorkspaceEnvironmentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.environmentVersions() .list("test-rg", "my-aml-workspace", "string", "string", 1, null, null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsPublishSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsPublishSamples.java new file mode 100644 index 0000000000000..f4231b6721229 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsPublishSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.DestinationAsset; + +/** + * Samples for EnvironmentVersions Publish. + */ +public final class EnvironmentVersionsPublishSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/EnvironmentVersion/publish.json + */ + /** + * Sample code: Publish Workspace Environment Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + publishWorkspaceEnvironmentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.environmentVersions() + .publish("test-rg", "my-aml-workspace", "string", "string", + new DestinationAsset().withDestinationName("string") + .withDestinationVersion("string") + .withRegistryName("string"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesGetSamples.java new file mode 100644 index 0000000000000..5c53c742d3365 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for Features Get. + */ +public final class FeaturesGetSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Feature/get.json + */ + /** + * Sample code: Get Feature. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getFeature(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.features() + .getWithResponse("test-rg", "my-aml-workspace", "string", "string", "string", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesListSamples.java new file mode 100644 index 0000000000000..9a2e1aec1e8ac --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesListSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for Features List. + */ +public final class FeaturesListSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Feature/list.json + */ + /** + * Sample code: List Feature. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listFeature(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.features() + .list("test-rg", "my-aml-workspace", "string", "string", null, "string", "string", "string", null, null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetContainersCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetContainersCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..12f7c85203f7f --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetContainersCreateOrUpdateSamples.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.FeaturesetContainerProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for FeaturesetContainers CreateOrUpdate. + */ +public final class FeaturesetContainersCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/FeaturesetContainer/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Workspace Featureset Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateWorkspaceFeaturesetContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.featuresetContainers() + .define("string") + .withExistingWorkspace("test-rg", "my-aml-workspace") + .withProperties(new FeaturesetContainerProperties().withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsArchived(false)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetContainersDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetContainersDeleteSamples.java new file mode 100644 index 0000000000000..c6b71fa0a413b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetContainersDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for FeaturesetContainers Delete. + */ +public final class FeaturesetContainersDeleteSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/FeaturesetContainer/delete.json + */ + /** + * Sample code: Delete Workspace Featureset Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + deleteWorkspaceFeaturesetContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.featuresetContainers() + .delete("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetContainersGetEntitySamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetContainersGetEntitySamples.java new file mode 100644 index 0000000000000..73f7c9d4fab4f --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetContainersGetEntitySamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for FeaturesetContainers GetEntity. + */ +public final class FeaturesetContainersGetEntitySamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/FeaturesetContainer/getEntity.json + */ + /** + * Sample code: GetEntity Workspace Featureset Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getEntityWorkspaceFeaturesetContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.featuresetContainers() + .getEntityWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetContainersListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetContainersListSamples.java new file mode 100644 index 0000000000000..81653d7af9610 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetContainersListSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** + * Samples for FeaturesetContainers List. + */ +public final class FeaturesetContainersListSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/FeaturesetContainer/list.json + */ + /** + * Sample code: List Workspace Featureset Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + listWorkspaceFeaturesetContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.featuresetContainers() + .list("test-rg", "my-aml-workspace", null, "string", ListViewType.ARCHIVED_ONLY, null, null, null, null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetVersionsBackfillSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetVersionsBackfillSamples.java new file mode 100644 index 0000000000000..f0cb3014e1ef6 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetVersionsBackfillSamples.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.DataAvailabilityStatus; +import com.azure.resourcemanager.machinelearning.models.FeaturesetVersionBackfillRequest; +import com.azure.resourcemanager.machinelearning.models.FeatureWindow; +import com.azure.resourcemanager.machinelearning.models.MaterializationComputeResource; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for FeaturesetVersions Backfill. + */ +public final class FeaturesetVersionsBackfillSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/FeaturesetVersion/backfill.json + */ + /** + * Sample code: Backfill Workspace Featureset Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + backfillWorkspaceFeaturesetVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.featuresetVersions() + .backfill("test-rg", "my-aml-workspace", "string", "string", + new FeaturesetVersionBackfillRequest() + .withDataAvailabilityStatus(Arrays.asList(DataAvailabilityStatus.NONE)) + .withDescription("string") + .withDisplayName("string") + .withFeatureWindow( + new FeatureWindow().withFeatureWindowEnd(OffsetDateTime.parse("2020-01-01T12:34:56.999+00:51")) + .withFeatureWindowStart(OffsetDateTime.parse("2020-01-01T12:34:56.999+00:51"))) + .withJobId("string") + .withResource(new MaterializationComputeResource().withInstanceType("string")) + .withSparkConfiguration(mapOf("string", "string")) + .withTags(mapOf("string", "string")), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetVersionsCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetVersionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..17bd111fbf527 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetVersionsCreateOrUpdateSamples.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.EmailNotificationEnableType; +import com.azure.resourcemanager.machinelearning.models.FeaturesetSpecification; +import com.azure.resourcemanager.machinelearning.models.FeaturesetVersionProperties; +import com.azure.resourcemanager.machinelearning.models.MaterializationComputeResource; +import com.azure.resourcemanager.machinelearning.models.MaterializationSettings; +import com.azure.resourcemanager.machinelearning.models.MaterializationStoreType; +import com.azure.resourcemanager.machinelearning.models.NotificationSetting; +import com.azure.resourcemanager.machinelearning.models.RecurrenceFrequency; +import com.azure.resourcemanager.machinelearning.models.RecurrenceSchedule; +import com.azure.resourcemanager.machinelearning.models.RecurrenceTrigger; +import com.azure.resourcemanager.machinelearning.models.WeekDay; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for FeaturesetVersions CreateOrUpdate. + */ +public final class FeaturesetVersionsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/FeaturesetVersion/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Workspace Featureset Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateWorkspaceFeaturesetVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.featuresetVersions() + .define("string") + .withExistingFeatureset("test-rg", "my-aml-workspace", "string") + .withProperties(new FeaturesetVersionProperties().withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsAnonymous(false) + .withIsArchived(false) + .withEntities(Arrays.asList("string")) + .withMaterializationSettings(new MaterializationSettings() + .withNotification( + new NotificationSetting().withEmailOn(Arrays.asList(EmailNotificationEnableType.JOB_FAILED)) + .withEmails(Arrays.asList("string"))) + .withResource(new MaterializationComputeResource().withInstanceType("string")) + .withSchedule(new RecurrenceTrigger().withEndTime("string") + .withStartTime("string") + .withTimeZone("string") + .withFrequency(RecurrenceFrequency.DAY) + .withInterval(1) + .withSchedule(new RecurrenceSchedule().withHours(Arrays.asList(1)) + .withMinutes(Arrays.asList(1)) + .withMonthDays(Arrays.asList(1)) + .withWeekDays(Arrays.asList(WeekDay.MONDAY)))) + .withSparkConfiguration(mapOf("string", "string")) + .withStoreType(MaterializationStoreType.ONLINE)) + .withSpecification(new FeaturesetSpecification().withPath("string")) + .withStage("string")) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetVersionsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetVersionsDeleteSamples.java new file mode 100644 index 0000000000000..a3228adc8cdde --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetVersionsDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for FeaturesetVersions Delete. + */ +public final class FeaturesetVersionsDeleteSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/FeaturesetVersion/delete.json + */ + /** + * Sample code: Delete Workspace Featureset Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + deleteWorkspaceFeaturesetVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.featuresetVersions() + .delete("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetVersionsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetVersionsGetSamples.java new file mode 100644 index 0000000000000..14a86c106c2e7 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetVersionsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for FeaturesetVersions Get. + */ +public final class FeaturesetVersionsGetSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/FeaturesetVersion/get.json + */ + /** + * Sample code: Get Workspace Featureset Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + getWorkspaceFeaturesetVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.featuresetVersions() + .getWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetVersionsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetVersionsListSamples.java new file mode 100644 index 0000000000000..4da42cdddb4f5 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturesetVersionsListSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** + * Samples for FeaturesetVersions List. + */ +public final class FeaturesetVersionsListSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/FeaturesetVersion/list.json + */ + /** + * Sample code: List Workspace Featureset Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + listWorkspaceFeaturesetVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.featuresetVersions() + .list("test-rg", "my-aml-workspace", "string", null, "string", ListViewType.ALL, null, null, null, null, + null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityContainersCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityContainersCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..3800e3cb98043 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityContainersCreateOrUpdateSamples.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.FeaturestoreEntityContainerProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for FeaturestoreEntityContainers CreateOrUpdate. + */ +public final class FeaturestoreEntityContainersCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/FeaturestoreEntityContainer/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Workspace Featurestore Entity Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateWorkspaceFeaturestoreEntityContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.featurestoreEntityContainers() + .define("string") + .withExistingWorkspace("test-rg", "my-aml-workspace") + .withProperties(new FeaturestoreEntityContainerProperties().withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsArchived(false)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityContainersDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityContainersDeleteSamples.java new file mode 100644 index 0000000000000..afa00b7c7eacd --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityContainersDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for FeaturestoreEntityContainers Delete. + */ +public final class FeaturestoreEntityContainersDeleteSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/FeaturestoreEntityContainer/delete.json + */ + /** + * Sample code: Delete Workspace Featurestore Entity Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void deleteWorkspaceFeaturestoreEntityContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.featurestoreEntityContainers() + .delete("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityContainersGetEntitySamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityContainersGetEntitySamples.java new file mode 100644 index 0000000000000..e72e2ca0cd770 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityContainersGetEntitySamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for FeaturestoreEntityContainers GetEntity. + */ +public final class FeaturestoreEntityContainersGetEntitySamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/FeaturestoreEntityContainer/getEntity.json + */ + /** + * Sample code: GetEntity Workspace Featurestore Entity Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getEntityWorkspaceFeaturestoreEntityContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.featurestoreEntityContainers() + .getEntityWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityContainersListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityContainersListSamples.java new file mode 100644 index 0000000000000..79a080896727a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityContainersListSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** + * Samples for FeaturestoreEntityContainers List. + */ +public final class FeaturestoreEntityContainersListSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/FeaturestoreEntityContainer/list.json + */ + /** + * Sample code: List Workspace Featurestore Entity Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listWorkspaceFeaturestoreEntityContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.featurestoreEntityContainers() + .list("test-rg", "my-aml-workspace", null, "string", ListViewType.ALL, null, null, null, null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityVersionsCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityVersionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..035d0dfb47ded --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityVersionsCreateOrUpdateSamples.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.FeatureDataType; +import com.azure.resourcemanager.machinelearning.models.FeaturestoreEntityVersionProperties; +import com.azure.resourcemanager.machinelearning.models.IndexColumn; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for FeaturestoreEntityVersions CreateOrUpdate. + */ +public final class FeaturestoreEntityVersionsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/FeaturestoreEntityVersion/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Workspace Featurestore Entity Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateWorkspaceFeaturestoreEntityVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.featurestoreEntityVersions() + .define("string") + .withExistingFeaturestoreEntity("test-rg", "my-aml-workspace", "string") + .withProperties( + new FeaturestoreEntityVersionProperties().withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsAnonymous(false) + .withIsArchived(false) + .withIndexColumns(Arrays + .asList(new IndexColumn().withColumnName("string").withDataType(FeatureDataType.DATETIME)))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityVersionsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityVersionsDeleteSamples.java new file mode 100644 index 0000000000000..f51848aa42bd3 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityVersionsDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for FeaturestoreEntityVersions Delete. + */ +public final class FeaturestoreEntityVersionsDeleteSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/FeaturestoreEntityVersion/delete.json + */ + /** + * Sample code: Delete Workspace Featurestore Entity Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void deleteWorkspaceFeaturestoreEntityVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.featurestoreEntityVersions() + .delete("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityVersionsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityVersionsGetSamples.java new file mode 100644 index 0000000000000..8eddc58fc5ee4 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityVersionsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for FeaturestoreEntityVersions Get. + */ +public final class FeaturestoreEntityVersionsGetSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/FeaturestoreEntityVersion/get.json + */ + /** + * Sample code: Get Workspace Featurestore Entity Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getWorkspaceFeaturestoreEntityVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.featurestoreEntityVersions() + .getWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityVersionsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityVersionsListSamples.java new file mode 100644 index 0000000000000..7cab290a022c0 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/FeaturestoreEntityVersionsListSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** + * Samples for FeaturestoreEntityVersions List. + */ +public final class FeaturestoreEntityVersionsListSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/FeaturestoreEntityVersion/list.json + */ + /** + * Sample code: List Workspace Featurestore Entity Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listWorkspaceFeaturestoreEntityVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.featurestoreEntityVersions() + .list("test-rg", "my-aml-workspace", "string", null, "string", ListViewType.ACTIVE_ONLY, null, null, null, + null, null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsCancelSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsCancelSamples.java index 3022117eaeaa9..c83910591344c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsCancelSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsCancelSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for Jobs Cancel. */ +/** + * Samples for Jobs Cancel. + */ public final class JobsCancelSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/cancel.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Job/cancel.json */ /** * Sample code: Cancel Job. - * + * * @param manager Entry point to MachineLearningManager. */ public static void cancelJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsCreateOrUpdateSamples.java index 394e954bdf1d0..d178828dbf945 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsCreateOrUpdateSamples.java @@ -10,17 +10,23 @@ import com.azure.resourcemanager.machinelearning.models.AutoMLJob; import com.azure.resourcemanager.machinelearning.models.CommandJob; import com.azure.resourcemanager.machinelearning.models.CommandJobLimits; +import com.azure.resourcemanager.machinelearning.models.CustomModelFineTuning; +import com.azure.resourcemanager.machinelearning.models.FineTuningJob; +import com.azure.resourcemanager.machinelearning.models.FineTuningTaskType; import com.azure.resourcemanager.machinelearning.models.Goal; import com.azure.resourcemanager.machinelearning.models.GridSamplingAlgorithm; import com.azure.resourcemanager.machinelearning.models.ImageClassification; import com.azure.resourcemanager.machinelearning.models.ImageLimitSettings; import com.azure.resourcemanager.machinelearning.models.ImageModelDistributionSettingsClassification; import com.azure.resourcemanager.machinelearning.models.ImageModelSettingsClassification; +import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; import com.azure.resourcemanager.machinelearning.models.JobResourceConfiguration; import com.azure.resourcemanager.machinelearning.models.JobService; import com.azure.resourcemanager.machinelearning.models.LiteralJobInput; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; import com.azure.resourcemanager.machinelearning.models.MedianStoppingPolicy; +import com.azure.resourcemanager.machinelearning.models.MLFlowModelJobInput; +import com.azure.resourcemanager.machinelearning.models.MLFlowModelJobOutput; +import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; import com.azure.resourcemanager.machinelearning.models.Mpi; import com.azure.resourcemanager.machinelearning.models.Objective; import com.azure.resourcemanager.machinelearning.models.OutputDeliveryMode; @@ -29,6 +35,7 @@ import com.azure.resourcemanager.machinelearning.models.SweepJobLimits; import com.azure.resourcemanager.machinelearning.models.TensorFlow; import com.azure.resourcemanager.machinelearning.models.TrialComponent; +import com.azure.resourcemanager.machinelearning.models.UriFileJobInput; import com.azure.resourcemanager.machinelearning.models.UriFileJobOutput; import java.io.IOException; import java.time.Duration; @@ -36,247 +43,219 @@ import java.util.HashMap; import java.util.Map; -/** Samples for Jobs CreateOrUpdate. */ +/** + * Samples for Jobs CreateOrUpdate. + */ public final class JobsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/AutoMLJob/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Job/AutoMLJob/createOrUpdate.json */ /** * Sample code: CreateOrUpdate AutoML Job. - * + * * @param manager Entry point to MachineLearningManager. */ public static void createOrUpdateAutoMLJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) throws IOException { - manager - .jobs() + manager.jobs() .define("string") .withExistingWorkspace("test-rg", "my-aml-workspace") - .withProperties( - new AutoMLJob() - .withDescription("string") - .withProperties(mapOf("string", "string")) - .withTags(mapOf("string", "string")) - .withComputeId("string") - .withDisplayName("string") - .withExperimentName("string") - .withIdentity(new AmlToken()) - .withIsArchived(false) - .withServices( - mapOf( - "string", - new JobService() - .withEndpoint("string") - .withJobServiceType("string") - .withPort(1) - .withProperties(mapOf("string", "string")))) - .withEnvironmentId("string") - .withEnvironmentVariables(mapOf("string", "string")) - .withOutputs( - mapOf( - "string", - new UriFileJobOutput() - .withDescription("string") - .withMode(OutputDeliveryMode.READ_WRITE_MOUNT) - .withUri("string"))) - .withResources( - new JobResourceConfiguration() - .withInstanceCount(1) - .withInstanceType("string") - .withProperties( - mapOf( - "string", - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"9bec0ab0-c62f-4fa9-a97c-7b24bbcc90ad\":null}", - Object.class, - SerializerEncoding.JSON)))) - .withTaskDetails( - new ImageClassification() - .withTargetColumnName("string") - .withTrainingData(new MLTableJobInput().withUri("string")) - .withModelSettings(new ImageModelSettingsClassification().withValidationCropSize(2)) - .withSearchSpace( - Arrays - .asList( - new ImageModelDistributionSettingsClassification() - .withValidationCropSize("choice(2, 360)"))) - .withLimitSettings(new ImageLimitSettings().withMaxTrials(2)))) + .withProperties(new AutoMLJob().withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withComputeId("string") + .withDisplayName("string") + .withExperimentName("string") + .withIdentity(new AmlToken()) + .withIsArchived(false) + .withServices(mapOf("string", + new JobService().withEndpoint("string") + .withJobServiceType("string") + .withPort(1) + .withProperties(mapOf("string", "string")))) + .withEnvironmentId("string") + .withEnvironmentVariables(mapOf("string", "string")) + .withOutputs(mapOf("string", + new UriFileJobOutput().withDescription("string") + .withMode(OutputDeliveryMode.READ_WRITE_MOUNT) + .withUri("string"))) + .withResources(new JobResourceConfiguration().withInstanceCount(1) + .withInstanceType("string") + .withProperties(mapOf("string", + SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"9bec0ab0-c62f-4fa9-a97c-7b24bbcc90ad\":null}", Object.class, + SerializerEncoding.JSON)))) + .withTaskDetails(new ImageClassification().withTargetColumnName("string") + .withTrainingData(new MLTableJobInput().withUri("string")) + .withModelSettings(new ImageModelSettingsClassification().withValidationCropSize(2)) + .withSearchSpace(Arrays.asList( + new ImageModelDistributionSettingsClassification().withValidationCropSize("choice(2, 360)"))) + .withLimitSettings(new ImageLimitSettings().withMaxTrials(2)))) .create(); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/SweepJob/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Job/SweepJob/createOrUpdate.json */ /** * Sample code: CreateOrUpdate Sweep Job. - * + * * @param manager Entry point to MachineLearningManager. */ public static void createOrUpdateSweepJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) throws IOException { - manager - .jobs() + manager.jobs() .define("string") .withExistingWorkspace("test-rg", "my-aml-workspace") - .withProperties( - new SweepJob() - .withDescription("string") - .withProperties(mapOf("string", "string")) - .withTags(mapOf("string", "string")) - .withComputeId("string") - .withDisplayName("string") - .withExperimentName("string") - .withServices( - mapOf( - "string", - new JobService() - .withEndpoint("string") - .withJobServiceType("string") - .withPort(1) - .withProperties(mapOf("string", "string")))) - .withEarlyTermination(new MedianStoppingPolicy().withDelayEvaluation(1).withEvaluationInterval(1)) - .withLimits( - new SweepJobLimits() - .withMaxConcurrentTrials(1) - .withMaxTotalTrials(1) - .withTrialTimeout(Duration.parse("PT1S"))) - .withObjective(new Objective().withGoal(Goal.MINIMIZE).withPrimaryMetric("string")) - .withSamplingAlgorithm(new GridSamplingAlgorithm()) - .withSearchSpace( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize("{\"string\":{}}", Object.class, SerializerEncoding.JSON)) - .withTrial( - new TrialComponent() - .withCodeId("fakeTokenPlaceholder") - .withCommand("string") - .withDistribution(new Mpi().withProcessCountPerInstance(1)) - .withEnvironmentId("string") - .withEnvironmentVariables(mapOf("string", "string")) - .withResources( - new JobResourceConfiguration() - .withInstanceCount(1) - .withInstanceType("string") - .withProperties( - mapOf( - "string", - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"e6b6493e-7d5e-4db3-be1e-306ec641327e\":null}", - Object.class, - SerializerEncoding.JSON)))))) + .withProperties(new SweepJob().withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withComputeId("string") + .withDisplayName("string") + .withExperimentName("string") + .withServices(mapOf("string", + new JobService().withEndpoint("string") + .withJobServiceType("string") + .withPort(1) + .withProperties(mapOf("string", "string")))) + .withEarlyTermination(new MedianStoppingPolicy().withDelayEvaluation(1).withEvaluationInterval(1)) + .withLimits(new SweepJobLimits().withMaxConcurrentTrials(1) + .withMaxTotalTrials(1) + .withTrialTimeout(Duration.parse("PT1S"))) + .withObjective(new Objective().withGoal(Goal.MINIMIZE).withPrimaryMetric("string")) + .withSamplingAlgorithm(new GridSamplingAlgorithm()) + .withSearchSpace(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"string\":{}}", Object.class, SerializerEncoding.JSON)) + .withTrial(new TrialComponent().withCodeId("fakeTokenPlaceholder") + .withCommand("string") + .withDistribution(new Mpi().withProcessCountPerInstance(1)) + .withEnvironmentId("string") + .withEnvironmentVariables(mapOf("string", "string")) + .withResources(new JobResourceConfiguration().withInstanceCount(1) + .withInstanceType("string") + .withProperties(mapOf("string", + SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"e6b6493e-7d5e-4db3-be1e-306ec641327e\":null}", Object.class, + SerializerEncoding.JSON)))))) .create(); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/PipelineJob/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Job/PipelineJob/createOrUpdate.json */ /** * Sample code: CreateOrUpdate Pipeline Job. - * + * * @param manager Entry point to MachineLearningManager. */ public static void createOrUpdatePipelineJob( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) throws IOException { - manager - .jobs() + manager.jobs() + .define("string") + .withExistingWorkspace("test-rg", "my-aml-workspace") + .withProperties(new PipelineJob().withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withComputeId("string") + .withDisplayName("string") + .withExperimentName("string") + .withServices(mapOf("string", + new JobService().withEndpoint("string") + .withJobServiceType("string") + .withPort(1) + .withProperties(mapOf("string", "string")))) + .withInputs(mapOf("string", new LiteralJobInput().withDescription("string").withValue("string"))) + .withOutputs(mapOf("string", + new UriFileJobOutput().withDescription("string") + .withMode(OutputDeliveryMode.UPLOAD) + .withUri("string"))) + .withSettings(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON))) + .create(); + } + + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Job/FineTuningJob/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate FineTuning Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + createOrUpdateFineTuningJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.jobs() .define("string") .withExistingWorkspace("test-rg", "my-aml-workspace") - .withProperties( - new PipelineJob() - .withDescription("string") - .withProperties(mapOf("string", "string")) - .withTags(mapOf("string", "string")) - .withComputeId("string") - .withDisplayName("string") - .withExperimentName("string") - .withServices( - mapOf( - "string", - new JobService() - .withEndpoint("string") - .withJobServiceType("string") - .withPort(1) - .withProperties(mapOf("string", "string")))) - .withInputs(mapOf("string", new LiteralJobInput().withDescription("string").withValue("string"))) - .withOutputs( - mapOf( - "string", - new UriFileJobOutput() - .withDescription("string") - .withMode(OutputDeliveryMode.UPLOAD) - .withUri("string"))) - .withSettings( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize("{}", Object.class, SerializerEncoding.JSON))) + .withProperties(new FineTuningJob().withExperimentName("llm-finetuning") + .withFineTuningDetails(new CustomModelFineTuning().withTaskType(FineTuningTaskType.TEXT_COMPLETION) + .withTrainingData(new UriFileJobInput().withMode(InputDeliveryMode.READ_ONLY_MOUNT) + .withUri("azureml://registries/azureml-meta/models/Llama-2-7b/versions/11")) + .withModel(new MLFlowModelJobInput().withMode(InputDeliveryMode.READ_ONLY_MOUNT) + .withUri("azureml://registries/azureml-meta/models/Llama-2-7b/versions/11"))) + .withOutputs(mapOf("string", + new MLFlowModelJobOutput().withDescription("string") + .withMode(OutputDeliveryMode.READ_WRITE_MOUNT) + .withUri("string")))) .create(); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/CommandJob/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Job/CommandJob/createOrUpdate.json */ /** * Sample code: CreateOrUpdate Command Job. - * + * * @param manager Entry point to MachineLearningManager. */ public static void createOrUpdateCommandJob( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) throws IOException { - manager - .jobs() + manager.jobs() .define("string") .withExistingWorkspace("test-rg", "my-aml-workspace") - .withProperties( - new CommandJob() - .withDescription("string") - .withProperties(mapOf("string", "string")) - .withTags(mapOf("string", "string")) - .withComputeId("string") - .withDisplayName("string") - .withExperimentName("string") - .withIdentity(new AmlToken()) - .withServices( - mapOf( - "string", - new JobService() - .withEndpoint("string") - .withJobServiceType("string") - .withPort(1) - .withProperties(mapOf("string", "string")))) - .withCodeId("fakeTokenPlaceholder") - .withCommand("string") - .withDistribution(new TensorFlow().withParameterServerCount(1).withWorkerCount(1)) - .withEnvironmentId("string") - .withEnvironmentVariables(mapOf("string", "string")) - .withInputs(mapOf("string", new LiteralJobInput().withDescription("string").withValue("string"))) - .withLimits(new CommandJobLimits().withTimeout(Duration.parse("PT5M"))) - .withOutputs( - mapOf( - "string", - new UriFileJobOutput() - .withDescription("string") - .withMode(OutputDeliveryMode.READ_WRITE_MOUNT) - .withUri("string"))) - .withResources( - new JobResourceConfiguration() - .withInstanceCount(1) - .withInstanceType("string") - .withProperties( - mapOf( - "string", - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"e6b6493e-7d5e-4db3-be1e-306ec641327e\":null}", - Object.class, - SerializerEncoding.JSON))))) + .withProperties(new CommandJob().withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withComputeId("string") + .withDisplayName("string") + .withExperimentName("string") + .withIdentity(new AmlToken()) + .withServices(mapOf("string", + new JobService().withEndpoint("string") + .withJobServiceType("string") + .withPort(1) + .withProperties(mapOf("string", "string")))) + .withCodeId("fakeTokenPlaceholder") + .withCommand("string") + .withDistribution(new TensorFlow().withParameterServerCount(1).withWorkerCount(1)) + .withEnvironmentId("string") + .withEnvironmentVariables(mapOf("string", "string")) + .withInputs(mapOf("string", new LiteralJobInput().withDescription("string").withValue("string"))) + .withLimits(new CommandJobLimits().withTimeout(Duration.parse("PT5M"))) + .withOutputs(mapOf("string", + new UriFileJobOutput().withDescription("string") + .withMode(OutputDeliveryMode.READ_WRITE_MOUNT) + .withUri("string"))) + .withResources(new JobResourceConfiguration().withInstanceCount(1) + .withInstanceType("string") + .withProperties(mapOf("string", + SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"e6b6493e-7d5e-4db3-be1e-306ec641327e\":null}", Object.class, + SerializerEncoding.JSON))))) .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsDeleteSamples.java index 8634125dda6dd..70a1c7c7e9f6e 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsDeleteSamples.java @@ -4,17 +4,24 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for Jobs Delete. */ +/** + * Samples for Jobs Delete. + */ public final class JobsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Job/delete.json */ /** * Sample code: Delete Job. - * + * * @param manager Entry point to MachineLearningManager. */ public static void deleteJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager.jobs().delete("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + manager.jobs() + .delete("test-rg", "my-aml-workspace", + "http://subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/my-favorite-aml-job", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsGetSamples.java index de450689ce60a..66bc10534736a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsGetSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for Jobs Get. */ +/** + * Samples for Jobs Get. + */ public final class JobsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/CommandJob/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Job/CommandJob/get.json */ /** * Sample code: Get Command Job. - * + * * @param manager Entry point to MachineLearningManager. */ public static void getCommandJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { @@ -19,11 +23,13 @@ public static void getCommandJob(com.azure.resourcemanager.machinelearning.Machi } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/AutoMLJob/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Job/AutoMLJob/get.json */ /** * Sample code: Get AutoML Job. - * + * * @param manager Entry point to MachineLearningManager. */ public static void getAutoMLJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { @@ -31,11 +37,13 @@ public static void getAutoMLJob(com.azure.resourcemanager.machinelearning.Machin } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/SweepJob/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Job/SweepJob/get.json */ /** * Sample code: Get Sweep Job. - * + * * @param manager Entry point to MachineLearningManager. */ public static void getSweepJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { @@ -43,14 +51,30 @@ public static void getSweepJob(com.azure.resourcemanager.machinelearning.Machine } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/PipelineJob/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Job/PipelineJob/get.json */ /** * Sample code: Get Pipeline Job. - * + * * @param manager Entry point to MachineLearningManager. */ public static void getPipelineJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager.jobs().getWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); } + + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Job/FineTuningJob/get.json + */ + /** + * Sample code: Get FineTuning Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void getFineTuningJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.jobs().getWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsListSamples.java index a5e1fdc1b6c31..eee058eee88dc 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/JobsListSamples.java @@ -4,59 +4,88 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for Jobs List. */ +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** + * Samples for Jobs List. + */ public final class JobsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/CommandJob/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Job/CommandJob/list.json */ /** * Sample code: List Command Job. - * + * * @param manager Entry point to MachineLearningManager. */ public static void listCommandJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .jobs() - .list("test-rg", "my-aml-workspace", null, "string", "string", null, com.azure.core.util.Context.NONE); + manager.jobs() + .list("test-rg", "my-aml-workspace", null, "string", "string", null, null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/PipelineJob/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Job/PipelineJob/list.json */ /** * Sample code: List Pipeline Job. - * + * * @param manager Entry point to MachineLearningManager. */ public static void listPipelineJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .jobs() - .list("test-rg", "my-aml-workspace", null, "string", "string", null, com.azure.core.util.Context.NONE); + manager.jobs() + .list("test-rg", "my-aml-workspace", null, "string", "string", null, null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Job/FineTuningJob/list.json + */ + /** + * Sample code: List FineTuning Job. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listFineTuningJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.jobs() + .list("test-rg", "my-aml-workspace", null, "string", "string", ListViewType.ALL, null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/SweepJob/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Job/SweepJob/list.json */ /** * Sample code: List Sweep Job. - * + * * @param manager Entry point to MachineLearningManager. */ public static void listSweepJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .jobs() - .list("test-rg", "my-aml-workspace", null, "string", "string", null, com.azure.core.util.Context.NONE); + manager.jobs() + .list("test-rg", "my-aml-workspace", null, "string", "string", null, null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/AutoMLJob/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Job/AutoMLJob/list.json */ /** * Sample code: List AutoML Job. - * + * * @param manager Entry point to MachineLearningManager. */ public static void listAutoMLJob(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager.jobs().list("test-rg", "my-aml-workspace", null, null, null, null, com.azure.core.util.Context.NONE); + manager.jobs() + .list("test-rg", "my-aml-workspace", null, null, null, null, null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ManagedNetworkProvisionsProvisionManagedNetworkSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ManagedNetworkProvisionsProvisionManagedNetworkSamples.java new file mode 100644 index 0000000000000..31e12448a616b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ManagedNetworkProvisionsProvisionManagedNetworkSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.ManagedNetworkProvisionOptions; + +/** + * Samples for ManagedNetworkProvisions ProvisionManagedNetwork. + */ +public final class ManagedNetworkProvisionsProvisionManagedNetworkSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/ManagedNetwork/provision.json + */ + /** + * Sample code: Provision ManagedNetwork. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + provisionManagedNetwork(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.managedNetworkProvisions() + .provisionManagedNetwork("test-rg", "aml-workspace-name", + new ManagedNetworkProvisionOptions().withIncludeSpark(false), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ManagedNetworkSettingsRuleCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ManagedNetworkSettingsRuleCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..daef0a4270238 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ManagedNetworkSettingsRuleCreateOrUpdateSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.FqdnOutboundRule; +import com.azure.resourcemanager.machinelearning.models.RuleCategory; +import com.azure.resourcemanager.machinelearning.models.RuleStatus; + +/** + * Samples for ManagedNetworkSettingsRule CreateOrUpdate. + */ +public final class ManagedNetworkSettingsRuleCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/ManagedNetwork/createOrUpdateRule.json + */ + /** + * Sample code: CreateOrUpdate ManagedNetworkSettingsRule. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateManagedNetworkSettingsRule( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.managedNetworkSettingsRules() + .define("rule_name_1") + .withExistingWorkspace("test-rg", "aml-workspace-name") + .withProperties(new FqdnOutboundRule().withCategory(RuleCategory.USER_DEFINED) + .withStatus(RuleStatus.ACTIVE) + .withDestination("destination_endpoint")) + .create(); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ManagedNetworkSettingsRuleDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ManagedNetworkSettingsRuleDeleteSamples.java new file mode 100644 index 0000000000000..b908df0cdf75a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ManagedNetworkSettingsRuleDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for ManagedNetworkSettingsRule Delete. + */ +public final class ManagedNetworkSettingsRuleDeleteSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/ManagedNetwork/deleteRule.json + */ + /** + * Sample code: Delete ManagedNetworkSettingsRule. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + deleteManagedNetworkSettingsRule(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.managedNetworkSettingsRules() + .delete("test-rg", "aml-workspace-name", "rule-name", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ManagedNetworkSettingsRuleGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ManagedNetworkSettingsRuleGetSamples.java new file mode 100644 index 0000000000000..6a5d92c9f70fa --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ManagedNetworkSettingsRuleGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for ManagedNetworkSettingsRule Get. + */ +public final class ManagedNetworkSettingsRuleGetSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/ManagedNetwork/getRule.json + */ + /** + * Sample code: Get ManagedNetworkSettingsRule. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + getManagedNetworkSettingsRule(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.managedNetworkSettingsRules() + .getWithResponse("test-rg", "aml-workspace-name", "name_of_the_fqdn_rule", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ManagedNetworkSettingsRuleListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ManagedNetworkSettingsRuleListSamples.java new file mode 100644 index 0000000000000..b6f50f1fe7c41 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ManagedNetworkSettingsRuleListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for ManagedNetworkSettingsRule List. + */ +public final class ManagedNetworkSettingsRuleListSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/ManagedNetwork/listRule.json + */ + /** + * Sample code: List ManagedNetworkSettingsRule. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + listManagedNetworkSettingsRule(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.managedNetworkSettingsRules().list("test-rg", "aml-workspace-name", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/MarketplaceSubscriptionsCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/MarketplaceSubscriptionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..fa9301d4d7a1b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/MarketplaceSubscriptionsCreateOrUpdateSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.MarketplaceSubscriptionProperties; + +/** + * Samples for MarketplaceSubscriptions CreateOrUpdate. + */ +public final class MarketplaceSubscriptionsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/MarketplaceSubscription/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Workspace Marketplace Subscription. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateWorkspaceMarketplaceSubscription( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.marketplaceSubscriptions() + .define("string") + .withExistingWorkspace("test-rg", "my-aml-workspace") + .withProperties(new MarketplaceSubscriptionProperties().withModelId("string")) + .create(); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/MarketplaceSubscriptionsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/MarketplaceSubscriptionsDeleteSamples.java new file mode 100644 index 0000000000000..a9bb82801bce6 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/MarketplaceSubscriptionsDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for MarketplaceSubscriptions Delete. + */ +public final class MarketplaceSubscriptionsDeleteSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/MarketplaceSubscription/delete.json + */ + /** + * Sample code: Delete Workspace Marketplace Subscription. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void deleteWorkspaceMarketplaceSubscription( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.marketplaceSubscriptions() + .delete("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/MarketplaceSubscriptionsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/MarketplaceSubscriptionsGetSamples.java new file mode 100644 index 0000000000000..778f3ea40b156 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/MarketplaceSubscriptionsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for MarketplaceSubscriptions Get. + */ +public final class MarketplaceSubscriptionsGetSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/MarketplaceSubscription/get.json + */ + /** + * Sample code: Get Workspace Marketplace Subscription. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + getWorkspaceMarketplaceSubscription(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.marketplaceSubscriptions() + .getWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/MarketplaceSubscriptionsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/MarketplaceSubscriptionsListSamples.java new file mode 100644 index 0000000000000..56dba692a0f62 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/MarketplaceSubscriptionsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for MarketplaceSubscriptions List. + */ +public final class MarketplaceSubscriptionsListSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/MarketplaceSubscription/list.json + */ + /** + * Sample code: List Workspace Marketplace Subscription. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + listWorkspaceMarketplaceSubscription(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.marketplaceSubscriptions().list("test-rg", "my-aml-workspace", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersCreateOrUpdateSamples.java index 677398e18bd28..8738819a9499e 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersCreateOrUpdateSamples.java @@ -4,33 +4,36 @@ package com.azure.resourcemanager.machinelearning.generated; +import com.azure.resourcemanager.machinelearning.fluent.models.ModelContainerInner; import com.azure.resourcemanager.machinelearning.models.ModelContainerProperties; import java.util.HashMap; import java.util.Map; -/** Samples for ModelContainers CreateOrUpdate. */ +/** + * Samples for ModelContainers CreateOrUpdate. + */ public final class ModelContainersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelContainer/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ModelContainer/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Model Container. - * + * Sample code: CreateOrUpdate Workspace Model Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateModelContainer( + public static void createOrUpdateWorkspaceModelContainer( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .modelContainers() - .define("testContainer") - .withExistingWorkspace("testrg123", "workspace123") - .withProperties( - new ModelContainerProperties() - .withDescription("Model container description") - .withTags(mapOf("tag1", "value1", "tag2", "value2"))) - .create(); + manager.modelContainers() + .createOrUpdateWithResponse("testrg123", "workspace123", "testContainer", + new ModelContainerInner() + .withProperties(new ModelContainerProperties().withDescription("Model container description") + .withTags(mapOf("tag1", "value1", "tag2", "value2"))), + com.azure.core.util.Context.NONE); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersDeleteSamples.java index 886e7ad2633df..f6d303a947ec6 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersDeleteSamples.java @@ -4,19 +4,23 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for ModelContainers Delete. */ +/** + * Samples for ModelContainers Delete. + */ public final class ModelContainersDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelContainer/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ModelContainer/delete.json */ /** - * Sample code: Delete Model Container. - * + * Sample code: Delete Workspace Model Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void deleteModelContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .modelContainers() + public static void + deleteWorkspaceModelContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.modelContainers() .deleteWithResponse("testrg123", "workspace123", "testContainer", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersGetSamples.java index d673453574060..ddf54e0a54989 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersGetSamples.java @@ -4,19 +4,23 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for ModelContainers Get. */ +/** + * Samples for ModelContainers Get. + */ public final class ModelContainersGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelContainer/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ModelContainer/get.json */ /** - * Sample code: Get Model Container. - * + * Sample code: Get Workspace Model Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void getModelContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .modelContainers() + public static void + getWorkspaceModelContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.modelContainers() .getWithResponse("testrg123", "workspace123", "testContainer", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersListSamples.java index c093dc594bcbb..335ac74996f4b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersListSamples.java @@ -4,17 +4,22 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for ModelContainers List. */ +/** + * Samples for ModelContainers List. + */ public final class ModelContainersListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelContainer/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ModelContainer/list.json */ /** - * Sample code: List Model Container. - * + * Sample code: List Workspace Model Container. + * * @param manager Entry point to MachineLearningManager. */ - public static void listModelContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void + listWorkspaceModelContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager.modelContainers().list("testrg123", "workspace123", null, null, null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsCreateOrUpdateSamples.java index 878dfda340fdb..911c0c3fab427 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsCreateOrUpdateSamples.java @@ -4,39 +4,41 @@ package com.azure.resourcemanager.machinelearning.generated; +import com.azure.resourcemanager.machinelearning.fluent.models.ModelVersionInner; import com.azure.resourcemanager.machinelearning.models.FlavorData; import com.azure.resourcemanager.machinelearning.models.ModelVersionProperties; import java.util.HashMap; import java.util.Map; -/** Samples for ModelVersions CreateOrUpdate. */ +/** + * Samples for ModelVersions CreateOrUpdate. + */ public final class ModelVersionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelVersion/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ModelVersion/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Model Version. - * + * Sample code: CreateOrUpdate Workspace Model Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateModelVersion( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .modelVersions() - .define("string") - .withExistingModel("test-rg", "my-aml-workspace", "string") - .withProperties( - new ModelVersionProperties() - .withDescription("string") + public static void + createOrUpdateWorkspaceModelVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.modelVersions() + .createOrUpdateWithResponse("test-rg", "my-aml-workspace", "string", "string", + new ModelVersionInner().withProperties(new ModelVersionProperties().withDescription("string") .withProperties(mapOf("string", "string")) .withTags(mapOf("string", "string")) .withIsAnonymous(false) .withFlavors(mapOf("string", new FlavorData().withData(mapOf("string", "string")))) .withModelType("CustomModel") - .withModelUri("string")) - .create(); + .withModelUri("string")), + com.azure.core.util.Context.NONE); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsDeleteSamples.java index a47b4bf440298..03e65d310e63b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsDeleteSamples.java @@ -4,19 +4,23 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for ModelVersions Delete. */ +/** + * Samples for ModelVersions Delete. + */ public final class ModelVersionsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelVersion/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ModelVersion/delete.json */ /** - * Sample code: Delete Model Version. - * + * Sample code: Delete Workspace Model Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void deleteModelVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .modelVersions() + public static void + deleteWorkspaceModelVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.modelVersions() .deleteWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsGetSamples.java index 6b3472f7fce9e..e3bd261a81007 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsGetSamples.java @@ -4,19 +4,23 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for ModelVersions Get. */ +/** + * Samples for ModelVersions Get. + */ public final class ModelVersionsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelVersion/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ModelVersion/get.json */ /** - * Sample code: Get Model Version. - * + * Sample code: Get Workspace Model Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void getModelVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .modelVersions() + public static void + getWorkspaceModelVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.modelVersions() .getWithResponse("test-rg", "my-aml-workspace", "string", "string", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsListSamples.java index f5dffaa0e7938..59fbb768f01d7 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsListSamples.java @@ -4,33 +4,24 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for ModelVersions List. */ +/** + * Samples for ModelVersions List. + */ public final class ModelVersionsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelVersion/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ModelVersion/list.json */ /** - * Sample code: List Model Version. - * + * Sample code: List Workspace Model Version. + * * @param manager Entry point to MachineLearningManager. */ - public static void listModelVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .modelVersions() - .list( - "test-rg", - "my-aml-workspace", - "string", - null, - "string", - 1, - "string", - "string", - 1, - "string", - "string", - null, - null, - com.azure.core.util.Context.NONE); + public static void + listWorkspaceModelVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.modelVersions() + .list("test-rg", "my-aml-workspace", "string", null, "string", 1, "string", "string", 1, "string", "string", + null, null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsPublishSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsPublishSamples.java new file mode 100644 index 0000000000000..b4ffa6a3116b6 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsPublishSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.DestinationAsset; + +/** + * Samples for ModelVersions Publish. + */ +public final class ModelVersionsPublishSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ModelVersion/publish.json + */ + /** + * Sample code: Publish Workspace Model Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + publishWorkspaceModelVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.modelVersions() + .publish("test-rg", "my-aml-workspace", "string", "string", + new DestinationAsset().withDestinationName("string") + .withDestinationVersion("string") + .withRegistryName("string"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsCreateOrUpdateSamples.java index 3043d9ccc18f4..2c38da6f3d133 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsCreateOrUpdateSamples.java @@ -21,136 +21,117 @@ import java.util.HashMap; import java.util.Map; -/** Samples for OnlineDeployments CreateOrUpdate. */ +/** + * Samples for OnlineDeployments CreateOrUpdate. + */ public final class OnlineDeploymentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/KubernetesOnlineDeployment/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/OnlineDeployment/KubernetesOnlineDeployment/createOrUpdate.json */ /** * Sample code: CreateOrUpdate Kubernetes Online Deployment. - * + * * @param manager Entry point to MachineLearningManager. */ public static void createOrUpdateKubernetesOnlineDeployment( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .onlineDeployments() + manager.onlineDeployments() .define("testDeploymentName") .withRegion("string") .withExistingOnlineEndpoint("test-rg", "my-aml-workspace", "testEndpointName") - .withProperties( - new KubernetesOnlineDeployment() - .withCodeConfiguration( - new CodeConfiguration().withCodeId("fakeTokenPlaceholder").withScoringScript("string")) - .withDescription("string") - .withEnvironmentId("string") - .withEnvironmentVariables(mapOf("string", "string")) - .withProperties(mapOf("string", "string")) - .withAppInsightsEnabled(false) - .withInstanceType("string") - .withLivenessProbe( - new ProbeSettings() - .withFailureThreshold(1) - .withInitialDelay(Duration.parse("PT5M")) - .withPeriod(Duration.parse("PT5M")) - .withSuccessThreshold(1) - .withTimeout(Duration.parse("PT5M"))) - .withModel("string") - .withModelMountPath("string") - .withRequestSettings( - new OnlineRequestSettings() - .withMaxConcurrentRequestsPerInstance(1) - .withMaxQueueWait(Duration.parse("PT5M")) - .withRequestTimeout(Duration.parse("PT5M"))) - .withScaleSettings(new DefaultScaleSettings()) - .withContainerResourceRequirements( - new ContainerResourceRequirements() - .withContainerResourceLimits( - new ContainerResourceSettings().withCpu("\"1\"").withGpu("\"1\"").withMemory("\"2Gi\"")) - .withContainerResourceRequests( - new ContainerResourceSettings() - .withCpu("\"1\"") - .withGpu("\"1\"") - .withMemory("\"2Gi\"")))) + .withProperties(new KubernetesOnlineDeployment() + .withCodeConfiguration( + new CodeConfiguration().withCodeId("fakeTokenPlaceholder").withScoringScript("string")) + .withDescription("string") + .withEnvironmentId("string") + .withEnvironmentVariables(mapOf("string", "string")) + .withProperties(mapOf("string", "string")) + .withAppInsightsEnabled(false) + .withInstanceType("string") + .withLivenessProbe(new ProbeSettings().withFailureThreshold(1) + .withInitialDelay(Duration.parse("PT5M")) + .withPeriod(Duration.parse("PT5M")) + .withSuccessThreshold(1) + .withTimeout(Duration.parse("PT5M"))) + .withModel("string") + .withModelMountPath("string") + .withRequestSettings(new OnlineRequestSettings().withMaxConcurrentRequestsPerInstance(1) + .withMaxQueueWait(Duration.parse("PT5M")) + .withRequestTimeout(Duration.parse("PT5M"))) + .withScaleSettings(new DefaultScaleSettings()) + .withContainerResourceRequirements(new ContainerResourceRequirements() + .withContainerResourceLimits( + new ContainerResourceSettings().withCpu("\"1\"").withGpu("\"1\"").withMemory("\"2Gi\"")) + .withContainerResourceRequests( + new ContainerResourceSettings().withCpu("\"1\"").withGpu("\"1\"").withMemory("\"2Gi\"")))) .withTags(mapOf()) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) .withKind("string") - .withSku( - new Sku() - .withName("string") - .withTier(SkuTier.FREE) - .withSize("string") - .withFamily("string") - .withCapacity(1)) + .withSku(new Sku().withName("string") + .withTier(SkuTier.FREE) + .withSize("string") + .withFamily("string") + .withCapacity(1)) .create(); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/ManagedOnlineDeployment/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/OnlineDeployment/ManagedOnlineDeployment/createOrUpdate.json */ /** * Sample code: CreateOrUpdate Managed Online Deployment. - * + * * @param manager Entry point to MachineLearningManager. */ public static void createOrUpdateManagedOnlineDeployment( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .onlineDeployments() + manager.onlineDeployments() .define("testDeploymentName") .withRegion("string") .withExistingOnlineEndpoint("test-rg", "my-aml-workspace", "testEndpointName") - .withProperties( - new ManagedOnlineDeployment() - .withCodeConfiguration( - new CodeConfiguration().withCodeId("fakeTokenPlaceholder").withScoringScript("string")) - .withDescription("string") - .withEnvironmentId("string") - .withEnvironmentVariables(mapOf("string", "string")) - .withProperties(mapOf("string", "string")) - .withAppInsightsEnabled(false) - .withInstanceType("string") - .withLivenessProbe( - new ProbeSettings() - .withFailureThreshold(1) - .withInitialDelay(Duration.parse("PT5M")) - .withPeriod(Duration.parse("PT5M")) - .withSuccessThreshold(1) - .withTimeout(Duration.parse("PT5M"))) - .withModel("string") - .withModelMountPath("string") - .withReadinessProbe( - new ProbeSettings() - .withFailureThreshold(30) - .withInitialDelay(Duration.parse("PT1S")) - .withPeriod(Duration.parse("PT10S")) - .withSuccessThreshold(1) - .withTimeout(Duration.parse("PT2S"))) - .withRequestSettings( - new OnlineRequestSettings() - .withMaxConcurrentRequestsPerInstance(1) - .withMaxQueueWait(Duration.parse("PT5M")) - .withRequestTimeout(Duration.parse("PT5M"))) - .withScaleSettings(new DefaultScaleSettings())) + .withProperties(new ManagedOnlineDeployment() + .withCodeConfiguration( + new CodeConfiguration().withCodeId("fakeTokenPlaceholder").withScoringScript("string")) + .withDescription("string") + .withEnvironmentId("string") + .withEnvironmentVariables(mapOf("string", "string")) + .withProperties(mapOf("string", "string")) + .withAppInsightsEnabled(false) + .withInstanceType("string") + .withLivenessProbe(new ProbeSettings().withFailureThreshold(1) + .withInitialDelay(Duration.parse("PT5M")) + .withPeriod(Duration.parse("PT5M")) + .withSuccessThreshold(1) + .withTimeout(Duration.parse("PT5M"))) + .withModel("string") + .withModelMountPath("string") + .withReadinessProbe(new ProbeSettings().withFailureThreshold(30) + .withInitialDelay(Duration.parse("PT1S")) + .withPeriod(Duration.parse("PT10S")) + .withSuccessThreshold(1) + .withTimeout(Duration.parse("PT2S"))) + .withRequestSettings(new OnlineRequestSettings().withMaxConcurrentRequestsPerInstance(1) + .withMaxQueueWait(Duration.parse("PT5M")) + .withRequestTimeout(Duration.parse("PT5M"))) + .withScaleSettings(new DefaultScaleSettings())) .withTags(mapOf()) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) .withKind("string") - .withSku( - new Sku() - .withName("string") - .withTier(SkuTier.FREE) - .withSize("string") - .withFamily("string") - .withCapacity(1)) + .withSku(new Sku().withName("string") + .withTier(SkuTier.FREE) + .withSize("string") + .withFamily("string") + .withCapacity(1)) .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsDeleteSamples.java index b55caae866863..a8aadf903142a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsDeleteSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for OnlineDeployments Delete. */ +/** + * Samples for OnlineDeployments Delete. + */ public final class OnlineDeploymentsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/OnlineDeployment/delete.json */ /** - * Sample code: Delete Online Deployment. - * + * Sample code: Delete Workspace Online Deployment. + * * @param manager Entry point to MachineLearningManager. */ - public static void deleteOnlineDeployment( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .onlineDeployments() + public static void + deleteWorkspaceOnlineDeployment(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.onlineDeployments() .delete("testrg123", "workspace123", "testEndpoint", "testDeployment", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsGetLogsSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsGetLogsSamples.java index 52bb9772696f9..60e6f1026ed80 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsGetLogsSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsGetLogsSamples.java @@ -7,25 +7,24 @@ import com.azure.resourcemanager.machinelearning.models.ContainerType; import com.azure.resourcemanager.machinelearning.models.DeploymentLogsRequest; -/** Samples for OnlineDeployments GetLogs. */ +/** + * Samples for OnlineDeployments GetLogs. + */ public final class OnlineDeploymentsGetLogsSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/getLogs.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/OnlineDeployment/getLogs.json */ /** * Sample code: Get Online Deployment Logs. - * + * * @param manager Entry point to MachineLearningManager. */ - public static void getOnlineDeploymentLogs( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .onlineDeployments() - .getLogsWithResponse( - "testrg123", - "workspace123", - "testEndpoint", - "testDeployment", + public static void + getOnlineDeploymentLogs(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.onlineDeployments() + .getLogsWithResponse("testrg123", "workspace123", "testEndpoint", "testDeployment", new DeploymentLogsRequest().withContainerType(ContainerType.STORAGE_INITIALIZER).withTail(0), com.azure.core.util.Context.NONE); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsGetSamples.java index 1f3ce3be094ee..8b2abcc7cc274 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsGetSamples.java @@ -4,45 +4,41 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for OnlineDeployments Get. */ +/** + * Samples for OnlineDeployments Get. + */ public final class OnlineDeploymentsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/KubernetesOnlineDeployment/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/OnlineDeployment/KubernetesOnlineDeployment/get.json */ /** * Sample code: Get Kubernetes Online Deployment. - * + * * @param manager Entry point to MachineLearningManager. */ - public static void getKubernetesOnlineDeployment( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .onlineDeployments() - .getWithResponse( - "test-rg", - "my-aml-workspace", - "testEndpointName", - "testDeploymentName", + public static void + getKubernetesOnlineDeployment(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.onlineDeployments() + .getWithResponse("test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/ManagedOnlineDeployment/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/OnlineDeployment/ManagedOnlineDeployment/get.json */ /** * Sample code: Get Managed Online Deployment. - * + * * @param manager Entry point to MachineLearningManager. */ - public static void getManagedOnlineDeployment( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .onlineDeployments() - .getWithResponse( - "test-rg", - "my-aml-workspace", - "testEndpointName", - "testDeploymentName", + public static void + getManagedOnlineDeployment(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.onlineDeployments() + .getWithResponse("test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsListSamples.java index 10373db08f210..c0a5c9153fabc 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsListSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for OnlineDeployments List. */ +/** + * Samples for OnlineDeployments List. + */ public final class OnlineDeploymentsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/OnlineDeployment/list.json */ /** * Sample code: List Online Deployments. - * + * * @param manager Entry point to MachineLearningManager. */ public static void listOnlineDeployments(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .onlineDeployments() - .list( - "test-rg", "my-aml-workspace", "testEndpointName", "string", 1, null, com.azure.core.util.Context.NONE); + manager.onlineDeployments() + .list("test-rg", "my-aml-workspace", "testEndpointName", "string", 1, null, + com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsListSkusSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsListSkusSamples.java index bf08722862482..64b8d15a0c5e4 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsListSkusSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsListSkusSamples.java @@ -4,49 +4,41 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for OnlineDeployments ListSkus. */ +/** + * Samples for OnlineDeployments ListSkus. + */ public final class OnlineDeploymentsListSkusSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/ManagedOnlineDeployment/listSkus.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/OnlineDeployment/ManagedOnlineDeployment/listSkus.json */ /** * Sample code: List Managed Online Deployment Skus. - * + * * @param manager Entry point to MachineLearningManager. */ - public static void listManagedOnlineDeploymentSkus( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .onlineDeployments() - .listSkus( - "test-rg", - "my-aml-workspace", - "testEndpointName", - "testDeploymentName", - 1, - null, + public static void + listManagedOnlineDeploymentSkus(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.onlineDeployments() + .listSkus("test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", 1, null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/KubernetesOnlineDeployment/listSkus.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/OnlineDeployment/KubernetesOnlineDeployment/listSkus.json */ /** * Sample code: List Kubernetes Online Deployment Skus. - * + * * @param manager Entry point to MachineLearningManager. */ - public static void listKubernetesOnlineDeploymentSkus( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .onlineDeployments() - .listSkus( - "test-rg", - "my-aml-workspace", - "testEndpointName", - "testDeploymentName", - 1, - null, + public static void + listKubernetesOnlineDeploymentSkus(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.onlineDeployments() + .listSkus("test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", 1, null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsUpdateSamples.java index 45cf7405cce15..ffa26259b89a2 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsUpdateSamples.java @@ -10,74 +10,63 @@ import java.util.HashMap; import java.util.Map; -/** Samples for OnlineDeployments Update. */ +/** + * Samples for OnlineDeployments Update. + */ public final class OnlineDeploymentsUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/ManagedOnlineDeployment/update.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/OnlineDeployment/ManagedOnlineDeployment/update.json */ /** * Sample code: Update Managed Online Deployment. - * + * * @param manager Entry point to MachineLearningManager. */ - public static void updateManagedOnlineDeployment( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - OnlineDeployment resource = - manager - .onlineDeployments() - .getWithResponse( - "test-rg", - "my-aml-workspace", - "testEndpointName", - "testDeploymentName", - com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + public static void + updateManagedOnlineDeployment(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + OnlineDeployment resource = manager.onlineDeployments() + .getWithResponse("test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf()) - .withSku( - new PartialSku() - .withCapacity(1) - .withFamily("string") - .withName("string") - .withSize("string") - .withTier(SkuTier.FREE)) + .withSku(new PartialSku().withCapacity(1) + .withFamily("string") + .withName("string") + .withSize("string") + .withTier(SkuTier.FREE)) .apply(); } /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/KubernetesOnlineDeployment/update.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/OnlineDeployment/KubernetesOnlineDeployment/update.json */ /** * Sample code: Update Kubernetes Online Deployment. - * + * * @param manager Entry point to MachineLearningManager. */ - public static void updateKubernetesOnlineDeployment( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - OnlineDeployment resource = - manager - .onlineDeployments() - .getWithResponse( - "test-rg", - "my-aml-workspace", - "testEndpointName", - "testDeploymentName", - com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + public static void + updateKubernetesOnlineDeployment(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + OnlineDeployment resource = manager.onlineDeployments() + .getWithResponse("test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf()) - .withSku( - new PartialSku() - .withCapacity(1) - .withFamily("string") - .withName("string") - .withSize("string") - .withTier(SkuTier.FREE)) + .withSku(new PartialSku().withCapacity(1) + .withFamily("string") + .withName("string") + .withSize("string") + .withTier(SkuTier.FREE)) .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsCreateOrUpdateSamples.java index c5a7830b8a283..c4cf2f0217ae2 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsCreateOrUpdateSamples.java @@ -14,46 +14,44 @@ import java.util.HashMap; import java.util.Map; -/** Samples for OnlineEndpoints CreateOrUpdate. */ +/** + * Samples for OnlineEndpoints CreateOrUpdate. + */ public final class OnlineEndpointsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/OnlineEndpoint/createOrUpdate.json */ /** - * Sample code: CreateOrUpdate Online Endpoint. - * + * Sample code: CreateOrUpdate Workspace Online Endpoint. + * * @param manager Entry point to MachineLearningManager. */ - public static void createOrUpdateOnlineEndpoint( + public static void createOrUpdateWorkspaceOnlineEndpoint( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .onlineEndpoints() + manager.onlineEndpoints() .define("testEndpointName") .withRegion("string") .withExistingWorkspace("test-rg", "my-aml-workspace") - .withProperties( - new OnlineEndpointProperties() - .withAuthMode(EndpointAuthMode.AMLTOKEN) - .withDescription("string") - .withProperties(mapOf("string", "string")) - .withCompute("string") - .withTraffic(mapOf("string", 1))) + .withProperties(new OnlineEndpointProperties().withAuthMode(EndpointAuthMode.AMLTOKEN) + .withDescription("string") + .withProperties(mapOf("string", "string")) + .withCompute("string") + .withTraffic(mapOf("string", 1))) .withTags(mapOf()) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) .withKind("string") - .withSku( - new Sku() - .withName("string") - .withTier(SkuTier.FREE) - .withSize("string") - .withFamily("string") - .withCapacity(1)) + .withSku(new Sku().withName("string") + .withTier(SkuTier.FREE) + .withSize("string") + .withFamily("string") + .withCapacity(1)) .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsDeleteSamples.java index e5728f1084b12..52b821d27e598 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsDeleteSamples.java @@ -4,19 +4,23 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for OnlineEndpoints Delete. */ +/** + * Samples for OnlineEndpoints Delete. + */ public final class OnlineEndpointsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/OnlineEndpoint/delete.json */ /** - * Sample code: Delete Online Endpoint. - * + * Sample code: Delete Workspace Online Endpoint. + * * @param manager Entry point to MachineLearningManager. */ - public static void deleteOnlineEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .onlineEndpoints() + public static void + deleteWorkspaceOnlineEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.onlineEndpoints() .delete("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsGetSamples.java index 7bb869bf92cb4..01ff812417c82 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsGetSamples.java @@ -4,19 +4,23 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for OnlineEndpoints Get. */ +/** + * Samples for OnlineEndpoints Get. + */ public final class OnlineEndpointsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/OnlineEndpoint/get.json */ /** - * Sample code: Get Online Endpoint. - * + * Sample code: Get Workspace Online Endpoint. + * * @param manager Entry point to MachineLearningManager. */ - public static void getOnlineEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .onlineEndpoints() + public static void + getWorkspaceOnlineEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.onlineEndpoints() .getWithResponse("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsGetTokenSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsGetTokenSamples.java index 0bddb517bc738..56a6a4ce7986b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsGetTokenSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsGetTokenSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for OnlineEndpoints GetToken. */ +/** + * Samples for OnlineEndpoints GetToken. + */ public final class OnlineEndpointsGetTokenSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/getToken.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/OnlineEndpoint/getToken.json */ /** - * Sample code: GetToken Online Endpoint. - * + * Sample code: GetToken Workspace Online Endpoint. + * * @param manager Entry point to MachineLearningManager. */ - public static void getTokenOnlineEndpoint( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .onlineEndpoints() + public static void + getTokenWorkspaceOnlineEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.onlineEndpoints() .getTokenWithResponse("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsListKeysSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsListKeysSamples.java index 6ec08e5fd2fd7..057350fcd3c55 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsListKeysSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsListKeysSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for OnlineEndpoints ListKeys. */ +/** + * Samples for OnlineEndpoints ListKeys. + */ public final class OnlineEndpointsListKeysSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/listKeys.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/OnlineEndpoint/listKeys.json */ /** - * Sample code: ListKeys Online Endpoint. - * + * Sample code: ListKeys Workspace Online Endpoint. + * * @param manager Entry point to MachineLearningManager. */ - public static void listKeysOnlineEndpoint( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .onlineEndpoints() + public static void + listKeysWorkspaceOnlineEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.onlineEndpoints() .listKeysWithResponse("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsListSamples.java index 93ac7f0262cd3..af404b976323a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsListSamples.java @@ -7,29 +7,24 @@ import com.azure.resourcemanager.machinelearning.models.EndpointComputeType; import com.azure.resourcemanager.machinelearning.models.OrderString; -/** Samples for OnlineEndpoints List. */ +/** + * Samples for OnlineEndpoints List. + */ public final class OnlineEndpointsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/OnlineEndpoint/list.json */ /** - * Sample code: List Online Endpoint. - * + * Sample code: List Workspace Online Endpoint. + * * @param manager Entry point to MachineLearningManager. */ - public static void listOnlineEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .onlineEndpoints() - .list( - "test-rg", - "my-aml-workspace", - "string", - 1, - EndpointComputeType.MANAGED, - null, - "string", - "string", - OrderString.CREATED_AT_DESC, - com.azure.core.util.Context.NONE); + public static void + listWorkspaceOnlineEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.onlineEndpoints() + .list("test-rg", "my-aml-workspace", "string", 1, EndpointComputeType.MANAGED, null, "string", "string", + OrderString.CREATED_AT_DESC, com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsRegenerateKeysSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsRegenerateKeysSamples.java index 9055f46d6d28c..9b2e1c2f7e55c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsRegenerateKeysSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsRegenerateKeysSamples.java @@ -7,24 +7,24 @@ import com.azure.resourcemanager.machinelearning.models.KeyType; import com.azure.resourcemanager.machinelearning.models.RegenerateEndpointKeysRequest; -/** Samples for OnlineEndpoints RegenerateKeys. */ +/** + * Samples for OnlineEndpoints RegenerateKeys. + */ public final class OnlineEndpointsRegenerateKeysSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/regenerateKeys.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/OnlineEndpoint/regenerateKeys.json */ /** - * Sample code: RegenerateKeys Online Endpoint. - * + * Sample code: RegenerateKeys Workspace Online Endpoint. + * * @param manager Entry point to MachineLearningManager. */ - public static void regenerateKeysOnlineEndpoint( + public static void regenerateKeysWorkspaceOnlineEndpoint( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .onlineEndpoints() - .regenerateKeys( - "test-rg", - "my-aml-workspace", - "testEndpointName", + manager.onlineEndpoints() + .regenerateKeys("test-rg", "my-aml-workspace", "testEndpointName", new RegenerateEndpointKeysRequest().withKeyType(KeyType.PRIMARY).withKeyValue("fakeTokenPlaceholder"), com.azure.core.util.Context.NONE); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsUpdateSamples.java index 617aea5a21ebb..0dd8dfbb1bb72 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsUpdateSamples.java @@ -13,38 +13,35 @@ import java.util.HashMap; import java.util.Map; -/** Samples for OnlineEndpoints Update. */ +/** + * Samples for OnlineEndpoints Update. + */ public final class OnlineEndpointsUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/update.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/OnlineEndpoint/update.json */ /** - * Sample code: Update Online Endpoint. - * + * Sample code: Update Workspace Online Endpoint. + * * @param manager Entry point to MachineLearningManager. */ - public static void updateOnlineEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) - throws IOException { - OnlineEndpoint resource = - manager - .onlineEndpoints() - .getWithResponse("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + public static void updateWorkspaceOnlineEndpoint( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) throws IOException { + OnlineEndpoint resource = manager.onlineEndpoints() + .getWithResponse("test-rg", "my-aml-workspace", "testEndpointName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf()) - .withIdentity( - new PartialManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities( - mapOf( - "string", - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize("{}", Object.class, SerializerEncoding.JSON)))) + .withIdentity(new PartialManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities(mapOf("string", + SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)))) .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OperationsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OperationsListSamples.java index ed6fb8689f40b..d1cdbafee0686 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OperationsListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/OperationsListSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for Operations List. */ +/** + * Samples for Operations List. + */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/operationsList.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/operationsList.json */ /** * Sample code: OperationsList. - * + * * @param manager Entry point to MachineLearningManager. */ public static void operationsList(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java index d694e37a8e51a..fcc165d63e739 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java @@ -7,25 +7,27 @@ import com.azure.resourcemanager.machinelearning.models.PrivateEndpointServiceConnectionStatus; import com.azure.resourcemanager.machinelearning.models.PrivateLinkServiceConnectionState; -/** Samples for PrivateEndpointConnections CreateOrUpdate. */ +/** + * Samples for PrivateEndpointConnections CreateOrUpdate. + */ public final class PrivateEndpointConnectionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/PrivateEndpointConnection/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/PrivateEndpointConnection/createOrUpdate.json */ /** * Sample code: WorkspacePutPrivateEndpointConnection. - * + * * @param manager Entry point to MachineLearningManager. */ public static void workspacePutPrivateEndpointConnection( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .privateEndpointConnections() + manager.privateEndpointConnections() .define("{privateEndpointConnectionName}") .withExistingWorkspace("rg-1234", "testworkspace") .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) .withDescription("Auto-Approved")) .create(); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsDeleteSamples.java index b51239dd78d90..48edc98b65ca6 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsDeleteSamples.java @@ -4,21 +4,24 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for PrivateEndpointConnections Delete. */ +/** + * Samples for PrivateEndpointConnections Delete. + */ public final class PrivateEndpointConnectionsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/PrivateEndpointConnection/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/PrivateEndpointConnection/delete.json */ /** * Sample code: WorkspaceDeletePrivateEndpointConnection. - * + * * @param manager Entry point to MachineLearningManager. */ public static void workspaceDeletePrivateEndpointConnection( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .privateEndpointConnections() - .deleteWithResponse( - "rg-1234", "testworkspace", "{privateEndpointConnectionName}", com.azure.core.util.Context.NONE); + manager.privateEndpointConnections() + .deleteWithResponse("rg-1234", "testworkspace", "{privateEndpointConnectionName}", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsGetSamples.java index fae483260cc07..9aea3fdbdd1d3 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsGetSamples.java @@ -4,21 +4,24 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for PrivateEndpointConnections Get. */ +/** + * Samples for PrivateEndpointConnections Get. + */ public final class PrivateEndpointConnectionsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/PrivateEndpointConnection/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/PrivateEndpointConnection/get.json */ /** * Sample code: WorkspaceGetPrivateEndpointConnection. - * + * * @param manager Entry point to MachineLearningManager. */ public static void workspaceGetPrivateEndpointConnection( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .privateEndpointConnections() - .getWithResponse( - "rg-1234", "testworkspace", "{privateEndpointConnectionName}", com.azure.core.util.Context.NONE); + manager.privateEndpointConnections() + .getWithResponse("rg-1234", "testworkspace", "{privateEndpointConnectionName}", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsListSamples.java index b815609fb93ba..497e7065e0431 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsListSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for PrivateEndpointConnections List. */ +/** + * Samples for PrivateEndpointConnections List. + */ public final class PrivateEndpointConnectionsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/PrivateEndpointConnection/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/PrivateEndpointConnection/list.json */ /** * Sample code: StorageAccountListPrivateEndpointConnections. - * + * * @param manager Entry point to MachineLearningManager. */ public static void storageAccountListPrivateEndpointConnections( diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkResourcesListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkResourcesListSamples.java index 5f7ca342d38f5..4d35d389f8060 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkResourcesListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkResourcesListSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for PrivateLinkResources List. */ +/** + * Samples for PrivateLinkResources List. + */ public final class PrivateLinkResourcesListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/PrivateLinkResource/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/PrivateLinkResource/list.json */ /** * Sample code: WorkspaceListPrivateLinkResources. - * + * * @param manager Entry point to MachineLearningManager. */ - public static void workspaceListPrivateLinkResources( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void + workspaceListPrivateLinkResources(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager.privateLinkResources().listWithResponse("rg-1234", "testworkspace", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/QuotasListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/QuotasListSamples.java index da38aefba0644..258f742a15e76 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/QuotasListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/QuotasListSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for Quotas List. */ +/** + * Samples for Quotas List. + */ public final class QuotasListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Quota/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Quota/list.json */ /** * Sample code: List workspace quotas by VMFamily. - * + * * @param manager Entry point to MachineLearningManager. */ - public static void listWorkspaceQuotasByVMFamily( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void + listWorkspaceQuotasByVMFamily(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager.quotas().list("eastus", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/QuotasUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/QuotasUpdateSamples.java index 7a5911910cf1a..8e998010542c2 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/QuotasUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/QuotasUpdateSamples.java @@ -9,37 +9,33 @@ import com.azure.resourcemanager.machinelearning.models.QuotaUpdateParameters; import java.util.Arrays; -/** Samples for Quotas Update. */ +/** + * Samples for Quotas Update. + */ public final class QuotasUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Quota/update.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Quota/update.json */ /** * Sample code: update quotas. - * + * * @param manager Entry point to MachineLearningManager. */ public static void updateQuotas(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .quotas() - .updateWithResponse( - "eastus", - new QuotaUpdateParameters() - .withValue( - Arrays - .asList( - new QuotaBaseProperties() - .withId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace1/quotas/Standard_DSv2_Family_Cluster_Dedicated_vCPUs") - .withType("Microsoft.MachineLearningServices/workspaces/quotas") - .withLimit(100L) - .withUnit(QuotaUnit.COUNT), - new QuotaBaseProperties() - .withId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace2/quotas/Standard_DSv2_Family_Cluster_Dedicated_vCPUs") - .withType("Microsoft.MachineLearningServices/workspaces/quotas") - .withLimit(200L) - .withUnit(QuotaUnit.COUNT))), + manager.quotas() + .updateWithResponse("eastus", new QuotaUpdateParameters().withValue(Arrays.asList( + new QuotaBaseProperties().withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace1/quotas/Standard_DSv2_Family_Cluster_Dedicated_vCPUs") + .withType("Microsoft.MachineLearningServices/workspaces/quotas") + .withLimit(100L) + .withUnit(QuotaUnit.COUNT), + new QuotaBaseProperties().withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace2/quotas/Standard_DSv2_Family_Cluster_Dedicated_vCPUs") + .withType("Microsoft.MachineLearningServices/workspaces/quotas") + .withLimit(200L) + .withUnit(QuotaUnit.COUNT))), com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..039ab7966e2e4 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesCreateOrUpdateSamples.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.AcrDetails; +import com.azure.resourcemanager.machinelearning.models.ArmResourceId; +import com.azure.resourcemanager.machinelearning.models.EndpointServiceConnectionStatus; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.machinelearning.models.PrivateEndpointResource; +import com.azure.resourcemanager.machinelearning.models.RegistryPrivateEndpointConnection; +import com.azure.resourcemanager.machinelearning.models.RegistryPrivateLinkServiceConnectionState; +import com.azure.resourcemanager.machinelearning.models.RegistryRegionArmDetails; +import com.azure.resourcemanager.machinelearning.models.Sku; +import com.azure.resourcemanager.machinelearning.models.SkuTier; +import com.azure.resourcemanager.machinelearning.models.StorageAccountDetails; +import com.azure.resourcemanager.machinelearning.models.SystemCreatedAcrAccount; +import com.azure.resourcemanager.machinelearning.models.SystemCreatedStorageAccount; +import com.azure.resourcemanager.machinelearning.models.UserAssignedIdentity; +import com.azure.resourcemanager.machinelearning.models.UserCreatedAcrAccount; +import com.azure.resourcemanager.machinelearning.models.UserCreatedStorageAccount; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Registries CreateOrUpdate. + */ +public final class RegistriesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registries/createOrUpdate-SystemCreated.json + */ + /** + * Sample code: CreateOrUpdate Registry with system created accounts. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateRegistryWithSystemCreatedAccounts( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registries() + .define("string") + .withRegion("string") + .withExistingResourceGroup("test-rg") + .withTags(mapOf()) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) + .withKind("string") + .withSku(new Sku().withName("string") + .withTier(SkuTier.FREE) + .withSize("string") + .withFamily("string") + .withCapacity(1)) + .withDiscoveryUrl("string") + .withIntellectualPropertyPublisher("string") + .withManagedResourceGroup(new ArmResourceId().withResourceId("string")) + .withMlFlowRegistryUri("string") + .withRegistryPrivateEndpointConnections( + Arrays.asList(new RegistryPrivateEndpointConnection().withId("string") + .withLocation("string") + .withGroupIds(Arrays.asList("string")) + .withPrivateEndpoint(new PrivateEndpointResource().withSubnetArmId("string")) + .withRegistryPrivateLinkServiceConnectionState( + new RegistryPrivateLinkServiceConnectionState().withActionsRequired("string") + .withDescription("string") + .withStatus(EndpointServiceConnectionStatus.APPROVED)) + .withProvisioningState("string"))) + .withPublicNetworkAccess("string") + .withRegionDetails(Arrays.asList(new RegistryRegionArmDetails() + .withAcrDetails(Arrays.asList(new AcrDetails() + .withSystemCreatedAcrAccount(new SystemCreatedAcrAccount().withAcrAccountName("string") + .withAcrAccountSku("string") + .withArmResourceId(new ArmResourceId().withResourceId("string"))))) + .withLocation("string") + .withStorageAccountDetails(Arrays.asList(new StorageAccountDetails() + .withSystemCreatedStorageAccount(new SystemCreatedStorageAccount().withAllowBlobPublicAccess(false) + .withArmResourceId(new ArmResourceId().withResourceId("string")) + .withStorageAccountHnsEnabled(false) + .withStorageAccountName("string") + .withStorageAccountType("string")))))) + .create(); + } + + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registries/createOrUpdate-UserCreated.json + */ + /** + * Sample code: CreateOrUpdate Registry with user created accounts. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateRegistryWithUserCreatedAccounts( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registries() + .define("string") + .withRegion("string") + .withExistingResourceGroup("test-rg") + .withTags(mapOf()) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) + .withKind("string") + .withSku(new Sku().withName("string") + .withTier(SkuTier.FREE) + .withSize("string") + .withFamily("string") + .withCapacity(1)) + .withDiscoveryUrl("string") + .withIntellectualPropertyPublisher("string") + .withManagedResourceGroup(new ArmResourceId().withResourceId("string")) + .withMlFlowRegistryUri("string") + .withRegistryPrivateEndpointConnections( + Arrays.asList(new RegistryPrivateEndpointConnection().withId("string") + .withLocation("string") + .withGroupIds(Arrays.asList("string")) + .withPrivateEndpoint(new PrivateEndpointResource().withSubnetArmId("string")) + .withRegistryPrivateLinkServiceConnectionState( + new RegistryPrivateLinkServiceConnectionState().withActionsRequired("string") + .withDescription("string") + .withStatus(EndpointServiceConnectionStatus.APPROVED)) + .withProvisioningState("string"))) + .withPublicNetworkAccess("string") + .withRegionDetails(Arrays.asList(new RegistryRegionArmDetails() + .withAcrDetails(Arrays.asList(new AcrDetails().withUserCreatedAcrAccount( + new UserCreatedAcrAccount().withArmResourceId(new ArmResourceId().withResourceId("string"))))) + .withLocation("string") + .withStorageAccountDetails(Arrays.asList(new StorageAccountDetails().withUserCreatedStorageAccount( + new UserCreatedStorageAccount().withArmResourceId(new ArmResourceId().withResourceId("string"))))))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesDeleteSamples.java new file mode 100644 index 0000000000000..dda34d383b832 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for Registries Delete. + */ +public final class RegistriesDeleteSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registries/delete.json + */ + /** + * Sample code: Delete Registry. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void deleteRegistry(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registries().delete("test-rg", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesGetByResourceGroupSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..801119a9a41ab --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesGetByResourceGroupSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for Registries GetByResourceGroup. + */ +public final class RegistriesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registries/get-UserCreated.json + */ + /** + * Sample code: Get Registry with user created accounts. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + getRegistryWithUserCreatedAccounts(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registries().getByResourceGroupWithResponse("test-rg", "string", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registries/get-SystemCreated.json + */ + /** + * Sample code: Get Registry with system created accounts. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + getRegistryWithSystemCreatedAccounts(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registries().getByResourceGroupWithResponse("test-rg", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesListByResourceGroupSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..2f161d65acdc1 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesListByResourceGroupSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for Registries ListByResourceGroup. + */ +public final class RegistriesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registries/list-UserCreated.json + */ + /** + * Sample code: List registries with user created accounts. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listRegistriesWithUserCreatedAccounts( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registries().listByResourceGroup("test-rg", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registries/list-SystemCreated.json + */ + /** + * Sample code: List registries with system created accounts. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void listRegistriesWithSystemCreatedAccounts( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registries().listByResourceGroup("test-rg", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesListSamples.java new file mode 100644 index 0000000000000..ce39be6458d31 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for Registries List. + */ +public final class RegistriesListSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registries/listBySubscription.json + */ + /** + * Sample code: List registries by subscription. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + listRegistriesBySubscription(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registries().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesRemoveRegionsSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesRemoveRegionsSamples.java new file mode 100644 index 0000000000000..e7a6b194919e9 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesRemoveRegionsSamples.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.fluent.models.RegistryInner; +import com.azure.resourcemanager.machinelearning.models.AcrDetails; +import com.azure.resourcemanager.machinelearning.models.ArmResourceId; +import com.azure.resourcemanager.machinelearning.models.EndpointServiceConnectionStatus; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.machinelearning.models.PrivateEndpointResource; +import com.azure.resourcemanager.machinelearning.models.RegistryPrivateEndpointConnection; +import com.azure.resourcemanager.machinelearning.models.RegistryPrivateLinkServiceConnectionState; +import com.azure.resourcemanager.machinelearning.models.RegistryRegionArmDetails; +import com.azure.resourcemanager.machinelearning.models.Sku; +import com.azure.resourcemanager.machinelearning.models.SkuTier; +import com.azure.resourcemanager.machinelearning.models.StorageAccountDetails; +import com.azure.resourcemanager.machinelearning.models.SystemCreatedAcrAccount; +import com.azure.resourcemanager.machinelearning.models.SystemCreatedStorageAccount; +import com.azure.resourcemanager.machinelearning.models.UserAssignedIdentity; +import com.azure.resourcemanager.machinelearning.models.UserCreatedAcrAccount; +import com.azure.resourcemanager.machinelearning.models.UserCreatedStorageAccount; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Registries RemoveRegions. + */ +public final class RegistriesRemoveRegionsSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registries/removeRegions.json + */ + /** + * Sample code: Remove regions from registry. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + removeRegionsFromRegistry(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registries() + .removeRegions("test-rg", "string", + new RegistryInner().withLocation("string") + .withTags(mapOf()) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) + .withKind("string") + .withSku(new Sku().withName("string") + .withTier(SkuTier.FREE) + .withSize("string") + .withFamily("string") + .withCapacity(1)) + .withDiscoveryUrl("string") + .withIntellectualPropertyPublisher("string") + .withManagedResourceGroup(new ArmResourceId().withResourceId("string")) + .withMlFlowRegistryUri("string") + .withRegistryPrivateEndpointConnections( + Arrays.asList(new RegistryPrivateEndpointConnection().withId("string") + .withLocation("string") + .withGroupIds(Arrays.asList("string")) + .withPrivateEndpoint(new PrivateEndpointResource().withSubnetArmId("string")) + .withRegistryPrivateLinkServiceConnectionState( + new RegistryPrivateLinkServiceConnectionState().withActionsRequired("string") + .withDescription("string") + .withStatus(EndpointServiceConnectionStatus.APPROVED)) + .withProvisioningState("string"))) + .withPublicNetworkAccess("string") + .withRegionDetails(Arrays.asList(new RegistryRegionArmDetails() + .withAcrDetails(Arrays.asList(new AcrDetails() + .withSystemCreatedAcrAccount(new SystemCreatedAcrAccount().withAcrAccountName("string") + .withAcrAccountSku("string") + .withArmResourceId(new ArmResourceId().withResourceId("string"))) + .withUserCreatedAcrAccount(new UserCreatedAcrAccount() + .withArmResourceId(new ArmResourceId().withResourceId("string"))))) + .withLocation("string") + .withStorageAccountDetails(Arrays.asList(new StorageAccountDetails() + .withSystemCreatedStorageAccount( + new SystemCreatedStorageAccount().withAllowBlobPublicAccess(false) + .withArmResourceId(new ArmResourceId().withResourceId("string")) + .withStorageAccountHnsEnabled(false) + .withStorageAccountName("string") + .withStorageAccountType("string")) + .withUserCreatedStorageAccount(new UserCreatedStorageAccount() + .withArmResourceId(new ArmResourceId().withResourceId("string"))))))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesUpdateSamples.java new file mode 100644 index 0000000000000..93d319df22a6b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistriesUpdateSamples.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.machinelearning.models.PartialSku; +import com.azure.resourcemanager.machinelearning.models.Registry; +import com.azure.resourcemanager.machinelearning.models.RegistryPartialManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.SkuTier; +import com.azure.resourcemanager.machinelearning.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Registries Update. + */ +public final class RegistriesUpdateSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registries/update-UserCreated.json + */ + /** + * Sample code: Update Registry with user created accounts. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void updateRegistryWithUserCreatedAccounts( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + Registry resource = manager.registries() + .getByResourceGroupWithResponse("test-rg", "string", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf()) + .withIdentity(new RegistryPartialManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) + .withSku(new PartialSku().withCapacity(1) + .withFamily("string") + .withName("string") + .withSize("string") + .withTier(SkuTier.BASIC)) + .apply(); + } + + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registries/update-SystemCreated.json + */ + /** + * Sample code: Update Registry with system created accounts. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void updateRegistryWithSystemCreatedAccounts( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + Registry resource = manager.registries() + .getByResourceGroupWithResponse("test-rg", "string", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf()) + .withIdentity( + new RegistryPartialManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) + .withSku(new PartialSku().withCapacity(1) + .withFamily("string") + .withName("string") + .withSize("string") + .withTier(SkuTier.BASIC)) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeContainersCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeContainersCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..385767d625221 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeContainersCreateOrUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.CodeContainerProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RegistryCodeContainers CreateOrUpdate. + */ +public final class RegistryCodeContainersCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/CodeContainer/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Registry Code Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + createOrUpdateRegistryCodeContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryCodeContainers() + .define("testContainer") + .withExistingRegistry("testrg123", "testregistry") + .withProperties(new CodeContainerProperties().withDescription("string") + .withTags(mapOf("tag1", "value1", "tag2", "value2"))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeContainersDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeContainersDeleteSamples.java new file mode 100644 index 0000000000000..becea15eabc66 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeContainersDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for RegistryCodeContainers Delete. + */ +public final class RegistryCodeContainersDeleteSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/CodeContainer/delete.json + */ + /** + * Sample code: Delete Registry Code Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + deleteRegistryCodeContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryCodeContainers() + .delete("testrg123", "testregistry", "testContainer", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeContainersGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeContainersGetSamples.java new file mode 100644 index 0000000000000..88e49c3b4a6b9 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeContainersGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for RegistryCodeContainers Get. + */ +public final class RegistryCodeContainersGetSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/CodeContainer/get.json + */ + /** + * Sample code: Get Registry Code Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + getRegistryCodeContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryCodeContainers() + .getWithResponse("testrg123", "testregistry", "testContainer", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeContainersListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeContainersListSamples.java new file mode 100644 index 0000000000000..fdc3e54848d85 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeContainersListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for RegistryCodeContainers List. + */ +public final class RegistryCodeContainersListSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/CodeContainer/list.json + */ + /** + * Sample code: List Registry Code Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + listRegistryCodeContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryCodeContainers().list("testrg123", "testregistry", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeVersionsCreateOrGetStartPendingUploadSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeVersionsCreateOrGetStartPendingUploadSamples.java new file mode 100644 index 0000000000000..79d9ee1c6096b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeVersionsCreateOrGetStartPendingUploadSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; +import com.azure.resourcemanager.machinelearning.models.PendingUploadType; + +/** + * Samples for RegistryCodeVersions CreateOrGetStartPendingUpload. + */ +public final class RegistryCodeVersionsCreateOrGetStartPendingUploadSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/CodeVersion/createOrGetStartPendingUpload.json + */ + /** + * Sample code: CreateOrGetStartPendingUpload Registry Code Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrGetStartPendingUploadRegistryCodeVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryCodeVersions() + .createOrGetStartPendingUploadWithResponse("test-rg", "registryName", "string", "string", + new PendingUploadRequestDto().withPendingUploadId("string") + .withPendingUploadType(PendingUploadType.TEMPORARY_BLOB_REFERENCE), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeVersionsCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeVersionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..c4407ce8f008b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeVersionsCreateOrUpdateSamples.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.CodeVersionProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RegistryCodeVersions CreateOrUpdate. + */ +public final class RegistryCodeVersionsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/CodeVersion/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Registry Code Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + createOrUpdateRegistryCodeVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryCodeVersions() + .define("string") + .withExistingCode("test-rg", "my-aml-registry", "string") + .withProperties(new CodeVersionProperties().withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsAnonymous(false) + .withCodeUri("fakeTokenPlaceholder")) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeVersionsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeVersionsDeleteSamples.java new file mode 100644 index 0000000000000..d1c1e03cfda16 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeVersionsDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for RegistryCodeVersions Delete. + */ +public final class RegistryCodeVersionsDeleteSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/CodeVersion/delete.json + */ + /** + * Sample code: Delete Registry Code Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + deleteRegistryCodeVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryCodeVersions() + .delete("test-rg", "my-aml-registry", "string", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeVersionsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeVersionsGetSamples.java new file mode 100644 index 0000000000000..19005c5b44048 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeVersionsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for RegistryCodeVersions Get. + */ +public final class RegistryCodeVersionsGetSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/CodeVersion/get.json + */ + /** + * Sample code: Get Registry Code Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + getRegistryCodeVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryCodeVersions() + .getWithResponse("test-rg", "my-aml-registry", "string", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeVersionsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeVersionsListSamples.java new file mode 100644 index 0000000000000..9c9fb08a1cd01 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryCodeVersionsListSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for RegistryCodeVersions List. + */ +public final class RegistryCodeVersionsListSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/CodeVersion/list.json + */ + /** + * Sample code: List Registry Code Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + listRegistryCodeVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryCodeVersions() + .list("test-rg", "my-aml-registry", "string", "string", 1, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentContainersCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentContainersCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..f5c770daa68e7 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentContainersCreateOrUpdateSamples.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.ComponentContainerProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RegistryComponentContainers CreateOrUpdate. + */ +public final class RegistryComponentContainersCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/ComponentContainer/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Registry Component Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateRegistryComponentContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryComponentContainers() + .define("string") + .withExistingRegistry("test-rg", "my-aml-registry") + .withProperties(new ComponentContainerProperties().withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string"))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentContainersDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentContainersDeleteSamples.java new file mode 100644 index 0000000000000..ff04fb7c37743 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentContainersDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for RegistryComponentContainers Delete. + */ +public final class RegistryComponentContainersDeleteSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/ComponentContainer/delete.json + */ + /** + * Sample code: Delete Registry Component Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + deleteRegistryComponentContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryComponentContainers() + .delete("test-rg", "my-aml-registry", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentContainersGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentContainersGetSamples.java new file mode 100644 index 0000000000000..a5b14d65ee664 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentContainersGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for RegistryComponentContainers Get. + */ +public final class RegistryComponentContainersGetSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/ComponentContainer/get.json + */ + /** + * Sample code: Get Registry Component Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + getRegistryComponentContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryComponentContainers() + .getWithResponse("test-rg", "my-aml-registry", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentContainersListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentContainersListSamples.java new file mode 100644 index 0000000000000..bfc4dcc882f6a --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentContainersListSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for RegistryComponentContainers List. + */ +public final class RegistryComponentContainersListSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/ComponentContainer/list.json + */ + /** + * Sample code: List Registry Component Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + listRegistryComponentContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryComponentContainers() + .list("test-rg", "my-aml-registry", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentVersionsCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentVersionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..f6ccb90a50406 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentVersionsCreateOrUpdateSamples.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.machinelearning.models.ComponentVersionProperties; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RegistryComponentVersions CreateOrUpdate. + */ +public final class RegistryComponentVersionsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/ComponentVersion/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Registry Component Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateRegistryComponentVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) throws IOException { + manager.registryComponentVersions() + .define("string") + .withExistingComponent("test-rg", "my-aml-registry", "string") + .withProperties(new ComponentVersionProperties().withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsAnonymous(false) + .withComponentSpec(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"8ced901b-d826-477d-bfef-329da9672513\":null}", Object.class, + SerializerEncoding.JSON))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentVersionsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentVersionsDeleteSamples.java new file mode 100644 index 0000000000000..017452580c65c --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentVersionsDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for RegistryComponentVersions Delete. + */ +public final class RegistryComponentVersionsDeleteSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/ComponentVersion/delete.json + */ + /** + * Sample code: Delete Registry Component Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + deleteRegistryComponentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryComponentVersions() + .delete("test-rg", "my-aml-registry", "string", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentVersionsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentVersionsGetSamples.java new file mode 100644 index 0000000000000..0107c14156260 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentVersionsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for RegistryComponentVersions Get. + */ +public final class RegistryComponentVersionsGetSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/ComponentVersion/get.json + */ + /** + * Sample code: Get Registry Component Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + getRegistryComponentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryComponentVersions() + .getWithResponse("test-rg", "my-aml-registry", "string", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentVersionsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentVersionsListSamples.java new file mode 100644 index 0000000000000..6d2fe9652d2f9 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryComponentVersionsListSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for RegistryComponentVersions List. + */ +public final class RegistryComponentVersionsListSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/ComponentVersion/list.json + */ + /** + * Sample code: List Registry Component Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + listRegistryComponentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryComponentVersions() + .list("test-rg", "my-aml-registry", "string", "string", 1, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataContainersCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataContainersCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..4f8cf166b58fc --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataContainersCreateOrUpdateSamples.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.DataContainerProperties; +import com.azure.resourcemanager.machinelearning.models.DataType; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RegistryDataContainers CreateOrUpdate. + */ +public final class RegistryDataContainersCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/DataContainer/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Registry Data Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + createOrUpdateRegistryDataContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryDataContainers() + .define("string") + .withExistingRegistry("test-rg", "registryName") + .withProperties(new DataContainerProperties().withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsArchived(false) + .withDataType(DataType.URI_FOLDER)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataContainersDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataContainersDeleteSamples.java new file mode 100644 index 0000000000000..b57b78bee87ba --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataContainersDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for RegistryDataContainers Delete. + */ +public final class RegistryDataContainersDeleteSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/DataContainer/delete.json + */ + /** + * Sample code: Delete Registry Data Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + deleteRegistryDataContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryDataContainers().delete("test-rg", "registryName", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataContainersGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataContainersGetSamples.java new file mode 100644 index 0000000000000..2456f3d451332 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataContainersGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for RegistryDataContainers Get. + */ +public final class RegistryDataContainersGetSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/DataContainer/get.json + */ + /** + * Sample code: Get Registry Data Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + getRegistryDataContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryDataContainers() + .getWithResponse("test-rg", "registryName", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataContainersListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataContainersListSamples.java new file mode 100644 index 0000000000000..cd2b6b5d3d1d6 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataContainersListSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** + * Samples for RegistryDataContainers List. + */ +public final class RegistryDataContainersListSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/DataContainer/registryList.json + */ + /** + * Sample code: RegistryList Registry Data Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + registryListRegistryDataContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryDataContainers() + .list("test-rg", "registryName", null, ListViewType.ALL, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataReferencesGetBlobReferenceSasSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataReferencesGetBlobReferenceSasSamples.java new file mode 100644 index 0000000000000..c39362e78cf8f --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataReferencesGetBlobReferenceSasSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.GetBlobReferenceSasRequestDto; + +/** + * Samples for RegistryDataReferences GetBlobReferenceSas. + */ +public final class RegistryDataReferencesGetBlobReferenceSasSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/DataReference/getBlobReferenceSAS.json + */ + /** + * Sample code: GetBlobReferenceSAS Data Reference. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + getBlobReferenceSASDataReference(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryDataReferences() + .getBlobReferenceSasWithResponse("test-rg", "registryName", "string", "string", + new GetBlobReferenceSasRequestDto().withAssetId("string") + .withBlobUri("https://www.contoso.com/example"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataVersionsCreateOrGetStartPendingUploadSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataVersionsCreateOrGetStartPendingUploadSamples.java new file mode 100644 index 0000000000000..fddcc578a72f0 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataVersionsCreateOrGetStartPendingUploadSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; +import com.azure.resourcemanager.machinelearning.models.PendingUploadType; + +/** + * Samples for RegistryDataVersions CreateOrGetStartPendingUpload. + */ +public final class RegistryDataVersionsCreateOrGetStartPendingUploadSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/DataVersionBase/createOrGetStartPendingUpload.json + */ + /** + * Sample code: CreateOrGetStartPendingUpload Registry Data Version Base. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrGetStartPendingUploadRegistryDataVersionBase( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryDataVersions() + .createOrGetStartPendingUploadWithResponse("test-rg", "registryName", "string", "string", + new PendingUploadRequestDto().withPendingUploadId("string") + .withPendingUploadType(PendingUploadType.NONE), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataVersionsCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataVersionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..c6f1f78bb771c --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataVersionsCreateOrUpdateSamples.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.MLTableData; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RegistryDataVersions CreateOrUpdate. + */ +public final class RegistryDataVersionsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/DataVersionBase/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Registry Data Version Base. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateRegistryDataVersionBase( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryDataVersions() + .define("string") + .withExistingData("test-rg", "registryName", "string") + .withProperties(new MLTableData().withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsAnonymous(false) + .withIsArchived(false) + .withDataUri("string") + .withReferencedUris(Arrays.asList("string"))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataVersionsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataVersionsDeleteSamples.java new file mode 100644 index 0000000000000..62a0b8f788ad2 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataVersionsDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for RegistryDataVersions Delete. + */ +public final class RegistryDataVersionsDeleteSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/DataVersionBase/delete.json + */ + /** + * Sample code: Delete Registry Data Version Base. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + deleteRegistryDataVersionBase(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryDataVersions() + .delete("test-rg", "registryName", "string", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataVersionsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataVersionsGetSamples.java new file mode 100644 index 0000000000000..6ed49f16b2ac0 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataVersionsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for RegistryDataVersions Get. + */ +public final class RegistryDataVersionsGetSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/DataVersionBase/get.json + */ + /** + * Sample code: Get Registry Data Version Base. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + getRegistryDataVersionBase(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryDataVersions() + .getWithResponse("test-rg", "registryName", "string", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataVersionsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataVersionsListSamples.java new file mode 100644 index 0000000000000..eba65816f1dd4 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryDataVersionsListSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.ListViewType; + +/** + * Samples for RegistryDataVersions List. + */ +public final class RegistryDataVersionsListSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/DataVersionBase/registryList.json + */ + /** + * Sample code: RegistryList Registry Data Version Base. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + registryListRegistryDataVersionBase(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryDataVersions() + .list("test-rg", "registryName", "string", "string", 1, null, "string", ListViewType.ARCHIVED_ONLY, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentContainersCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentContainersCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..9139f4afd9718 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentContainersCreateOrUpdateSamples.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.EnvironmentContainerProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RegistryEnvironmentContainers CreateOrUpdate. + */ +public final class RegistryEnvironmentContainersCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/EnvironmentContainer/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Registry Environment Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateRegistryEnvironmentContainer( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryEnvironmentContainers() + .define("testEnvironment") + .withExistingRegistry("testrg123", "testregistry") + .withProperties(new EnvironmentContainerProperties().withDescription("string") + .withProperties( + mapOf("additionalProp1", "string", "additionalProp2", "string", "additionalProp3", "string")) + .withTags(mapOf("additionalProp1", "string", "additionalProp2", "string", "additionalProp3", "string"))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentContainersDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentContainersDeleteSamples.java new file mode 100644 index 0000000000000..af7161d4afd05 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentContainersDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for RegistryEnvironmentContainers Delete. + */ +public final class RegistryEnvironmentContainersDeleteSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/EnvironmentContainer/delete.json + */ + /** + * Sample code: Delete Registry Environment Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + deleteRegistryEnvironmentContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryEnvironmentContainers() + .delete("testrg123", "testregistry", "testContainer", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentContainersGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentContainersGetSamples.java new file mode 100644 index 0000000000000..a8c483bf3136b --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentContainersGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for RegistryEnvironmentContainers Get. + */ +public final class RegistryEnvironmentContainersGetSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/EnvironmentContainer/get.json + */ + /** + * Sample code: Get Registry Environment Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + getRegistryEnvironmentContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryEnvironmentContainers() + .getWithResponse("testrg123", "testregistry", "testEnvironment", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentContainersListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentContainersListSamples.java new file mode 100644 index 0000000000000..f69293af899d0 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentContainersListSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for RegistryEnvironmentContainers List. + */ +public final class RegistryEnvironmentContainersListSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/EnvironmentContainer/list.json + */ + /** + * Sample code: List Registry Environment Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + listRegistryEnvironmentContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryEnvironmentContainers() + .list("testrg123", "testregistry", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentVersionsCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentVersionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..036149b95faf2 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentVersionsCreateOrUpdateSamples.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.BuildContext; +import com.azure.resourcemanager.machinelearning.models.EnvironmentVersionProperties; +import com.azure.resourcemanager.machinelearning.models.InferenceContainerProperties; +import com.azure.resourcemanager.machinelearning.models.Route; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RegistryEnvironmentVersions CreateOrUpdate. + */ +public final class RegistryEnvironmentVersionsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/EnvironmentVersion/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Registry Environment Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateRegistryEnvironmentVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryEnvironmentVersions() + .define("string") + .withExistingEnvironment("test-rg", "my-aml-registry", "string") + .withProperties(new EnvironmentVersionProperties().withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsAnonymous(false) + .withBuild(new BuildContext().withContextUri( + "https://storage-account.blob.core.windows.net/azureml/DockerBuildContext/95ddede6b9b8c4e90472db3acd0a8d28/") + .withDockerfilePath("prod/Dockerfile")) + .withCondaFile("string") + .withImage("docker.io/tensorflow/serving:latest") + .withInferenceConfig( + new InferenceContainerProperties().withLivenessRoute(new Route().withPath("string").withPort(1)) + .withReadinessRoute(new Route().withPath("string").withPort(1)) + .withScoringRoute(new Route().withPath("string").withPort(1)))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentVersionsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentVersionsDeleteSamples.java new file mode 100644 index 0000000000000..fa41d7d74e907 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentVersionsDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for RegistryEnvironmentVersions Delete. + */ +public final class RegistryEnvironmentVersionsDeleteSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/EnvironmentVersion/delete.json + */ + /** + * Sample code: Delete Registry Environment Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + deleteRegistryEnvironmentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryEnvironmentVersions() + .delete("test-rg", "my-aml-registry", "string", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentVersionsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentVersionsGetSamples.java new file mode 100644 index 0000000000000..e48581a47b675 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentVersionsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for RegistryEnvironmentVersions Get. + */ +public final class RegistryEnvironmentVersionsGetSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/EnvironmentVersion/get.json + */ + /** + * Sample code: Get Registry Environment Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + getRegistryEnvironmentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryEnvironmentVersions() + .getWithResponse("test-rg", "my-aml-registry", "string", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentVersionsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentVersionsListSamples.java new file mode 100644 index 0000000000000..8ff30b5b6e9aa --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryEnvironmentVersionsListSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for RegistryEnvironmentVersions List. + */ +public final class RegistryEnvironmentVersionsListSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/EnvironmentVersion/list.json + */ + /** + * Sample code: List Registry Environment Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + listRegistryEnvironmentVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryEnvironmentVersions() + .list("test-rg", "my-aml-regsitry", "string", "string", 1, null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelContainersCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelContainersCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..30bb6dee11ace --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelContainersCreateOrUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.ModelContainerProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RegistryModelContainers CreateOrUpdate. + */ +public final class RegistryModelContainersCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/ModelContainer/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Registry Model Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + createOrUpdateRegistryModelContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryModelContainers() + .define("testContainer") + .withExistingRegistry("testrg123", "registry123") + .withProperties(new ModelContainerProperties().withDescription("Model container description") + .withTags(mapOf("tag1", "value1", "tag2", "value2"))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelContainersDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelContainersDeleteSamples.java new file mode 100644 index 0000000000000..c9e9016e4d96c --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelContainersDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for RegistryModelContainers Delete. + */ +public final class RegistryModelContainersDeleteSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/ModelContainer/delete.json + */ + /** + * Sample code: Delete Registry Model Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + deleteRegistryModelContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryModelContainers() + .delete("testrg123", "registry123", "testContainer", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelContainersGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelContainersGetSamples.java new file mode 100644 index 0000000000000..42601764e6da3 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelContainersGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for RegistryModelContainers Get. + */ +public final class RegistryModelContainersGetSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/ModelContainer/get.json + */ + /** + * Sample code: Get Registry Model Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + getRegistryModelContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryModelContainers() + .getWithResponse("testrg123", "registry123", "testContainer", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelContainersListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelContainersListSamples.java new file mode 100644 index 0000000000000..53b51aa7bc283 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelContainersListSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for RegistryModelContainers List. + */ +public final class RegistryModelContainersListSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/ModelContainer/list.json + */ + /** + * Sample code: List Registry Model Container. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + listRegistryModelContainer(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryModelContainers() + .list("testrg123", "registry123", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelVersionsCreateOrGetStartPendingUploadSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelVersionsCreateOrGetStartPendingUploadSamples.java new file mode 100644 index 0000000000000..0dcf117cc0726 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelVersionsCreateOrGetStartPendingUploadSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.PendingUploadRequestDto; +import com.azure.resourcemanager.machinelearning.models.PendingUploadType; + +/** + * Samples for RegistryModelVersions CreateOrGetStartPendingUpload. + */ +public final class RegistryModelVersionsCreateOrGetStartPendingUploadSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/ModelVersion/createOrGetStartPendingUpload.json + */ + /** + * Sample code: CreateOrGetStartPendingUpload Registry Model Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrGetStartPendingUploadRegistryModelVersion( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryModelVersions() + .createOrGetStartPendingUploadWithResponse("test-rg", "registryName", "string", "string", + new PendingUploadRequestDto().withPendingUploadId("string") + .withPendingUploadType(PendingUploadType.TEMPORARY_BLOB_REFERENCE), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelVersionsCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelVersionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..98f2c9ea34999 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelVersionsCreateOrUpdateSamples.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.FlavorData; +import com.azure.resourcemanager.machinelearning.models.ModelVersionProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RegistryModelVersions CreateOrUpdate. + */ +public final class RegistryModelVersionsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/ModelVersion/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Registry Model Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + createOrUpdateRegistryModelVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryModelVersions() + .define("string") + .withExistingModel("test-rg", "my-aml-registry", "string") + .withProperties(new ModelVersionProperties().withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withIsAnonymous(false) + .withFlavors(mapOf("string", new FlavorData().withData(mapOf("string", "string")))) + .withModelType("CustomModel") + .withModelUri("string")) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelVersionsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelVersionsDeleteSamples.java new file mode 100644 index 0000000000000..40ff1152296a6 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelVersionsDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for RegistryModelVersions Delete. + */ +public final class RegistryModelVersionsDeleteSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/ModelVersion/delete.json + */ + /** + * Sample code: Delete Registry Model Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + deleteRegistryModelVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryModelVersions() + .delete("test-rg", "my-aml-registry", "string", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelVersionsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelVersionsGetSamples.java new file mode 100644 index 0000000000000..eee06f9aa9096 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelVersionsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for RegistryModelVersions Get. + */ +public final class RegistryModelVersionsGetSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/ModelVersion/get.json + */ + /** + * Sample code: Get Registry Model Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + getRegistryModelVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryModelVersions() + .getWithResponse("test-rg", "my-aml-registry", "string", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelVersionsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelVersionsListSamples.java new file mode 100644 index 0000000000000..fd39a8e7e1e34 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/RegistryModelVersionsListSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for RegistryModelVersions List. + */ +public final class RegistryModelVersionsListSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Registry/ModelVersion/list.json + */ + /** + * Sample code: List Registry Model Version. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + listRegistryModelVersion(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.registryModelVersions() + .list("test-rg", "my-aml-registry", "string", null, "string", 1, "string", "string", "string", "string", + null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/SchedulesCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/SchedulesCreateOrUpdateSamples.java index f58b680aaf5b0..29248864778ba 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/SchedulesCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/SchedulesCreateOrUpdateSamples.java @@ -13,47 +13,42 @@ import java.util.HashMap; import java.util.Map; -/** Samples for Schedules CreateOrUpdate. */ +/** + * Samples for Schedules CreateOrUpdate. + */ public final class SchedulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Schedule/createOrUpdate.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Schedule/createOrUpdate.json */ /** * Sample code: CreateOrUpdate Schedule. - * + * * @param manager Entry point to MachineLearningManager. */ public static void createOrUpdateSchedule(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) throws IOException { - manager - .schedules() + manager.schedules() .define("string") .withExistingWorkspace("test-rg", "my-aml-workspace") - .withProperties( - new ScheduleProperties() - .withDescription("string") - .withProperties(mapOf("string", "string")) - .withTags(mapOf("string", "string")) - .withAction( - new EndpointScheduleAction() - .withEndpointInvocationDefinition( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"9965593e-526f-4b89-bb36-761138cf2794\":null}", - Object.class, - SerializerEncoding.JSON))) - .withDisplayName("string") - .withIsEnabled(false) - .withTrigger( - new CronTrigger() - .withEndTime("string") - .withStartTime("string") - .withTimeZone("string") - .withExpression("string"))) + .withProperties(new ScheduleProperties().withDescription("string") + .withProperties(mapOf("string", "string")) + .withTags(mapOf("string", "string")) + .withAction(new EndpointScheduleAction() + .withEndpointInvocationDefinition(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"9965593e-526f-4b89-bb36-761138cf2794\":null}", Object.class, + SerializerEncoding.JSON))) + .withDisplayName("string") + .withIsEnabled(false) + .withTrigger(new CronTrigger().withEndTime("string") + .withStartTime("string") + .withTimeZone("string") + .withExpression("string"))) .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/SchedulesDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/SchedulesDeleteSamples.java index 8425d2bdae803..5856313ab1f42 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/SchedulesDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/SchedulesDeleteSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for Schedules Delete. */ +/** + * Samples for Schedules Delete. + */ public final class SchedulesDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Schedule/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Schedule/delete.json */ /** * Sample code: Delete Schedule. - * + * * @param manager Entry point to MachineLearningManager. */ public static void deleteSchedule(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/SchedulesGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/SchedulesGetSamples.java index ed4851ee6751a..538ed61f79b43 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/SchedulesGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/SchedulesGetSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for Schedules Get. */ +/** + * Samples for Schedules Get. + */ public final class SchedulesGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Schedule/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Schedule/get.json */ /** * Sample code: Get Schedule. - * + * * @param manager Entry point to MachineLearningManager. */ public static void getSchedule(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/SchedulesListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/SchedulesListSamples.java index a73377880c36f..6b8ddfbc036fa 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/SchedulesListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/SchedulesListSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for Schedules List. */ +/** + * Samples for Schedules List. + */ public final class SchedulesListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Schedule/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Schedule/list.json */ /** * Sample code: List Schedules. - * + * * @param manager Entry point to MachineLearningManager. */ public static void listSchedules(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ServerlessEndpointsCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ServerlessEndpointsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..7dad354818c63 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ServerlessEndpointsCreateOrUpdateSamples.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.ContentSafety; +import com.azure.resourcemanager.machinelearning.models.ContentSafetyStatus; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.machinelearning.models.ModelSettings; +import com.azure.resourcemanager.machinelearning.models.ServerlessEndpointProperties; +import com.azure.resourcemanager.machinelearning.models.ServerlessInferenceEndpointAuthMode; +import com.azure.resourcemanager.machinelearning.models.Sku; +import com.azure.resourcemanager.machinelearning.models.SkuTier; +import com.azure.resourcemanager.machinelearning.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ServerlessEndpoints CreateOrUpdate. + */ +public final class ServerlessEndpointsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ServerlessEndpoint/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Workspace Serverless Endpoint. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void createOrUpdateWorkspaceServerlessEndpoint( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.serverlessEndpoints() + .define("string") + .withRegion("string") + .withExistingWorkspace("test-rg", "my-aml-workspace") + .withProperties(new ServerlessEndpointProperties().withAuthMode(ServerlessInferenceEndpointAuthMode.KEY) + .withContentSafety(new ContentSafety().withContentSafetyStatus(ContentSafetyStatus.ENABLED)) + .withModelSettings(new ModelSettings().withModelId("string"))) + .withTags(mapOf()) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities(mapOf("string", new UserAssignedIdentity()))) + .withKind("string") + .withSku(new Sku().withName("string") + .withTier(SkuTier.STANDARD) + .withSize("string") + .withFamily("string") + .withCapacity(1)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ServerlessEndpointsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ServerlessEndpointsDeleteSamples.java new file mode 100644 index 0000000000000..f0105e5c39691 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ServerlessEndpointsDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for ServerlessEndpoints Delete. + */ +public final class ServerlessEndpointsDeleteSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ServerlessEndpoint/delete.json + */ + /** + * Sample code: Delete Workspace Serverless Endpoint. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + deleteWorkspaceServerlessEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.serverlessEndpoints().delete("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ServerlessEndpointsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ServerlessEndpointsGetSamples.java new file mode 100644 index 0000000000000..e21fa15717c41 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ServerlessEndpointsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for ServerlessEndpoints Get. + */ +public final class ServerlessEndpointsGetSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ServerlessEndpoint/get.json + */ + /** + * Sample code: Get Workspace Serverless Endpoint. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + getWorkspaceServerlessEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.serverlessEndpoints() + .getWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ServerlessEndpointsListKeysSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ServerlessEndpointsListKeysSamples.java new file mode 100644 index 0000000000000..91c0f205539af --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ServerlessEndpointsListKeysSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for ServerlessEndpoints ListKeys. + */ +public final class ServerlessEndpointsListKeysSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ServerlessEndpoint/listKeys.json + */ + /** + * Sample code: ListKeys Workspace Serverless Endpoint. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + listKeysWorkspaceServerlessEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.serverlessEndpoints() + .listKeysWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ServerlessEndpointsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ServerlessEndpointsListSamples.java new file mode 100644 index 0000000000000..782a69819ed1d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ServerlessEndpointsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for ServerlessEndpoints List. + */ +public final class ServerlessEndpointsListSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ServerlessEndpoint/list.json + */ + /** + * Sample code: List Workspace Serverless Endpoint. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + listWorkspaceServerlessEndpoint(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.serverlessEndpoints().list("test-rg", "my-aml-workspace", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ServerlessEndpointsRegenerateKeysSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ServerlessEndpointsRegenerateKeysSamples.java new file mode 100644 index 0000000000000..c48bb8b1e5ddf --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ServerlessEndpointsRegenerateKeysSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.resourcemanager.machinelearning.models.KeyType; +import com.azure.resourcemanager.machinelearning.models.RegenerateEndpointKeysRequest; + +/** + * Samples for ServerlessEndpoints RegenerateKeys. + */ +public final class ServerlessEndpointsRegenerateKeysSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ServerlessEndpoint/regenerateKeys.json + */ + /** + * Sample code: RegenerateKeys Workspace Serverless Endpoint. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void regenerateKeysWorkspaceServerlessEndpoint( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.serverlessEndpoints() + .regenerateKeys("test-rg", "my-aml-workspace", "string", + new RegenerateEndpointKeysRequest().withKeyType(KeyType.PRIMARY).withKeyValue("fakeTokenPlaceholder"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ServerlessEndpointsUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ServerlessEndpointsUpdateSamples.java new file mode 100644 index 0000000000000..6fb504bf27f5d --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/ServerlessEndpointsUpdateSamples.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.machinelearning.models.PartialManagedServiceIdentity; +import com.azure.resourcemanager.machinelearning.models.PartialSku; +import com.azure.resourcemanager.machinelearning.models.ServerlessEndpoint; +import com.azure.resourcemanager.machinelearning.models.SkuTier; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ServerlessEndpoints Update. + */ +public final class ServerlessEndpointsUpdateSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/ServerlessEndpoint/update.json + */ + /** + * Sample code: Update Workspace Serverless Endpoint. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void updateWorkspaceServerlessEndpoint( + com.azure.resourcemanager.machinelearning.MachineLearningManager manager) throws IOException { + ServerlessEndpoint resource = manager.serverlessEndpoints() + .getWithResponse("test-rg", "my-aml-workspace", "string", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf()) + .withIdentity(new PartialManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf("string", + SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)))) + .withSku(new PartialSku().withCapacity(1) + .withFamily("string") + .withName("string") + .withSize("string") + .withTier(SkuTier.PREMIUM)) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/UsagesListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/UsagesListSamples.java index 610f0219a60a3..bdfe6471da323 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/UsagesListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/UsagesListSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for Usages List. */ +/** + * Samples for Usages List. + */ public final class UsagesListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Usage/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Usage/list.json */ /** * Sample code: List Usages. - * + * * @param manager Entry point to MachineLearningManager. */ public static void listUsages(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/VirtualMachineSizesListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/VirtualMachineSizesListSamples.java index bd3b35c93152d..30b46fd77f7cf 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/VirtualMachineSizesListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/VirtualMachineSizesListSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for VirtualMachineSizes List. */ +/** + * Samples for VirtualMachineSizes List. + */ public final class VirtualMachineSizesListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/VirtualMachineSize/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/VirtualMachineSize/list.json */ /** * Sample code: List VM Sizes. - * + * * @param manager Entry point to MachineLearningManager. */ public static void listVMSizes(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsCreateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsCreateSamples.java index ee18b1460db3a..4d6fe5f4500f5 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsCreateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsCreateSamples.java @@ -7,25 +7,27 @@ import com.azure.resourcemanager.machinelearning.models.ConnectionCategory; import com.azure.resourcemanager.machinelearning.models.NoneAuthTypeWorkspaceConnectionProperties; -/** Samples for WorkspaceConnections Create. */ +/** + * Samples for WorkspaceConnections Create. + */ public final class WorkspaceConnectionsCreateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/WorkspaceConnection/create.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/WorkspaceConnection/create.json */ /** * Sample code: CreateWorkspaceConnection. - * + * * @param manager Entry point to MachineLearningManager. */ - public static void createWorkspaceConnection( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .workspaceConnections() + public static void + createWorkspaceConnection(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.workspaceConnections() .define("connection-1") .withExistingWorkspace("resourceGroup-1", "workspace-1") .withProperties( - new NoneAuthTypeWorkspaceConnectionProperties() - .withCategory(ConnectionCategory.CONTAINER_REGISTRY) + new NoneAuthTypeWorkspaceConnectionProperties().withCategory(ConnectionCategory.CONTAINER_REGISTRY) .withTarget("www.facebook.com")) .create(); } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsDeleteSamples.java index 70584254ef26d..b23b305334be7 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsDeleteSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for WorkspaceConnections Delete. */ +/** + * Samples for WorkspaceConnections Delete. + */ public final class WorkspaceConnectionsDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/WorkspaceConnection/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/WorkspaceConnection/delete.json */ /** * Sample code: DeleteWorkspaceConnection. - * + * * @param manager Entry point to MachineLearningManager. */ - public static void deleteWorkspaceConnection( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .workspaceConnections() + public static void + deleteWorkspaceConnection(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.workspaceConnections() .deleteWithResponse("resourceGroup-1", "workspace-1", "connection-1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsGetSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsGetSamples.java index c5c1c28e42fd3..2f317cb4d7f2a 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsGetSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsGetSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for WorkspaceConnections Get. */ +/** + * Samples for WorkspaceConnections Get. + */ public final class WorkspaceConnectionsGetSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/WorkspaceConnection/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/WorkspaceConnection/get.json */ /** * Sample code: GetWorkspaceConnection. - * + * * @param manager Entry point to MachineLearningManager. */ - public static void getWorkspaceConnection( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .workspaceConnections() + public static void + getWorkspaceConnection(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.workspaceConnections() .getWithResponse("resourceGroup-1", "workspace-1", "connection-1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsListSamples.java index a555209830d68..f47a0c5d0be3c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsListSamples.java @@ -4,25 +4,24 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for WorkspaceConnections List. */ +/** + * Samples for WorkspaceConnections List. + */ public final class WorkspaceConnectionsListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/WorkspaceConnection/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/WorkspaceConnection/list.json */ /** * Sample code: ListWorkspaceConnections. - * + * * @param manager Entry point to MachineLearningManager. */ - public static void listWorkspaceConnections( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .workspaceConnections() - .list( - "resourceGroup-1", - "workspace-1", - "www.facebook.com", - "ContainerRegistry", + public static void + listWorkspaceConnections(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.workspaceConnections() + .list("resourceGroup-1", "workspace-1", "www.facebook.com", "ContainerRegistry", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsListSecretsSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsListSecretsSamples.java new file mode 100644 index 0000000000000..655d3e4d3dd06 --- /dev/null +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsListSecretsSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.machinelearning.generated; + +/** + * Samples for WorkspaceConnections ListSecrets. + */ +public final class WorkspaceConnectionsListSecretsSamples { + /* + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/WorkspaceConnection/listSecrets.json + */ + /** + * Sample code: GetWorkspaceConnection. + * + * @param manager Entry point to MachineLearningManager. + */ + public static void + getWorkspaceConnection(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + manager.workspaceConnections() + .listSecretsWithResponse("test-rg", "workspace-1", "connection-1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceFeaturesListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceFeaturesListSamples.java index a2e9ec836c5de..2b5f7279a9d9f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceFeaturesListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceFeaturesListSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for WorkspaceFeatures List. */ +/** + * Samples for WorkspaceFeatures List. + */ public final class WorkspaceFeaturesListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/WorkspaceFeature/list.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/WorkspaceFeature/list.json */ /** * Sample code: List Workspace features. - * + * * @param manager Entry point to MachineLearningManager. */ public static void listWorkspaceFeatures(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesCreateOrUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesCreateOrUpdateSamples.java index f4db9bbdf9ca2..b681a3dcc130e 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesCreateOrUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesCreateOrUpdateSamples.java @@ -17,29 +17,30 @@ import java.util.HashMap; import java.util.Map; -/** Samples for Workspaces CreateOrUpdate. */ +/** + * Samples for Workspaces CreateOrUpdate. + */ public final class WorkspacesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/create.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/create.json */ /** * Sample code: Create Workspace. - * + * * @param manager Entry point to MachineLearningManager. */ public static void createWorkspace(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .workspaces() + manager.workspaces() .define("testworkspace") .withExistingResourceGroup("workspace-1234") .withRegion("eastus2euap") - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf( - "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testuai", - new UserAssignedIdentity()))) + .withIdentity(new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testuai", + new UserAssignedIdentity()))) .withDescription("test description") .withFriendlyName("HelloName") .withKeyVault( @@ -50,32 +51,23 @@ public static void createWorkspace(com.azure.resourcemanager.machinelearning.Mac "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.ContainerRegistry/registries/testRegistry") .withStorageAccount( "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/accountcrud-1234/providers/Microsoft.Storage/storageAccounts/testStorageAccount") - .withEncryption( - new EncryptionProperty() - .withStatus(EncryptionStatus.ENABLED) - .withIdentity( - new IdentityForCmk() - .withUserAssignedIdentity( - "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testuai")) - .withKeyVaultProperties( - new EncryptionKeyVaultProperties() - .withKeyVaultArmId("fakeTokenPlaceholder") - .withKeyIdentifier("fakeTokenPlaceholder") - .withIdentityClientId(""))) + .withEncryption(new EncryptionProperty().withStatus(EncryptionStatus.ENABLED) + .withIdentity(new IdentityForCmk().withUserAssignedIdentity( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testuai")) + .withKeyVaultProperties(new EncryptionKeyVaultProperties().withKeyVaultArmId("fakeTokenPlaceholder") + .withKeyIdentifier("fakeTokenPlaceholder") + .withIdentityClientId(""))) .withHbiWorkspace(false) - .withSharedPrivateLinkResources( - Arrays - .asList( - new SharedPrivateLinkResource() - .withName("testdbresource") - .withPrivateLinkResourceId( - "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.DocumentDB/databaseAccounts/testdbresource/privateLinkResources/Sql") - .withGroupId("Sql") - .withRequestMessage("Please approve") - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED))) + .withSharedPrivateLinkResources(Arrays.asList(new SharedPrivateLinkResource().withName("testdbresource") + .withPrivateLinkResourceId( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.DocumentDB/databaseAccounts/testdbresource/privateLinkResources/Sql") + .withGroupId("Sql") + .withRequestMessage("Please approve") + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED))) .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesDeleteSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesDeleteSamples.java index c1fd156d125f6..89028cc006611 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesDeleteSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesDeleteSamples.java @@ -4,17 +4,21 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for Workspaces Delete. */ +/** + * Samples for Workspaces Delete. + */ public final class WorkspacesDeleteSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/delete.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/delete.json */ /** * Sample code: Delete Workspace. - * + * * @param manager Entry point to MachineLearningManager. */ public static void deleteWorkspace(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager.workspaces().delete("workspace-1234", "testworkspace", com.azure.core.util.Context.NONE); + manager.workspaces().delete("workspace-1234", "testworkspace", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesDiagnoseSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesDiagnoseSamples.java index 686192ecc6e0c..07cf359afc904 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesDiagnoseSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesDiagnoseSamples.java @@ -9,37 +9,36 @@ import java.util.HashMap; import java.util.Map; -/** Samples for Workspaces Diagnose. */ +/** + * Samples for Workspaces Diagnose. + */ public final class WorkspacesDiagnoseSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/diagnose.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/diagnose.json */ /** * Sample code: Diagnose Workspace. - * + * * @param manager Entry point to MachineLearningManager. */ public static void diagnoseWorkspace(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .workspaces() - .diagnose( - "workspace-1234", - "testworkspace", - new DiagnoseWorkspaceParameters() - .withValue( - new DiagnoseRequestProperties() - .withUdr(mapOf()) - .withNsg(mapOf()) - .withResourceLock(mapOf()) - .withDnsResolution(mapOf()) - .withStorageAccount(mapOf()) - .withKeyVault(mapOf()) - .withContainerRegistry(mapOf()) - .withApplicationInsights(mapOf()) - .withOthers(mapOf())), + manager.workspaces() + .diagnose("workspace-1234", "testworkspace", + new DiagnoseWorkspaceParameters().withValue(new DiagnoseRequestProperties().withUdr(mapOf()) + .withNsg(mapOf()) + .withResourceLock(mapOf()) + .withDnsResolution(mapOf()) + .withStorageAccount(mapOf()) + .withKeyVault(mapOf()) + .withContainerRegistry(mapOf()) + .withApplicationInsights(mapOf()) + .withOthers(mapOf())), com.azure.core.util.Context.NONE); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesGetByResourceGroupSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesGetByResourceGroupSamples.java index 179c4e8e29b0b..586b843525f0c 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesGetByResourceGroupSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesGetByResourceGroupSamples.java @@ -4,19 +4,22 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for Workspaces GetByResourceGroup. */ +/** + * Samples for Workspaces GetByResourceGroup. + */ public final class WorkspacesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/get.json */ /** * Sample code: Get Workspace. - * + * * @param manager Entry point to MachineLearningManager. */ public static void getWorkspace(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .workspaces() + manager.workspaces() .getByResourceGroupWithResponse("workspace-1234", "testworkspace", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListByResourceGroupSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListByResourceGroupSamples.java index 669be8f3e6d32..988bec07e762b 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListByResourceGroupSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListByResourceGroupSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for Workspaces ListByResourceGroup. */ +/** + * Samples for Workspaces ListByResourceGroup. + */ public final class WorkspacesListByResourceGroupSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/listByResourceGroup.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/listByResourceGroup.json */ /** * Sample code: Get Workspaces by Resource Group. - * + * * @param manager Entry point to MachineLearningManager. */ - public static void getWorkspacesByResourceGroup( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void + getWorkspacesByResourceGroup(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager.workspaces().listByResourceGroup("workspace-1234", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListKeysSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListKeysSamples.java index ccbe6102435a5..c0768410b7c50 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListKeysSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListKeysSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for Workspaces ListKeys. */ +/** + * Samples for Workspaces ListKeys. + */ public final class WorkspacesListKeysSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/listKeys.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/listKeys.json */ /** * Sample code: List Workspace Keys. - * + * * @param manager Entry point to MachineLearningManager. */ public static void listWorkspaceKeys(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListNotebookAccessTokenSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListNotebookAccessTokenSamples.java index ef8427324993f..04d6db64860a3 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListNotebookAccessTokenSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListNotebookAccessTokenSamples.java @@ -4,19 +4,22 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for Workspaces ListNotebookAccessToken. */ +/** + * Samples for Workspaces ListNotebookAccessToken. + */ public final class WorkspacesListNotebookAccessTokenSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/listNotebookAccessToken.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/listNotebookAccessToken.json */ /** * Sample code: List Workspace Keys. - * + * * @param manager Entry point to MachineLearningManager. */ public static void listWorkspaceKeys(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .workspaces() + manager.workspaces() .listNotebookAccessTokenWithResponse("workspace-1234", "testworkspace", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListNotebookKeysSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListNotebookKeysSamples.java index 3e287c705f692..716a9f9dc81ce 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListNotebookKeysSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListNotebookKeysSamples.java @@ -4,19 +4,22 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for Workspaces ListNotebookKeys. */ +/** + * Samples for Workspaces ListNotebookKeys. + */ public final class WorkspacesListNotebookKeysSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Notebook/listKeys.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Notebook/listKeys.json */ /** * Sample code: List Workspace Keys. - * + * * @param manager Entry point to MachineLearningManager. */ public static void listWorkspaceKeys(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .workspaces() + manager.workspaces() .listNotebookKeysWithResponse("testrg123", "workspaces123", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListOutboundNetworkDependenciesEndpointsSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListOutboundNetworkDependenciesEndpointsSamples.java index efa218684f9b3..f4fa7d9613272 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListOutboundNetworkDependenciesEndpointsSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListOutboundNetworkDependenciesEndpointsSamples.java @@ -4,21 +4,24 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for Workspaces ListOutboundNetworkDependenciesEndpoints. */ +/** + * Samples for Workspaces ListOutboundNetworkDependenciesEndpoints. + */ public final class WorkspacesListOutboundNetworkDependenciesEndpointsSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ExternalFQDN/get.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/ExternalFQDN/get.json */ /** * Sample code: ListOutboundNetworkDependenciesEndpoints. - * + * * @param manager Entry point to MachineLearningManager. */ public static void listOutboundNetworkDependenciesEndpoints( com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .workspaces() - .listOutboundNetworkDependenciesEndpointsWithResponse( - "workspace-1234", "testworkspace", com.azure.core.util.Context.NONE); + manager.workspaces() + .listOutboundNetworkDependenciesEndpointsWithResponse("workspace-1234", "testworkspace", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListSamples.java index 75c206e34e8ab..8e276271e9598 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for Workspaces List. */ +/** + * Samples for Workspaces List. + */ public final class WorkspacesListSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/listBySubscription.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/listBySubscription.json */ /** * Sample code: Get Workspaces by subscription. - * + * * @param manager Entry point to MachineLearningManager. */ - public static void getWorkspacesBySubscription( - com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { + public static void + getWorkspacesBySubscription(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { manager.workspaces().list(null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListStorageAccountKeysSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListStorageAccountKeysSamples.java index 9394db609d6c0..05a0e5e03a75e 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListStorageAccountKeysSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListStorageAccountKeysSamples.java @@ -4,19 +4,22 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for Workspaces ListStorageAccountKeys. */ +/** + * Samples for Workspaces ListStorageAccountKeys. + */ public final class WorkspacesListStorageAccountKeysSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/listStorageAccountKeys.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/listStorageAccountKeys.json */ /** * Sample code: List Workspace Keys. - * + * * @param manager Entry point to MachineLearningManager. */ public static void listWorkspaceKeys(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - manager - .workspaces() + manager.workspaces() .listStorageAccountKeysWithResponse("testrg123", "workspaces123", com.azure.core.util.Context.NONE); } } diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesPrepareNotebookSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesPrepareNotebookSamples.java index 127a903e671c4..a7468db119a5d 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesPrepareNotebookSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesPrepareNotebookSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for Workspaces PrepareNotebook. */ +/** + * Samples for Workspaces PrepareNotebook. + */ public final class WorkspacesPrepareNotebookSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Notebook/prepare.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Notebook/prepare.json */ /** * Sample code: Prepare Notebook. - * + * * @param manager Entry point to MachineLearningManager. */ public static void prepareNotebook(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesResyncKeysSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesResyncKeysSamples.java index 6f3d88cf74730..bacca147d1b6f 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesResyncKeysSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesResyncKeysSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.machinelearning.generated; -/** Samples for Workspaces ResyncKeys. */ +/** + * Samples for Workspaces ResyncKeys. + */ public final class WorkspacesResyncKeysSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/resyncKeys.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/resyncKeys.json */ /** * Sample code: Resync Workspace Keys. - * + * * @param manager Entry point to MachineLearningManager. */ public static void resyncWorkspaceKeys(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesUpdateSamples.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesUpdateSamples.java index 5eb660d26642b..c7ff1c818ac89 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesUpdateSamples.java +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/samples/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesUpdateSamples.java @@ -7,24 +7,25 @@ import com.azure.resourcemanager.machinelearning.models.PublicNetworkAccess; import com.azure.resourcemanager.machinelearning.models.Workspace; -/** Samples for Workspaces Update. */ +/** + * Samples for Workspaces Update. + */ public final class WorkspacesUpdateSamples { /* - * x-ms-original-file: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/update.json + * x-ms-original-file: + * specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01- + * preview/examples/Workspace/update.json */ /** * Sample code: Update Workspace. - * + * * @param manager Entry point to MachineLearningManager. */ public static void updateWorkspace(com.azure.resourcemanager.machinelearning.MachineLearningManager manager) { - Workspace resource = - manager - .workspaces() - .getByResourceGroupWithResponse("workspace-1234", "testworkspace", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + Workspace resource = manager.workspaces() + .getByResourceGroupWithResponse("workspace-1234", "testworkspace", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withDescription("new description") .withFriendlyName("New friendly name") .withPublicNetworkAccess(PublicNetworkAccess.DISABLED) diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AksNetworkingConfigurationTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AksNetworkingConfigurationTests.java deleted file mode 100644 index c7c3e2424e74e..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AksNetworkingConfigurationTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AksNetworkingConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class AksNetworkingConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AksNetworkingConfiguration model = - BinaryData - .fromString( - "{\"subnetId\":\"pilguooqjag\",\"serviceCidr\":\"itgueiookjbs\",\"dnsServiceIP\":\"rtdtpdelq\",\"dockerBridgeCidr\":\"slmot\"}") - .toObject(AksNetworkingConfiguration.class); - Assertions.assertEquals("pilguooqjag", model.subnetId()); - Assertions.assertEquals("itgueiookjbs", model.serviceCidr()); - Assertions.assertEquals("rtdtpdelq", model.dnsServiceIp()); - Assertions.assertEquals("slmot", model.dockerBridgeCidr()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AksNetworkingConfiguration model = - new AksNetworkingConfiguration() - .withSubnetId("pilguooqjag") - .withServiceCidr("itgueiookjbs") - .withDnsServiceIp("rtdtpdelq") - .withDockerBridgeCidr("slmot"); - model = BinaryData.fromObject(model).toObject(AksNetworkingConfiguration.class); - Assertions.assertEquals("pilguooqjag", model.subnetId()); - Assertions.assertEquals("itgueiookjbs", model.serviceCidr()); - Assertions.assertEquals("rtdtpdelq", model.dnsServiceIp()); - Assertions.assertEquals("slmot", model.dockerBridgeCidr()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlComputeNodeInformationTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlComputeNodeInformationTests.java deleted file mode 100644 index 382335e46a8b3..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlComputeNodeInformationTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AmlComputeNodeInformation; - -public final class AmlComputeNodeInformationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AmlComputeNodeInformation model = - BinaryData - .fromString( - "{\"nodeId\":\"hsmtxpsiebtfhvp\",\"privateIpAddress\":\"apskrdqm\",\"publicIpAddress\":\"jdhtldwkyzxu\",\"port\":379697539,\"nodeState\":\"unusable\",\"runId\":\"scwsv\"}") - .toObject(AmlComputeNodeInformation.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AmlComputeNodeInformation model = new AmlComputeNodeInformation(); - model = BinaryData.fromObject(model).toObject(AmlComputeNodeInformation.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlComputeNodesInformationTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlComputeNodesInformationTests.java deleted file mode 100644 index bdb79d003a025..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlComputeNodesInformationTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AmlComputeNodesInformation; - -public final class AmlComputeNodesInformationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AmlComputeNodesInformation model = - BinaryData - .fromString( - "{\"nodes\":[{\"nodeId\":\"zjancuxr\",\"privateIpAddress\":\"wbavxbniwdj\",\"publicIpAddress\":\"zt\",\"port\":593552862,\"nodeState\":\"unusable\",\"runId\":\"xytxhpzxbz\"},{\"nodeId\":\"zabglcuhxwt\",\"privateIpAddress\":\"yqiklbbovplwzb\",\"publicIpAddress\":\"gy\",\"port\":1408848677,\"nodeState\":\"idle\",\"runId\":\"mkfssxqukkfplgm\"},{\"nodeId\":\"xnkjzkdesl\",\"privateIpAddress\":\"lopwiyig\",\"publicIpAddress\":\"pkdwzbai\",\"port\":830727700,\"nodeState\":\"unusable\",\"runId\":\"m\"}],\"nextLink\":\"qupedeojnab\"}") - .toObject(AmlComputeNodesInformation.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AmlComputeNodesInformation model = new AmlComputeNodesInformation(); - model = BinaryData.fromObject(model).toObject(AmlComputeNodesInformation.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlOperationDisplayTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlOperationDisplayTests.java deleted file mode 100644 index 4dd999feefe24..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlOperationDisplayTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AmlOperationDisplay; -import org.junit.jupiter.api.Assertions; - -public final class AmlOperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AmlOperationDisplay model = - BinaryData - .fromString( - "{\"provider\":\"gjofjd\",\"resource\":\"qs\",\"operation\":\"eupewnwreitjz\",\"description\":\"lusarh\"}") - .toObject(AmlOperationDisplay.class); - Assertions.assertEquals("gjofjd", model.provider()); - Assertions.assertEquals("qs", model.resource()); - Assertions.assertEquals("eupewnwreitjz", model.operation()); - Assertions.assertEquals("lusarh", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AmlOperationDisplay model = - new AmlOperationDisplay() - .withProvider("gjofjd") - .withResource("qs") - .withOperation("eupewnwreitjz") - .withDescription("lusarh"); - model = BinaryData.fromObject(model).toObject(AmlOperationDisplay.class); - Assertions.assertEquals("gjofjd", model.provider()); - Assertions.assertEquals("qs", model.resource()); - Assertions.assertEquals("eupewnwreitjz", model.operation()); - Assertions.assertEquals("lusarh", model.description()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlOperationInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlOperationInnerTests.java deleted file mode 100644 index 2259819743556..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlOperationInnerTests.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.AmlOperationInner; -import com.azure.resourcemanager.machinelearning.models.AmlOperationDisplay; -import org.junit.jupiter.api.Assertions; - -public final class AmlOperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AmlOperationInner model = - BinaryData - .fromString( - "{\"name\":\"siznto\",\"display\":{\"provider\":\"a\",\"resource\":\"ajpsquc\",\"operation\":\"o\",\"description\":\"dkfo\"},\"isDataAction\":false}") - .toObject(AmlOperationInner.class); - Assertions.assertEquals("siznto", model.name()); - Assertions.assertEquals("a", model.display().provider()); - Assertions.assertEquals("ajpsquc", model.display().resource()); - Assertions.assertEquals("o", model.display().operation()); - Assertions.assertEquals("dkfo", model.display().description()); - Assertions.assertEquals(false, model.isDataAction()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AmlOperationInner model = - new AmlOperationInner() - .withName("siznto") - .withDisplay( - new AmlOperationDisplay() - .withProvider("a") - .withResource("ajpsquc") - .withOperation("o") - .withDescription("dkfo")) - .withIsDataAction(false); - model = BinaryData.fromObject(model).toObject(AmlOperationInner.class); - Assertions.assertEquals("siznto", model.name()); - Assertions.assertEquals("a", model.display().provider()); - Assertions.assertEquals("ajpsquc", model.display().resource()); - Assertions.assertEquals("o", model.display().operation()); - Assertions.assertEquals("dkfo", model.display().description()); - Assertions.assertEquals(false, model.isDataAction()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlOperationListResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlOperationListResultTests.java deleted file mode 100644 index 5401da3f66c4b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlOperationListResultTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.AmlOperationInner; -import com.azure.resourcemanager.machinelearning.models.AmlOperationDisplay; -import com.azure.resourcemanager.machinelearning.models.AmlOperationListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AmlOperationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AmlOperationListResult model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"quvgjxpybczme\",\"display\":{\"provider\":\"zopbsphrupidgs\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"hdxbmtqio\",\"description\":\"zehtbmu\"},\"isDataAction\":false},{\"name\":\"noi\",\"display\":{\"provider\":\"lrxybqsoq\",\"resource\":\"gkdmb\",\"operation\":\"zlobcufpd\",\"description\":\"rbt\"},\"isDataAction\":true},{\"name\":\"nq\",\"display\":{\"provider\":\"qgn\",\"resource\":\"ooojywifsqe\",\"operation\":\"agdfmglzlh\",\"description\":\"rifkwm\"},\"isDataAction\":true}]}") - .toObject(AmlOperationListResult.class); - Assertions.assertEquals("quvgjxpybczme", model.value().get(0).name()); - Assertions.assertEquals("zopbsphrupidgs", model.value().get(0).display().provider()); - Assertions.assertEquals("bejhphoycmsxa", model.value().get(0).display().resource()); - Assertions.assertEquals("hdxbmtqio", model.value().get(0).display().operation()); - Assertions.assertEquals("zehtbmu", model.value().get(0).display().description()); - Assertions.assertEquals(false, model.value().get(0).isDataAction()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AmlOperationListResult model = - new AmlOperationListResult() - .withValue( - Arrays - .asList( - new AmlOperationInner() - .withName("quvgjxpybczme") - .withDisplay( - new AmlOperationDisplay() - .withProvider("zopbsphrupidgs") - .withResource("bejhphoycmsxa") - .withOperation("hdxbmtqio") - .withDescription("zehtbmu")) - .withIsDataAction(false), - new AmlOperationInner() - .withName("noi") - .withDisplay( - new AmlOperationDisplay() - .withProvider("lrxybqsoq") - .withResource("gkdmb") - .withOperation("zlobcufpd") - .withDescription("rbt")) - .withIsDataAction(true), - new AmlOperationInner() - .withName("nq") - .withDisplay( - new AmlOperationDisplay() - .withProvider("qgn") - .withResource("ooojywifsqe") - .withOperation("agdfmglzlh") - .withDescription("rifkwm")) - .withIsDataAction(true))); - model = BinaryData.fromObject(model).toObject(AmlOperationListResult.class); - Assertions.assertEquals("quvgjxpybczme", model.value().get(0).name()); - Assertions.assertEquals("zopbsphrupidgs", model.value().get(0).display().provider()); - Assertions.assertEquals("bejhphoycmsxa", model.value().get(0).display().resource()); - Assertions.assertEquals("hdxbmtqio", model.value().get(0).display().operation()); - Assertions.assertEquals("zehtbmu", model.value().get(0).display().description()); - Assertions.assertEquals(false, model.value().get(0).isDataAction()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlTokenTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlTokenTests.java deleted file mode 100644 index 4500fbd744095..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlTokenTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AmlToken; - -public final class AmlTokenTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AmlToken model = BinaryData.fromString("{\"identityType\":\"AMLToken\"}").toObject(AmlToken.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AmlToken model = new AmlToken(); - model = BinaryData.fromObject(model).toObject(AmlToken.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlUserFeatureInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlUserFeatureInnerTests.java deleted file mode 100644 index acef398e64afe..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AmlUserFeatureInnerTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.AmlUserFeatureInner; -import org.junit.jupiter.api.Assertions; - -public final class AmlUserFeatureInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AmlUserFeatureInner model = - BinaryData - .fromString("{\"id\":\"pkt\",\"displayName\":\"ylkmqp\",\"description\":\"yhlfb\"}") - .toObject(AmlUserFeatureInner.class); - Assertions.assertEquals("pkt", model.id()); - Assertions.assertEquals("ylkmqp", model.displayName()); - Assertions.assertEquals("yhlfb", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AmlUserFeatureInner model = - new AmlUserFeatureInner().withId("pkt").withDisplayName("ylkmqp").withDescription("yhlfb"); - model = BinaryData.fromObject(model).toObject(AmlUserFeatureInner.class); - Assertions.assertEquals("pkt", model.id()); - Assertions.assertEquals("ylkmqp", model.displayName()); - Assertions.assertEquals("yhlfb", model.description()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssetBaseTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssetBaseTests.java deleted file mode 100644 index bf7b889c21a85..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssetBaseTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AssetBase; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class AssetBaseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AssetBase model = - BinaryData - .fromString( - "{\"isAnonymous\":false,\"isArchived\":false,\"description\":\"szfjvfbgofelja\",\"properties\":{\"ojnal\":\"mqhldvrii\",\"qhhahhxvrhmzkwpj\":\"hfkvtvsexsowuel\",\"ughftqsx\":\"wws\"},\"tags\":{\"grjguufzd\":\"ujxukndxd\",\"whbotzingamv\":\"syqtfi\"}}") - .toObject(AssetBase.class); - Assertions.assertEquals("szfjvfbgofelja", model.description()); - Assertions.assertEquals("mqhldvrii", model.properties().get("ojnal")); - Assertions.assertEquals("ujxukndxd", model.tags().get("grjguufzd")); - Assertions.assertEquals(false, model.isAnonymous()); - Assertions.assertEquals(false, model.isArchived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AssetBase model = - new AssetBase() - .withDescription("szfjvfbgofelja") - .withProperties(mapOf("ojnal", "mqhldvrii", "qhhahhxvrhmzkwpj", "hfkvtvsexsowuel", "ughftqsx", "wws")) - .withTags(mapOf("grjguufzd", "ujxukndxd", "whbotzingamv", "syqtfi")) - .withIsAnonymous(false) - .withIsArchived(false); - model = BinaryData.fromObject(model).toObject(AssetBase.class); - Assertions.assertEquals("szfjvfbgofelja", model.description()); - Assertions.assertEquals("mqhldvrii", model.properties().get("ojnal")); - Assertions.assertEquals("ujxukndxd", model.tags().get("grjguufzd")); - Assertions.assertEquals(false, model.isAnonymous()); - Assertions.assertEquals(false, model.isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssetContainerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssetContainerTests.java deleted file mode 100644 index 68efc629022b3..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssetContainerTests.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AssetContainer; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class AssetContainerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AssetContainer model = - BinaryData - .fromString( - "{\"isArchived\":false,\"latestVersion\":\"qnyhgb\",\"nextVersion\":\"tjivfxzsjabib\",\"description\":\"stawfsdjpvkv\",\"properties\":{\"budurgkakmo\":\"xbkzbzkdvncj\",\"gzrf\":\"zhjjklffhmouwq\",\"ikayuhqlbjbsybb\":\"eeyebi\"},\"tags\":{\"slthaq\":\"vtldgmfpgvmpip\"}}") - .toObject(AssetContainer.class); - Assertions.assertEquals("stawfsdjpvkv", model.description()); - Assertions.assertEquals("xbkzbzkdvncj", model.properties().get("budurgkakmo")); - Assertions.assertEquals("vtldgmfpgvmpip", model.tags().get("slthaq")); - Assertions.assertEquals(false, model.isArchived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AssetContainer model = - new AssetContainer() - .withDescription("stawfsdjpvkv") - .withProperties( - mapOf("budurgkakmo", "xbkzbzkdvncj", "gzrf", "zhjjklffhmouwq", "ikayuhqlbjbsybb", "eeyebi")) - .withTags(mapOf("slthaq", "vtldgmfpgvmpip")) - .withIsArchived(false); - model = BinaryData.fromObject(model).toObject(AssetContainer.class); - Assertions.assertEquals("stawfsdjpvkv", model.description()); - Assertions.assertEquals("xbkzbzkdvncj", model.properties().get("budurgkakmo")); - Assertions.assertEquals("vtldgmfpgvmpip", model.tags().get("slthaq")); - Assertions.assertEquals(false, model.isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssetJobInputTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssetJobInputTests.java deleted file mode 100644 index b29a8197e2ab3..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssetJobInputTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AssetJobInput; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import org.junit.jupiter.api.Assertions; - -public final class AssetJobInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AssetJobInput model = - BinaryData.fromString("{\"mode\":\"ReadOnlyMount\",\"uri\":\"fgbrtt\"}").toObject(AssetJobInput.class); - Assertions.assertEquals(InputDeliveryMode.READ_ONLY_MOUNT, model.mode()); - Assertions.assertEquals("fgbrtt", model.uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AssetJobInput model = new AssetJobInput().withMode(InputDeliveryMode.READ_ONLY_MOUNT).withUri("fgbrtt"); - model = BinaryData.fromObject(model).toObject(AssetJobInput.class); - Assertions.assertEquals(InputDeliveryMode.READ_ONLY_MOUNT, model.mode()); - Assertions.assertEquals("fgbrtt", model.uri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssetJobOutputTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssetJobOutputTests.java deleted file mode 100644 index 9b241f855a052..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssetJobOutputTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AssetJobOutput; -import com.azure.resourcemanager.machinelearning.models.OutputDeliveryMode; -import org.junit.jupiter.api.Assertions; - -public final class AssetJobOutputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AssetJobOutput model = - BinaryData.fromString("{\"mode\":\"Upload\",\"uri\":\"lkiexhajlfnthiq\"}").toObject(AssetJobOutput.class); - Assertions.assertEquals(OutputDeliveryMode.UPLOAD, model.mode()); - Assertions.assertEquals("lkiexhajlfnthiq", model.uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AssetJobOutput model = new AssetJobOutput().withMode(OutputDeliveryMode.UPLOAD).withUri("lkiexhajlfnthiq"); - model = BinaryData.fromObject(model).toObject(AssetJobOutput.class); - Assertions.assertEquals(OutputDeliveryMode.UPLOAD, model.mode()); - Assertions.assertEquals("lkiexhajlfnthiq", model.uri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssetReferenceBaseTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssetReferenceBaseTests.java deleted file mode 100644 index 11357aca4ae81..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssetReferenceBaseTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AssetReferenceBase; - -public final class AssetReferenceBaseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AssetReferenceBase model = - BinaryData.fromString("{\"referenceType\":\"AssetReferenceBase\"}").toObject(AssetReferenceBase.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AssetReferenceBase model = new AssetReferenceBase(); - model = BinaryData.fromObject(model).toObject(AssetReferenceBase.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssignedUserTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssignedUserTests.java deleted file mode 100644 index 0ee7c299110b0..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AssignedUserTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AssignedUser; -import org.junit.jupiter.api.Assertions; - -public final class AssignedUserTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AssignedUser model = - BinaryData - .fromString("{\"objectId\":\"mykyujxsglhs\",\"tenantId\":\"rryejylmbkzudnig\"}") - .toObject(AssignedUser.class); - Assertions.assertEquals("mykyujxsglhs", model.objectId()); - Assertions.assertEquals("rryejylmbkzudnig", model.tenantId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AssignedUser model = new AssignedUser().withObjectId("mykyujxsglhs").withTenantId("rryejylmbkzudnig"); - model = BinaryData.fromObject(model).toObject(AssignedUser.class); - Assertions.assertEquals("mykyujxsglhs", model.objectId()); - Assertions.assertEquals("rryejylmbkzudnig", model.tenantId()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoForecastHorizonTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoForecastHorizonTests.java deleted file mode 100644 index 44430f0e8225b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoForecastHorizonTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AutoForecastHorizon; - -public final class AutoForecastHorizonTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutoForecastHorizon model = BinaryData.fromString("{\"mode\":\"Auto\"}").toObject(AutoForecastHorizon.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutoForecastHorizon model = new AutoForecastHorizon(); - model = BinaryData.fromObject(model).toObject(AutoForecastHorizon.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoMLJobTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoMLJobTests.java deleted file mode 100644 index 789779d401001..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoMLJobTests.java +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AutoMLJob; -import com.azure.resourcemanager.machinelearning.models.AutoMLVertical; -import com.azure.resourcemanager.machinelearning.models.IdentityConfiguration; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.JobOutput; -import com.azure.resourcemanager.machinelearning.models.JobResourceConfiguration; -import com.azure.resourcemanager.machinelearning.models.JobService; -import com.azure.resourcemanager.machinelearning.models.LogVerbosity; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class AutoMLJobTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutoMLJob model = - BinaryData - .fromString( - "{\"jobType\":\"AutoML\",\"environmentId\":\"uttdiygbp\",\"environmentVariables\":{\"ctwwgzw\":\"swmtxk\",\"og\":\"jlmec\"},\"outputs\":{\"zaifghtmoqqtlff\":{\"jobOutputType\":\"JobOutput\",\"description\":\"vne\"},\"avfqnvhnqoewdogi\":{\"jobOutputType\":\"JobOutput\",\"description\":\"bkrkjj\"},\"t\":{\"jobOutputType\":\"JobOutput\",\"description\":\"tesypvidbztjh\"},\"p\":{\"jobOutputType\":\"JobOutput\",\"description\":\"ovnynkbwetnju\"}},\"resources\":{\"dockerArgs\":\"kzyaup\",\"shmSize\":\"ccxnafbwqroohtuo\",\"instanceCount\":339434421,\"instanceType\":\"nur\",\"properties\":{\"ecmslclbl\":\"datamghihp\",\"bsjuscvsfx\":\"datajxl\",\"cydrtceukdqkk\":\"datagctmgxuupbezq\",\"chillcecf\":\"dataihztgeqmgqzgwldo\"}},\"taskDetails\":{\"taskType\":\"AutoMLVertical\",\"logVerbosity\":\"Debug\",\"targetColumnName\":\"aoaguhicqlli\",\"trainingData\":{\"jobInputType\":\"mltable\",\"mode\":\"EvalMount\",\"uri\":\"ac\",\"description\":\"vhrweftkwqejpmv\"}},\"componentId\":\"ehaepwamcxtc\",\"computeId\":\"upeuknijduyye\",\"displayName\":\"ydjfb\",\"experimentName\":\"yv\",\"identity\":{\"identityType\":\"IdentityConfiguration\"},\"isArchived\":true,\"services\":{\"xjcmmzrrsc\":{\"endpoint\":\"wikdmh\",\"errorMessage\":\"kuflgbh\",\"jobServiceType\":\"uacdixmxuf\",\"port\":2084049172,\"properties\":{\"kfnozoeoqbvj\":\"qg\",\"ay\":\"vefgwbmqjchntas\",\"wyvf\":\"xbulpzealbmqkyo\"},\"status\":\"btsuahxs\"},\"k\":{\"endpoint\":\"i\",\"errorMessage\":\"drnpxqwodiff\",\"jobServiceType\":\"cjrmmua\",\"port\":1056195369,\"properties\":{\"e\":\"jogjonmc\",\"akpoldtvevbo\":\"oyzbamwineofvf\",\"zjknyuxg\":\"lz\",\"mrdixtreki\":\"ttxpnrupza\"},\"status\":\"wyskbruffgll\"}},\"status\":\"Paused\",\"description\":\"lxhrp\",\"properties\":{\"iryr\":\"mblcouqehbhbcds\",\"pmbltoormkfql\":\"ndo\",\"nbmjksibjgsjjxxa\":\"xldykalsygaolnjp\"},\"tags\":{\"gxyivpinbmh\":\"nadzyq\",\"bkezn\":\"bjijkgqxnh\",\"nggiycwkdtaa\":\"aujvaa\",\"ekaum\":\"xw\"}}") - .toObject(AutoMLJob.class); - Assertions.assertEquals("lxhrp", model.description()); - Assertions.assertEquals("mblcouqehbhbcds", model.properties().get("iryr")); - Assertions.assertEquals("nadzyq", model.tags().get("gxyivpinbmh")); - Assertions.assertEquals("ehaepwamcxtc", model.componentId()); - Assertions.assertEquals("upeuknijduyye", model.computeId()); - Assertions.assertEquals("ydjfb", model.displayName()); - Assertions.assertEquals("yv", model.experimentName()); - Assertions.assertEquals(true, model.isArchived()); - Assertions.assertEquals("wikdmh", model.services().get("xjcmmzrrsc").endpoint()); - Assertions.assertEquals("uacdixmxuf", model.services().get("xjcmmzrrsc").jobServiceType()); - Assertions.assertEquals(2084049172, model.services().get("xjcmmzrrsc").port()); - Assertions.assertEquals("qg", model.services().get("xjcmmzrrsc").properties().get("kfnozoeoqbvj")); - Assertions.assertEquals("uttdiygbp", model.environmentId()); - Assertions.assertEquals("swmtxk", model.environmentVariables().get("ctwwgzw")); - Assertions.assertEquals("vne", model.outputs().get("zaifghtmoqqtlff").description()); - Assertions.assertEquals(339434421, model.resources().instanceCount()); - Assertions.assertEquals("nur", model.resources().instanceType()); - Assertions.assertEquals("kzyaup", model.resources().dockerArgs()); - Assertions.assertEquals("ccxnafbwqroohtuo", model.resources().shmSize()); - Assertions.assertEquals(LogVerbosity.DEBUG, model.taskDetails().logVerbosity()); - Assertions.assertEquals("aoaguhicqlli", model.taskDetails().targetColumnName()); - Assertions.assertEquals("vhrweftkwqejpmv", model.taskDetails().trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_MOUNT, model.taskDetails().trainingData().mode()); - Assertions.assertEquals("ac", model.taskDetails().trainingData().uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutoMLJob model = - new AutoMLJob() - .withDescription("lxhrp") - .withProperties( - mapOf("iryr", "mblcouqehbhbcds", "pmbltoormkfql", "ndo", "nbmjksibjgsjjxxa", "xldykalsygaolnjp")) - .withTags( - mapOf("gxyivpinbmh", "nadzyq", "bkezn", "bjijkgqxnh", "nggiycwkdtaa", "aujvaa", "ekaum", "xw")) - .withComponentId("ehaepwamcxtc") - .withComputeId("upeuknijduyye") - .withDisplayName("ydjfb") - .withExperimentName("yv") - .withIdentity(new IdentityConfiguration()) - .withIsArchived(true) - .withServices( - mapOf( - "xjcmmzrrsc", - new JobService() - .withEndpoint("wikdmh") - .withJobServiceType("uacdixmxuf") - .withPort(2084049172) - .withProperties( - mapOf("kfnozoeoqbvj", "qg", "ay", "vefgwbmqjchntas", "wyvf", "xbulpzealbmqkyo")), - "k", - new JobService() - .withEndpoint("i") - .withJobServiceType("cjrmmua") - .withPort(1056195369) - .withProperties( - mapOf( - "e", - "jogjonmc", - "akpoldtvevbo", - "oyzbamwineofvf", - "zjknyuxg", - "lz", - "mrdixtreki", - "ttxpnrupza")))) - .withEnvironmentId("uttdiygbp") - .withEnvironmentVariables(mapOf("ctwwgzw", "swmtxk", "og", "jlmec")) - .withOutputs( - mapOf( - "zaifghtmoqqtlff", - new JobOutput().withDescription("vne"), - "avfqnvhnqoewdogi", - new JobOutput().withDescription("bkrkjj"), - "t", - new JobOutput().withDescription("tesypvidbztjh"), - "p", - new JobOutput().withDescription("ovnynkbwetnju"))) - .withResources( - new JobResourceConfiguration() - .withInstanceCount(339434421) - .withInstanceType("nur") - .withProperties( - mapOf( - "ecmslclbl", - "datamghihp", - "bsjuscvsfx", - "datajxl", - "cydrtceukdqkk", - "datagctmgxuupbezq", - "chillcecf", - "dataihztgeqmgqzgwldo")) - .withDockerArgs("kzyaup") - .withShmSize("ccxnafbwqroohtuo")) - .withTaskDetails( - new AutoMLVertical() - .withLogVerbosity(LogVerbosity.DEBUG) - .withTargetColumnName("aoaguhicqlli") - .withTrainingData( - new MLTableJobInput() - .withDescription("vhrweftkwqejpmv") - .withMode(InputDeliveryMode.EVAL_MOUNT) - .withUri("ac"))); - model = BinaryData.fromObject(model).toObject(AutoMLJob.class); - Assertions.assertEquals("lxhrp", model.description()); - Assertions.assertEquals("mblcouqehbhbcds", model.properties().get("iryr")); - Assertions.assertEquals("nadzyq", model.tags().get("gxyivpinbmh")); - Assertions.assertEquals("ehaepwamcxtc", model.componentId()); - Assertions.assertEquals("upeuknijduyye", model.computeId()); - Assertions.assertEquals("ydjfb", model.displayName()); - Assertions.assertEquals("yv", model.experimentName()); - Assertions.assertEquals(true, model.isArchived()); - Assertions.assertEquals("wikdmh", model.services().get("xjcmmzrrsc").endpoint()); - Assertions.assertEquals("uacdixmxuf", model.services().get("xjcmmzrrsc").jobServiceType()); - Assertions.assertEquals(2084049172, model.services().get("xjcmmzrrsc").port()); - Assertions.assertEquals("qg", model.services().get("xjcmmzrrsc").properties().get("kfnozoeoqbvj")); - Assertions.assertEquals("uttdiygbp", model.environmentId()); - Assertions.assertEquals("swmtxk", model.environmentVariables().get("ctwwgzw")); - Assertions.assertEquals("vne", model.outputs().get("zaifghtmoqqtlff").description()); - Assertions.assertEquals(339434421, model.resources().instanceCount()); - Assertions.assertEquals("nur", model.resources().instanceType()); - Assertions.assertEquals("kzyaup", model.resources().dockerArgs()); - Assertions.assertEquals("ccxnafbwqroohtuo", model.resources().shmSize()); - Assertions.assertEquals(LogVerbosity.DEBUG, model.taskDetails().logVerbosity()); - Assertions.assertEquals("aoaguhicqlli", model.taskDetails().targetColumnName()); - Assertions.assertEquals("vhrweftkwqejpmv", model.taskDetails().trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_MOUNT, model.taskDetails().trainingData().mode()); - Assertions.assertEquals("ac", model.taskDetails().trainingData().uri()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoMLVerticalTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoMLVerticalTests.java deleted file mode 100644 index 8d3ae3ca9647c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoMLVerticalTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AutoMLVertical; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.LogVerbosity; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import org.junit.jupiter.api.Assertions; - -public final class AutoMLVerticalTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutoMLVertical model = - BinaryData - .fromString( - "{\"taskType\":\"AutoMLVertical\",\"logVerbosity\":\"Critical\",\"targetColumnName\":\"eocnhzqrottj\",\"trainingData\":{\"jobInputType\":\"mltable\",\"mode\":\"Download\",\"uri\":\"yjzp\",\"description\":\"rl\"}}") - .toObject(AutoMLVertical.class); - Assertions.assertEquals(LogVerbosity.CRITICAL, model.logVerbosity()); - Assertions.assertEquals("eocnhzqrottj", model.targetColumnName()); - Assertions.assertEquals("rl", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.trainingData().mode()); - Assertions.assertEquals("yjzp", model.trainingData().uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutoMLVertical model = - new AutoMLVertical() - .withLogVerbosity(LogVerbosity.CRITICAL) - .withTargetColumnName("eocnhzqrottj") - .withTrainingData( - new MLTableJobInput().withDescription("rl").withMode(InputDeliveryMode.DOWNLOAD).withUri("yjzp")); - model = BinaryData.fromObject(model).toObject(AutoMLVertical.class); - Assertions.assertEquals(LogVerbosity.CRITICAL, model.logVerbosity()); - Assertions.assertEquals("eocnhzqrottj", model.targetColumnName()); - Assertions.assertEquals("rl", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.trainingData().mode()); - Assertions.assertEquals("yjzp", model.trainingData().uri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoNCrossValidationsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoNCrossValidationsTests.java deleted file mode 100644 index 58b47b826dc68..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoNCrossValidationsTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AutoNCrossValidations; - -public final class AutoNCrossValidationsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutoNCrossValidations model = - BinaryData.fromString("{\"mode\":\"Auto\"}").toObject(AutoNCrossValidations.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutoNCrossValidations model = new AutoNCrossValidations(); - model = BinaryData.fromObject(model).toObject(AutoNCrossValidations.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoPausePropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoPausePropertiesTests.java deleted file mode 100644 index f12d789871f5b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoPausePropertiesTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AutoPauseProperties; -import org.junit.jupiter.api.Assertions; - -public final class AutoPausePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutoPauseProperties model = - BinaryData - .fromString("{\"delayInMinutes\":1505052289,\"enabled\":true}") - .toObject(AutoPauseProperties.class); - Assertions.assertEquals(1505052289, model.delayInMinutes()); - Assertions.assertEquals(true, model.enabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutoPauseProperties model = new AutoPauseProperties().withDelayInMinutes(1505052289).withEnabled(true); - model = BinaryData.fromObject(model).toObject(AutoPauseProperties.class); - Assertions.assertEquals(1505052289, model.delayInMinutes()); - Assertions.assertEquals(true, model.enabled()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoScalePropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoScalePropertiesTests.java deleted file mode 100644 index c895c8da10433..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoScalePropertiesTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AutoScaleProperties; -import org.junit.jupiter.api.Assertions; - -public final class AutoScalePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutoScaleProperties model = - BinaryData - .fromString("{\"minNodeCount\":814110880,\"enabled\":true,\"maxNodeCount\":1557135644}") - .toObject(AutoScaleProperties.class); - Assertions.assertEquals(814110880, model.minNodeCount()); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals(1557135644, model.maxNodeCount()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutoScaleProperties model = - new AutoScaleProperties().withMinNodeCount(814110880).withEnabled(true).withMaxNodeCount(1557135644); - model = BinaryData.fromObject(model).toObject(AutoScaleProperties.class); - Assertions.assertEquals(814110880, model.minNodeCount()); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals(1557135644, model.maxNodeCount()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoSeasonalityTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoSeasonalityTests.java deleted file mode 100644 index e0e0e8665c433..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoSeasonalityTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AutoSeasonality; - -public final class AutoSeasonalityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutoSeasonality model = BinaryData.fromString("{\"mode\":\"Auto\"}").toObject(AutoSeasonality.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutoSeasonality model = new AutoSeasonality(); - model = BinaryData.fromObject(model).toObject(AutoSeasonality.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoTargetLagsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoTargetLagsTests.java deleted file mode 100644 index 127caf51febf1..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoTargetLagsTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AutoTargetLags; - -public final class AutoTargetLagsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutoTargetLags model = BinaryData.fromString("{\"mode\":\"Auto\"}").toObject(AutoTargetLags.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutoTargetLags model = new AutoTargetLags(); - model = BinaryData.fromObject(model).toObject(AutoTargetLags.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoTargetRollingWindowSizeTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoTargetRollingWindowSizeTests.java deleted file mode 100644 index 14db2d76c61f0..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/AutoTargetRollingWindowSizeTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AutoTargetRollingWindowSize; - -public final class AutoTargetRollingWindowSizeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutoTargetRollingWindowSize model = - BinaryData.fromString("{\"mode\":\"Auto\"}").toObject(AutoTargetRollingWindowSize.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutoTargetRollingWindowSize model = new AutoTargetRollingWindowSize(); - model = BinaryData.fromObject(model).toObject(AutoTargetRollingWindowSize.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BanditPolicyTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BanditPolicyTests.java deleted file mode 100644 index e2609437faf5e..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BanditPolicyTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.BanditPolicy; -import org.junit.jupiter.api.Assertions; - -public final class BanditPolicyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BanditPolicy model = - BinaryData - .fromString( - "{\"policyType\":\"Bandit\",\"slackAmount\":59.648163,\"slackFactor\":43.063473,\"delayEvaluation\":364097944,\"evaluationInterval\":2114496472}") - .toObject(BanditPolicy.class); - Assertions.assertEquals(364097944, model.delayEvaluation()); - Assertions.assertEquals(2114496472, model.evaluationInterval()); - Assertions.assertEquals(59.648163F, model.slackAmount()); - Assertions.assertEquals(43.063473F, model.slackFactor()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BanditPolicy model = - new BanditPolicy() - .withDelayEvaluation(364097944) - .withEvaluationInterval(2114496472) - .withSlackAmount(59.648163F) - .withSlackFactor(43.063473F); - model = BinaryData.fromObject(model).toObject(BanditPolicy.class); - Assertions.assertEquals(364097944, model.delayEvaluation()); - Assertions.assertEquals(2114496472, model.evaluationInterval()); - Assertions.assertEquals(59.648163F, model.slackAmount()); - Assertions.assertEquals(43.063473F, model.slackFactor()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentTrackedResourceArmPaginatedResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentTrackedResourceArmPaginatedResultTests.java deleted file mode 100644 index d9c91dc82e167..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentTrackedResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,221 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.BatchDeploymentInner; -import com.azure.resourcemanager.machinelearning.models.BatchDeploymentProperties; -import com.azure.resourcemanager.machinelearning.models.BatchDeploymentTrackedResourceArmPaginatedResult; -import com.azure.resourcemanager.machinelearning.models.BatchLoggingLevel; -import com.azure.resourcemanager.machinelearning.models.BatchOutputAction; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.Sku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class BatchDeploymentTrackedResourceArmPaginatedResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BatchDeploymentTrackedResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"nextLink\":\"byuqerpqlp\",\"value\":[{\"identity\":{\"principalId\":\"439e0872-7c89-4299-a31c-cf73792200da\",\"tenantId\":\"50121c3a-c7ab-40c4-8c70-18840ec211b8\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{}},\"kind\":\"dbutauvfbtkuwhh\",\"properties\":{\"compute\":\"ykojoxafnndlpic\",\"errorThreshold\":171305753,\"loggingLevel\":\"Warning\",\"maxConcurrencyPerInstance\":1638328793,\"miniBatchSize\":8200965629156318432,\"outputAction\":\"AppendRow\",\"outputFileName\":\"pwdreqnovvqf\",\"provisioningState\":\"Failed\",\"description\":\"suwsyrsnds\",\"environmentId\":\"g\",\"environmentVariables\":{},\"properties\":{}},\"sku\":{\"name\":\"r\",\"tier\":\"Standard\",\"size\":\"neqn\",\"family\":\"rrwlquuijfqkace\",\"capacity\":2104888829},\"location\":\"fpubjibwwi\",\"tags\":{\"ynfs\":\"hqkvpuvksgplsak\",\"jphuopxodlqi\":\"n\",\"slyzrpzbchckqq\":\"ntorzihleosjswsr\",\"suiizynkedyat\":\"qioxi\"},\"id\":\"wyhqmibzyhwits\",\"name\":\"ypyynpcdpumnzg\",\"type\":\"wznm\"},{\"identity\":{\"principalId\":\"466a0824-8e60-480f-8923-8af40473b79f\",\"tenantId\":\"77aada0f-7267-4cb3-94d7-d6d969aaa174\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"kind\":\"rgjhxb\",\"properties\":{\"compute\":\"tlwwrlk\",\"errorThreshold\":1940246801,\"loggingLevel\":\"Warning\",\"maxConcurrencyPerInstance\":333571047,\"miniBatchSize\":4567104725520033936,\"outputAction\":\"SummaryOnly\",\"outputFileName\":\"yhgsy\",\"provisioningState\":\"Deleting\",\"description\":\"dtbnnha\",\"environmentId\":\"ocrkvcikh\",\"environmentVariables\":{},\"properties\":{}},\"sku\":{\"name\":\"mqg\",\"tier\":\"Basic\",\"size\":\"ezikywggxkal\",\"family\":\"tmelw\",\"capacity\":908050565},\"location\":\"ccjzkzivgvv\",\"tags\":{\"hyrnxxmu\":\"y\",\"v\":\"edndr\"},\"id\":\"tkwqqtchealm\",\"name\":\"mtdaa\",\"type\":\"gdv\"},{\"identity\":{\"principalId\":\"b3def810-702e-4b60-ab84-3e75ff2656f0\",\"tenantId\":\"241d1b0c-4837-448d-a75d-493d5be4541e\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"kind\":\"g\",\"properties\":{\"compute\":\"rtfudxepxg\",\"errorThreshold\":682770513,\"loggingLevel\":\"Warning\",\"maxConcurrencyPerInstance\":1825902686,\"miniBatchSize\":4744038705838577883,\"outputAction\":\"AppendRow\",\"outputFileName\":\"himdbl\",\"provisioningState\":\"Deleting\",\"description\":\"jhfjxwm\",\"environmentId\":\"kkfoqr\",\"environmentVariables\":{},\"properties\":{}},\"sku\":{\"name\":\"zi\",\"tier\":\"Basic\",\"size\":\"wneaiv\",\"family\":\"czelpcirel\",\"capacity\":561356651},\"location\":\"enwabfatk\",\"tags\":{\"oulpjrv\":\"xbjhwuaanozjosph\",\"rvimjwosytxitcsk\":\"ag\",\"hlyfjhdgqgg\":\"cktqumiekkezzi\",\"qfatpxllrxcyjm\":\"bdunygaeqid\"},\"id\":\"a\",\"name\":\"su\",\"type\":\"arm\"},{\"identity\":{\"principalId\":\"ecb5ec81-5f09-4997-928a-d4e055e4403a\",\"tenantId\":\"e364d12b-cbeb-400a-949f-4056df2528ce\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"kind\":\"q\",\"properties\":{\"compute\":\"hhyxxrw\",\"errorThreshold\":324291601,\"loggingLevel\":\"Info\",\"maxConcurrencyPerInstance\":381030924,\"miniBatchSize\":4370015191993628840,\"outputAction\":\"AppendRow\",\"outputFileName\":\"areqna\",\"provisioningState\":\"Succeeded\",\"description\":\"ky\",\"environmentId\":\"beddgssofw\",\"environmentVariables\":{},\"properties\":{}},\"sku\":{\"name\":\"alkrmn\",\"tier\":\"Basic\",\"size\":\"xacqqudfnbyx\",\"family\":\"aabjyvayffimrz\",\"capacity\":1007625802},\"location\":\"qogsexnevfd\",\"tags\":{\"euzsoi\":\"wmewzsyy\"},\"id\":\"judpfrxt\",\"name\":\"thzvaytdwkqbrqu\",\"type\":\"paxh\"}]}") - .toObject(BatchDeploymentTrackedResourceArmPaginatedResult.class); - Assertions.assertEquals("byuqerpqlp", model.nextLink()); - Assertions.assertEquals("fpubjibwwi", model.value().get(0).location()); - Assertions.assertEquals("hqkvpuvksgplsak", model.value().get(0).tags().get("ynfs")); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("dbutauvfbtkuwhh", model.value().get(0).kind()); - Assertions.assertEquals("suwsyrsnds", model.value().get(0).properties().description()); - Assertions.assertEquals("g", model.value().get(0).properties().environmentId()); - Assertions.assertEquals("ykojoxafnndlpic", model.value().get(0).properties().compute()); - Assertions.assertEquals(171305753, model.value().get(0).properties().errorThreshold()); - Assertions.assertEquals(BatchLoggingLevel.WARNING, model.value().get(0).properties().loggingLevel()); - Assertions.assertEquals(1638328793, model.value().get(0).properties().maxConcurrencyPerInstance()); - Assertions.assertEquals(8200965629156318432L, model.value().get(0).properties().miniBatchSize()); - Assertions.assertEquals(BatchOutputAction.APPEND_ROW, model.value().get(0).properties().outputAction()); - Assertions.assertEquals("pwdreqnovvqf", model.value().get(0).properties().outputFileName()); - Assertions.assertEquals("r", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.STANDARD, model.value().get(0).sku().tier()); - Assertions.assertEquals("neqn", model.value().get(0).sku().size()); - Assertions.assertEquals("rrwlquuijfqkace", model.value().get(0).sku().family()); - Assertions.assertEquals(2104888829, model.value().get(0).sku().capacity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BatchDeploymentTrackedResourceArmPaginatedResult model = - new BatchDeploymentTrackedResourceArmPaginatedResult() - .withNextLink("byuqerpqlp") - .withValue( - Arrays - .asList( - new BatchDeploymentInner() - .withLocation("fpubjibwwi") - .withTags( - mapOf( - "ynfs", - "hqkvpuvksgplsak", - "jphuopxodlqi", - "n", - "slyzrpzbchckqq", - "ntorzihleosjswsr", - "suiizynkedyat", - "qioxi")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withKind("dbutauvfbtkuwhh") - .withProperties( - new BatchDeploymentProperties() - .withDescription("suwsyrsnds") - .withEnvironmentId("g") - .withEnvironmentVariables(mapOf()) - .withProperties(mapOf()) - .withCompute("ykojoxafnndlpic") - .withErrorThreshold(171305753) - .withLoggingLevel(BatchLoggingLevel.WARNING) - .withMaxConcurrencyPerInstance(1638328793) - .withMiniBatchSize(8200965629156318432L) - .withOutputAction(BatchOutputAction.APPEND_ROW) - .withOutputFileName("pwdreqnovvqf")) - .withSku( - new Sku() - .withName("r") - .withTier(SkuTier.STANDARD) - .withSize("neqn") - .withFamily("rrwlquuijfqkace") - .withCapacity(2104888829)), - new BatchDeploymentInner() - .withLocation("ccjzkzivgvv") - .withTags(mapOf("hyrnxxmu", "y", "v", "edndr")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withKind("rgjhxb") - .withProperties( - new BatchDeploymentProperties() - .withDescription("dtbnnha") - .withEnvironmentId("ocrkvcikh") - .withEnvironmentVariables(mapOf()) - .withProperties(mapOf()) - .withCompute("tlwwrlk") - .withErrorThreshold(1940246801) - .withLoggingLevel(BatchLoggingLevel.WARNING) - .withMaxConcurrencyPerInstance(333571047) - .withMiniBatchSize(4567104725520033936L) - .withOutputAction(BatchOutputAction.SUMMARY_ONLY) - .withOutputFileName("yhgsy")) - .withSku( - new Sku() - .withName("mqg") - .withTier(SkuTier.BASIC) - .withSize("ezikywggxkal") - .withFamily("tmelw") - .withCapacity(908050565)), - new BatchDeploymentInner() - .withLocation("enwabfatk") - .withTags( - mapOf( - "oulpjrv", - "xbjhwuaanozjosph", - "rvimjwosytxitcsk", - "ag", - "hlyfjhdgqgg", - "cktqumiekkezzi", - "qfatpxllrxcyjm", - "bdunygaeqid")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withKind("g") - .withProperties( - new BatchDeploymentProperties() - .withDescription("jhfjxwm") - .withEnvironmentId("kkfoqr") - .withEnvironmentVariables(mapOf()) - .withProperties(mapOf()) - .withCompute("rtfudxepxg") - .withErrorThreshold(682770513) - .withLoggingLevel(BatchLoggingLevel.WARNING) - .withMaxConcurrencyPerInstance(1825902686) - .withMiniBatchSize(4744038705838577883L) - .withOutputAction(BatchOutputAction.APPEND_ROW) - .withOutputFileName("himdbl")) - .withSku( - new Sku() - .withName("zi") - .withTier(SkuTier.BASIC) - .withSize("wneaiv") - .withFamily("czelpcirel") - .withCapacity(561356651)), - new BatchDeploymentInner() - .withLocation("qogsexnevfd") - .withTags(mapOf("euzsoi", "wmewzsyy")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withKind("q") - .withProperties( - new BatchDeploymentProperties() - .withDescription("ky") - .withEnvironmentId("beddgssofw") - .withEnvironmentVariables(mapOf()) - .withProperties(mapOf()) - .withCompute("hhyxxrw") - .withErrorThreshold(324291601) - .withLoggingLevel(BatchLoggingLevel.INFO) - .withMaxConcurrencyPerInstance(381030924) - .withMiniBatchSize(4370015191993628840L) - .withOutputAction(BatchOutputAction.APPEND_ROW) - .withOutputFileName("areqna")) - .withSku( - new Sku() - .withName("alkrmn") - .withTier(SkuTier.BASIC) - .withSize("xacqqudfnbyx") - .withFamily("aabjyvayffimrz") - .withCapacity(1007625802)))); - model = BinaryData.fromObject(model).toObject(BatchDeploymentTrackedResourceArmPaginatedResult.class); - Assertions.assertEquals("byuqerpqlp", model.nextLink()); - Assertions.assertEquals("fpubjibwwi", model.value().get(0).location()); - Assertions.assertEquals("hqkvpuvksgplsak", model.value().get(0).tags().get("ynfs")); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("dbutauvfbtkuwhh", model.value().get(0).kind()); - Assertions.assertEquals("suwsyrsnds", model.value().get(0).properties().description()); - Assertions.assertEquals("g", model.value().get(0).properties().environmentId()); - Assertions.assertEquals("ykojoxafnndlpic", model.value().get(0).properties().compute()); - Assertions.assertEquals(171305753, model.value().get(0).properties().errorThreshold()); - Assertions.assertEquals(BatchLoggingLevel.WARNING, model.value().get(0).properties().loggingLevel()); - Assertions.assertEquals(1638328793, model.value().get(0).properties().maxConcurrencyPerInstance()); - Assertions.assertEquals(8200965629156318432L, model.value().get(0).properties().miniBatchSize()); - Assertions.assertEquals(BatchOutputAction.APPEND_ROW, model.value().get(0).properties().outputAction()); - Assertions.assertEquals("pwdreqnovvqf", model.value().get(0).properties().outputFileName()); - Assertions.assertEquals("r", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.STANDARD, model.value().get(0).sku().tier()); - Assertions.assertEquals("neqn", model.value().get(0).sku().size()); - Assertions.assertEquals("rrwlquuijfqkace", model.value().get(0).sku().family()); - Assertions.assertEquals(2104888829, model.value().get(0).sku().capacity()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsDeleteMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsDeleteMockTests.java deleted file mode 100644 index 4a747598b2ef1..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchDeploymentsDeleteMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BatchDeploymentsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .batchDeployments() - .delete("ujdsooxrqwo", "urbti", "apdyarikeejdpdfh", "wmmkfq", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointDefaultsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointDefaultsTests.java deleted file mode 100644 index 46d3c75933860..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointDefaultsTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.BatchEndpointDefaults; -import org.junit.jupiter.api.Assertions; - -public final class BatchEndpointDefaultsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BatchEndpointDefaults model = - BinaryData.fromString("{\"deploymentName\":\"wsbpfvm\"}").toObject(BatchEndpointDefaults.class); - Assertions.assertEquals("wsbpfvm", model.deploymentName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BatchEndpointDefaults model = new BatchEndpointDefaults().withDeploymentName("wsbpfvm"); - model = BinaryData.fromObject(model).toObject(BatchEndpointDefaults.class); - Assertions.assertEquals("wsbpfvm", model.deploymentName()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointTrackedResourceArmPaginatedResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointTrackedResourceArmPaginatedResultTests.java deleted file mode 100644 index f8fc66942d42b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointTrackedResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.BatchEndpointInner; -import com.azure.resourcemanager.machinelearning.models.BatchEndpointProperties; -import com.azure.resourcemanager.machinelearning.models.BatchEndpointTrackedResourceArmPaginatedResult; -import com.azure.resourcemanager.machinelearning.models.EndpointAuthMode; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.Sku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class BatchEndpointTrackedResourceArmPaginatedResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BatchEndpointTrackedResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"nextLink\":\"gcj\",\"value\":[{\"identity\":{\"principalId\":\"f81557b3-3455-43a9-863a-877ebc9a8614\",\"tenantId\":\"ca2f438e-dabf-4a7a-808b-9b35946ac806\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{}},\"kind\":\"ttdumorppxebmnzb\",\"properties\":{\"provisioningState\":\"Canceled\",\"authMode\":\"Key\",\"description\":\"lkfg\",\"properties\":{},\"scoringUri\":\"euel\",\"swaggerUri\":\"hsd\"},\"sku\":{\"name\":\"t\",\"tier\":\"Standard\",\"size\":\"kd\",\"family\":\"wq\",\"capacity\":180318621},\"location\":\"zx\",\"tags\":{\"sg\":\"ithhqzon\",\"c\":\"b\"},\"id\":\"hfwdsjnkaljutiis\",\"name\":\"acffgdkzzewkfvhq\",\"type\":\"railvpnppfuf\"}]}") - .toObject(BatchEndpointTrackedResourceArmPaginatedResult.class); - Assertions.assertEquals("gcj", model.nextLink()); - Assertions.assertEquals("zx", model.value().get(0).location()); - Assertions.assertEquals("ithhqzon", model.value().get(0).tags().get("sg")); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("ttdumorppxebmnzb", model.value().get(0).kind()); - Assertions.assertEquals(EndpointAuthMode.KEY, model.value().get(0).properties().authMode()); - Assertions.assertEquals("lkfg", model.value().get(0).properties().description()); - Assertions.assertEquals("t", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.STANDARD, model.value().get(0).sku().tier()); - Assertions.assertEquals("kd", model.value().get(0).sku().size()); - Assertions.assertEquals("wq", model.value().get(0).sku().family()); - Assertions.assertEquals(180318621, model.value().get(0).sku().capacity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BatchEndpointTrackedResourceArmPaginatedResult model = - new BatchEndpointTrackedResourceArmPaginatedResult() - .withNextLink("gcj") - .withValue( - Arrays - .asList( - new BatchEndpointInner() - .withLocation("zx") - .withTags(mapOf("sg", "ithhqzon", "c", "b")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withKind("ttdumorppxebmnzb") - .withProperties( - new BatchEndpointProperties() - .withAuthMode(EndpointAuthMode.KEY) - .withDescription("lkfg") - .withProperties(mapOf())) - .withSku( - new Sku() - .withName("t") - .withTier(SkuTier.STANDARD) - .withSize("kd") - .withFamily("wq") - .withCapacity(180318621)))); - model = BinaryData.fromObject(model).toObject(BatchEndpointTrackedResourceArmPaginatedResult.class); - Assertions.assertEquals("gcj", model.nextLink()); - Assertions.assertEquals("zx", model.value().get(0).location()); - Assertions.assertEquals("ithhqzon", model.value().get(0).tags().get("sg")); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("ttdumorppxebmnzb", model.value().get(0).kind()); - Assertions.assertEquals(EndpointAuthMode.KEY, model.value().get(0).properties().authMode()); - Assertions.assertEquals("lkfg", model.value().get(0).properties().description()); - Assertions.assertEquals("t", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.STANDARD, model.value().get(0).sku().tier()); - Assertions.assertEquals("kd", model.value().get(0).sku().size()); - Assertions.assertEquals("wq", model.value().get(0).sku().family()); - Assertions.assertEquals(180318621, model.value().get(0).sku().capacity()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsDeleteMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsDeleteMockTests.java deleted file mode 100644 index 6497981344837..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchEndpointsDeleteMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BatchEndpointsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.batchEndpoints().delete("pm", "rdlhvdvmiphbe", "eqjzm", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchRetrySettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchRetrySettingsTests.java deleted file mode 100644 index 5828f1ca72ec1..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BatchRetrySettingsTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.BatchRetrySettings; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class BatchRetrySettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BatchRetrySettings model = - BinaryData - .fromString("{\"maxRetries\":80770684,\"timeout\":\"PT155H21M58S\"}") - .toObject(BatchRetrySettings.class); - Assertions.assertEquals(80770684, model.maxRetries()); - Assertions.assertEquals(Duration.parse("PT155H21M58S"), model.timeout()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BatchRetrySettings model = - new BatchRetrySettings().withMaxRetries(80770684).withTimeout(Duration.parse("PT155H21M58S")); - model = BinaryData.fromObject(model).toObject(BatchRetrySettings.class); - Assertions.assertEquals(80770684, model.maxRetries()); - Assertions.assertEquals(Duration.parse("PT155H21M58S"), model.timeout()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BayesianSamplingAlgorithmTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BayesianSamplingAlgorithmTests.java deleted file mode 100644 index eff5b3a84ec34..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BayesianSamplingAlgorithmTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.BayesianSamplingAlgorithm; - -public final class BayesianSamplingAlgorithmTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BayesianSamplingAlgorithm model = - BinaryData.fromString("{\"samplingAlgorithmType\":\"Bayesian\"}").toObject(BayesianSamplingAlgorithm.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BayesianSamplingAlgorithm model = new BayesianSamplingAlgorithm(); - model = BinaryData.fromObject(model).toObject(BayesianSamplingAlgorithm.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BuildContextTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BuildContextTests.java deleted file mode 100644 index f45e52a1aad6a..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/BuildContextTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.BuildContext; -import org.junit.jupiter.api.Assertions; - -public final class BuildContextTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BuildContext model = - BinaryData - .fromString("{\"contextUri\":\"mfpjbabw\",\"dockerfilePath\":\"fcxsspuunnoxy\"}") - .toObject(BuildContext.class); - Assertions.assertEquals("mfpjbabw", model.contextUri()); - Assertions.assertEquals("fcxsspuunnoxy", model.dockerfilePath()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BuildContext model = new BuildContext().withContextUri("mfpjbabw").withDockerfilePath("fcxsspuunnoxy"); - model = BinaryData.fromObject(model).toObject(BuildContext.class); - Assertions.assertEquals("mfpjbabw", model.contextUri()); - Assertions.assertEquals("fcxsspuunnoxy", model.dockerfilePath()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ClassificationTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ClassificationTests.java deleted file mode 100644 index 54361a6a37d24..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ClassificationTests.java +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.BlockedTransformers; -import com.azure.resourcemanager.machinelearning.models.Classification; -import com.azure.resourcemanager.machinelearning.models.ClassificationModels; -import com.azure.resourcemanager.machinelearning.models.ClassificationPrimaryMetrics; -import com.azure.resourcemanager.machinelearning.models.ClassificationTrainingSettings; -import com.azure.resourcemanager.machinelearning.models.FeaturizationMode; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.LogVerbosity; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import com.azure.resourcemanager.machinelearning.models.NCrossValidations; -import com.azure.resourcemanager.machinelearning.models.StackEnsembleSettings; -import com.azure.resourcemanager.machinelearning.models.StackMetaLearnerType; -import com.azure.resourcemanager.machinelearning.models.TableVerticalFeaturizationSettings; -import com.azure.resourcemanager.machinelearning.models.TableVerticalLimitSettings; -import java.time.Duration; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ClassificationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Classification model = - BinaryData - .fromString( - "{\"taskType\":\"Classification\",\"positiveLabel\":\"z\",\"primaryMetric\":\"Accuracy\",\"trainingSettings\":{\"allowedTrainingAlgorithms\":[\"BernoulliNaiveBayes\",\"KNN\",\"LogisticRegression\",\"DecisionTree\"],\"blockedTrainingAlgorithms\":[\"SGD\",\"LightGBM\",\"SVM\"],\"enableDnnTraining\":true,\"enableModelExplainability\":true,\"enableOnnxCompatibleModels\":true,\"enableStackEnsemble\":false,\"enableVoteEnsemble\":false,\"ensembleModelDownloadTimeout\":\"PT239H29M50S\",\"stackEnsembleSettings\":{\"stackMetaLearnerKWargs\":\"dataclvdjjukyrdnqod\",\"stackMetaLearnerTrainPercentage\":30.06941234013376,\"stackMetaLearnerType\":\"LightGBMClassifier\"}},\"cvSplitColumnNames\":[\"aqnvzoqgyipemchg\",\"v\"],\"featurizationSettings\":{\"blockedTransformers\":[\"WoETargetEncoder\",\"WordEmbedding\",\"LabelEncoder\"],\"columnNameAndTypes\":{\"iuh\":\"ptlghwzhomewjjst\",\"ia\":\"awmo\",\"vodrrslblxydkxr\":\"cz\"},\"enableDnnFeaturization\":true,\"mode\":\"Off\",\"transformerParams\":{\"g\":[],\"qljnqkhychoco\":[],\"lehu\":[]},\"datasetLanguage\":\"lrqff\"},\"limitSettings\":{\"enableEarlyTermination\":false,\"exitScore\":50.27087572372039,\"maxConcurrentTrials\":450328402,\"maxCoresPerTrial\":1075829949,\"maxTrials\":662993818,\"timeout\":\"PT194H12M11S\",\"trialTimeout\":\"PT236H50M57S\"},\"nCrossValidations\":{\"mode\":\"NCrossValidations\"},\"testData\":{\"jobInputType\":\"mltable\",\"mode\":\"Direct\",\"uri\":\"rxmrgchbapx\",\"description\":\"y\"},\"testDataSize\":1.7164995710023723,\"validationData\":{\"jobInputType\":\"mltable\",\"mode\":\"EvalMount\",\"uri\":\"buscgduus\",\"description\":\"ycblevpmcl\"},\"validationDataSize\":38.79068857320828,\"weightColumnName\":\"yxlzgs\",\"logVerbosity\":\"Info\",\"targetColumnName\":\"zltafhbzffovwm\",\"trainingData\":{\"jobInputType\":\"mltable\",\"mode\":\"ReadWriteMount\",\"uri\":\"zqs\",\"description\":\"pgvdwnapfdqw\"}}") - .toObject(Classification.class); - Assertions.assertEquals(LogVerbosity.INFO, model.logVerbosity()); - Assertions.assertEquals("zltafhbzffovwm", model.targetColumnName()); - Assertions.assertEquals("pgvdwnapfdqw", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_WRITE_MOUNT, model.trainingData().mode()); - Assertions.assertEquals("zqs", model.trainingData().uri()); - Assertions.assertEquals("z", model.positiveLabel()); - Assertions.assertEquals(ClassificationPrimaryMetrics.ACCURACY, model.primaryMetric()); - Assertions.assertEquals(true, model.trainingSettings().enableDnnTraining()); - Assertions.assertEquals(true, model.trainingSettings().enableModelExplainability()); - Assertions.assertEquals(true, model.trainingSettings().enableOnnxCompatibleModels()); - Assertions.assertEquals(false, model.trainingSettings().enableStackEnsemble()); - Assertions.assertEquals(false, model.trainingSettings().enableVoteEnsemble()); - Assertions - .assertEquals(Duration.parse("PT239H29M50S"), model.trainingSettings().ensembleModelDownloadTimeout()); - Assertions - .assertEquals( - 30.06941234013376D, model.trainingSettings().stackEnsembleSettings().stackMetaLearnerTrainPercentage()); - Assertions - .assertEquals( - StackMetaLearnerType.LIGHT_GBMCLASSIFIER, - model.trainingSettings().stackEnsembleSettings().stackMetaLearnerType()); - Assertions - .assertEquals( - ClassificationModels.BERNOULLI_NAIVE_BAYES, - model.trainingSettings().allowedTrainingAlgorithms().get(0)); - Assertions.assertEquals(ClassificationModels.SGD, model.trainingSettings().blockedTrainingAlgorithms().get(0)); - Assertions.assertEquals("aqnvzoqgyipemchg", model.cvSplitColumnNames().get(0)); - Assertions.assertEquals("lrqff", model.featurizationSettings().datasetLanguage()); - Assertions - .assertEquals( - BlockedTransformers.WO_ETARGET_ENCODER, model.featurizationSettings().blockedTransformers().get(0)); - Assertions.assertEquals("ptlghwzhomewjjst", model.featurizationSettings().columnNameAndTypes().get("iuh")); - Assertions.assertEquals(true, model.featurizationSettings().enableDnnFeaturization()); - Assertions.assertEquals(FeaturizationMode.OFF, model.featurizationSettings().mode()); - Assertions.assertEquals(false, model.limitSettings().enableEarlyTermination()); - Assertions.assertEquals(50.27087572372039D, model.limitSettings().exitScore()); - Assertions.assertEquals(450328402, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(1075829949, model.limitSettings().maxCoresPerTrial()); - Assertions.assertEquals(662993818, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT194H12M11S"), model.limitSettings().timeout()); - Assertions.assertEquals(Duration.parse("PT236H50M57S"), model.limitSettings().trialTimeout()); - Assertions.assertEquals("y", model.testData().description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.testData().mode()); - Assertions.assertEquals("rxmrgchbapx", model.testData().uri()); - Assertions.assertEquals(1.7164995710023723D, model.testDataSize()); - Assertions.assertEquals("ycblevpmcl", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_MOUNT, model.validationData().mode()); - Assertions.assertEquals("buscgduus", model.validationData().uri()); - Assertions.assertEquals(38.79068857320828D, model.validationDataSize()); - Assertions.assertEquals("yxlzgs", model.weightColumnName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Classification model = - new Classification() - .withLogVerbosity(LogVerbosity.INFO) - .withTargetColumnName("zltafhbzffovwm") - .withTrainingData( - new MLTableJobInput() - .withDescription("pgvdwnapfdqw") - .withMode(InputDeliveryMode.READ_WRITE_MOUNT) - .withUri("zqs")) - .withPositiveLabel("z") - .withPrimaryMetric(ClassificationPrimaryMetrics.ACCURACY) - .withTrainingSettings( - new ClassificationTrainingSettings() - .withEnableDnnTraining(true) - .withEnableModelExplainability(true) - .withEnableOnnxCompatibleModels(true) - .withEnableStackEnsemble(false) - .withEnableVoteEnsemble(false) - .withEnsembleModelDownloadTimeout(Duration.parse("PT239H29M50S")) - .withStackEnsembleSettings( - new StackEnsembleSettings() - .withStackMetaLearnerKWargs("dataclvdjjukyrdnqod") - .withStackMetaLearnerTrainPercentage(30.06941234013376D) - .withStackMetaLearnerType(StackMetaLearnerType.LIGHT_GBMCLASSIFIER)) - .withAllowedTrainingAlgorithms( - Arrays - .asList( - ClassificationModels.BERNOULLI_NAIVE_BAYES, - ClassificationModels.KNN, - ClassificationModels.LOGISTIC_REGRESSION, - ClassificationModels.DECISION_TREE)) - .withBlockedTrainingAlgorithms( - Arrays - .asList( - ClassificationModels.SGD, - ClassificationModels.LIGHT_GBM, - ClassificationModels.SVM))) - .withCvSplitColumnNames(Arrays.asList("aqnvzoqgyipemchg", "v")) - .withFeaturizationSettings( - new TableVerticalFeaturizationSettings() - .withDatasetLanguage("lrqff") - .withBlockedTransformers( - Arrays - .asList( - BlockedTransformers.WO_ETARGET_ENCODER, - BlockedTransformers.WORD_EMBEDDING, - BlockedTransformers.LABEL_ENCODER)) - .withColumnNameAndTypes(mapOf("iuh", "ptlghwzhomewjjst", "ia", "awmo", "vodrrslblxydkxr", "cz")) - .withEnableDnnFeaturization(true) - .withMode(FeaturizationMode.OFF) - .withTransformerParams( - mapOf("g", Arrays.asList(), "qljnqkhychoco", Arrays.asList(), "lehu", Arrays.asList()))) - .withLimitSettings( - new TableVerticalLimitSettings() - .withEnableEarlyTermination(false) - .withExitScore(50.27087572372039D) - .withMaxConcurrentTrials(450328402) - .withMaxCoresPerTrial(1075829949) - .withMaxTrials(662993818) - .withTimeout(Duration.parse("PT194H12M11S")) - .withTrialTimeout(Duration.parse("PT236H50M57S"))) - .withNCrossValidations(new NCrossValidations()) - .withTestData( - new MLTableJobInput() - .withDescription("y") - .withMode(InputDeliveryMode.DIRECT) - .withUri("rxmrgchbapx")) - .withTestDataSize(1.7164995710023723D) - .withValidationData( - new MLTableJobInput() - .withDescription("ycblevpmcl") - .withMode(InputDeliveryMode.EVAL_MOUNT) - .withUri("buscgduus")) - .withValidationDataSize(38.79068857320828D) - .withWeightColumnName("yxlzgs"); - model = BinaryData.fromObject(model).toObject(Classification.class); - Assertions.assertEquals(LogVerbosity.INFO, model.logVerbosity()); - Assertions.assertEquals("zltafhbzffovwm", model.targetColumnName()); - Assertions.assertEquals("pgvdwnapfdqw", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_WRITE_MOUNT, model.trainingData().mode()); - Assertions.assertEquals("zqs", model.trainingData().uri()); - Assertions.assertEquals("z", model.positiveLabel()); - Assertions.assertEquals(ClassificationPrimaryMetrics.ACCURACY, model.primaryMetric()); - Assertions.assertEquals(true, model.trainingSettings().enableDnnTraining()); - Assertions.assertEquals(true, model.trainingSettings().enableModelExplainability()); - Assertions.assertEquals(true, model.trainingSettings().enableOnnxCompatibleModels()); - Assertions.assertEquals(false, model.trainingSettings().enableStackEnsemble()); - Assertions.assertEquals(false, model.trainingSettings().enableVoteEnsemble()); - Assertions - .assertEquals(Duration.parse("PT239H29M50S"), model.trainingSettings().ensembleModelDownloadTimeout()); - Assertions - .assertEquals( - 30.06941234013376D, model.trainingSettings().stackEnsembleSettings().stackMetaLearnerTrainPercentage()); - Assertions - .assertEquals( - StackMetaLearnerType.LIGHT_GBMCLASSIFIER, - model.trainingSettings().stackEnsembleSettings().stackMetaLearnerType()); - Assertions - .assertEquals( - ClassificationModels.BERNOULLI_NAIVE_BAYES, - model.trainingSettings().allowedTrainingAlgorithms().get(0)); - Assertions.assertEquals(ClassificationModels.SGD, model.trainingSettings().blockedTrainingAlgorithms().get(0)); - Assertions.assertEquals("aqnvzoqgyipemchg", model.cvSplitColumnNames().get(0)); - Assertions.assertEquals("lrqff", model.featurizationSettings().datasetLanguage()); - Assertions - .assertEquals( - BlockedTransformers.WO_ETARGET_ENCODER, model.featurizationSettings().blockedTransformers().get(0)); - Assertions.assertEquals("ptlghwzhomewjjst", model.featurizationSettings().columnNameAndTypes().get("iuh")); - Assertions.assertEquals(true, model.featurizationSettings().enableDnnFeaturization()); - Assertions.assertEquals(FeaturizationMode.OFF, model.featurizationSettings().mode()); - Assertions.assertEquals(false, model.limitSettings().enableEarlyTermination()); - Assertions.assertEquals(50.27087572372039D, model.limitSettings().exitScore()); - Assertions.assertEquals(450328402, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(1075829949, model.limitSettings().maxCoresPerTrial()); - Assertions.assertEquals(662993818, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT194H12M11S"), model.limitSettings().timeout()); - Assertions.assertEquals(Duration.parse("PT236H50M57S"), model.limitSettings().trialTimeout()); - Assertions.assertEquals("y", model.testData().description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.testData().mode()); - Assertions.assertEquals("rxmrgchbapx", model.testData().uri()); - Assertions.assertEquals(1.7164995710023723D, model.testDataSize()); - Assertions.assertEquals("ycblevpmcl", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_MOUNT, model.validationData().mode()); - Assertions.assertEquals("buscgduus", model.validationData().uri()); - Assertions.assertEquals(38.79068857320828D, model.validationDataSize()); - Assertions.assertEquals("yxlzgs", model.weightColumnName()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ClassificationTrainingSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ClassificationTrainingSettingsTests.java deleted file mode 100644 index 4cc81b1ca45ec..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ClassificationTrainingSettingsTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ClassificationModels; -import com.azure.resourcemanager.machinelearning.models.ClassificationTrainingSettings; -import com.azure.resourcemanager.machinelearning.models.StackEnsembleSettings; -import com.azure.resourcemanager.machinelearning.models.StackMetaLearnerType; -import java.time.Duration; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ClassificationTrainingSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClassificationTrainingSettings model = - BinaryData - .fromString( - "{\"allowedTrainingAlgorithms\":[\"LinearSVM\",\"KNN\"],\"blockedTrainingAlgorithms\":[\"LogisticRegression\"],\"enableDnnTraining\":false,\"enableModelExplainability\":true,\"enableOnnxCompatibleModels\":false,\"enableStackEnsemble\":true,\"enableVoteEnsemble\":false,\"ensembleModelDownloadTimeout\":\"PT171H27M12S\",\"stackEnsembleSettings\":{\"stackMetaLearnerKWargs\":\"dataeseyqr\",\"stackMetaLearnerTrainPercentage\":0.8015922020078059,\"stackMetaLearnerType\":\"LightGBMClassifier\"}}") - .toObject(ClassificationTrainingSettings.class); - Assertions.assertEquals(false, model.enableDnnTraining()); - Assertions.assertEquals(true, model.enableModelExplainability()); - Assertions.assertEquals(false, model.enableOnnxCompatibleModels()); - Assertions.assertEquals(true, model.enableStackEnsemble()); - Assertions.assertEquals(false, model.enableVoteEnsemble()); - Assertions.assertEquals(Duration.parse("PT171H27M12S"), model.ensembleModelDownloadTimeout()); - Assertions.assertEquals(0.8015922020078059D, model.stackEnsembleSettings().stackMetaLearnerTrainPercentage()); - Assertions - .assertEquals( - StackMetaLearnerType.LIGHT_GBMCLASSIFIER, model.stackEnsembleSettings().stackMetaLearnerType()); - Assertions.assertEquals(ClassificationModels.LINEAR_SVM, model.allowedTrainingAlgorithms().get(0)); - Assertions.assertEquals(ClassificationModels.LOGISTIC_REGRESSION, model.blockedTrainingAlgorithms().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClassificationTrainingSettings model = - new ClassificationTrainingSettings() - .withEnableDnnTraining(false) - .withEnableModelExplainability(true) - .withEnableOnnxCompatibleModels(false) - .withEnableStackEnsemble(true) - .withEnableVoteEnsemble(false) - .withEnsembleModelDownloadTimeout(Duration.parse("PT171H27M12S")) - .withStackEnsembleSettings( - new StackEnsembleSettings() - .withStackMetaLearnerKWargs("dataeseyqr") - .withStackMetaLearnerTrainPercentage(0.8015922020078059D) - .withStackMetaLearnerType(StackMetaLearnerType.LIGHT_GBMCLASSIFIER)) - .withAllowedTrainingAlgorithms(Arrays.asList(ClassificationModels.LINEAR_SVM, ClassificationModels.KNN)) - .withBlockedTrainingAlgorithms(Arrays.asList(ClassificationModels.LOGISTIC_REGRESSION)); - model = BinaryData.fromObject(model).toObject(ClassificationTrainingSettings.class); - Assertions.assertEquals(false, model.enableDnnTraining()); - Assertions.assertEquals(true, model.enableModelExplainability()); - Assertions.assertEquals(false, model.enableOnnxCompatibleModels()); - Assertions.assertEquals(true, model.enableStackEnsemble()); - Assertions.assertEquals(false, model.enableVoteEnsemble()); - Assertions.assertEquals(Duration.parse("PT171H27M12S"), model.ensembleModelDownloadTimeout()); - Assertions.assertEquals(0.8015922020078059D, model.stackEnsembleSettings().stackMetaLearnerTrainPercentage()); - Assertions - .assertEquals( - StackMetaLearnerType.LIGHT_GBMCLASSIFIER, model.stackEnsembleSettings().stackMetaLearnerType()); - Assertions.assertEquals(ClassificationModels.LINEAR_SVM, model.allowedTrainingAlgorithms().get(0)); - Assertions.assertEquals(ClassificationModels.LOGISTIC_REGRESSION, model.blockedTrainingAlgorithms().get(0)); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ClusterUpdateParametersTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ClusterUpdateParametersTests.java deleted file mode 100644 index 34fb2ad4a38d5..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ClusterUpdateParametersTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ClusterUpdateParameters; -import com.azure.resourcemanager.machinelearning.models.ScaleSettingsInformation; - -public final class ClusterUpdateParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterUpdateParameters model = - BinaryData.fromString("{\"properties\":{\"properties\":{}}}").toObject(ClusterUpdateParameters.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterUpdateParameters model = new ClusterUpdateParameters().withProperties(new ScaleSettingsInformation()); - model = BinaryData.fromObject(model).toObject(ClusterUpdateParameters.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ClusterUpdatePropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ClusterUpdatePropertiesTests.java deleted file mode 100644 index af927978ddd64..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ClusterUpdatePropertiesTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.ClusterUpdateProperties; -import com.azure.resourcemanager.machinelearning.models.ScaleSettings; -import com.azure.resourcemanager.machinelearning.models.ScaleSettingsInformation; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class ClusterUpdatePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClusterUpdateProperties model = - BinaryData - .fromString( - "{\"properties\":{\"scaleSettings\":{\"maxNodeCount\":735455048,\"minNodeCount\":1281560612,\"nodeIdleTimeBeforeScaleDown\":\"PT89H36M53S\"}}}") - .toObject(ClusterUpdateProperties.class); - Assertions.assertEquals(735455048, model.properties().scaleSettings().maxNodeCount()); - Assertions.assertEquals(1281560612, model.properties().scaleSettings().minNodeCount()); - Assertions - .assertEquals( - Duration.parse("PT89H36M53S"), model.properties().scaleSettings().nodeIdleTimeBeforeScaleDown()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClusterUpdateProperties model = - new ClusterUpdateProperties() - .withProperties( - new ScaleSettingsInformation() - .withScaleSettings( - new ScaleSettings() - .withMaxNodeCount(735455048) - .withMinNodeCount(1281560612) - .withNodeIdleTimeBeforeScaleDown(Duration.parse("PT89H36M53S")))); - model = BinaryData.fromObject(model).toObject(ClusterUpdateProperties.class); - Assertions.assertEquals(735455048, model.properties().scaleSettings().maxNodeCount()); - Assertions.assertEquals(1281560612, model.properties().scaleSettings().minNodeCount()); - Assertions - .assertEquals( - Duration.parse("PT89H36M53S"), model.properties().scaleSettings().nodeIdleTimeBeforeScaleDown()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainerInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainerInnerTests.java deleted file mode 100644 index 45ffe83779de7..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainerInnerTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.CodeContainerInner; -import com.azure.resourcemanager.machinelearning.models.CodeContainerProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class CodeContainerInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CodeContainerInner model = - BinaryData - .fromString( - "{\"properties\":{\"isArchived\":true,\"latestVersion\":\"zbhd\",\"nextVersion\":\"mlmz\",\"description\":\"oftrmaequia\",\"properties\":{\"nswhcc\":\"cslfaoqzpiyylha\",\"aivwitqscywu\":\"ph\"},\"tags\":{\"i\":\"oluhczbwemh\",\"wmsweypqwd\":\"sbrgz\",\"mkttlstvlzywem\":\"ggicccnxqhue\",\"lusiy\":\"zrncsdt\"}},\"id\":\"sfgytguslfead\",\"name\":\"ygqukyhejh\",\"type\":\"isxgfp\"}") - .toObject(CodeContainerInner.class); - Assertions.assertEquals("oftrmaequia", model.properties().description()); - Assertions.assertEquals("cslfaoqzpiyylha", model.properties().properties().get("nswhcc")); - Assertions.assertEquals("oluhczbwemh", model.properties().tags().get("i")); - Assertions.assertEquals(true, model.properties().isArchived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CodeContainerInner model = - new CodeContainerInner() - .withProperties( - new CodeContainerProperties() - .withDescription("oftrmaequia") - .withProperties(mapOf("nswhcc", "cslfaoqzpiyylha", "aivwitqscywu", "ph")) - .withTags( - mapOf( - "i", - "oluhczbwemh", - "wmsweypqwd", - "sbrgz", - "mkttlstvlzywem", - "ggicccnxqhue", - "lusiy", - "zrncsdt")) - .withIsArchived(true)); - model = BinaryData.fromObject(model).toObject(CodeContainerInner.class); - Assertions.assertEquals("oftrmaequia", model.properties().description()); - Assertions.assertEquals("cslfaoqzpiyylha", model.properties().properties().get("nswhcc")); - Assertions.assertEquals("oluhczbwemh", model.properties().tags().get("i")); - Assertions.assertEquals(true, model.properties().isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainerPropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainerPropertiesTests.java deleted file mode 100644 index 18c6c8a71c1b4..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainerPropertiesTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.CodeContainerProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class CodeContainerPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CodeContainerProperties model = - BinaryData - .fromString( - "{\"isArchived\":true,\"latestVersion\":\"p\",\"nextVersion\":\"ksrpqv\",\"description\":\"zraehtwd\",\"properties\":{\"cdl\":\"tswiby\",\"hfwpracstwit\":\"h\",\"nmdyodnwzxl\":\"khevxccedc\",\"nhltiugcxn\":\"jc\"},\"tags\":{\"nyowxwlmdjrkvfg\":\"wxqibyq\",\"j\":\"vfvpdbodaciz\",\"hvxndzwmkrefajpj\":\"lhkrribdeibqipqk\"}}") - .toObject(CodeContainerProperties.class); - Assertions.assertEquals("zraehtwd", model.description()); - Assertions.assertEquals("tswiby", model.properties().get("cdl")); - Assertions.assertEquals("wxqibyq", model.tags().get("nyowxwlmdjrkvfg")); - Assertions.assertEquals(true, model.isArchived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CodeContainerProperties model = - new CodeContainerProperties() - .withDescription("zraehtwd") - .withProperties( - mapOf("cdl", "tswiby", "hfwpracstwit", "h", "nmdyodnwzxl", "khevxccedc", "nhltiugcxn", "jc")) - .withTags( - mapOf("nyowxwlmdjrkvfg", "wxqibyq", "j", "vfvpdbodaciz", "hvxndzwmkrefajpj", "lhkrribdeibqipqk")) - .withIsArchived(true); - model = BinaryData.fromObject(model).toObject(CodeContainerProperties.class); - Assertions.assertEquals("zraehtwd", model.description()); - Assertions.assertEquals("tswiby", model.properties().get("cdl")); - Assertions.assertEquals("wxqibyq", model.tags().get("nyowxwlmdjrkvfg")); - Assertions.assertEquals(true, model.isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainerResourceArmPaginatedResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainerResourceArmPaginatedResultTests.java deleted file mode 100644 index 3178496ff08ee..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainerResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.CodeContainerInner; -import com.azure.resourcemanager.machinelearning.models.CodeContainerProperties; -import com.azure.resourcemanager.machinelearning.models.CodeContainerResourceArmPaginatedResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class CodeContainerResourceArmPaginatedResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CodeContainerResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"nextLink\":\"kojvd\",\"value\":[{\"properties\":{\"isArchived\":true,\"latestVersion\":\"ouicybxarzgszu\",\"nextVersion\":\"x\",\"description\":\"q\",\"properties\":{},\"tags\":{}},\"id\":\"oamciodh\",\"name\":\"haz\",\"type\":\"khnzbonlw\"},{\"properties\":{\"isArchived\":true,\"latestVersion\":\"gokdwbwhks\",\"nextVersion\":\"cmrvexzt\",\"description\":\"t\",\"properties\":{},\"tags\":{}},\"id\":\"ra\",\"name\":\"yzkoowtlmngu\",\"type\":\"aw\"},{\"properties\":{\"isArchived\":true,\"latestVersion\":\"syuuximerq\",\"nextVersion\":\"bw\",\"description\":\"nkbykutwpfhp\",\"properties\":{},\"tags\":{}},\"id\":\"r\",\"name\":\"kdsnfdsdoakgtdl\",\"type\":\"kkze\"},{\"properties\":{\"isArchived\":false,\"latestVersion\":\"ewpusdsttwvogvb\",\"nextVersion\":\"jdcngqqm\",\"description\":\"kufgmj\",\"properties\":{},\"tags\":{}},\"id\":\"dgrtwaenuuzkopbm\",\"name\":\"nrfdw\",\"type\":\"yuhhziu\"}]}") - .toObject(CodeContainerResourceArmPaginatedResult.class); - Assertions.assertEquals("kojvd", model.nextLink()); - Assertions.assertEquals("q", model.value().get(0).properties().description()); - Assertions.assertEquals(true, model.value().get(0).properties().isArchived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CodeContainerResourceArmPaginatedResult model = - new CodeContainerResourceArmPaginatedResult() - .withNextLink("kojvd") - .withValue( - Arrays - .asList( - new CodeContainerInner() - .withProperties( - new CodeContainerProperties() - .withDescription("q") - .withProperties(mapOf()) - .withTags(mapOf()) - .withIsArchived(true)), - new CodeContainerInner() - .withProperties( - new CodeContainerProperties() - .withDescription("t") - .withProperties(mapOf()) - .withTags(mapOf()) - .withIsArchived(true)), - new CodeContainerInner() - .withProperties( - new CodeContainerProperties() - .withDescription("nkbykutwpfhp") - .withProperties(mapOf()) - .withTags(mapOf()) - .withIsArchived(true)), - new CodeContainerInner() - .withProperties( - new CodeContainerProperties() - .withDescription("kufgmj") - .withProperties(mapOf()) - .withTags(mapOf()) - .withIsArchived(false)))); - model = BinaryData.fromObject(model).toObject(CodeContainerResourceArmPaginatedResult.class); - Assertions.assertEquals("kojvd", model.nextLink()); - Assertions.assertEquals("q", model.value().get(0).properties().description()); - Assertions.assertEquals(true, model.value().get(0).properties().isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersCreateOrUpdateWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 2d055797b46df..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.CodeContainer; -import com.azure.resourcemanager.machinelearning.models.CodeContainerProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CodeContainersCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"isArchived\":true,\"latestVersion\":\"bwfwhxorpwaltzwu\",\"nextVersion\":\"xojfcc\",\"description\":\"h\",\"properties\":{\"xcdrzprobzzxezm\":\"thvazjpw\",\"jeuxsphlo\":\"rkjg\",\"ufvcgnrgl\":\"fpmijpdvzvfbhwbd\"},\"tags\":{\"ebzx\":\"wyambhba\",\"qutibhl\":\"k\",\"bduxvzmlghnys\":\"nntrvrkps\",\"kppdi\":\"lpyeu\"}},\"id\":\"bo\",\"name\":\"xvhhyqq\",\"type\":\"gatxgrznmginmtsd\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CodeContainer response = - manager - .codeContainers() - .define("xyauxre") - .withExistingWorkspace("wrswyiljp", "bkgx") - .withProperties( - new CodeContainerProperties() - .withDescription("gpwb") - .withProperties(mapOf("li", "ri")) - .withTags( - mapOf( - "bibticuhqvum", - "cgnwplrrbphcts", - "eqbbewfcuqfpy", - "pbfs", - "eyyjshcybwfuppox", - "xmzrmtmvwitu", - "iikmoxrezsvavlrx", - "rcmvouujx")) - .withIsArchived(false)) - .create(); - - Assertions.assertEquals("h", response.properties().description()); - Assertions.assertEquals("thvazjpw", response.properties().properties().get("xcdrzprobzzxezm")); - Assertions.assertEquals("wyambhba", response.properties().tags().get("ebzx")); - Assertions.assertEquals(true, response.properties().isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersDeleteWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersDeleteWithResponseMockTests.java deleted file mode 100644 index 7a8d44abb0028..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersDeleteWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CodeContainersDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .codeContainers() - .deleteWithResponse("hkigglclwalhvub", "gzphetxd", "cmyc", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersGetWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersGetWithResponseMockTests.java deleted file mode 100644 index 3efd57df3af43..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersGetWithResponseMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.CodeContainer; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CodeContainersGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"isArchived\":false,\"latestVersion\":\"x\",\"nextVersion\":\"fpzvoikvntwczf\",\"description\":\"ushlcxpblalh\",\"properties\":{\"kissaidqzsaa\":\"p\",\"fiafc\":\"qdsgptotxj\"},\"tags\":{\"cao\":\"tbfijz\"}},\"id\":\"olbuauktwieope\",\"name\":\"e\",\"type\":\"xq\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CodeContainer response = - manager - .codeContainers() - .getWithResponse("ajqzj", "alec", "bibiwks", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("ushlcxpblalh", response.properties().description()); - Assertions.assertEquals("p", response.properties().properties().get("kissaidqzsaa")); - Assertions.assertEquals("tbfijz", response.properties().tags().get("cao")); - Assertions.assertEquals(false, response.properties().isArchived()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersListMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersListMockTests.java deleted file mode 100644 index 303e81d6000f6..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeContainersListMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.CodeContainer; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CodeContainersListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"isArchived\":false,\"latestVersion\":\"mazdfsqxh\",\"nextVersion\":\"mrejparnpvgr\",\"description\":\"rbwtdrcwgzwl\",\"properties\":{\"acfculzjrmhpf\":\"lhhfi\",\"xsoxi\":\"wvyldqpzf\"},\"tags\":{\"qqt\":\"jlzkdrocqsxy\"}},\"id\":\"iwdwisvnmeylajam\",\"name\":\"ajyhftpzc\",\"type\":\"ryklleynqa\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.codeContainers().list("aluzyi", "fcvcewbwq", "dgsjsat", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("rbwtdrcwgzwl", response.iterator().next().properties().description()); - Assertions.assertEquals("lhhfi", response.iterator().next().properties().properties().get("acfculzjrmhpf")); - Assertions.assertEquals("jlzkdrocqsxy", response.iterator().next().properties().tags().get("qqt")); - Assertions.assertEquals(false, response.iterator().next().properties().isArchived()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsDeleteWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsDeleteWithResponseMockTests.java deleted file mode 100644 index 9cdca2627d869..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CodeVersionsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CodeVersionsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .codeVersions() - .deleteWithResponse("j", "xowkdnj", "xgkrh", "iehycpnowawonoe", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ColumnTransformerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ColumnTransformerTests.java deleted file mode 100644 index fc0822215bd47..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ColumnTransformerTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ColumnTransformer; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ColumnTransformerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ColumnTransformer model = - BinaryData - .fromString("{\"fields\":[\"dsmjtgr\",\"gdgkki\"],\"parameters\":\"dataplkcsm\"}") - .toObject(ColumnTransformer.class); - Assertions.assertEquals("dsmjtgr", model.fields().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ColumnTransformer model = - new ColumnTransformer().withFields(Arrays.asList("dsmjtgr", "gdgkki")).withParameters("dataplkcsm"); - model = BinaryData.fromObject(model).toObject(ColumnTransformer.class); - Assertions.assertEquals("dsmjtgr", model.fields().get(0)); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CommandJobLimitsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CommandJobLimitsTests.java deleted file mode 100644 index b51a96cea3340..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CommandJobLimitsTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.CommandJobLimits; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class CommandJobLimitsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CommandJobLimits model = - BinaryData - .fromString("{\"jobLimitsType\":\"Command\",\"timeout\":\"PT130H21M4S\"}") - .toObject(CommandJobLimits.class); - Assertions.assertEquals(Duration.parse("PT130H21M4S"), model.timeout()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CommandJobLimits model = new CommandJobLimits().withTimeout(Duration.parse("PT130H21M4S")); - model = BinaryData.fromObject(model).toObject(CommandJobLimits.class); - Assertions.assertEquals(Duration.parse("PT130H21M4S"), model.timeout()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainerInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainerInnerTests.java deleted file mode 100644 index 179ff3923e2cb..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainerInnerTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.ComponentContainerInner; -import com.azure.resourcemanager.machinelearning.models.ComponentContainerProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ComponentContainerInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComponentContainerInner model = - BinaryData - .fromString( - "{\"properties\":{\"isArchived\":true,\"latestVersion\":\"snjvcdwxlpqekftn\",\"nextVersion\":\"tjsyin\",\"description\":\"fq\",\"properties\":{\"ikdgszywkbir\":\"tdhtmdvyp\"},\"tags\":{\"hkjoqr\":\"zh\",\"mfiibfggj\":\"qqaatjinrvgou\",\"rwxkvtkkgl\":\"ool\"}},\"id\":\"wjygvjayvblmhvk\",\"name\":\"uhbxvvy\",\"type\":\"gsopbyrqufegxu\"}") - .toObject(ComponentContainerInner.class); - Assertions.assertEquals("fq", model.properties().description()); - Assertions.assertEquals("tdhtmdvyp", model.properties().properties().get("ikdgszywkbir")); - Assertions.assertEquals("zh", model.properties().tags().get("hkjoqr")); - Assertions.assertEquals(true, model.properties().isArchived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComponentContainerInner model = - new ComponentContainerInner() - .withProperties( - new ComponentContainerProperties() - .withDescription("fq") - .withProperties(mapOf("ikdgszywkbir", "tdhtmdvyp")) - .withTags(mapOf("hkjoqr", "zh", "mfiibfggj", "qqaatjinrvgou", "rwxkvtkkgl", "ool")) - .withIsArchived(true)); - model = BinaryData.fromObject(model).toObject(ComponentContainerInner.class); - Assertions.assertEquals("fq", model.properties().description()); - Assertions.assertEquals("tdhtmdvyp", model.properties().properties().get("ikdgszywkbir")); - Assertions.assertEquals("zh", model.properties().tags().get("hkjoqr")); - Assertions.assertEquals(true, model.properties().isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainerPropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainerPropertiesTests.java deleted file mode 100644 index 7ac37197ded3a..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainerPropertiesTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ComponentContainerProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ComponentContainerPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComponentContainerProperties model = - BinaryData - .fromString( - "{\"isArchived\":false,\"latestVersion\":\"bnhlmc\",\"nextVersion\":\"p\",\"description\":\"gitvg\",\"properties\":{\"rh\":\"rixkwmyijejve\",\"xexccbdreaxhcexd\":\"pna\"},\"tags\":{\"yjsvfyc\":\"qahqkghtpwijn\",\"fvoow\":\"z\",\"pyostronzmyhgfi\":\"rvmtgjq\"}}") - .toObject(ComponentContainerProperties.class); - Assertions.assertEquals("gitvg", model.description()); - Assertions.assertEquals("rixkwmyijejve", model.properties().get("rh")); - Assertions.assertEquals("qahqkghtpwijn", model.tags().get("yjsvfyc")); - Assertions.assertEquals(false, model.isArchived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComponentContainerProperties model = - new ComponentContainerProperties() - .withDescription("gitvg") - .withProperties(mapOf("rh", "rixkwmyijejve", "xexccbdreaxhcexd", "pna")) - .withTags(mapOf("yjsvfyc", "qahqkghtpwijn", "fvoow", "z", "pyostronzmyhgfi", "rvmtgjq")) - .withIsArchived(false); - model = BinaryData.fromObject(model).toObject(ComponentContainerProperties.class); - Assertions.assertEquals("gitvg", model.description()); - Assertions.assertEquals("rixkwmyijejve", model.properties().get("rh")); - Assertions.assertEquals("qahqkghtpwijn", model.tags().get("yjsvfyc")); - Assertions.assertEquals(false, model.isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainerResourceArmPaginatedResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainerResourceArmPaginatedResultTests.java deleted file mode 100644 index e0932d12bdfa4..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainerResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.ComponentContainerInner; -import com.azure.resourcemanager.machinelearning.models.ComponentContainerProperties; -import com.azure.resourcemanager.machinelearning.models.ComponentContainerResourceArmPaginatedResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ComponentContainerResourceArmPaginatedResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComponentContainerResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"nextLink\":\"ho\",\"value\":[{\"properties\":{\"isArchived\":true,\"latestVersion\":\"phqamvdkfwynwcvt\",\"nextVersion\":\"kayh\",\"description\":\"nvyq\",\"properties\":{},\"tags\":{}},\"id\":\"zwpcnpwzcjaesg\",\"name\":\"v\",\"type\":\"ccyajg\"},{\"properties\":{\"isArchived\":true,\"latestVersion\":\"wygzlvdnkfxusem\",\"nextVersion\":\"zrmuhapfcqdps\",\"description\":\"qvpsvuoymg\",\"properties\":{},\"tags\":{}},\"id\":\"vezrypqlmfeo\",\"name\":\"erqwkyhkobopg\",\"type\":\"edkowepbqpcrfk\"}]}") - .toObject(ComponentContainerResourceArmPaginatedResult.class); - Assertions.assertEquals("ho", model.nextLink()); - Assertions.assertEquals("nvyq", model.value().get(0).properties().description()); - Assertions.assertEquals(true, model.value().get(0).properties().isArchived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComponentContainerResourceArmPaginatedResult model = - new ComponentContainerResourceArmPaginatedResult() - .withNextLink("ho") - .withValue( - Arrays - .asList( - new ComponentContainerInner() - .withProperties( - new ComponentContainerProperties() - .withDescription("nvyq") - .withProperties(mapOf()) - .withTags(mapOf()) - .withIsArchived(true)), - new ComponentContainerInner() - .withProperties( - new ComponentContainerProperties() - .withDescription("qvpsvuoymg") - .withProperties(mapOf()) - .withTags(mapOf()) - .withIsArchived(true)))); - model = BinaryData.fromObject(model).toObject(ComponentContainerResourceArmPaginatedResult.class); - Assertions.assertEquals("ho", model.nextLink()); - Assertions.assertEquals("nvyq", model.value().get(0).properties().description()); - Assertions.assertEquals(true, model.value().get(0).properties().isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersCreateOrUpdateWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index d358c3b29a3ce..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ComponentContainer; -import com.azure.resourcemanager.machinelearning.models.ComponentContainerProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ComponentContainersCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"isArchived\":false,\"latestVersion\":\"bpbokhmml\",\"nextVersion\":\"yarnggcjfwblqhxk\",\"description\":\"mcolmu\",\"properties\":{\"kluwz\":\"vaos\",\"nobguqisqsqkpdmi\":\"eygzvtyevjhu\",\"pnml\":\"y\"},\"tags\":{\"yrx\":\"cpszpmcvqdvrdmv\",\"mbtple\":\"hgvqojbxaotcgbz\"}},\"id\":\"ioyidoxznvg\",\"name\":\"dtmuuvd\",\"type\":\"wsxmrszb\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ComponentContainer response = - manager - .componentContainers() - .define("wrdtnagzlgpy") - .withExistingWorkspace("avqdorbccqcd", "thojvlirknucos") - .withProperties( - new ComponentContainerProperties() - .withDescription("urgmcdcp") - .withProperties(mapOf("hyaaknyukibxiglh", "lojermhzicsbfd")) - .withTags(mapOf("tozyagjjnxkb", "wxqtejpiilh", "yxg", "lh", "cnvqeons", "fklvqzrwtrdg")) - .withIsArchived(true)) - .create(); - - Assertions.assertEquals("mcolmu", response.properties().description()); - Assertions.assertEquals("vaos", response.properties().properties().get("kluwz")); - Assertions.assertEquals("cpszpmcvqdvrdmv", response.properties().tags().get("yrx")); - Assertions.assertEquals(false, response.properties().isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersDeleteWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersDeleteWithResponseMockTests.java deleted file mode 100644 index 6996fbb163cc9..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersDeleteWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ComponentContainersDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .componentContainers() - .deleteWithResponse( - "tpuwnnohmmzngocf", "juypwyiulaynosu", "kfhaxttpfsmwgsgh", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersGetWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersGetWithResponseMockTests.java deleted file mode 100644 index e4b1837836cc8..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersGetWithResponseMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ComponentContainer; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ComponentContainersGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"isArchived\":false,\"latestVersion\":\"bzkuastaxklpr\",\"nextVersion\":\"l\",\"description\":\"l\",\"properties\":{\"yskye\":\"zwxvscksgf\",\"ckwrtw\":\"gafxczvf\"},\"tags\":{\"lhpdhwynctaczcnj\":\"yveszr\",\"x\":\"mbbfnv\",\"nkrtikl\":\"tzo\"}},\"id\":\"n\",\"name\":\"hql\",\"type\":\"oqksyiibhyxwbgbu\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ComponentContainer response = - manager - .componentContainers() - .getWithResponse("ucumlddauqml", "feothxu", "rigrjdljlkq", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("l", response.properties().description()); - Assertions.assertEquals("zwxvscksgf", response.properties().properties().get("yskye")); - Assertions.assertEquals("yveszr", response.properties().tags().get("lhpdhwynctaczcnj")); - Assertions.assertEquals(false, response.properties().isArchived()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersListMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersListMockTests.java deleted file mode 100644 index 923a359e700ba..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentContainersListMockTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ComponentContainer; -import com.azure.resourcemanager.machinelearning.models.ListViewType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ComponentContainersListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"isArchived\":true,\"latestVersion\":\"ncgagdvc\",\"nextVersion\":\"hftzbpyfao\",\"description\":\"f\",\"properties\":{\"rf\":\"ncwmhjob\",\"dc\":\"ri\",\"f\":\"h\",\"oorssatfy\":\"cvbzwgwhgkgsoa\"},\"tags\":{\"dqn\":\"ufdmxuq\",\"fqayopbtsix\":\"sttuxv\",\"jay\":\"gvbhxmndztgs\"}},\"id\":\"arxneibpgbr\",\"name\":\"bjdqkn\",\"type\":\"qnm\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .componentContainers() - .list("f", "uz", "wjecooyvhtuqbpe", ListViewType.ALL, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("f", response.iterator().next().properties().description()); - Assertions.assertEquals("ncwmhjob", response.iterator().next().properties().properties().get("rf")); - Assertions.assertEquals("ufdmxuq", response.iterator().next().properties().tags().get("dqn")); - Assertions.assertEquals(true, response.iterator().next().properties().isArchived()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionInnerTests.java deleted file mode 100644 index b66999b281017..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionInnerTests.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.ComponentVersionInner; -import com.azure.resourcemanager.machinelearning.models.ComponentVersionProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ComponentVersionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComponentVersionInner model = - BinaryData - .fromString( - "{\"properties\":{\"componentSpec\":\"datarnjwmw\",\"isAnonymous\":true,\"isArchived\":false,\"description\":\"zejjoqk\",\"properties\":{\"azpxdtnkdmkqjjl\":\"hsxttaugzxnf\",\"ou\":\"uenvrkp\",\"aays\":\"ibreb\"},\"tags\":{\"tezlwff\":\"xqtnq\",\"pqqmted\":\"iakp\"}},\"id\":\"mmji\",\"name\":\"yeozphvwauyqncy\",\"type\":\"upkvipmdsc\"}") - .toObject(ComponentVersionInner.class); - Assertions.assertEquals("zejjoqk", model.properties().description()); - Assertions.assertEquals("hsxttaugzxnf", model.properties().properties().get("azpxdtnkdmkqjjl")); - Assertions.assertEquals("xqtnq", model.properties().tags().get("tezlwff")); - Assertions.assertEquals(true, model.properties().isAnonymous()); - Assertions.assertEquals(false, model.properties().isArchived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComponentVersionInner model = - new ComponentVersionInner() - .withProperties( - new ComponentVersionProperties() - .withDescription("zejjoqk") - .withProperties(mapOf("azpxdtnkdmkqjjl", "hsxttaugzxnf", "ou", "uenvrkp", "aays", "ibreb")) - .withTags(mapOf("tezlwff", "xqtnq", "pqqmted", "iakp")) - .withIsAnonymous(true) - .withIsArchived(false) - .withComponentSpec("datarnjwmw")); - model = BinaryData.fromObject(model).toObject(ComponentVersionInner.class); - Assertions.assertEquals("zejjoqk", model.properties().description()); - Assertions.assertEquals("hsxttaugzxnf", model.properties().properties().get("azpxdtnkdmkqjjl")); - Assertions.assertEquals("xqtnq", model.properties().tags().get("tezlwff")); - Assertions.assertEquals(true, model.properties().isAnonymous()); - Assertions.assertEquals(false, model.properties().isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionPropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionPropertiesTests.java deleted file mode 100644 index b9d87e131cd96..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionPropertiesTests.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ComponentVersionProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ComponentVersionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComponentVersionProperties model = - BinaryData - .fromString( - "{\"componentSpec\":\"dataqupevzh\",\"isAnonymous\":true,\"isArchived\":false,\"description\":\"hojujbypelmcuv\",\"properties\":{\"fw\":\"bjx\",\"coolsttpkiwkkb\":\"yl\",\"fpncurdo\":\"ujrywvtyl\",\"cbihwqk\":\"wiithtywub\"},\"tags\":{\"dgoihxumwctondzj\":\"ntwjch\",\"fdlwg\":\"uu\",\"gseinq\":\"ytsbwtovv\"}}") - .toObject(ComponentVersionProperties.class); - Assertions.assertEquals("hojujbypelmcuv", model.description()); - Assertions.assertEquals("bjx", model.properties().get("fw")); - Assertions.assertEquals("ntwjch", model.tags().get("dgoihxumwctondzj")); - Assertions.assertEquals(true, model.isAnonymous()); - Assertions.assertEquals(false, model.isArchived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComponentVersionProperties model = - new ComponentVersionProperties() - .withDescription("hojujbypelmcuv") - .withProperties( - mapOf("fw", "bjx", "coolsttpkiwkkb", "yl", "fpncurdo", "ujrywvtyl", "cbihwqk", "wiithtywub")) - .withTags(mapOf("dgoihxumwctondzj", "ntwjch", "fdlwg", "uu", "gseinq", "ytsbwtovv")) - .withIsAnonymous(true) - .withIsArchived(false) - .withComponentSpec("dataqupevzh"); - model = BinaryData.fromObject(model).toObject(ComponentVersionProperties.class); - Assertions.assertEquals("hojujbypelmcuv", model.description()); - Assertions.assertEquals("bjx", model.properties().get("fw")); - Assertions.assertEquals("ntwjch", model.tags().get("dgoihxumwctondzj")); - Assertions.assertEquals(true, model.isAnonymous()); - Assertions.assertEquals(false, model.isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionResourceArmPaginatedResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionResourceArmPaginatedResultTests.java deleted file mode 100644 index 7b0f86dc01c1c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.ComponentVersionInner; -import com.azure.resourcemanager.machinelearning.models.ComponentVersionProperties; -import com.azure.resourcemanager.machinelearning.models.ComponentVersionResourceArmPaginatedResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ComponentVersionResourceArmPaginatedResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComponentVersionResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"nextLink\":\"sxkm\",\"value\":[{\"properties\":{\"componentSpec\":\"datakrrjrea\",\"isAnonymous\":false,\"isArchived\":true,\"description\":\"mhjglikkxwslolb\",\"properties\":{},\"tags\":{}},\"id\":\"zlmvfelfktgp\",\"name\":\"crpw\",\"type\":\"xeznoi\"}]}") - .toObject(ComponentVersionResourceArmPaginatedResult.class); - Assertions.assertEquals("sxkm", model.nextLink()); - Assertions.assertEquals("mhjglikkxwslolb", model.value().get(0).properties().description()); - Assertions.assertEquals(false, model.value().get(0).properties().isAnonymous()); - Assertions.assertEquals(true, model.value().get(0).properties().isArchived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComponentVersionResourceArmPaginatedResult model = - new ComponentVersionResourceArmPaginatedResult() - .withNextLink("sxkm") - .withValue( - Arrays - .asList( - new ComponentVersionInner() - .withProperties( - new ComponentVersionProperties() - .withDescription("mhjglikkxwslolb") - .withProperties(mapOf()) - .withTags(mapOf()) - .withIsAnonymous(false) - .withIsArchived(true) - .withComponentSpec("datakrrjrea")))); - model = BinaryData.fromObject(model).toObject(ComponentVersionResourceArmPaginatedResult.class); - Assertions.assertEquals("sxkm", model.nextLink()); - Assertions.assertEquals("mhjglikkxwslolb", model.value().get(0).properties().description()); - Assertions.assertEquals(false, model.value().get(0).properties().isAnonymous()); - Assertions.assertEquals(true, model.value().get(0).properties().isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsCreateOrUpdateWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index f2df4fe9d91ec..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ComponentVersion; -import com.azure.resourcemanager.machinelearning.models.ComponentVersionProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ComponentVersionsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"componentSpec\":\"dataudpabcreuwzos\",\"isAnonymous\":false,\"isArchived\":false,\"description\":\"vasormrexzvdubew\",\"properties\":{\"ovsdqhzrtdbakrli\":\"gbaduve\",\"ifjmclngygnh\":\"zfvppkeq\"},\"tags\":{\"oqtrotpvclpo\":\"mbcdtajdopggorw\",\"xjgvh\":\"yrlmwkptsk\",\"ookbpu\":\"ccbmkakm\",\"kmlwkt\":\"mgvmuy\"}},\"id\":\"wzkroyrdurxfl\",\"name\":\"qjimejtgzjxxlfej\",\"type\":\"zuqloiwyayyzivr\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ComponentVersion response = - manager - .componentVersions() - .define("zkn") - .withExistingComponent("jzkcasfwzcntog", "fjwajnrt", "zvaqkifmxawost") - .withProperties( - new ComponentVersionProperties() - .withDescription("fnqqwyp") - .withProperties(mapOf("b", "r")) - .withTags(mapOf("wjfkainjmuym", "tggrss", "gmusaictdscnkzzo", "ecvztsc")) - .withIsAnonymous(false) - .withIsArchived(true) - .withComponentSpec("datakmjqncfvdsc")) - .create(); - - Assertions.assertEquals("vasormrexzvdubew", response.properties().description()); - Assertions.assertEquals("gbaduve", response.properties().properties().get("ovsdqhzrtdbakrli")); - Assertions.assertEquals("mbcdtajdopggorw", response.properties().tags().get("oqtrotpvclpo")); - Assertions.assertEquals(false, response.properties().isAnonymous()); - Assertions.assertEquals(false, response.properties().isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsDeleteWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsDeleteWithResponseMockTests.java deleted file mode 100644 index 2335daf835ca7..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ComponentVersionsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .componentVersions() - .deleteWithResponse( - "gdusxurs", "ivuxcjkcoqwczs", "iqrizfwihvaan", "qtnhjrfd", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsGetWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsGetWithResponseMockTests.java deleted file mode 100644 index 35b5951185f6d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsGetWithResponseMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ComponentVersion; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ComponentVersionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"componentSpec\":\"datafkumcfjxoky\",\"isAnonymous\":true,\"isArchived\":true,\"description\":\"vfnkwmygjjekrk\",\"properties\":{\"rdtulcrcjdklotcs\":\"rugjqyckgtx\",\"zoonsv\":\"b\"},\"tags\":{\"nn\":\"hkxfpwhdyslbklgl\",\"xrid\":\"kwayqshwy\",\"aqjmkgxqwque\":\"tb\"}},\"id\":\"ylztp\",\"name\":\"iizevjykofvez\",\"type\":\"fkhkqtwqlep\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ComponentVersion response = - manager - .componentVersions() - .getWithResponse( - "fdvbbaexxjfwtg", "fkkauigvmua", "mczfedyuepsvplt", "dajjvywe", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("vfnkwmygjjekrk", response.properties().description()); - Assertions.assertEquals("rugjqyckgtx", response.properties().properties().get("rdtulcrcjdklotcs")); - Assertions.assertEquals("hkxfpwhdyslbklgl", response.properties().tags().get("nn")); - Assertions.assertEquals(true, response.properties().isAnonymous()); - Assertions.assertEquals(true, response.properties().isArchived()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsListMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsListMockTests.java deleted file mode 100644 index ebfe28fbc2a34..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComponentVersionsListMockTests.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ComponentVersion; -import com.azure.resourcemanager.machinelearning.models.ListViewType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ComponentVersionsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"componentSpec\":\"datask\",\"isAnonymous\":false,\"isArchived\":false,\"description\":\"ahzllrqmtlpb\",\"properties\":{\"noiicsu\":\"oiduyqypff\"},\"tags\":{\"oluqwgusxxhdo\":\"brjjtalxrdsjr\"}},\"id\":\"jwyblvtbdmvsb\",\"name\":\"idaelqpvekmkwjfb\",\"type\":\"tlo\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .componentVersions() - .list( - "nimx", - "pnerxrzut", - "lcurzaqmnbx", - "aehtd", - 2095580918, - "mbnvynfaooeacted", - ListViewType.ACTIVE_ONLY, - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ahzllrqmtlpb", response.iterator().next().properties().description()); - Assertions.assertEquals("oiduyqypff", response.iterator().next().properties().properties().get("noiicsu")); - Assertions.assertEquals("brjjtalxrdsjr", response.iterator().next().properties().tags().get("oluqwgusxxhdo")); - Assertions.assertEquals(false, response.iterator().next().properties().isAnonymous()); - Assertions.assertEquals(false, response.iterator().next().properties().isArchived()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceApplicationTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceApplicationTests.java deleted file mode 100644 index 353ba419fa065..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceApplicationTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ComputeInstanceApplication; -import org.junit.jupiter.api.Assertions; - -public final class ComputeInstanceApplicationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComputeInstanceApplication model = - BinaryData - .fromString("{\"displayName\":\"cyychunsjlp\",\"endpointUri\":\"twszhvvuic\"}") - .toObject(ComputeInstanceApplication.class); - Assertions.assertEquals("cyychunsjlp", model.displayName()); - Assertions.assertEquals("twszhvvuic", model.endpointUri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComputeInstanceApplication model = - new ComputeInstanceApplication().withDisplayName("cyychunsjlp").withEndpointUri("twszhvvuic"); - model = BinaryData.fromObject(model).toObject(ComputeInstanceApplication.class); - Assertions.assertEquals("cyychunsjlp", model.displayName()); - Assertions.assertEquals("twszhvvuic", model.endpointUri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceConnectivityEndpointsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceConnectivityEndpointsTests.java deleted file mode 100644 index e817919d853fa..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceConnectivityEndpointsTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ComputeInstanceConnectivityEndpoints; - -public final class ComputeInstanceConnectivityEndpointsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComputeInstanceConnectivityEndpoints model = - BinaryData - .fromString("{\"publicIpAddress\":\"vbrdfjmzsyzfho\",\"privateIpAddress\":\"h\"}") - .toObject(ComputeInstanceConnectivityEndpoints.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComputeInstanceConnectivityEndpoints model = new ComputeInstanceConnectivityEndpoints(); - model = BinaryData.fromObject(model).toObject(ComputeInstanceConnectivityEndpoints.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceContainerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceContainerTests.java deleted file mode 100644 index 7fdfda816fde6..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceContainerTests.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.Autosave; -import com.azure.resourcemanager.machinelearning.models.ComputeInstanceContainer; -import com.azure.resourcemanager.machinelearning.models.ComputeInstanceEnvironmentInfo; -import com.azure.resourcemanager.machinelearning.models.Network; -import org.junit.jupiter.api.Assertions; - -public final class ComputeInstanceContainerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComputeInstanceContainer model = - BinaryData - .fromString( - "{\"name\":\"khvuhxepmrutz\",\"autosave\":\"Remote\",\"gpu\":\"obns\",\"network\":\"Host\",\"environment\":{\"name\":\"ltymkmvguihywart\",\"version\":\"phkixkykxdssjpe\"},\"services\":[\"datacfxhikkflrmy\"]}") - .toObject(ComputeInstanceContainer.class); - Assertions.assertEquals("khvuhxepmrutz", model.name()); - Assertions.assertEquals(Autosave.REMOTE, model.autosave()); - Assertions.assertEquals("obns", model.gpu()); - Assertions.assertEquals(Network.HOST, model.network()); - Assertions.assertEquals("ltymkmvguihywart", model.environment().name()); - Assertions.assertEquals("phkixkykxdssjpe", model.environment().version()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComputeInstanceContainer model = - new ComputeInstanceContainer() - .withName("khvuhxepmrutz") - .withAutosave(Autosave.REMOTE) - .withGpu("obns") - .withNetwork(Network.HOST) - .withEnvironment( - new ComputeInstanceEnvironmentInfo().withName("ltymkmvguihywart").withVersion("phkixkykxdssjpe")); - model = BinaryData.fromObject(model).toObject(ComputeInstanceContainer.class); - Assertions.assertEquals("khvuhxepmrutz", model.name()); - Assertions.assertEquals(Autosave.REMOTE, model.autosave()); - Assertions.assertEquals("obns", model.gpu()); - Assertions.assertEquals(Network.HOST, model.network()); - Assertions.assertEquals("ltymkmvguihywart", model.environment().name()); - Assertions.assertEquals("phkixkykxdssjpe", model.environment().version()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceCreatedByTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceCreatedByTests.java deleted file mode 100644 index bb0dc3aac424c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceCreatedByTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ComputeInstanceCreatedBy; - -public final class ComputeInstanceCreatedByTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComputeInstanceCreatedBy model = - BinaryData - .fromString( - "{\"userName\":\"vtrrmhwrbfdpyflu\",\"userOrgId\":\"vjglrocuyzlwhhme\",\"userId\":\"ooclutnp\"}") - .toObject(ComputeInstanceCreatedBy.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComputeInstanceCreatedBy model = new ComputeInstanceCreatedBy(); - model = BinaryData.fromObject(model).toObject(ComputeInstanceCreatedBy.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceDataDiskTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceDataDiskTests.java deleted file mode 100644 index e59e9c32edd91..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceDataDiskTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.Caching; -import com.azure.resourcemanager.machinelearning.models.ComputeInstanceDataDisk; -import com.azure.resourcemanager.machinelearning.models.StorageAccountType; -import org.junit.jupiter.api.Assertions; - -public final class ComputeInstanceDataDiskTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComputeInstanceDataDisk model = - BinaryData - .fromString( - "{\"caching\":\"ReadWrite\",\"diskSizeGB\":264674589,\"lun\":753182470,\"storageAccountType\":\"Premium_LRS\"}") - .toObject(ComputeInstanceDataDisk.class); - Assertions.assertEquals(Caching.READ_WRITE, model.caching()); - Assertions.assertEquals(264674589, model.diskSizeGB()); - Assertions.assertEquals(753182470, model.lun()); - Assertions.assertEquals(StorageAccountType.PREMIUM_LRS, model.storageAccountType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComputeInstanceDataDisk model = - new ComputeInstanceDataDisk() - .withCaching(Caching.READ_WRITE) - .withDiskSizeGB(264674589) - .withLun(753182470) - .withStorageAccountType(StorageAccountType.PREMIUM_LRS); - model = BinaryData.fromObject(model).toObject(ComputeInstanceDataDisk.class); - Assertions.assertEquals(Caching.READ_WRITE, model.caching()); - Assertions.assertEquals(264674589, model.diskSizeGB()); - Assertions.assertEquals(753182470, model.lun()); - Assertions.assertEquals(StorageAccountType.PREMIUM_LRS, model.storageAccountType()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceDataMountTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceDataMountTests.java deleted file mode 100644 index 5580c97a01ba0..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceDataMountTests.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ComputeInstanceDataMount; -import com.azure.resourcemanager.machinelearning.models.MountAction; -import com.azure.resourcemanager.machinelearning.models.MountState; -import com.azure.resourcemanager.machinelearning.models.SourceType; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class ComputeInstanceDataMountTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComputeInstanceDataMount model = - BinaryData - .fromString( - "{\"source\":\"wlxte\",\"sourceType\":\"URI\",\"mountName\":\"jgwdtgukranbl\",\"mountAction\":\"Unmount\",\"createdBy\":\"lkccuzgygqwa\",\"mountPath\":\"iul\",\"mountState\":\"UnmountFailed\",\"mountedOn\":\"2021-09-27T01:24:26Z\",\"error\":\"rglvaw\"}") - .toObject(ComputeInstanceDataMount.class); - Assertions.assertEquals("wlxte", model.source()); - Assertions.assertEquals(SourceType.URI, model.sourceType()); - Assertions.assertEquals("jgwdtgukranbl", model.mountName()); - Assertions.assertEquals(MountAction.UNMOUNT, model.mountAction()); - Assertions.assertEquals("lkccuzgygqwa", model.createdBy()); - Assertions.assertEquals("iul", model.mountPath()); - Assertions.assertEquals(MountState.UNMOUNT_FAILED, model.mountState()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-27T01:24:26Z"), model.mountedOn()); - Assertions.assertEquals("rglvaw", model.error()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComputeInstanceDataMount model = - new ComputeInstanceDataMount() - .withSource("wlxte") - .withSourceType(SourceType.URI) - .withMountName("jgwdtgukranbl") - .withMountAction(MountAction.UNMOUNT) - .withCreatedBy("lkccuzgygqwa") - .withMountPath("iul") - .withMountState(MountState.UNMOUNT_FAILED) - .withMountedOn(OffsetDateTime.parse("2021-09-27T01:24:26Z")) - .withError("rglvaw"); - model = BinaryData.fromObject(model).toObject(ComputeInstanceDataMount.class); - Assertions.assertEquals("wlxte", model.source()); - Assertions.assertEquals(SourceType.URI, model.sourceType()); - Assertions.assertEquals("jgwdtgukranbl", model.mountName()); - Assertions.assertEquals(MountAction.UNMOUNT, model.mountAction()); - Assertions.assertEquals("lkccuzgygqwa", model.createdBy()); - Assertions.assertEquals("iul", model.mountPath()); - Assertions.assertEquals(MountState.UNMOUNT_FAILED, model.mountState()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-27T01:24:26Z"), model.mountedOn()); - Assertions.assertEquals("rglvaw", model.error()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceEnvironmentInfoTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceEnvironmentInfoTests.java deleted file mode 100644 index 17390ecdc9f3a..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceEnvironmentInfoTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ComputeInstanceEnvironmentInfo; -import org.junit.jupiter.api.Assertions; - -public final class ComputeInstanceEnvironmentInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComputeInstanceEnvironmentInfo model = - BinaryData - .fromString("{\"name\":\"incqlhriswsl\",\"version\":\"iiovgqcgxu\"}") - .toObject(ComputeInstanceEnvironmentInfo.class); - Assertions.assertEquals("incqlhriswsl", model.name()); - Assertions.assertEquals("iiovgqcgxu", model.version()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComputeInstanceEnvironmentInfo model = - new ComputeInstanceEnvironmentInfo().withName("incqlhriswsl").withVersion("iiovgqcgxu"); - model = BinaryData.fromObject(model).toObject(ComputeInstanceEnvironmentInfo.class); - Assertions.assertEquals("incqlhriswsl", model.name()); - Assertions.assertEquals("iiovgqcgxu", model.version()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceLastOperationTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceLastOperationTests.java deleted file mode 100644 index 665d6aa9d183d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceLastOperationTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ComputeInstanceLastOperation; -import com.azure.resourcemanager.machinelearning.models.OperationName; -import com.azure.resourcemanager.machinelearning.models.OperationStatus; -import com.azure.resourcemanager.machinelearning.models.OperationTrigger; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class ComputeInstanceLastOperationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComputeInstanceLastOperation model = - BinaryData - .fromString( - "{\"operationName\":\"Reimage\",\"operationTime\":\"2021-10-12T06:41:45Z\",\"operationStatus\":\"InProgress\",\"operationTrigger\":\"IdleShutdown\"}") - .toObject(ComputeInstanceLastOperation.class); - Assertions.assertEquals(OperationName.REIMAGE, model.operationName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-12T06:41:45Z"), model.operationTime()); - Assertions.assertEquals(OperationStatus.IN_PROGRESS, model.operationStatus()); - Assertions.assertEquals(OperationTrigger.IDLE_SHUTDOWN, model.operationTrigger()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComputeInstanceLastOperation model = - new ComputeInstanceLastOperation() - .withOperationName(OperationName.REIMAGE) - .withOperationTime(OffsetDateTime.parse("2021-10-12T06:41:45Z")) - .withOperationStatus(OperationStatus.IN_PROGRESS) - .withOperationTrigger(OperationTrigger.IDLE_SHUTDOWN); - model = BinaryData.fromObject(model).toObject(ComputeInstanceLastOperation.class); - Assertions.assertEquals(OperationName.REIMAGE, model.operationName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-12T06:41:45Z"), model.operationTime()); - Assertions.assertEquals(OperationStatus.IN_PROGRESS, model.operationStatus()); - Assertions.assertEquals(OperationTrigger.IDLE_SHUTDOWN, model.operationTrigger()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceVersionTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceVersionTests.java deleted file mode 100644 index 4e09a116f0b0f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeInstanceVersionTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ComputeInstanceVersion; -import org.junit.jupiter.api.Assertions; - -public final class ComputeInstanceVersionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComputeInstanceVersion model = - BinaryData.fromString("{\"runtime\":\"z\"}").toObject(ComputeInstanceVersion.class); - Assertions.assertEquals("z", model.runtime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComputeInstanceVersion model = new ComputeInstanceVersion().withRuntime("z"); - model = BinaryData.fromObject(model).toObject(ComputeInstanceVersion.class); - Assertions.assertEquals("z", model.runtime()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeResourceInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeResourceInnerTests.java deleted file mode 100644 index 2e193135041f0..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeResourceInnerTests.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.ComputeResourceInner; -import com.azure.resourcemanager.machinelearning.models.Compute; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.Sku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import com.azure.resourcemanager.machinelearning.models.UserAssignedIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ComputeResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComputeResourceInner model = - BinaryData - .fromString( - "{\"identity\":{\"principalId\":\"7fba71ed-02a3-4dcb-81fc-4ba57769d9aa\",\"tenantId\":\"e70fe5bc-d75a-4541-bc8f-32e7904dcaaf\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"idokgjlj\":{\"principalId\":\"94a7d9af-e519-4c92-87c2-8418a856bc2c\",\"clientId\":\"29eb96fc-b273-4899-963f-bd7b5e463024\"}}},\"location\":\"xgvcl\",\"tags\":{\"bijhtxfvgxbf\":\"sncghkjeszz\",\"ec\":\"mxnehmp\",\"gr\":\"godebfqkkrbmpu\"},\"sku\":{\"name\":\"flz\",\"tier\":\"Standard\",\"size\":\"zpuzycisp\",\"family\":\"zahmgkbrpyydhibn\",\"capacity\":2043148337},\"properties\":{\"computeType\":\"Compute\",\"computeLocation\":\"kadrgvt\",\"provisioningState\":\"Unknown\",\"description\":\"buynhijggm\",\"createdOn\":\"2021-03-31T00:28:57Z\",\"modifiedOn\":\"2021-01-01T18:17:26Z\",\"resourceId\":\"rbu\",\"provisioningErrors\":[],\"isAttachedCompute\":false,\"disableLocalAuth\":true},\"id\":\"zzmhjrunmpxttd\",\"name\":\"hrbnlankxmyskpbh\",\"type\":\"nbtkcxywnytnr\"}") - .toObject(ComputeResourceInner.class); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("xgvcl", model.location()); - Assertions.assertEquals("sncghkjeszz", model.tags().get("bijhtxfvgxbf")); - Assertions.assertEquals("flz", model.sku().name()); - Assertions.assertEquals(SkuTier.STANDARD, model.sku().tier()); - Assertions.assertEquals("zpuzycisp", model.sku().size()); - Assertions.assertEquals("zahmgkbrpyydhibn", model.sku().family()); - Assertions.assertEquals(2043148337, model.sku().capacity()); - Assertions.assertEquals("kadrgvt", model.properties().computeLocation()); - Assertions.assertEquals("buynhijggm", model.properties().description()); - Assertions.assertEquals("rbu", model.properties().resourceId()); - Assertions.assertEquals(true, model.properties().disableLocalAuth()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComputeResourceInner model = - new ComputeResourceInner() - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("idokgjlj", new UserAssignedIdentity()))) - .withLocation("xgvcl") - .withTags(mapOf("bijhtxfvgxbf", "sncghkjeszz", "ec", "mxnehmp", "gr", "godebfqkkrbmpu")) - .withSku( - new Sku() - .withName("flz") - .withTier(SkuTier.STANDARD) - .withSize("zpuzycisp") - .withFamily("zahmgkbrpyydhibn") - .withCapacity(2043148337)) - .withProperties( - new Compute() - .withComputeLocation("kadrgvt") - .withDescription("buynhijggm") - .withResourceId("rbu") - .withDisableLocalAuth(true)); - model = BinaryData.fromObject(model).toObject(ComputeResourceInner.class); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("xgvcl", model.location()); - Assertions.assertEquals("sncghkjeszz", model.tags().get("bijhtxfvgxbf")); - Assertions.assertEquals("flz", model.sku().name()); - Assertions.assertEquals(SkuTier.STANDARD, model.sku().tier()); - Assertions.assertEquals("zpuzycisp", model.sku().size()); - Assertions.assertEquals("zahmgkbrpyydhibn", model.sku().family()); - Assertions.assertEquals(2043148337, model.sku().capacity()); - Assertions.assertEquals("kadrgvt", model.properties().computeLocation()); - Assertions.assertEquals("buynhijggm", model.properties().description()); - Assertions.assertEquals("rbu", model.properties().resourceId()); - Assertions.assertEquals(true, model.properties().disableLocalAuth()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeResourceSchemaTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeResourceSchemaTests.java deleted file mode 100644 index ace304817ef71..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeResourceSchemaTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.Compute; -import com.azure.resourcemanager.machinelearning.models.ComputeResourceSchema; -import org.junit.jupiter.api.Assertions; - -public final class ComputeResourceSchemaTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComputeResourceSchema model = - BinaryData - .fromString( - "{\"properties\":{\"computeType\":\"Compute\",\"computeLocation\":\"lqidyby\",\"provisioningState\":\"Updating\",\"description\":\"clha\",\"createdOn\":\"2021-03-19T01:34:05Z\",\"modifiedOn\":\"2021-01-19T10:24:33Z\",\"resourceId\":\"p\",\"provisioningErrors\":[],\"isAttachedCompute\":true,\"disableLocalAuth\":false}}") - .toObject(ComputeResourceSchema.class); - Assertions.assertEquals("lqidyby", model.properties().computeLocation()); - Assertions.assertEquals("clha", model.properties().description()); - Assertions.assertEquals("p", model.properties().resourceId()); - Assertions.assertEquals(false, model.properties().disableLocalAuth()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComputeResourceSchema model = - new ComputeResourceSchema() - .withProperties( - new Compute() - .withComputeLocation("lqidyby") - .withDescription("clha") - .withResourceId("p") - .withDisableLocalAuth(false)); - model = BinaryData.fromObject(model).toObject(ComputeResourceSchema.class); - Assertions.assertEquals("lqidyby", model.properties().computeLocation()); - Assertions.assertEquals("clha", model.properties().description()); - Assertions.assertEquals("p", model.properties().resourceId()); - Assertions.assertEquals(false, model.properties().disableLocalAuth()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeSchedulesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeSchedulesTests.java deleted file mode 100644 index 95463915c5068..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeSchedulesTests.java +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ComputePowerAction; -import com.azure.resourcemanager.machinelearning.models.ComputeSchedules; -import com.azure.resourcemanager.machinelearning.models.ComputeStartStopSchedule; -import com.azure.resourcemanager.machinelearning.models.CronTrigger; -import com.azure.resourcemanager.machinelearning.models.RecurrenceFrequency; -import com.azure.resourcemanager.machinelearning.models.RecurrenceTrigger; -import com.azure.resourcemanager.machinelearning.models.ScheduleBase; -import com.azure.resourcemanager.machinelearning.models.ScheduleProvisioningState; -import com.azure.resourcemanager.machinelearning.models.ScheduleStatus; -import com.azure.resourcemanager.machinelearning.models.TriggerType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ComputeSchedulesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComputeSchedules model = - BinaryData - .fromString( - "{\"computeStartStop\":[{\"id\":\"lxrzvhqjwtr\",\"provisioningStatus\":\"Completed\",\"status\":\"Disabled\",\"action\":\"Start\",\"triggerType\":\"Cron\",\"recurrence\":{\"triggerType\":\"Recurrence\",\"frequency\":\"Hour\",\"interval\":1941330764,\"endTime\":\"w\",\"startTime\":\"jsmwrokc\",\"timeZone\":\"fzzzwyjafitlhg\"},\"cron\":{\"triggerType\":\"Cron\",\"expression\":\"nuchlgmltxdwhmo\",\"endTime\":\"sgzv\",\"startTime\":\"snnjzfpafolpym\",\"timeZone\":\"mxq\"},\"schedule\":{\"id\":\"gpgdphtvdulaj\",\"provisioningStatus\":\"Provisioning\",\"status\":\"Enabled\"}},{\"id\":\"csrlzknmzl\",\"provisioningStatus\":\"Failed\",\"status\":\"Disabled\",\"action\":\"Start\",\"triggerType\":\"Cron\",\"recurrence\":{\"triggerType\":\"Recurrence\",\"frequency\":\"Hour\",\"interval\":794571898,\"endTime\":\"q\",\"startTime\":\"jhmqrhvthla\",\"timeZone\":\"dcxsmlz\"},\"cron\":{\"triggerType\":\"Cron\",\"expression\":\"zdtxetlgyd\",\"endTime\":\"qvlnnpxybafiqgea\",\"startTime\":\"bgj\",\"timeZone\":\"glklb\"},\"schedule\":{\"id\":\"idwcwvmzegjon\",\"provisioningStatus\":\"Provisioning\",\"status\":\"Disabled\"}},{\"id\":\"gdn\",\"provisioningStatus\":\"Failed\",\"status\":\"Disabled\",\"action\":\"Stop\",\"triggerType\":\"Cron\",\"recurrence\":{\"triggerType\":\"Recurrence\",\"frequency\":\"Month\",\"interval\":1147399422,\"endTime\":\"sjcitdigsxc\",\"startTime\":\"l\",\"timeZone\":\"lkeuac\"},\"cron\":{\"triggerType\":\"Cron\",\"expression\":\"omflrytswfp\",\"endTime\":\"dgycxnmskwhqjjy\",\"startTime\":\"urlpshh\",\"timeZone\":\"pedwqsl\"},\"schedule\":{\"id\":\"mpqvwwsk\",\"provisioningStatus\":\"Completed\",\"status\":\"Disabled\"}},{\"id\":\"wimuvqej\",\"provisioningStatus\":\"Failed\",\"status\":\"Disabled\",\"action\":\"Start\",\"triggerType\":\"Recurrence\",\"recurrence\":{\"triggerType\":\"Recurrence\",\"frequency\":\"Week\",\"interval\":1658057009,\"endTime\":\"uqtljqobbpih\",\"startTime\":\"cecybmrqbrjbbmpx\",\"timeZone\":\"vykfrexcrse\"},\"cron\":{\"triggerType\":\"Cron\",\"expression\":\"jksghudg\",\"endTime\":\"xog\",\"startTime\":\"gsv\",\"timeZone\":\"jkxibda\"},\"schedule\":{\"id\":\"kmdyomkxfbvfbh\",\"provisioningStatus\":\"Completed\",\"status\":\"Disabled\"}}]}") - .toObject(ComputeSchedules.class); - Assertions.assertEquals(ScheduleStatus.DISABLED, model.computeStartStop().get(0).status()); - Assertions.assertEquals(ComputePowerAction.START, model.computeStartStop().get(0).action()); - Assertions.assertEquals(TriggerType.CRON, model.computeStartStop().get(0).triggerType()); - Assertions.assertEquals("w", model.computeStartStop().get(0).recurrence().endTime()); - Assertions.assertEquals("jsmwrokc", model.computeStartStop().get(0).recurrence().startTime()); - Assertions.assertEquals("fzzzwyjafitlhg", model.computeStartStop().get(0).recurrence().timeZone()); - Assertions.assertEquals(RecurrenceFrequency.HOUR, model.computeStartStop().get(0).recurrence().frequency()); - Assertions.assertEquals(1941330764, model.computeStartStop().get(0).recurrence().interval()); - Assertions.assertEquals("sgzv", model.computeStartStop().get(0).cron().endTime()); - Assertions.assertEquals("snnjzfpafolpym", model.computeStartStop().get(0).cron().startTime()); - Assertions.assertEquals("mxq", model.computeStartStop().get(0).cron().timeZone()); - Assertions.assertEquals("nuchlgmltxdwhmo", model.computeStartStop().get(0).cron().expression()); - Assertions.assertEquals("gpgdphtvdulaj", model.computeStartStop().get(0).schedule().id()); - Assertions - .assertEquals( - ScheduleProvisioningState.PROVISIONING, - model.computeStartStop().get(0).schedule().provisioningStatus()); - Assertions.assertEquals(ScheduleStatus.ENABLED, model.computeStartStop().get(0).schedule().status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComputeSchedules model = - new ComputeSchedules() - .withComputeStartStop( - Arrays - .asList( - new ComputeStartStopSchedule() - .withStatus(ScheduleStatus.DISABLED) - .withAction(ComputePowerAction.START) - .withTriggerType(TriggerType.CRON) - .withRecurrence( - new RecurrenceTrigger() - .withEndTime("w") - .withStartTime("jsmwrokc") - .withTimeZone("fzzzwyjafitlhg") - .withFrequency(RecurrenceFrequency.HOUR) - .withInterval(1941330764)) - .withCron( - new CronTrigger() - .withEndTime("sgzv") - .withStartTime("snnjzfpafolpym") - .withTimeZone("mxq") - .withExpression("nuchlgmltxdwhmo")) - .withSchedule( - new ScheduleBase() - .withId("gpgdphtvdulaj") - .withProvisioningStatus(ScheduleProvisioningState.PROVISIONING) - .withStatus(ScheduleStatus.ENABLED)), - new ComputeStartStopSchedule() - .withStatus(ScheduleStatus.DISABLED) - .withAction(ComputePowerAction.START) - .withTriggerType(TriggerType.CRON) - .withRecurrence( - new RecurrenceTrigger() - .withEndTime("q") - .withStartTime("jhmqrhvthla") - .withTimeZone("dcxsmlz") - .withFrequency(RecurrenceFrequency.HOUR) - .withInterval(794571898)) - .withCron( - new CronTrigger() - .withEndTime("qvlnnpxybafiqgea") - .withStartTime("bgj") - .withTimeZone("glklb") - .withExpression("zdtxetlgyd")) - .withSchedule( - new ScheduleBase() - .withId("idwcwvmzegjon") - .withProvisioningStatus(ScheduleProvisioningState.PROVISIONING) - .withStatus(ScheduleStatus.DISABLED)), - new ComputeStartStopSchedule() - .withStatus(ScheduleStatus.DISABLED) - .withAction(ComputePowerAction.STOP) - .withTriggerType(TriggerType.CRON) - .withRecurrence( - new RecurrenceTrigger() - .withEndTime("sjcitdigsxc") - .withStartTime("l") - .withTimeZone("lkeuac") - .withFrequency(RecurrenceFrequency.MONTH) - .withInterval(1147399422)) - .withCron( - new CronTrigger() - .withEndTime("dgycxnmskwhqjjy") - .withStartTime("urlpshh") - .withTimeZone("pedwqsl") - .withExpression("omflrytswfp")) - .withSchedule( - new ScheduleBase() - .withId("mpqvwwsk") - .withProvisioningStatus(ScheduleProvisioningState.COMPLETED) - .withStatus(ScheduleStatus.DISABLED)), - new ComputeStartStopSchedule() - .withStatus(ScheduleStatus.DISABLED) - .withAction(ComputePowerAction.START) - .withTriggerType(TriggerType.RECURRENCE) - .withRecurrence( - new RecurrenceTrigger() - .withEndTime("uqtljqobbpih") - .withStartTime("cecybmrqbrjbbmpx") - .withTimeZone("vykfrexcrse") - .withFrequency(RecurrenceFrequency.WEEK) - .withInterval(1658057009)) - .withCron( - new CronTrigger() - .withEndTime("xog") - .withStartTime("gsv") - .withTimeZone("jkxibda") - .withExpression("jksghudg")) - .withSchedule( - new ScheduleBase() - .withId("kmdyomkxfbvfbh") - .withProvisioningStatus(ScheduleProvisioningState.COMPLETED) - .withStatus(ScheduleStatus.DISABLED)))); - model = BinaryData.fromObject(model).toObject(ComputeSchedules.class); - Assertions.assertEquals(ScheduleStatus.DISABLED, model.computeStartStop().get(0).status()); - Assertions.assertEquals(ComputePowerAction.START, model.computeStartStop().get(0).action()); - Assertions.assertEquals(TriggerType.CRON, model.computeStartStop().get(0).triggerType()); - Assertions.assertEquals("w", model.computeStartStop().get(0).recurrence().endTime()); - Assertions.assertEquals("jsmwrokc", model.computeStartStop().get(0).recurrence().startTime()); - Assertions.assertEquals("fzzzwyjafitlhg", model.computeStartStop().get(0).recurrence().timeZone()); - Assertions.assertEquals(RecurrenceFrequency.HOUR, model.computeStartStop().get(0).recurrence().frequency()); - Assertions.assertEquals(1941330764, model.computeStartStop().get(0).recurrence().interval()); - Assertions.assertEquals("sgzv", model.computeStartStop().get(0).cron().endTime()); - Assertions.assertEquals("snnjzfpafolpym", model.computeStartStop().get(0).cron().startTime()); - Assertions.assertEquals("mxq", model.computeStartStop().get(0).cron().timeZone()); - Assertions.assertEquals("nuchlgmltxdwhmo", model.computeStartStop().get(0).cron().expression()); - Assertions.assertEquals("gpgdphtvdulaj", model.computeStartStop().get(0).schedule().id()); - Assertions - .assertEquals( - ScheduleProvisioningState.PROVISIONING, - model.computeStartStop().get(0).schedule().provisioningStatus()); - Assertions.assertEquals(ScheduleStatus.ENABLED, model.computeStartStop().get(0).schedule().status()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeSecretsInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeSecretsInnerTests.java deleted file mode 100644 index d0d7dd931e676..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeSecretsInnerTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.ComputeSecretsInner; - -public final class ComputeSecretsInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComputeSecretsInner model = - BinaryData.fromString("{\"computeType\":\"ComputeSecrets\"}").toObject(ComputeSecretsInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComputeSecretsInner model = new ComputeSecretsInner(); - model = BinaryData.fromObject(model).toObject(ComputeSecretsInner.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeStartStopScheduleTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeStartStopScheduleTests.java deleted file mode 100644 index 422af5e5d26e0..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeStartStopScheduleTests.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ComputePowerAction; -import com.azure.resourcemanager.machinelearning.models.ComputeStartStopSchedule; -import com.azure.resourcemanager.machinelearning.models.CronTrigger; -import com.azure.resourcemanager.machinelearning.models.RecurrenceFrequency; -import com.azure.resourcemanager.machinelearning.models.RecurrenceSchedule; -import com.azure.resourcemanager.machinelearning.models.RecurrenceTrigger; -import com.azure.resourcemanager.machinelearning.models.ScheduleBase; -import com.azure.resourcemanager.machinelearning.models.ScheduleProvisioningState; -import com.azure.resourcemanager.machinelearning.models.ScheduleStatus; -import com.azure.resourcemanager.machinelearning.models.TriggerType; -import com.azure.resourcemanager.machinelearning.models.WeekDay; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ComputeStartStopScheduleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComputeStartStopSchedule model = - BinaryData - .fromString( - "{\"id\":\"wpg\",\"provisioningStatus\":\"Failed\",\"status\":\"Enabled\",\"action\":\"Start\",\"triggerType\":\"Recurrence\",\"recurrence\":{\"triggerType\":\"Recurrence\",\"frequency\":\"Day\",\"interval\":926595396,\"schedule\":{\"hours\":[1582308433],\"minutes\":[166613008],\"monthDays\":[587867611,1327364121],\"weekDays\":[\"Thursday\"]},\"endTime\":\"bwsnsqow\",\"startTime\":\"comlikytwvczc\",\"timeZone\":\"k\"},\"cron\":{\"triggerType\":\"Cron\",\"expression\":\"ve\",\"endTime\":\"fdv\",\"startTime\":\"hbwrnfxtgddpqth\",\"timeZone\":\"n\"},\"schedule\":{\"id\":\"oya\",\"provisioningStatus\":\"Provisioning\",\"status\":\"Disabled\"}}") - .toObject(ComputeStartStopSchedule.class); - Assertions.assertEquals(ScheduleStatus.ENABLED, model.status()); - Assertions.assertEquals(ComputePowerAction.START, model.action()); - Assertions.assertEquals(TriggerType.RECURRENCE, model.triggerType()); - Assertions.assertEquals("bwsnsqow", model.recurrence().endTime()); - Assertions.assertEquals("comlikytwvczc", model.recurrence().startTime()); - Assertions.assertEquals("k", model.recurrence().timeZone()); - Assertions.assertEquals(RecurrenceFrequency.DAY, model.recurrence().frequency()); - Assertions.assertEquals(926595396, model.recurrence().interval()); - Assertions.assertEquals(1582308433, model.recurrence().schedule().hours().get(0)); - Assertions.assertEquals(166613008, model.recurrence().schedule().minutes().get(0)); - Assertions.assertEquals(587867611, model.recurrence().schedule().monthDays().get(0)); - Assertions.assertEquals(WeekDay.THURSDAY, model.recurrence().schedule().weekDays().get(0)); - Assertions.assertEquals("fdv", model.cron().endTime()); - Assertions.assertEquals("hbwrnfxtgddpqth", model.cron().startTime()); - Assertions.assertEquals("n", model.cron().timeZone()); - Assertions.assertEquals("ve", model.cron().expression()); - Assertions.assertEquals("oya", model.schedule().id()); - Assertions.assertEquals(ScheduleProvisioningState.PROVISIONING, model.schedule().provisioningStatus()); - Assertions.assertEquals(ScheduleStatus.DISABLED, model.schedule().status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComputeStartStopSchedule model = - new ComputeStartStopSchedule() - .withStatus(ScheduleStatus.ENABLED) - .withAction(ComputePowerAction.START) - .withTriggerType(TriggerType.RECURRENCE) - .withRecurrence( - new RecurrenceTrigger() - .withEndTime("bwsnsqow") - .withStartTime("comlikytwvczc") - .withTimeZone("k") - .withFrequency(RecurrenceFrequency.DAY) - .withInterval(926595396) - .withSchedule( - new RecurrenceSchedule() - .withHours(Arrays.asList(1582308433)) - .withMinutes(Arrays.asList(166613008)) - .withMonthDays(Arrays.asList(587867611, 1327364121)) - .withWeekDays(Arrays.asList(WeekDay.THURSDAY)))) - .withCron( - new CronTrigger() - .withEndTime("fdv") - .withStartTime("hbwrnfxtgddpqth") - .withTimeZone("n") - .withExpression("ve")) - .withSchedule( - new ScheduleBase() - .withId("oya") - .withProvisioningStatus(ScheduleProvisioningState.PROVISIONING) - .withStatus(ScheduleStatus.DISABLED)); - model = BinaryData.fromObject(model).toObject(ComputeStartStopSchedule.class); - Assertions.assertEquals(ScheduleStatus.ENABLED, model.status()); - Assertions.assertEquals(ComputePowerAction.START, model.action()); - Assertions.assertEquals(TriggerType.RECURRENCE, model.triggerType()); - Assertions.assertEquals("bwsnsqow", model.recurrence().endTime()); - Assertions.assertEquals("comlikytwvczc", model.recurrence().startTime()); - Assertions.assertEquals("k", model.recurrence().timeZone()); - Assertions.assertEquals(RecurrenceFrequency.DAY, model.recurrence().frequency()); - Assertions.assertEquals(926595396, model.recurrence().interval()); - Assertions.assertEquals(1582308433, model.recurrence().schedule().hours().get(0)); - Assertions.assertEquals(166613008, model.recurrence().schedule().minutes().get(0)); - Assertions.assertEquals(587867611, model.recurrence().schedule().monthDays().get(0)); - Assertions.assertEquals(WeekDay.THURSDAY, model.recurrence().schedule().weekDays().get(0)); - Assertions.assertEquals("fdv", model.cron().endTime()); - Assertions.assertEquals("hbwrnfxtgddpqth", model.cron().startTime()); - Assertions.assertEquals("n", model.cron().timeZone()); - Assertions.assertEquals("ve", model.cron().expression()); - Assertions.assertEquals("oya", model.schedule().id()); - Assertions.assertEquals(ScheduleProvisioningState.PROVISIONING, model.schedule().provisioningStatus()); - Assertions.assertEquals(ScheduleStatus.DISABLED, model.schedule().status()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeTests.java deleted file mode 100644 index 6d5820af19793..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputeTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.Compute; -import org.junit.jupiter.api.Assertions; - -public final class ComputeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Compute model = - BinaryData - .fromString( - "{\"computeType\":\"Compute\",\"computeLocation\":\"tsthsucocm\",\"provisioningState\":\"Canceled\",\"description\":\"zt\",\"createdOn\":\"2021-04-09T08:14:29Z\",\"modifiedOn\":\"2021-08-28T10:19:16Z\",\"resourceId\":\"qpuedckzywbiex\",\"provisioningErrors\":[],\"isAttachedCompute\":false,\"disableLocalAuth\":false}") - .toObject(Compute.class); - Assertions.assertEquals("tsthsucocm", model.computeLocation()); - Assertions.assertEquals("zt", model.description()); - Assertions.assertEquals("qpuedckzywbiex", model.resourceId()); - Assertions.assertEquals(false, model.disableLocalAuth()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Compute model = - new Compute() - .withComputeLocation("tsthsucocm") - .withDescription("zt") - .withResourceId("qpuedckzywbiex") - .withDisableLocalAuth(false); - model = BinaryData.fromObject(model).toObject(Compute.class); - Assertions.assertEquals("tsthsucocm", model.computeLocation()); - Assertions.assertEquals("zt", model.description()); - Assertions.assertEquals("qpuedckzywbiex", model.resourceId()); - Assertions.assertEquals(false, model.disableLocalAuth()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesCreateOrUpdateMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesCreateOrUpdateMockTests.java deleted file mode 100644 index 34735a5e7776c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesCreateOrUpdateMockTests.java +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.Compute; -import com.azure.resourcemanager.machinelearning.models.ComputeResource; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.Sku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ComputesCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"identity\":{\"principalId\":\"1ee3bee0-6ff7-49e8-bb68-e00d27bcece0\",\"tenantId\":\"5cc048d8-79ef-4872-886f-a002e40a7489\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"location\":\"nii\",\"tags\":{\"sjtgirnbgmgmddo\":\"vqban\"},\"sku\":{\"name\":\"mynltwmpftmfoeaj\",\"tier\":\"Standard\",\"size\":\"xwet\",\"family\":\"fddrvlkpzwbhnrec\",\"capacity\":252329651},\"properties\":{\"computeType\":\"Compute\",\"computeLocation\":\"muhkahm\",\"provisioningState\":\"Succeeded\",\"description\":\"iuc\",\"createdOn\":\"2021-02-05T06:18:58Z\",\"modifiedOn\":\"2021-09-23T11:37:53Z\",\"resourceId\":\"jpjbweunxcqr\",\"provisioningErrors\":[],\"isAttachedCompute\":false,\"disableLocalAuth\":false},\"id\":\"hppiybx\",\"name\":\"gnzuzpbgkzcsc\",\"type\":\"iuzvkunhdimju\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ComputeResource response = - manager - .computes() - .define("ojxrjnbsconxavi") - .withExistingWorkspace("mdafbgymqt", "apr") - .withRegion("izqfsgnwdxz") - .withTags(mapOf("rfbo", "q")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.NONE) - .withUserAssignedIdentities(mapOf())) - .withSku( - new Sku() - .withName("ipmlnfyzavf") - .withTier(SkuTier.FREE) - .withSize("icdbkpdj") - .withFamily("qh") - .withCapacity(222903277)) - .withProperties( - new Compute() - .withComputeLocation("dgonjhxshthmgp") - .withDescription("lptkbvc") - .withResourceId("gqqbtimpk") - .withDisableLocalAuth(false)) - .create(); - - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.identity().type()); - Assertions.assertEquals("nii", response.location()); - Assertions.assertEquals("vqban", response.tags().get("sjtgirnbgmgmddo")); - Assertions.assertEquals("mynltwmpftmfoeaj", response.sku().name()); - Assertions.assertEquals(SkuTier.STANDARD, response.sku().tier()); - Assertions.assertEquals("xwet", response.sku().size()); - Assertions.assertEquals("fddrvlkpzwbhnrec", response.sku().family()); - Assertions.assertEquals(252329651, response.sku().capacity()); - Assertions.assertEquals("muhkahm", response.properties().computeLocation()); - Assertions.assertEquals("iuc", response.properties().description()); - Assertions.assertEquals("jpjbweunxcqr", response.properties().resourceId()); - Assertions.assertEquals(false, response.properties().disableLocalAuth()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesDeleteMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesDeleteMockTests.java deleted file mode 100644 index 08eeb0e3f5775..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesDeleteMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.UnderlyingResourceAction; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ComputesDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .computes() - .delete( - "tlqh", "pxouvmr", "iflikyypzkgxfx", UnderlyingResourceAction.DETACH, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesGetWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesGetWithResponseMockTests.java deleted file mode 100644 index ed6becf3e9e77..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesGetWithResponseMockTests.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ComputeResource; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ComputesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"identity\":{\"principalId\":\"1de443a3-f608-425f-91bd-438d47ec26d7\",\"tenantId\":\"e37f22c1-6b70-4a8c-8d5a-d0815df251d2\",\"type\":\"None\",\"userAssignedIdentities\":{}},\"location\":\"kgd\",\"tags\":{\"qsktxqf\":\"krukizyhgsqt\",\"cgbfzuscstun\":\"jbqggweeiwdhdm\",\"bkl\":\"lhxd\",\"f\":\"iichgjsysmvxodgw\"},\"sku\":{\"name\":\"sifcuvbdujgc\",\"tier\":\"Free\",\"size\":\"cbbwjtrdxriz\",\"family\":\"bbgiarksykpgdqxw\",\"capacity\":230334707},\"properties\":{\"computeType\":\"Compute\",\"computeLocation\":\"qrxhaclcdos\",\"provisioningState\":\"Creating\",\"description\":\"jqgkifmmainwhe\",\"createdOn\":\"2021-07-02T12:23:07Z\",\"modifiedOn\":\"2021-11-29T01:34:21Z\",\"resourceId\":\"wuntobuiz\",\"provisioningErrors\":[],\"isAttachedCompute\":false,\"disableLocalAuth\":true},\"id\":\"vydjufbnk\",\"name\":\"blaxpegj\",\"type\":\"dabalfdxaglzfytl\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ComputeResource response = - manager - .computes() - .getWithResponse("xampqcr", "g", "uqxbpiatwfauje", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(ManagedServiceIdentityType.NONE, response.identity().type()); - Assertions.assertEquals("kgd", response.location()); - Assertions.assertEquals("krukizyhgsqt", response.tags().get("qsktxqf")); - Assertions.assertEquals("sifcuvbdujgc", response.sku().name()); - Assertions.assertEquals(SkuTier.FREE, response.sku().tier()); - Assertions.assertEquals("cbbwjtrdxriz", response.sku().size()); - Assertions.assertEquals("bbgiarksykpgdqxw", response.sku().family()); - Assertions.assertEquals(230334707, response.sku().capacity()); - Assertions.assertEquals("qrxhaclcdos", response.properties().computeLocation()); - Assertions.assertEquals("jqgkifmmainwhe", response.properties().description()); - Assertions.assertEquals("wuntobuiz", response.properties().resourceId()); - Assertions.assertEquals(true, response.properties().disableLocalAuth()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesListKeysWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesListKeysWithResponseMockTests.java deleted file mode 100644 index cdf7973f94365..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesListKeysWithResponseMockTests.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ComputeSecrets; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ComputesListKeysWithResponseMockTests { - @Test - public void testListKeysWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"computeType\":\"ComputeSecrets\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ComputeSecrets response = - manager - .computes() - .listKeysWithResponse("lilw", "ghjhjvmabzzbwa", "b", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesListMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesListMockTests.java deleted file mode 100644 index 31b5b2dd45c8c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesListMockTests.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ComputeResource; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ComputesListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"identity\":{\"principalId\":\"0be36eb6-1866-4b48-9c68-496f7e78e9dd\",\"tenantId\":\"3db7bdd0-a243-4495-af5a-9360ec87f65c\",\"type\":\"None\",\"userAssignedIdentities\":{}},\"location\":\"ujmoi\",\"tags\":{\"jslkyozdsfzjue\":\"wemhdee\",\"jtv\":\"rhrhtsl\",\"xvgjbfi\":\"j\",\"bj\":\"bpnjodf\"},\"sku\":{\"name\":\"wmtqsmoxsaz\",\"tier\":\"Basic\",\"size\":\"gwecywnfysz\",\"family\":\"czs\",\"capacity\":57372147},\"properties\":{\"computeType\":\"Compute\",\"computeLocation\":\"ddbboz\",\"provisioningState\":\"Deleting\",\"description\":\"mkjmyitrchwudlxe\",\"createdOn\":\"2021-07-21T06:48:48Z\",\"modifiedOn\":\"2021-01-08T01:59:39Z\",\"resourceId\":\"noejhqlfmsibz\",\"provisioningErrors\":[],\"isAttachedCompute\":false,\"disableLocalAuth\":true},\"id\":\"ydpmypgfqvmt\",\"name\":\"whlakxpejpew\",\"type\":\"yjl\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.computes().list("zb", "yqjoghdsa", "djanormo", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(ManagedServiceIdentityType.NONE, response.iterator().next().identity().type()); - Assertions.assertEquals("ujmoi", response.iterator().next().location()); - Assertions.assertEquals("wemhdee", response.iterator().next().tags().get("jslkyozdsfzjue")); - Assertions.assertEquals("wmtqsmoxsaz", response.iterator().next().sku().name()); - Assertions.assertEquals(SkuTier.BASIC, response.iterator().next().sku().tier()); - Assertions.assertEquals("gwecywnfysz", response.iterator().next().sku().size()); - Assertions.assertEquals("czs", response.iterator().next().sku().family()); - Assertions.assertEquals(57372147, response.iterator().next().sku().capacity()); - Assertions.assertEquals("ddbboz", response.iterator().next().properties().computeLocation()); - Assertions.assertEquals("mkjmyitrchwudlxe", response.iterator().next().properties().description()); - Assertions.assertEquals("noejhqlfmsibz", response.iterator().next().properties().resourceId()); - Assertions.assertEquals(true, response.iterator().next().properties().disableLocalAuth()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesListNodesMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesListNodesMockTests.java deleted file mode 100644 index 72ba2b3c739f9..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ComputesListNodesMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.AmlComputeNodeInformation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ComputesListNodesMockTests { - @Test - public void testListNodes() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"nodes\":[{\"nodeId\":\"skw\",\"privateIpAddress\":\"sdetjygowifcqpol\",\"publicIpAddress\":\"gysdgzyyb\",\"port\":375628920,\"nodeState\":\"running\",\"runId\":\"cptvdxxheig\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.computes().listNodes("yrqsdbpokszanm", "wgpterdiuw", "i", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ContainerResourceRequirementsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ContainerResourceRequirementsTests.java deleted file mode 100644 index 1f0d2cfe906e1..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ContainerResourceRequirementsTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ContainerResourceRequirements; -import com.azure.resourcemanager.machinelearning.models.ContainerResourceSettings; -import org.junit.jupiter.api.Assertions; - -public final class ContainerResourceRequirementsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ContainerResourceRequirements model = - BinaryData - .fromString( - "{\"containerResourceLimits\":{\"cpu\":\"wllcolsr\",\"gpu\":\"apte\",\"memory\":\"excgjokjljnhvl\"},\"containerResourceRequests\":{\"cpu\":\"ek\",\"gpu\":\"eksnbksdqhjvyk\",\"memory\":\"eslk\"}}") - .toObject(ContainerResourceRequirements.class); - Assertions.assertEquals("wllcolsr", model.containerResourceLimits().cpu()); - Assertions.assertEquals("apte", model.containerResourceLimits().gpu()); - Assertions.assertEquals("excgjokjljnhvl", model.containerResourceLimits().memory()); - Assertions.assertEquals("ek", model.containerResourceRequests().cpu()); - Assertions.assertEquals("eksnbksdqhjvyk", model.containerResourceRequests().gpu()); - Assertions.assertEquals("eslk", model.containerResourceRequests().memory()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ContainerResourceRequirements model = - new ContainerResourceRequirements() - .withContainerResourceLimits( - new ContainerResourceSettings().withCpu("wllcolsr").withGpu("apte").withMemory("excgjokjljnhvl")) - .withContainerResourceRequests( - new ContainerResourceSettings().withCpu("ek").withGpu("eksnbksdqhjvyk").withMemory("eslk")); - model = BinaryData.fromObject(model).toObject(ContainerResourceRequirements.class); - Assertions.assertEquals("wllcolsr", model.containerResourceLimits().cpu()); - Assertions.assertEquals("apte", model.containerResourceLimits().gpu()); - Assertions.assertEquals("excgjokjljnhvl", model.containerResourceLimits().memory()); - Assertions.assertEquals("ek", model.containerResourceRequests().cpu()); - Assertions.assertEquals("eksnbksdqhjvyk", model.containerResourceRequests().gpu()); - Assertions.assertEquals("eslk", model.containerResourceRequests().memory()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ContainerResourceSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ContainerResourceSettingsTests.java deleted file mode 100644 index 430c11d570d60..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ContainerResourceSettingsTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ContainerResourceSettings; -import org.junit.jupiter.api.Assertions; - -public final class ContainerResourceSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ContainerResourceSettings model = - BinaryData - .fromString("{\"cpu\":\"ustcpoq\",\"gpu\":\"vnwqjwgo\",\"memory\":\"lejjjkxy\"}") - .toObject(ContainerResourceSettings.class); - Assertions.assertEquals("ustcpoq", model.cpu()); - Assertions.assertEquals("vnwqjwgo", model.gpu()); - Assertions.assertEquals("lejjjkxy", model.memory()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ContainerResourceSettings model = - new ContainerResourceSettings().withCpu("ustcpoq").withGpu("vnwqjwgo").withMemory("lejjjkxy"); - model = BinaryData.fromObject(model).toObject(ContainerResourceSettings.class); - Assertions.assertEquals("ustcpoq", model.cpu()); - Assertions.assertEquals("vnwqjwgo", model.gpu()); - Assertions.assertEquals("lejjjkxy", model.memory()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CosmosDbSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CosmosDbSettingsTests.java deleted file mode 100644 index eb119224d22af..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CosmosDbSettingsTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.CosmosDbSettings; -import org.junit.jupiter.api.Assertions; - -public final class CosmosDbSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CosmosDbSettings model = - BinaryData.fromString("{\"collectionsThroughput\":1098993569}").toObject(CosmosDbSettings.class); - Assertions.assertEquals(1098993569, model.collectionsThroughput()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CosmosDbSettings model = new CosmosDbSettings().withCollectionsThroughput(1098993569); - model = BinaryData.fromObject(model).toObject(CosmosDbSettings.class); - Assertions.assertEquals(1098993569, model.collectionsThroughput()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CronTriggerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CronTriggerTests.java deleted file mode 100644 index 946de8b11fecc..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CronTriggerTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.CronTrigger; -import org.junit.jupiter.api.Assertions; - -public final class CronTriggerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CronTrigger model = - BinaryData - .fromString( - "{\"triggerType\":\"Cron\",\"expression\":\"ksrl\",\"endTime\":\"desqplpvmjcdo\",\"startTime\":\"bidyv\",\"timeZone\":\"owx\"}") - .toObject(CronTrigger.class); - Assertions.assertEquals("desqplpvmjcdo", model.endTime()); - Assertions.assertEquals("bidyv", model.startTime()); - Assertions.assertEquals("owx", model.timeZone()); - Assertions.assertEquals("ksrl", model.expression()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CronTrigger model = - new CronTrigger() - .withEndTime("desqplpvmjcdo") - .withStartTime("bidyv") - .withTimeZone("owx") - .withExpression("ksrl"); - model = BinaryData.fromObject(model).toObject(CronTrigger.class); - Assertions.assertEquals("desqplpvmjcdo", model.endTime()); - Assertions.assertEquals("bidyv", model.startTime()); - Assertions.assertEquals("owx", model.timeZone()); - Assertions.assertEquals("ksrl", model.expression()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomForecastHorizonTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomForecastHorizonTests.java deleted file mode 100644 index 0204d2f8ca62d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomForecastHorizonTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.CustomForecastHorizon; -import org.junit.jupiter.api.Assertions; - -public final class CustomForecastHorizonTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomForecastHorizon model = - BinaryData.fromString("{\"mode\":\"Custom\",\"value\":632851650}").toObject(CustomForecastHorizon.class); - Assertions.assertEquals(632851650, model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomForecastHorizon model = new CustomForecastHorizon().withValue(632851650); - model = BinaryData.fromObject(model).toObject(CustomForecastHorizon.class); - Assertions.assertEquals(632851650, model.value()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomModelJobInputTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomModelJobInputTests.java deleted file mode 100644 index e397e628a6a11..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomModelJobInputTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.CustomModelJobInput; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import org.junit.jupiter.api.Assertions; - -public final class CustomModelJobInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomModelJobInput model = - BinaryData - .fromString( - "{\"jobInputType\":\"custom_model\",\"mode\":\"Direct\",\"uri\":\"bkjbz\",\"description\":\"nsvk\"}") - .toObject(CustomModelJobInput.class); - Assertions.assertEquals("nsvk", model.description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.mode()); - Assertions.assertEquals("bkjbz", model.uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomModelJobInput model = - new CustomModelJobInput().withDescription("nsvk").withMode(InputDeliveryMode.DIRECT).withUri("bkjbz"); - model = BinaryData.fromObject(model).toObject(CustomModelJobInput.class); - Assertions.assertEquals("nsvk", model.description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.mode()); - Assertions.assertEquals("bkjbz", model.uri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomModelJobOutputTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomModelJobOutputTests.java deleted file mode 100644 index af669e82b1c3b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomModelJobOutputTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.CustomModelJobOutput; -import com.azure.resourcemanager.machinelearning.models.OutputDeliveryMode; -import org.junit.jupiter.api.Assertions; - -public final class CustomModelJobOutputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomModelJobOutput model = - BinaryData - .fromString( - "{\"jobOutputType\":\"custom_model\",\"mode\":\"ReadWriteMount\",\"uri\":\"tjknsxfwushcdp\",\"description\":\"pn\"}") - .toObject(CustomModelJobOutput.class); - Assertions.assertEquals("pn", model.description()); - Assertions.assertEquals(OutputDeliveryMode.READ_WRITE_MOUNT, model.mode()); - Assertions.assertEquals("tjknsxfwushcdp", model.uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomModelJobOutput model = - new CustomModelJobOutput() - .withDescription("pn") - .withMode(OutputDeliveryMode.READ_WRITE_MOUNT) - .withUri("tjknsxfwushcdp"); - model = BinaryData.fromObject(model).toObject(CustomModelJobOutput.class); - Assertions.assertEquals("pn", model.description()); - Assertions.assertEquals(OutputDeliveryMode.READ_WRITE_MOUNT, model.mode()); - Assertions.assertEquals("tjknsxfwushcdp", model.uri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomNCrossValidationsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomNCrossValidationsTests.java deleted file mode 100644 index 07b772a2ac82a..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomNCrossValidationsTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.CustomNCrossValidations; -import org.junit.jupiter.api.Assertions; - -public final class CustomNCrossValidationsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomNCrossValidations model = - BinaryData.fromString("{\"mode\":\"Custom\",\"value\":691698964}").toObject(CustomNCrossValidations.class); - Assertions.assertEquals(691698964, model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomNCrossValidations model = new CustomNCrossValidations().withValue(691698964); - model = BinaryData.fromObject(model).toObject(CustomNCrossValidations.class); - Assertions.assertEquals(691698964, model.value()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomSeasonalityTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomSeasonalityTests.java deleted file mode 100644 index 8f1caf6d57906..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomSeasonalityTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.CustomSeasonality; -import org.junit.jupiter.api.Assertions; - -public final class CustomSeasonalityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomSeasonality model = - BinaryData.fromString("{\"mode\":\"Custom\",\"value\":1578351643}").toObject(CustomSeasonality.class); - Assertions.assertEquals(1578351643, model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomSeasonality model = new CustomSeasonality().withValue(1578351643); - model = BinaryData.fromObject(model).toObject(CustomSeasonality.class); - Assertions.assertEquals(1578351643, model.value()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomTargetLagsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomTargetLagsTests.java deleted file mode 100644 index b6cfdaad5bdf8..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomTargetLagsTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.CustomTargetLags; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class CustomTargetLagsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomTargetLags model = - BinaryData - .fromString("{\"mode\":\"Custom\",\"values\":[915823701,1407190218,425904374]}") - .toObject(CustomTargetLags.class); - Assertions.assertEquals(915823701, model.values().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomTargetLags model = new CustomTargetLags().withValues(Arrays.asList(915823701, 1407190218, 425904374)); - model = BinaryData.fromObject(model).toObject(CustomTargetLags.class); - Assertions.assertEquals(915823701, model.values().get(0)); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomTargetRollingWindowSizeTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomTargetRollingWindowSizeTests.java deleted file mode 100644 index 6af5bc3d69578..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/CustomTargetRollingWindowSizeTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.CustomTargetRollingWindowSize; -import org.junit.jupiter.api.Assertions; - -public final class CustomTargetRollingWindowSizeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomTargetRollingWindowSize model = - BinaryData - .fromString("{\"mode\":\"Custom\",\"value\":482115950}") - .toObject(CustomTargetRollingWindowSize.class); - Assertions.assertEquals(482115950, model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomTargetRollingWindowSize model = new CustomTargetRollingWindowSize().withValue(482115950); - model = BinaryData.fromObject(model).toObject(CustomTargetRollingWindowSize.class); - Assertions.assertEquals(482115950, model.value()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainerInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainerInnerTests.java deleted file mode 100644 index 80d46d3567473..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainerInnerTests.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.DataContainerInner; -import com.azure.resourcemanager.machinelearning.models.DataContainerProperties; -import com.azure.resourcemanager.machinelearning.models.DataType; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DataContainerInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataContainerInner model = - BinaryData - .fromString( - "{\"properties\":{\"dataType\":\"uri_folder\",\"isArchived\":true,\"latestVersion\":\"ycnunvjsrtk\",\"nextVersion\":\"wnopqgikyzirtx\",\"description\":\"uxzejntpsew\",\"properties\":{\"rydxtqm\":\"ilqu\"},\"tags\":{\"f\":\"xorgg\"}},\"id\":\"aomtbghhavgrvkff\",\"name\":\"vjzhpjbib\",\"type\":\"jmfxumvf\"}") - .toObject(DataContainerInner.class); - Assertions.assertEquals("uxzejntpsew", model.properties().description()); - Assertions.assertEquals("ilqu", model.properties().properties().get("rydxtqm")); - Assertions.assertEquals("xorgg", model.properties().tags().get("f")); - Assertions.assertEquals(true, model.properties().isArchived()); - Assertions.assertEquals(DataType.URI_FOLDER, model.properties().dataType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataContainerInner model = - new DataContainerInner() - .withProperties( - new DataContainerProperties() - .withDescription("uxzejntpsew") - .withProperties(mapOf("rydxtqm", "ilqu")) - .withTags(mapOf("f", "xorgg")) - .withIsArchived(true) - .withDataType(DataType.URI_FOLDER)); - model = BinaryData.fromObject(model).toObject(DataContainerInner.class); - Assertions.assertEquals("uxzejntpsew", model.properties().description()); - Assertions.assertEquals("ilqu", model.properties().properties().get("rydxtqm")); - Assertions.assertEquals("xorgg", model.properties().tags().get("f")); - Assertions.assertEquals(true, model.properties().isArchived()); - Assertions.assertEquals(DataType.URI_FOLDER, model.properties().dataType()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainerPropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainerPropertiesTests.java deleted file mode 100644 index 2b0434e60be5c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainerPropertiesTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.DataContainerProperties; -import com.azure.resourcemanager.machinelearning.models.DataType; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DataContainerPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataContainerProperties model = - BinaryData - .fromString( - "{\"dataType\":\"mltable\",\"isArchived\":false,\"latestVersion\":\"vwxnbkfe\",\"nextVersion\":\"xscyhwzdgirujbz\",\"description\":\"mvzzbtdcqvp\",\"properties\":{\"n\":\"ujviylwdshfs\",\"rymsgaojfmw\":\"bgye\",\"hirctymoxoftpipi\":\"cotmr\",\"lihhyuspskasdvlm\":\"yczuhxacpq\"},\"tags\":{\"ulucv\":\"gz\",\"urisjnhnytxifqj\":\"amrsreuzv\",\"esutrgjupauutpw\":\"gxmrhublwp\",\"jqgwzp\":\"qhih\"}}") - .toObject(DataContainerProperties.class); - Assertions.assertEquals("mvzzbtdcqvp", model.description()); - Assertions.assertEquals("ujviylwdshfs", model.properties().get("n")); - Assertions.assertEquals("gz", model.tags().get("ulucv")); - Assertions.assertEquals(false, model.isArchived()); - Assertions.assertEquals(DataType.MLTABLE, model.dataType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataContainerProperties model = - new DataContainerProperties() - .withDescription("mvzzbtdcqvp") - .withProperties( - mapOf( - "n", - "ujviylwdshfs", - "rymsgaojfmw", - "bgye", - "hirctymoxoftpipi", - "cotmr", - "lihhyuspskasdvlm", - "yczuhxacpq")) - .withTags( - mapOf( - "ulucv", - "gz", - "urisjnhnytxifqj", - "amrsreuzv", - "esutrgjupauutpw", - "gxmrhublwp", - "jqgwzp", - "qhih")) - .withIsArchived(false) - .withDataType(DataType.MLTABLE); - model = BinaryData.fromObject(model).toObject(DataContainerProperties.class); - Assertions.assertEquals("mvzzbtdcqvp", model.description()); - Assertions.assertEquals("ujviylwdshfs", model.properties().get("n")); - Assertions.assertEquals("gz", model.tags().get("ulucv")); - Assertions.assertEquals(false, model.isArchived()); - Assertions.assertEquals(DataType.MLTABLE, model.dataType()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainerResourceArmPaginatedResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainerResourceArmPaginatedResultTests.java deleted file mode 100644 index a4e0717beafe1..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainerResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.DataContainerInner; -import com.azure.resourcemanager.machinelearning.models.DataContainerProperties; -import com.azure.resourcemanager.machinelearning.models.DataContainerResourceArmPaginatedResult; -import com.azure.resourcemanager.machinelearning.models.DataType; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DataContainerResourceArmPaginatedResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataContainerResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"nextLink\":\"ufxqknpirgnepttw\",\"value\":[{\"properties\":{\"dataType\":\"uri_file\",\"isArchived\":true,\"latestVersion\":\"cdm\",\"nextVersion\":\"r\",\"description\":\"lpijnkrxfrd\",\"properties\":{},\"tags\":{}},\"id\":\"atiz\",\"name\":\"ronasxift\",\"type\":\"zq\"},{\"properties\":{\"dataType\":\"uri_folder\",\"isArchived\":false,\"latestVersion\":\"wesgogczh\",\"nextVersion\":\"nxkrlgnyhmossxkk\",\"description\":\"h\",\"properties\":{},\"tags\":{}},\"id\":\"xjb\",\"name\":\"hqxvcxgfrpdsofbs\",\"type\":\"rnsvbuswd\"}]}") - .toObject(DataContainerResourceArmPaginatedResult.class); - Assertions.assertEquals("ufxqknpirgnepttw", model.nextLink()); - Assertions.assertEquals("lpijnkrxfrd", model.value().get(0).properties().description()); - Assertions.assertEquals(true, model.value().get(0).properties().isArchived()); - Assertions.assertEquals(DataType.URI_FILE, model.value().get(0).properties().dataType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataContainerResourceArmPaginatedResult model = - new DataContainerResourceArmPaginatedResult() - .withNextLink("ufxqknpirgnepttw") - .withValue( - Arrays - .asList( - new DataContainerInner() - .withProperties( - new DataContainerProperties() - .withDescription("lpijnkrxfrd") - .withProperties(mapOf()) - .withTags(mapOf()) - .withIsArchived(true) - .withDataType(DataType.URI_FILE)), - new DataContainerInner() - .withProperties( - new DataContainerProperties() - .withDescription("h") - .withProperties(mapOf()) - .withTags(mapOf()) - .withIsArchived(false) - .withDataType(DataType.URI_FOLDER)))); - model = BinaryData.fromObject(model).toObject(DataContainerResourceArmPaginatedResult.class); - Assertions.assertEquals("ufxqknpirgnepttw", model.nextLink()); - Assertions.assertEquals("lpijnkrxfrd", model.value().get(0).properties().description()); - Assertions.assertEquals(true, model.value().get(0).properties().isArchived()); - Assertions.assertEquals(DataType.URI_FILE, model.value().get(0).properties().dataType()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainersCreateOrUpdateWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainersCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index c21fbede1d469..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainersCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.DataContainer; -import com.azure.resourcemanager.machinelearning.models.DataContainerProperties; -import com.azure.resourcemanager.machinelearning.models.DataType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DataContainersCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"dataType\":\"mltable\",\"isArchived\":false,\"latestVersion\":\"kc\",\"nextVersion\":\"gzkj\",\"description\":\"qpdwad\",\"properties\":{\"qymjzucwwmejjqhd\":\"ztldsvczdjiah\"},\"tags\":{\"yfozkbnzxbypfqp\":\"mqxiyoo\",\"r\":\"aix\"}},\"id\":\"kkderfrswq\",\"name\":\"kwepwo\",\"type\":\"ggicwnxhtfmcqbs\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DataContainer response = - manager - .dataContainers() - .define("yizwbxgdebxla") - .withExistingWorkspace("ddtgctxegtvgwy", "rbelfnzz") - .withProperties( - new DataContainerProperties() - .withDescription("cpjs") - .withProperties( - mapOf("cucsqsnxfbxu", "em", "su", "eapdrbzyv", "hmhjd", "dulpodkaxpfobk", "eluqr", "lt")) - .withTags(mapOf("srkgz", "dhfztlra", "dbkuwpzqxlcwe", "yh", "qufqizj", "kfecjvxf")) - .withIsArchived(false) - .withDataType(DataType.URI_FOLDER)) - .create(); - - Assertions.assertEquals("qpdwad", response.properties().description()); - Assertions.assertEquals("ztldsvczdjiah", response.properties().properties().get("qymjzucwwmejjqhd")); - Assertions.assertEquals("mqxiyoo", response.properties().tags().get("yfozkbnzxbypfqp")); - Assertions.assertEquals(false, response.properties().isArchived()); - Assertions.assertEquals(DataType.MLTABLE, response.properties().dataType()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainersDeleteWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainersDeleteWithResponseMockTests.java deleted file mode 100644 index 3db0566ca853b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainersDeleteWithResponseMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DataContainersDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.dataContainers().deleteWithResponse("zx", "kn", "fdrld", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainersGetWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainersGetWithResponseMockTests.java deleted file mode 100644 index 49bf49716b24d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainersGetWithResponseMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.DataContainer; -import com.azure.resourcemanager.machinelearning.models.DataType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DataContainersGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"dataType\":\"uri_file\",\"isArchived\":false,\"latestVersion\":\"zcsozjvxdz\",\"nextVersion\":\"ggbnvtxo\",\"description\":\"alzyxwhoeamo\",\"properties\":{\"fpnimtwuuhaueg\":\"doey\",\"zjy\":\"kwmnfeub\"},\"tags\":{\"nqd\":\"fugiphrrkuu\",\"opueo\":\"rhzz\"}},\"id\":\"svwlujop\",\"name\":\"nibittoztjdqumq\",\"type\":\"fmwc\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DataContainer response = - manager - .dataContainers() - .getWithResponse("yehi", "ittugyu", "wrldax", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("alzyxwhoeamo", response.properties().description()); - Assertions.assertEquals("doey", response.properties().properties().get("fpnimtwuuhaueg")); - Assertions.assertEquals("fugiphrrkuu", response.properties().tags().get("nqd")); - Assertions.assertEquals(false, response.properties().isArchived()); - Assertions.assertEquals(DataType.URI_FILE, response.properties().dataType()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainersListMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainersListMockTests.java deleted file mode 100644 index de0d56c7ab37e..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataContainersListMockTests.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.DataContainer; -import com.azure.resourcemanager.machinelearning.models.DataType; -import com.azure.resourcemanager.machinelearning.models.ListViewType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DataContainersListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"dataType\":\"mltable\",\"isArchived\":false,\"latestVersion\":\"yeyzm\",\"nextVersion\":\"sqc\",\"description\":\"nxlzbuwodmach\",\"properties\":{\"rmvgoqplehmumkz\":\"nrpb\",\"prwnhkgqggoxsst\":\"llcz\",\"cwmhlymgnukxrk\":\"ivrakfrryn\"},\"tags\":{\"clakku\":\"pequlrlzaudgjtf\",\"toucgj\":\"ddwnhczb\",\"slvlizedvb\":\"irjwayhicqqwwvgw\",\"srgekzyqxadyfhb\":\"abv\"}},\"id\":\"khojqttbspvk\",\"name\":\"glaqjsg\",\"type\":\"zstuj\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .dataContainers() - .list( - "itcdqlhchwhrk", - "jlei", - "ibfiplhxfnsm", - ListViewType.ARCHIVED_ONLY, - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("nxlzbuwodmach", response.iterator().next().properties().description()); - Assertions.assertEquals("nrpb", response.iterator().next().properties().properties().get("rmvgoqplehmumkz")); - Assertions.assertEquals("pequlrlzaudgjtf", response.iterator().next().properties().tags().get("clakku")); - Assertions.assertEquals(false, response.iterator().next().properties().isArchived()); - Assertions.assertEquals(DataType.MLTABLE, response.iterator().next().properties().dataType()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataFactoryTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataFactoryTests.java deleted file mode 100644 index d24b30e51dd2f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataFactoryTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.DataFactory; -import org.junit.jupiter.api.Assertions; - -public final class DataFactoryTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataFactory model = - BinaryData - .fromString( - "{\"computeType\":\"DataFactory\",\"computeLocation\":\"anurnnqb\",\"provisioningState\":\"Unknown\",\"description\":\"izxqltgrd\",\"createdOn\":\"2021-08-08T02:29:28Z\",\"modifiedOn\":\"2021-03-28T12:05:51Z\",\"resourceId\":\"x\",\"provisioningErrors\":[],\"isAttachedCompute\":true,\"disableLocalAuth\":false}") - .toObject(DataFactory.class); - Assertions.assertEquals("anurnnqb", model.computeLocation()); - Assertions.assertEquals("izxqltgrd", model.description()); - Assertions.assertEquals("x", model.resourceId()); - Assertions.assertEquals(false, model.disableLocalAuth()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataFactory model = - new DataFactory() - .withComputeLocation("anurnnqb") - .withDescription("izxqltgrd") - .withResourceId("x") - .withDisableLocalAuth(false); - model = BinaryData.fromObject(model).toObject(DataFactory.class); - Assertions.assertEquals("anurnnqb", model.computeLocation()); - Assertions.assertEquals("izxqltgrd", model.description()); - Assertions.assertEquals("x", model.resourceId()); - Assertions.assertEquals(false, model.disableLocalAuth()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataLakeAnalyticsSchemaPropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataLakeAnalyticsSchemaPropertiesTests.java deleted file mode 100644 index dd2067f2876c0..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataLakeAnalyticsSchemaPropertiesTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.DataLakeAnalyticsSchemaProperties; -import org.junit.jupiter.api.Assertions; - -public final class DataLakeAnalyticsSchemaPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataLakeAnalyticsSchemaProperties model = - BinaryData - .fromString("{\"dataLakeStoreAccountName\":\"b\"}") - .toObject(DataLakeAnalyticsSchemaProperties.class); - Assertions.assertEquals("b", model.dataLakeStoreAccountName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataLakeAnalyticsSchemaProperties model = - new DataLakeAnalyticsSchemaProperties().withDataLakeStoreAccountName("b"); - model = BinaryData.fromObject(model).toObject(DataLakeAnalyticsSchemaProperties.class); - Assertions.assertEquals("b", model.dataLakeStoreAccountName()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataLakeAnalyticsSchemaTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataLakeAnalyticsSchemaTests.java deleted file mode 100644 index 5529cf53c492c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataLakeAnalyticsSchemaTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.DataLakeAnalyticsSchema; -import com.azure.resourcemanager.machinelearning.models.DataLakeAnalyticsSchemaProperties; -import org.junit.jupiter.api.Assertions; - -public final class DataLakeAnalyticsSchemaTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataLakeAnalyticsSchema model = - BinaryData - .fromString("{\"properties\":{\"dataLakeStoreAccountName\":\"mg\"}}") - .toObject(DataLakeAnalyticsSchema.class); - Assertions.assertEquals("mg", model.properties().dataLakeStoreAccountName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataLakeAnalyticsSchema model = - new DataLakeAnalyticsSchema() - .withProperties(new DataLakeAnalyticsSchemaProperties().withDataLakeStoreAccountName("mg")); - model = BinaryData.fromObject(model).toObject(DataLakeAnalyticsSchema.class); - Assertions.assertEquals("mg", model.properties().dataLakeStoreAccountName()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataLakeAnalyticsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataLakeAnalyticsTests.java deleted file mode 100644 index 3f98d4cf05ae7..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataLakeAnalyticsTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.DataLakeAnalytics; -import com.azure.resourcemanager.machinelearning.models.DataLakeAnalyticsSchemaProperties; -import org.junit.jupiter.api.Assertions; - -public final class DataLakeAnalyticsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataLakeAnalytics model = - BinaryData - .fromString( - "{\"computeType\":\"DataLakeAnalytics\",\"properties\":{\"dataLakeStoreAccountName\":\"wrxaomzisg\"},\"computeLocation\":\"rczezkhhlt\",\"provisioningState\":\"Deleting\",\"description\":\"hqo\",\"createdOn\":\"2021-11-21T17:40:44Z\",\"modifiedOn\":\"2021-08-05T21:29:34Z\",\"resourceId\":\"ueayfbpcmsplb\",\"provisioningErrors\":[],\"isAttachedCompute\":false,\"disableLocalAuth\":true}") - .toObject(DataLakeAnalytics.class); - Assertions.assertEquals("rczezkhhlt", model.computeLocation()); - Assertions.assertEquals("hqo", model.description()); - Assertions.assertEquals("ueayfbpcmsplb", model.resourceId()); - Assertions.assertEquals(true, model.disableLocalAuth()); - Assertions.assertEquals("wrxaomzisg", model.properties().dataLakeStoreAccountName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataLakeAnalytics model = - new DataLakeAnalytics() - .withComputeLocation("rczezkhhlt") - .withDescription("hqo") - .withResourceId("ueayfbpcmsplb") - .withDisableLocalAuth(true) - .withProperties(new DataLakeAnalyticsSchemaProperties().withDataLakeStoreAccountName("wrxaomzisg")); - model = BinaryData.fromObject(model).toObject(DataLakeAnalytics.class); - Assertions.assertEquals("rczezkhhlt", model.computeLocation()); - Assertions.assertEquals("hqo", model.description()); - Assertions.assertEquals("ueayfbpcmsplb", model.resourceId()); - Assertions.assertEquals(true, model.disableLocalAuth()); - Assertions.assertEquals("wrxaomzisg", model.properties().dataLakeStoreAccountName()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataPathAssetReferenceTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataPathAssetReferenceTests.java deleted file mode 100644 index 88749f1779a12..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataPathAssetReferenceTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.DataPathAssetReference; -import org.junit.jupiter.api.Assertions; - -public final class DataPathAssetReferenceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataPathAssetReference model = - BinaryData - .fromString( - "{\"referenceType\":\"DataPath\",\"datastoreId\":\"uwxeoiojfizf\",\"path\":\"kjzwfbcyayk\"}") - .toObject(DataPathAssetReference.class); - Assertions.assertEquals("uwxeoiojfizf", model.datastoreId()); - Assertions.assertEquals("kjzwfbcyayk", model.path()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataPathAssetReference model = - new DataPathAssetReference().withDatastoreId("uwxeoiojfizf").withPath("kjzwfbcyayk"); - model = BinaryData.fromObject(model).toObject(DataPathAssetReference.class); - Assertions.assertEquals("uwxeoiojfizf", model.datastoreId()); - Assertions.assertEquals("kjzwfbcyayk", model.path()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionBaseInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionBaseInnerTests.java deleted file mode 100644 index 33fbb9af69258..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionBaseInnerTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.DataVersionBaseInner; -import com.azure.resourcemanager.machinelearning.models.DataVersionBaseProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DataVersionBaseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataVersionBaseInner model = - BinaryData - .fromString( - "{\"properties\":{\"dataType\":\"DataVersionBaseProperties\",\"dataUri\":\"vpkjpr\",\"isAnonymous\":true,\"isArchived\":false,\"description\":\"ql\",\"properties\":{\"dshmkxmaehvbbx\":\"gtczheydb\"},\"tags\":{\"kgxywr\":\"pltfnhtba\"}},\"id\":\"pyklyhpluodpvru\",\"name\":\"dlgzibthostgkt\",\"type\":\"tvdxeclzedqb\"}") - .toObject(DataVersionBaseInner.class); - Assertions.assertEquals("ql", model.properties().description()); - Assertions.assertEquals("gtczheydb", model.properties().properties().get("dshmkxmaehvbbx")); - Assertions.assertEquals("pltfnhtba", model.properties().tags().get("kgxywr")); - Assertions.assertEquals(true, model.properties().isAnonymous()); - Assertions.assertEquals(false, model.properties().isArchived()); - Assertions.assertEquals("vpkjpr", model.properties().dataUri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataVersionBaseInner model = - new DataVersionBaseInner() - .withProperties( - new DataVersionBaseProperties() - .withDescription("ql") - .withProperties(mapOf("dshmkxmaehvbbx", "gtczheydb")) - .withTags(mapOf("kgxywr", "pltfnhtba")) - .withIsAnonymous(true) - .withIsArchived(false) - .withDataUri("vpkjpr")); - model = BinaryData.fromObject(model).toObject(DataVersionBaseInner.class); - Assertions.assertEquals("ql", model.properties().description()); - Assertions.assertEquals("gtczheydb", model.properties().properties().get("dshmkxmaehvbbx")); - Assertions.assertEquals("pltfnhtba", model.properties().tags().get("kgxywr")); - Assertions.assertEquals(true, model.properties().isAnonymous()); - Assertions.assertEquals(false, model.properties().isArchived()); - Assertions.assertEquals("vpkjpr", model.properties().dataUri()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionBasePropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionBasePropertiesTests.java deleted file mode 100644 index 4067e2dd17217..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionBasePropertiesTests.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.DataVersionBaseProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DataVersionBasePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataVersionBaseProperties model = - BinaryData - .fromString( - "{\"dataType\":\"DataVersionBaseProperties\",\"dataUri\":\"vh\",\"isAnonymous\":false,\"isArchived\":true,\"description\":\"dqkdlwwqfbu\",\"properties\":{\"lmbtxhwgfwsrt\":\"xtrqjfs\",\"kh\":\"wcoezbrhub\"},\"tags\":{\"kkqfqjbvle\":\"goo\"}}") - .toObject(DataVersionBaseProperties.class); - Assertions.assertEquals("dqkdlwwqfbu", model.description()); - Assertions.assertEquals("xtrqjfs", model.properties().get("lmbtxhwgfwsrt")); - Assertions.assertEquals("goo", model.tags().get("kkqfqjbvle")); - Assertions.assertEquals(false, model.isAnonymous()); - Assertions.assertEquals(true, model.isArchived()); - Assertions.assertEquals("vh", model.dataUri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataVersionBaseProperties model = - new DataVersionBaseProperties() - .withDescription("dqkdlwwqfbu") - .withProperties(mapOf("lmbtxhwgfwsrt", "xtrqjfs", "kh", "wcoezbrhub")) - .withTags(mapOf("kkqfqjbvle", "goo")) - .withIsAnonymous(false) - .withIsArchived(true) - .withDataUri("vh"); - model = BinaryData.fromObject(model).toObject(DataVersionBaseProperties.class); - Assertions.assertEquals("dqkdlwwqfbu", model.description()); - Assertions.assertEquals("xtrqjfs", model.properties().get("lmbtxhwgfwsrt")); - Assertions.assertEquals("goo", model.tags().get("kkqfqjbvle")); - Assertions.assertEquals(false, model.isAnonymous()); - Assertions.assertEquals(true, model.isArchived()); - Assertions.assertEquals("vh", model.dataUri()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionBaseResourceArmPaginatedResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionBaseResourceArmPaginatedResultTests.java deleted file mode 100644 index c498cc1b9ac60..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionBaseResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.DataVersionBaseInner; -import com.azure.resourcemanager.machinelearning.models.DataVersionBaseProperties; -import com.azure.resourcemanager.machinelearning.models.DataVersionBaseResourceArmPaginatedResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DataVersionBaseResourceArmPaginatedResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataVersionBaseResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"nextLink\":\"qntcypsxjvfoimwk\",\"value\":[{\"properties\":{\"dataType\":\"DataVersionBaseProperties\",\"dataUri\":\"rcizjxvyd\",\"isAnonymous\":false,\"isArchived\":false,\"description\":\"lhvygdyftu\",\"properties\":{},\"tags\":{}},\"id\":\"nawjslbiwkojgcy\",\"name\":\"tsf\",\"type\":\"z\"},{\"properties\":{\"dataType\":\"DataVersionBaseProperties\",\"dataUri\":\"baeqphc\",\"isAnonymous\":false,\"isArchived\":false,\"description\":\"pxehuwrykqga\",\"properties\":{},\"tags\":{}},\"id\":\"iklbydvkhb\",\"name\":\"jdz\",\"type\":\"xcv\"},{\"properties\":{\"dataType\":\"DataVersionBaseProperties\",\"dataUri\":\"srhnjivo\",\"isAnonymous\":true,\"isArchived\":false,\"description\":\"qfzgemjdftul\",\"properties\":{},\"tags\":{}},\"id\":\"ucea\",\"name\":\"tmczuomejwcwwqi\",\"type\":\"knssxmojm\"}]}") - .toObject(DataVersionBaseResourceArmPaginatedResult.class); - Assertions.assertEquals("qntcypsxjvfoimwk", model.nextLink()); - Assertions.assertEquals("lhvygdyftu", model.value().get(0).properties().description()); - Assertions.assertEquals(false, model.value().get(0).properties().isAnonymous()); - Assertions.assertEquals(false, model.value().get(0).properties().isArchived()); - Assertions.assertEquals("rcizjxvyd", model.value().get(0).properties().dataUri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataVersionBaseResourceArmPaginatedResult model = - new DataVersionBaseResourceArmPaginatedResult() - .withNextLink("qntcypsxjvfoimwk") - .withValue( - Arrays - .asList( - new DataVersionBaseInner() - .withProperties( - new DataVersionBaseProperties() - .withDescription("lhvygdyftu") - .withProperties(mapOf()) - .withTags(mapOf()) - .withIsAnonymous(false) - .withIsArchived(false) - .withDataUri("rcizjxvyd")), - new DataVersionBaseInner() - .withProperties( - new DataVersionBaseProperties() - .withDescription("pxehuwrykqga") - .withProperties(mapOf()) - .withTags(mapOf()) - .withIsAnonymous(false) - .withIsArchived(false) - .withDataUri("baeqphc")), - new DataVersionBaseInner() - .withProperties( - new DataVersionBaseProperties() - .withDescription("qfzgemjdftul") - .withProperties(mapOf()) - .withTags(mapOf()) - .withIsAnonymous(true) - .withIsArchived(false) - .withDataUri("srhnjivo")))); - model = BinaryData.fromObject(model).toObject(DataVersionBaseResourceArmPaginatedResult.class); - Assertions.assertEquals("qntcypsxjvfoimwk", model.nextLink()); - Assertions.assertEquals("lhvygdyftu", model.value().get(0).properties().description()); - Assertions.assertEquals(false, model.value().get(0).properties().isAnonymous()); - Assertions.assertEquals(false, model.value().get(0).properties().isArchived()); - Assertions.assertEquals("rcizjxvyd", model.value().get(0).properties().dataUri()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsCreateOrUpdateWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 627299b201b6d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.DataVersionBase; -import com.azure.resourcemanager.machinelearning.models.DataVersionBaseProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DataVersionsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"dataType\":\"DataVersionBaseProperties\",\"dataUri\":\"sx\",\"isAnonymous\":true,\"isArchived\":true,\"description\":\"orimmo\",\"properties\":{\"kkmvhzfovanyrva\":\"de\",\"ewikfyaqandmym\":\"rtgelg\"},\"tags\":{\"bpbvzopaxmf\":\"qjumovs\",\"faxdtnqifbsa\":\"vsmcwo\"}},\"id\":\"oiauesugmocpcj\",\"name\":\"cboe\",\"type\":\"rgttw\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DataVersionBase response = - manager - .dataVersions() - .define("qich") - .withExistingData("vdhgjnaqyqip", "lzmvcdsvmwbi", "ekdtfobvfiyb") - .withProperties( - new DataVersionBaseProperties() - .withDescription("ulrqtbht") - .withProperties(mapOf("ryfmxmdu", "pzl", "giln", "zf")) - .withTags( - mapOf( - "qqyeqfcb", - "ccgndjgdprig", - "fsh", - "ulpyuflq", - "klkqnqvkixnmb", - "ujcyohigimwdc", - "zayspzvriet", - "mecuyrzwim")) - .withIsAnonymous(true) - .withIsArchived(true) - .withDataUri("ybfzdqekivycp")) - .create(); - - Assertions.assertEquals("orimmo", response.properties().description()); - Assertions.assertEquals("de", response.properties().properties().get("kkmvhzfovanyrva")); - Assertions.assertEquals("qjumovs", response.properties().tags().get("bpbvzopaxmf")); - Assertions.assertEquals(true, response.properties().isAnonymous()); - Assertions.assertEquals(true, response.properties().isArchived()); - Assertions.assertEquals("sx", response.properties().dataUri()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsDeleteWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsDeleteWithResponseMockTests.java deleted file mode 100644 index fe4af1524ea9a..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DataVersionsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .dataVersions() - .deleteWithResponse( - "qrxqwqnjx", "dfddtullygtav", "zcxdfweapyfmlxrl", "phraspifleim", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsGetWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsGetWithResponseMockTests.java deleted file mode 100644 index 32ac248ee912f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsGetWithResponseMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.DataVersionBase; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DataVersionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"dataType\":\"DataVersionBaseProperties\",\"dataUri\":\"mtznpaxwfqtyyqi\",\"isAnonymous\":true,\"isArchived\":true,\"description\":\"ngbso\",\"properties\":{\"zbkuckgkdsksw\":\"kmii\",\"woykdnonaaxwm\":\"iiqqcqikclsmalns\"},\"tags\":{\"q\":\"ujlqcwnynlle\"}},\"id\":\"bgvsbtsertoxadh\",\"name\":\"uvjhxmnrqstjc\",\"type\":\"etwmlgicvnp\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DataVersionBase response = - manager - .dataVersions() - .getWithResponse("x", "mdbgi", "ehfgsm", "rjuqbpxtokl", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("ngbso", response.properties().description()); - Assertions.assertEquals("kmii", response.properties().properties().get("zbkuckgkdsksw")); - Assertions.assertEquals("ujlqcwnynlle", response.properties().tags().get("q")); - Assertions.assertEquals(true, response.properties().isAnonymous()); - Assertions.assertEquals(true, response.properties().isArchived()); - Assertions.assertEquals("mtznpaxwfqtyyqi", response.properties().dataUri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsListMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsListMockTests.java deleted file mode 100644 index f5a6b45c3561c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DataVersionsListMockTests.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.DataVersionBase; -import com.azure.resourcemanager.machinelearning.models.ListViewType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DataVersionsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"dataType\":\"DataVersionBaseProperties\",\"dataUri\":\"pjyyqmkwlhvc\",\"isAnonymous\":true,\"isArchived\":true,\"description\":\"jk\",\"properties\":{\"uzmsxgam\":\"xrwzo\"},\"tags\":{\"j\":\"kwppthuzdprmimr\",\"xyemhkft\":\"poq\",\"tecloamfmxtll\":\"aew\"}},\"id\":\"tymqcnrrfijhggab\",\"name\":\"bgamklilirwd\",\"type\":\"ffhsdpzouhk\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .dataVersions() - .list( - "d", - "pgchzpgfqum", - "djxh", - "ghgodkynrceq", - 233157705, - "fdbdfmmxj", - "naj", - ListViewType.ACTIVE_ONLY, - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("jk", response.iterator().next().properties().description()); - Assertions.assertEquals("xrwzo", response.iterator().next().properties().properties().get("uzmsxgam")); - Assertions.assertEquals("kwppthuzdprmimr", response.iterator().next().properties().tags().get("j")); - Assertions.assertEquals(true, response.iterator().next().properties().isAnonymous()); - Assertions.assertEquals(true, response.iterator().next().properties().isArchived()); - Assertions.assertEquals("pjyyqmkwlhvc", response.iterator().next().properties().dataUri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DatastoreResourceArmPaginatedResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DatastoreResourceArmPaginatedResultTests.java deleted file mode 100644 index 3716ec3a07fac..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DatastoreResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.DatastoreInner; -import com.azure.resourcemanager.machinelearning.models.DatastoreProperties; -import com.azure.resourcemanager.machinelearning.models.DatastoreResourceArmPaginatedResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DatastoreResourceArmPaginatedResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatastoreResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"nextLink\":\"fmluiqtqzfavyvn\",\"value\":[{\"properties\":{\"datastoreType\":\"DatastoreProperties\",\"isDefault\":false,\"description\":\"yeua\",\"properties\":{},\"tags\":{}},\"id\":\"abqgzslesjcbh\",\"name\":\"rnntiewdjcv\",\"type\":\"quwrbehwag\"}]}") - .toObject(DatastoreResourceArmPaginatedResult.class); - Assertions.assertEquals("fmluiqtqzfavyvn", model.nextLink()); - Assertions.assertEquals("yeua", model.value().get(0).properties().description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatastoreResourceArmPaginatedResult model = - new DatastoreResourceArmPaginatedResult() - .withNextLink("fmluiqtqzfavyvn") - .withValue( - Arrays - .asList( - new DatastoreInner() - .withProperties( - new DatastoreProperties() - .withDescription("yeua") - .withProperties(mapOf()) - .withTags(mapOf())))); - model = BinaryData.fromObject(model).toObject(DatastoreResourceArmPaginatedResult.class); - Assertions.assertEquals("fmluiqtqzfavyvn", model.nextLink()); - Assertions.assertEquals("yeua", model.value().get(0).properties().description()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DatastoresDeleteWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DatastoresDeleteWithResponseMockTests.java deleted file mode 100644 index 0fdbce8dfb9d3..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DatastoresDeleteWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DatastoresDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .datastores() - .deleteWithResponse("bp", "nupoyryefqmwovyz", "xlnomfpbjcee", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DefaultScaleSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DefaultScaleSettingsTests.java deleted file mode 100644 index 6aebf34094fec..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DefaultScaleSettingsTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.DefaultScaleSettings; - -public final class DefaultScaleSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefaultScaleSettings model = - BinaryData.fromString("{\"scaleType\":\"Default\"}").toObject(DefaultScaleSettings.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefaultScaleSettings model = new DefaultScaleSettings(); - model = BinaryData.fromObject(model).toObject(DefaultScaleSettings.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DeploymentLogsInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DeploymentLogsInnerTests.java deleted file mode 100644 index 97597fc5b2a11..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DeploymentLogsInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.DeploymentLogsInner; -import org.junit.jupiter.api.Assertions; - -public final class DeploymentLogsInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeploymentLogsInner model = - BinaryData.fromString("{\"content\":\"jcxcjxgrytfmpcyc\"}").toObject(DeploymentLogsInner.class); - Assertions.assertEquals("jcxcjxgrytfmpcyc", model.content()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeploymentLogsInner model = new DeploymentLogsInner().withContent("jcxcjxgrytfmpcyc"); - model = BinaryData.fromObject(model).toObject(DeploymentLogsInner.class); - Assertions.assertEquals("jcxcjxgrytfmpcyc", model.content()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DeploymentLogsRequestTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DeploymentLogsRequestTests.java deleted file mode 100644 index 82ee2e9d4bd43..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DeploymentLogsRequestTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ContainerType; -import com.azure.resourcemanager.machinelearning.models.DeploymentLogsRequest; -import org.junit.jupiter.api.Assertions; - -public final class DeploymentLogsRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeploymentLogsRequest model = - BinaryData - .fromString("{\"containerType\":\"StorageInitializer\",\"tail\":304740778}") - .toObject(DeploymentLogsRequest.class); - Assertions.assertEquals(ContainerType.STORAGE_INITIALIZER, model.containerType()); - Assertions.assertEquals(304740778, model.tail()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeploymentLogsRequest model = - new DeploymentLogsRequest().withContainerType(ContainerType.STORAGE_INITIALIZER).withTail(304740778); - model = BinaryData.fromObject(model).toObject(DeploymentLogsRequest.class); - Assertions.assertEquals(ContainerType.STORAGE_INITIALIZER, model.containerType()); - Assertions.assertEquals(304740778, model.tail()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DeploymentResourceConfigurationTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DeploymentResourceConfigurationTests.java deleted file mode 100644 index ec591bc0c0ab7..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DeploymentResourceConfigurationTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.DeploymentResourceConfiguration; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DeploymentResourceConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeploymentResourceConfiguration model = - BinaryData - .fromString( - "{\"instanceCount\":1806206586,\"instanceType\":\"dcfhucqdpf\",\"properties\":{\"vudutncor\":\"datalsbjjcanvxbv\",\"xqtvcofu\":\"datar\"}}") - .toObject(DeploymentResourceConfiguration.class); - Assertions.assertEquals(1806206586, model.instanceCount()); - Assertions.assertEquals("dcfhucqdpf", model.instanceType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeploymentResourceConfiguration model = - new DeploymentResourceConfiguration() - .withInstanceCount(1806206586) - .withInstanceType("dcfhucqdpf") - .withProperties(mapOf("vudutncor", "datalsbjjcanvxbv", "xqtvcofu", "datar")); - model = BinaryData.fromObject(model).toObject(DeploymentResourceConfiguration.class); - Assertions.assertEquals(1806206586, model.instanceCount()); - Assertions.assertEquals("dcfhucqdpf", model.instanceType()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DistributionConfigurationTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DistributionConfigurationTests.java deleted file mode 100644 index 79a8c8e054660..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/DistributionConfigurationTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.DistributionConfiguration; - -public final class DistributionConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DistributionConfiguration model = - BinaryData - .fromString("{\"distributionType\":\"DistributionConfiguration\"}") - .toObject(DistributionConfiguration.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DistributionConfiguration model = new DistributionConfiguration(); - model = BinaryData.fromObject(model).toObject(DistributionConfiguration.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EarlyTerminationPolicyTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EarlyTerminationPolicyTests.java deleted file mode 100644 index 48a697c830af2..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EarlyTerminationPolicyTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.EarlyTerminationPolicy; -import org.junit.jupiter.api.Assertions; - -public final class EarlyTerminationPolicyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EarlyTerminationPolicy model = - BinaryData - .fromString( - "{\"policyType\":\"EarlyTerminationPolicy\",\"delayEvaluation\":1491450827,\"evaluationInterval\":935954000}") - .toObject(EarlyTerminationPolicy.class); - Assertions.assertEquals(1491450827, model.delayEvaluation()); - Assertions.assertEquals(935954000, model.evaluationInterval()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EarlyTerminationPolicy model = - new EarlyTerminationPolicy().withDelayEvaluation(1491450827).withEvaluationInterval(935954000); - model = BinaryData.fromObject(model).toObject(EarlyTerminationPolicy.class); - Assertions.assertEquals(1491450827, model.delayEvaluation()); - Assertions.assertEquals(935954000, model.evaluationInterval()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EndpointScheduleActionTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EndpointScheduleActionTests.java deleted file mode 100644 index b2079ae77443a..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EndpointScheduleActionTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.EndpointScheduleAction; - -public final class EndpointScheduleActionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EndpointScheduleAction model = - BinaryData - .fromString("{\"actionType\":\"InvokeBatchEndpoint\",\"endpointInvocationDefinition\":\"datamfzsbf\"}") - .toObject(EndpointScheduleAction.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EndpointScheduleAction model = new EndpointScheduleAction().withEndpointInvocationDefinition("datamfzsbf"); - model = BinaryData.fromObject(model).toObject(EndpointScheduleAction.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainerInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainerInnerTests.java deleted file mode 100644 index 876683c15f202..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainerInnerTests.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentContainerInner; -import com.azure.resourcemanager.machinelearning.models.EnvironmentContainerProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class EnvironmentContainerInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnvironmentContainerInner model = - BinaryData - .fromString( - "{\"properties\":{\"isArchived\":false,\"latestVersion\":\"ulfgslqu\",\"nextVersion\":\"wdlenrdsut\",\"description\":\"bazpjuohmi\",\"properties\":{\"wpklvxw\":\"lnorwmdu\",\"epn\":\"ygdxpgpqchis\",\"fozauorsuk\":\"bjcrxgibbdaxco\"},\"tags\":{\"vnuuepzl\":\"bqplh\",\"vmnnrw\":\"phwzsoldweyuqdu\"}},\"id\":\"i\",\"name\":\"rk\",\"type\":\"alywjhhgdn\"}") - .toObject(EnvironmentContainerInner.class); - Assertions.assertEquals("bazpjuohmi", model.properties().description()); - Assertions.assertEquals("lnorwmdu", model.properties().properties().get("wpklvxw")); - Assertions.assertEquals("bqplh", model.properties().tags().get("vnuuepzl")); - Assertions.assertEquals(false, model.properties().isArchived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnvironmentContainerInner model = - new EnvironmentContainerInner() - .withProperties( - new EnvironmentContainerProperties() - .withDescription("bazpjuohmi") - .withProperties( - mapOf("wpklvxw", "lnorwmdu", "epn", "ygdxpgpqchis", "fozauorsuk", "bjcrxgibbdaxco")) - .withTags(mapOf("vnuuepzl", "bqplh", "vmnnrw", "phwzsoldweyuqdu")) - .withIsArchived(false)); - model = BinaryData.fromObject(model).toObject(EnvironmentContainerInner.class); - Assertions.assertEquals("bazpjuohmi", model.properties().description()); - Assertions.assertEquals("lnorwmdu", model.properties().properties().get("wpklvxw")); - Assertions.assertEquals("bqplh", model.properties().tags().get("vnuuepzl")); - Assertions.assertEquals(false, model.properties().isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainerPropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainerPropertiesTests.java deleted file mode 100644 index db15e9292ceee..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainerPropertiesTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.EnvironmentContainerProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class EnvironmentContainerPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnvironmentContainerProperties model = - BinaryData - .fromString( - "{\"isArchived\":false,\"latestVersion\":\"ivfomiloxgg\",\"nextVersion\":\"fi\",\"description\":\"dieuzaofj\",\"properties\":{\"ubiipuipwoqonma\":\"cyyysfgdot\"},\"tags\":{\"izsh\":\"k\"}}") - .toObject(EnvironmentContainerProperties.class); - Assertions.assertEquals("dieuzaofj", model.description()); - Assertions.assertEquals("cyyysfgdot", model.properties().get("ubiipuipwoqonma")); - Assertions.assertEquals("k", model.tags().get("izsh")); - Assertions.assertEquals(false, model.isArchived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnvironmentContainerProperties model = - new EnvironmentContainerProperties() - .withDescription("dieuzaofj") - .withProperties(mapOf("ubiipuipwoqonma", "cyyysfgdot")) - .withTags(mapOf("izsh", "k")) - .withIsArchived(false); - model = BinaryData.fromObject(model).toObject(EnvironmentContainerProperties.class); - Assertions.assertEquals("dieuzaofj", model.description()); - Assertions.assertEquals("cyyysfgdot", model.properties().get("ubiipuipwoqonma")); - Assertions.assertEquals("k", model.tags().get("izsh")); - Assertions.assertEquals(false, model.isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainerResourceArmPaginatedResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainerResourceArmPaginatedResultTests.java deleted file mode 100644 index f52bf87e95c97..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainerResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentContainerInner; -import com.azure.resourcemanager.machinelearning.models.EnvironmentContainerProperties; -import com.azure.resourcemanager.machinelearning.models.EnvironmentContainerResourceArmPaginatedResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class EnvironmentContainerResourceArmPaginatedResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnvironmentContainerResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"nextLink\":\"buffkmrqemvvhm\",\"value\":[{\"properties\":{\"isArchived\":true,\"latestVersion\":\"utacoe\",\"nextVersion\":\"vewzcj\",\"description\":\"m\",\"properties\":{},\"tags\":{}},\"id\":\"guaadraufactkahz\",\"name\":\"v\",\"type\":\"jjziuxxpsh\"}]}") - .toObject(EnvironmentContainerResourceArmPaginatedResult.class); - Assertions.assertEquals("buffkmrqemvvhm", model.nextLink()); - Assertions.assertEquals("m", model.value().get(0).properties().description()); - Assertions.assertEquals(true, model.value().get(0).properties().isArchived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnvironmentContainerResourceArmPaginatedResult model = - new EnvironmentContainerResourceArmPaginatedResult() - .withNextLink("buffkmrqemvvhm") - .withValue( - Arrays - .asList( - new EnvironmentContainerInner() - .withProperties( - new EnvironmentContainerProperties() - .withDescription("m") - .withProperties(mapOf()) - .withTags(mapOf()) - .withIsArchived(true)))); - model = BinaryData.fromObject(model).toObject(EnvironmentContainerResourceArmPaginatedResult.class); - Assertions.assertEquals("buffkmrqemvvhm", model.nextLink()); - Assertions.assertEquals("m", model.value().get(0).properties().description()); - Assertions.assertEquals(true, model.value().get(0).properties().isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersCreateOrUpdateWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 2b0670da2c8be..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.EnvironmentContainer; -import com.azure.resourcemanager.machinelearning.models.EnvironmentContainerProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class EnvironmentContainersCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"isArchived\":false,\"latestVersion\":\"jenvjeateaxx\",\"nextVersion\":\"xoxdjxldnaryyi\",\"description\":\"kd\",\"properties\":{\"zaledoyqxlunkf\":\"ndwdbvx\",\"oanpohrvm\":\"hmcxqqxmyzkl\",\"a\":\"rqra\",\"k\":\"ivznllas\"},\"tags\":{\"aihxjtgzgtaiywbq\":\"jqjpv\",\"mhljqlxspm\":\"roigbsfsgsaenwld\"}},\"id\":\"ctr\",\"name\":\"ldsxebuhsxrz\",\"type\":\"mgsdaluyckhefrbh\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - EnvironmentContainer response = - manager - .environmentContainers() - .define("vsolzwil") - .withExistingWorkspace("dofuckclb", "xlu") - .withProperties( - new EnvironmentContainerProperties() - .withDescription("dkktpmbmxbmbrwgz") - .withProperties(mapOf("hxsdplaumydmhwe", "jb", "xydgtokvqbvwg", "jf", "lhpses", "gwzpvxak")) - .withTags( - mapOf( - "goqg", - "amqiydvxcgdhy", - "spglq", - "oyqyxyjrcbqpb", - "tdahneaoovtyjzti", - "o", - "ekfsrm", - "fwjlof")) - .withIsArchived(false)) - .create(); - - Assertions.assertEquals("kd", response.properties().description()); - Assertions.assertEquals("ndwdbvx", response.properties().properties().get("zaledoyqxlunkf")); - Assertions.assertEquals("jqjpv", response.properties().tags().get("aihxjtgzgtaiywbq")); - Assertions.assertEquals(false, response.properties().isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersDeleteWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersDeleteWithResponseMockTests.java deleted file mode 100644 index 4fe0f354d62e5..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersDeleteWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class EnvironmentContainersDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .environmentContainers() - .deleteWithResponse("d", "fa", "rptvcshtkutzcttb", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersGetWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersGetWithResponseMockTests.java deleted file mode 100644 index b4f4b37be1a2a..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersGetWithResponseMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.EnvironmentContainer; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class EnvironmentContainersGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"isArchived\":false,\"latestVersion\":\"jirmuydgfttm\",\"nextVersion\":\"fgeoagfuoftnx\",\"description\":\"wxmdaj\",\"properties\":{\"gsevmdm\":\"g\",\"zljdnci\":\"enlrstgf\"},\"tags\":{\"cvucgytoxu\":\"vamyyznmrgcdo\",\"qmebgszplusdekpd\":\"httnzqs\",\"ssgpgvo\":\"z\",\"cwztlvvws\":\"yejidbdqzsqun\"}},\"id\":\"rkky\",\"name\":\"trepw\",\"type\":\"wfkcauxuvavcpf\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - EnvironmentContainer response = - manager - .environmentContainers() - .getWithResponse("gdirda", "m", "zjgcfjfx", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("wxmdaj", response.properties().description()); - Assertions.assertEquals("g", response.properties().properties().get("gsevmdm")); - Assertions.assertEquals("vamyyznmrgcdo", response.properties().tags().get("cvucgytoxu")); - Assertions.assertEquals(false, response.properties().isArchived()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersListMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersListMockTests.java deleted file mode 100644 index 8be28b3cf8d39..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentContainersListMockTests.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.EnvironmentContainer; -import com.azure.resourcemanager.machinelearning.models.ListViewType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class EnvironmentContainersListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"isArchived\":false,\"latestVersion\":\"ipsdudgcozzomehx\",\"nextVersion\":\"ntolamlb\",\"description\":\"uxkqllczipvwdt\",\"properties\":{\"kwx\":\"zdqiqdlrat\",\"lhpryjfzihuio\":\"auwxsuykznhrfgsl\",\"pajtfeyvkbd\":\"eo\",\"rhd\":\"dd\"},\"tags\":{\"zytijcx\":\"beuuqutkzwtjwwg\",\"qkkkbjuckcatuqbh\":\"nondegjdyd\"}},\"id\":\"wcnxtpzdlyseid\",\"name\":\"oa\",\"type\":\"atprytgrhzbq\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .environmentContainers() - .list( - "ddnvovbooqbmdq", - "xyglaetscflw", - "jdtlriefooyycux", - ListViewType.ACTIVE_ONLY, - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("uxkqllczipvwdt", response.iterator().next().properties().description()); - Assertions.assertEquals("zdqiqdlrat", response.iterator().next().properties().properties().get("kwx")); - Assertions.assertEquals("beuuqutkzwtjwwg", response.iterator().next().properties().tags().get("zytijcx")); - Assertions.assertEquals(false, response.iterator().next().properties().isArchived()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionInnerTests.java deleted file mode 100644 index a0f3ff3557bd1..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionInnerTests.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentVersionInner; -import com.azure.resourcemanager.machinelearning.models.AutoRebuildSetting; -import com.azure.resourcemanager.machinelearning.models.BuildContext; -import com.azure.resourcemanager.machinelearning.models.EnvironmentVersionProperties; -import com.azure.resourcemanager.machinelearning.models.InferenceContainerProperties; -import com.azure.resourcemanager.machinelearning.models.OperatingSystemType; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class EnvironmentVersionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnvironmentVersionInner model = - BinaryData - .fromString( - "{\"properties\":{\"autoRebuild\":\"OnBaseImageUpdate\",\"build\":{\"contextUri\":\"vizqzdwl\",\"dockerfilePath\":\"lyoupfgfbkju\"},\"condaFile\":\"yhgk\",\"environmentType\":\"Curated\",\"image\":\"sgow\",\"inferenceConfig\":{},\"osType\":\"Linux\",\"isAnonymous\":false,\"isArchived\":true,\"description\":\"bqactxtgzukx\",\"properties\":{\"tg\":\"m\",\"isavok\":\"qqxhrnxrxcpj\",\"azivjlfrqttbajl\":\"dzf\"},\"tags\":{\"dkqqfkuvscxkd\":\"nwxyiop\",\"oaz\":\"ligovibrxkpm\"}},\"id\":\"u\",\"name\":\"cbgoor\",\"type\":\"te\"}") - .toObject(EnvironmentVersionInner.class); - Assertions.assertEquals("bqactxtgzukx", model.properties().description()); - Assertions.assertEquals("m", model.properties().properties().get("tg")); - Assertions.assertEquals("nwxyiop", model.properties().tags().get("dkqqfkuvscxkd")); - Assertions.assertEquals(false, model.properties().isAnonymous()); - Assertions.assertEquals(true, model.properties().isArchived()); - Assertions.assertEquals(AutoRebuildSetting.ON_BASE_IMAGE_UPDATE, model.properties().autoRebuild()); - Assertions.assertEquals("vizqzdwl", model.properties().build().contextUri()); - Assertions.assertEquals("lyoupfgfbkju", model.properties().build().dockerfilePath()); - Assertions.assertEquals("yhgk", model.properties().condaFile()); - Assertions.assertEquals("sgow", model.properties().image()); - Assertions.assertEquals(OperatingSystemType.LINUX, model.properties().osType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnvironmentVersionInner model = - new EnvironmentVersionInner() - .withProperties( - new EnvironmentVersionProperties() - .withDescription("bqactxtgzukx") - .withProperties(mapOf("tg", "m", "isavok", "qqxhrnxrxcpj", "azivjlfrqttbajl", "dzf")) - .withTags(mapOf("dkqqfkuvscxkd", "nwxyiop", "oaz", "ligovibrxkpm")) - .withIsAnonymous(false) - .withIsArchived(true) - .withAutoRebuild(AutoRebuildSetting.ON_BASE_IMAGE_UPDATE) - .withBuild(new BuildContext().withContextUri("vizqzdwl").withDockerfilePath("lyoupfgfbkju")) - .withCondaFile("yhgk") - .withImage("sgow") - .withInferenceConfig(new InferenceContainerProperties()) - .withOsType(OperatingSystemType.LINUX)); - model = BinaryData.fromObject(model).toObject(EnvironmentVersionInner.class); - Assertions.assertEquals("bqactxtgzukx", model.properties().description()); - Assertions.assertEquals("m", model.properties().properties().get("tg")); - Assertions.assertEquals("nwxyiop", model.properties().tags().get("dkqqfkuvscxkd")); - Assertions.assertEquals(false, model.properties().isAnonymous()); - Assertions.assertEquals(true, model.properties().isArchived()); - Assertions.assertEquals(AutoRebuildSetting.ON_BASE_IMAGE_UPDATE, model.properties().autoRebuild()); - Assertions.assertEquals("vizqzdwl", model.properties().build().contextUri()); - Assertions.assertEquals("lyoupfgfbkju", model.properties().build().dockerfilePath()); - Assertions.assertEquals("yhgk", model.properties().condaFile()); - Assertions.assertEquals("sgow", model.properties().image()); - Assertions.assertEquals(OperatingSystemType.LINUX, model.properties().osType()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionPropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionPropertiesTests.java deleted file mode 100644 index 8e545095d6971..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionPropertiesTests.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AutoRebuildSetting; -import com.azure.resourcemanager.machinelearning.models.BuildContext; -import com.azure.resourcemanager.machinelearning.models.EnvironmentVersionProperties; -import com.azure.resourcemanager.machinelearning.models.InferenceContainerProperties; -import com.azure.resourcemanager.machinelearning.models.OperatingSystemType; -import com.azure.resourcemanager.machinelearning.models.Route; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class EnvironmentVersionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnvironmentVersionProperties model = - BinaryData - .fromString( - "{\"autoRebuild\":\"OnBaseImageUpdate\",\"build\":{\"contextUri\":\"hjxa\",\"dockerfilePath\":\"vjgsl\"},\"condaFile\":\"dilmyww\",\"environmentType\":\"UserCreated\",\"image\":\"xnyed\",\"inferenceConfig\":{\"livenessRoute\":{\"path\":\"yvudtjuewbci\",\"port\":1871891438},\"readinessRoute\":{\"path\":\"uwhcjyxccybv\",\"port\":436827826},\"scoringRoute\":{\"path\":\"akkud\",\"port\":417091375}},\"osType\":\"Linux\",\"isAnonymous\":true,\"isArchived\":false,\"description\":\"agst\",\"properties\":{\"gsj\":\"hpfkyrkdbdgi\",\"obaiyhddviaceg\":\"mnwqj\",\"ntfpmvmemfnc\":\"n\",\"xlllchp\":\"dwvvba\"},\"tags\":{\"jcswsmys\":\"zevwrdnhfukuv\",\"lerchpq\":\"uluqypfc\"}}") - .toObject(EnvironmentVersionProperties.class); - Assertions.assertEquals("agst", model.description()); - Assertions.assertEquals("hpfkyrkdbdgi", model.properties().get("gsj")); - Assertions.assertEquals("zevwrdnhfukuv", model.tags().get("jcswsmys")); - Assertions.assertEquals(true, model.isAnonymous()); - Assertions.assertEquals(false, model.isArchived()); - Assertions.assertEquals(AutoRebuildSetting.ON_BASE_IMAGE_UPDATE, model.autoRebuild()); - Assertions.assertEquals("hjxa", model.build().contextUri()); - Assertions.assertEquals("vjgsl", model.build().dockerfilePath()); - Assertions.assertEquals("dilmyww", model.condaFile()); - Assertions.assertEquals("xnyed", model.image()); - Assertions.assertEquals("yvudtjuewbci", model.inferenceConfig().livenessRoute().path()); - Assertions.assertEquals(1871891438, model.inferenceConfig().livenessRoute().port()); - Assertions.assertEquals("uwhcjyxccybv", model.inferenceConfig().readinessRoute().path()); - Assertions.assertEquals(436827826, model.inferenceConfig().readinessRoute().port()); - Assertions.assertEquals("akkud", model.inferenceConfig().scoringRoute().path()); - Assertions.assertEquals(417091375, model.inferenceConfig().scoringRoute().port()); - Assertions.assertEquals(OperatingSystemType.LINUX, model.osType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnvironmentVersionProperties model = - new EnvironmentVersionProperties() - .withDescription("agst") - .withProperties( - mapOf("gsj", "hpfkyrkdbdgi", "obaiyhddviaceg", "mnwqj", "ntfpmvmemfnc", "n", "xlllchp", "dwvvba")) - .withTags(mapOf("jcswsmys", "zevwrdnhfukuv", "lerchpq", "uluqypfc")) - .withIsAnonymous(true) - .withIsArchived(false) - .withAutoRebuild(AutoRebuildSetting.ON_BASE_IMAGE_UPDATE) - .withBuild(new BuildContext().withContextUri("hjxa").withDockerfilePath("vjgsl")) - .withCondaFile("dilmyww") - .withImage("xnyed") - .withInferenceConfig( - new InferenceContainerProperties() - .withLivenessRoute(new Route().withPath("yvudtjuewbci").withPort(1871891438)) - .withReadinessRoute(new Route().withPath("uwhcjyxccybv").withPort(436827826)) - .withScoringRoute(new Route().withPath("akkud").withPort(417091375))) - .withOsType(OperatingSystemType.LINUX); - model = BinaryData.fromObject(model).toObject(EnvironmentVersionProperties.class); - Assertions.assertEquals("agst", model.description()); - Assertions.assertEquals("hpfkyrkdbdgi", model.properties().get("gsj")); - Assertions.assertEquals("zevwrdnhfukuv", model.tags().get("jcswsmys")); - Assertions.assertEquals(true, model.isAnonymous()); - Assertions.assertEquals(false, model.isArchived()); - Assertions.assertEquals(AutoRebuildSetting.ON_BASE_IMAGE_UPDATE, model.autoRebuild()); - Assertions.assertEquals("hjxa", model.build().contextUri()); - Assertions.assertEquals("vjgsl", model.build().dockerfilePath()); - Assertions.assertEquals("dilmyww", model.condaFile()); - Assertions.assertEquals("xnyed", model.image()); - Assertions.assertEquals("yvudtjuewbci", model.inferenceConfig().livenessRoute().path()); - Assertions.assertEquals(1871891438, model.inferenceConfig().livenessRoute().port()); - Assertions.assertEquals("uwhcjyxccybv", model.inferenceConfig().readinessRoute().path()); - Assertions.assertEquals(436827826, model.inferenceConfig().readinessRoute().port()); - Assertions.assertEquals("akkud", model.inferenceConfig().scoringRoute().path()); - Assertions.assertEquals(417091375, model.inferenceConfig().scoringRoute().port()); - Assertions.assertEquals(OperatingSystemType.LINUX, model.osType()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionResourceArmPaginatedResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionResourceArmPaginatedResultTests.java deleted file mode 100644 index 7d0ac414f67a7..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.EnvironmentVersionInner; -import com.azure.resourcemanager.machinelearning.models.AutoRebuildSetting; -import com.azure.resourcemanager.machinelearning.models.EnvironmentVersionProperties; -import com.azure.resourcemanager.machinelearning.models.EnvironmentVersionResourceArmPaginatedResult; -import com.azure.resourcemanager.machinelearning.models.OperatingSystemType; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class EnvironmentVersionResourceArmPaginatedResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnvironmentVersionResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"nextLink\":\"cimpevfg\",\"value\":[{\"properties\":{\"autoRebuild\":\"Disabled\",\"condaFile\":\"bywdxsmicc\",\"environmentType\":\"Curated\",\"image\":\"scjfnyns\",\"osType\":\"Windows\",\"isAnonymous\":true,\"isArchived\":false,\"description\":\"qytibyowbblgyavu\",\"properties\":{},\"tags\":{}},\"id\":\"joxoism\",\"name\":\"ksbpimlqoljx\",\"type\":\"cgxxlxs\"}]}") - .toObject(EnvironmentVersionResourceArmPaginatedResult.class); - Assertions.assertEquals("cimpevfg", model.nextLink()); - Assertions.assertEquals("qytibyowbblgyavu", model.value().get(0).properties().description()); - Assertions.assertEquals(true, model.value().get(0).properties().isAnonymous()); - Assertions.assertEquals(false, model.value().get(0).properties().isArchived()); - Assertions.assertEquals(AutoRebuildSetting.DISABLED, model.value().get(0).properties().autoRebuild()); - Assertions.assertEquals("bywdxsmicc", model.value().get(0).properties().condaFile()); - Assertions.assertEquals("scjfnyns", model.value().get(0).properties().image()); - Assertions.assertEquals(OperatingSystemType.WINDOWS, model.value().get(0).properties().osType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnvironmentVersionResourceArmPaginatedResult model = - new EnvironmentVersionResourceArmPaginatedResult() - .withNextLink("cimpevfg") - .withValue( - Arrays - .asList( - new EnvironmentVersionInner() - .withProperties( - new EnvironmentVersionProperties() - .withDescription("qytibyowbblgyavu") - .withProperties(mapOf()) - .withTags(mapOf()) - .withIsAnonymous(true) - .withIsArchived(false) - .withAutoRebuild(AutoRebuildSetting.DISABLED) - .withCondaFile("bywdxsmicc") - .withImage("scjfnyns") - .withOsType(OperatingSystemType.WINDOWS)))); - model = BinaryData.fromObject(model).toObject(EnvironmentVersionResourceArmPaginatedResult.class); - Assertions.assertEquals("cimpevfg", model.nextLink()); - Assertions.assertEquals("qytibyowbblgyavu", model.value().get(0).properties().description()); - Assertions.assertEquals(true, model.value().get(0).properties().isAnonymous()); - Assertions.assertEquals(false, model.value().get(0).properties().isArchived()); - Assertions.assertEquals(AutoRebuildSetting.DISABLED, model.value().get(0).properties().autoRebuild()); - Assertions.assertEquals("bywdxsmicc", model.value().get(0).properties().condaFile()); - Assertions.assertEquals("scjfnyns", model.value().get(0).properties().image()); - Assertions.assertEquals(OperatingSystemType.WINDOWS, model.value().get(0).properties().osType()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsCreateOrUpdateWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 301d807f7f9ce..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.AutoRebuildSetting; -import com.azure.resourcemanager.machinelearning.models.BuildContext; -import com.azure.resourcemanager.machinelearning.models.EnvironmentVersion; -import com.azure.resourcemanager.machinelearning.models.EnvironmentVersionProperties; -import com.azure.resourcemanager.machinelearning.models.InferenceContainerProperties; -import com.azure.resourcemanager.machinelearning.models.OperatingSystemType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class EnvironmentVersionsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"autoRebuild\":\"OnBaseImageUpdate\",\"build\":{\"contextUri\":\"bkfukdljq\",\"dockerfilePath\":\"tsdyds\"},\"condaFile\":\"pafyalo\",\"environmentType\":\"Curated\",\"image\":\"izzn\",\"inferenceConfig\":{},\"osType\":\"Windows\",\"isAnonymous\":true,\"isArchived\":false,\"description\":\"fyjfd\",\"properties\":{\"qh\":\"yvndjokgwesym\",\"ujqbbgsimwejl\":\"qpfzlpejtznxlue\",\"bcpr\":\"bkbpjzobd\"},\"tags\":{\"awp\":\"kuhydtnaczkfwfat\"}},\"id\":\"skivdwgtqcu\",\"name\":\"ecsaaqgoqbdiu\",\"type\":\"csbskowkrbh\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - EnvironmentVersion response = - manager - .environmentVersions() - .define("wrqkza") - .withExistingEnvironment("h", "gsiqikvllr", "tpmglxkoikmtr") - .withProperties( - new EnvironmentVersionProperties() - .withDescription("sbvvdlsflxkqesdf") - .withProperties(mapOf("dklt", "bgzancoinmphymcq", "toj", "dhqnufbxweiib")) - .withTags( - mapOf( - "uaorhjk", - "nybydhuihaouwud", - "amqprlo", - "hwvumosqir", - "zcmtagelajdyolj", - "rugejcvjkjy", - "qfmzsizzhravrc", - "qy")) - .withIsAnonymous(true) - .withIsArchived(false) - .withAutoRebuild(AutoRebuildSetting.ON_BASE_IMAGE_UPDATE) - .withBuild(new BuildContext().withContextUri("mpa").withDockerfilePath("wzlweeprn")) - .withCondaFile("zltkaszfj") - .withImage("bduxapgrcq") - .withInferenceConfig(new InferenceContainerProperties()) - .withOsType(OperatingSystemType.WINDOWS)) - .create(); - - Assertions.assertEquals("fyjfd", response.properties().description()); - Assertions.assertEquals("yvndjokgwesym", response.properties().properties().get("qh")); - Assertions.assertEquals("kuhydtnaczkfwfat", response.properties().tags().get("awp")); - Assertions.assertEquals(true, response.properties().isAnonymous()); - Assertions.assertEquals(false, response.properties().isArchived()); - Assertions.assertEquals(AutoRebuildSetting.ON_BASE_IMAGE_UPDATE, response.properties().autoRebuild()); - Assertions.assertEquals("bkfukdljq", response.properties().build().contextUri()); - Assertions.assertEquals("tsdyds", response.properties().build().dockerfilePath()); - Assertions.assertEquals("pafyalo", response.properties().condaFile()); - Assertions.assertEquals("izzn", response.properties().image()); - Assertions.assertEquals(OperatingSystemType.WINDOWS, response.properties().osType()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsDeleteWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsDeleteWithResponseMockTests.java deleted file mode 100644 index 59dc400d4ad1e..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class EnvironmentVersionsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .environmentVersions() - .deleteWithResponse("hpyvdkgdet", "z", "canzb", "ekwuyckyvn", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsGetWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsGetWithResponseMockTests.java deleted file mode 100644 index 9af7a5f2564ed..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsGetWithResponseMockTests.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.AutoRebuildSetting; -import com.azure.resourcemanager.machinelearning.models.EnvironmentVersion; -import com.azure.resourcemanager.machinelearning.models.OperatingSystemType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class EnvironmentVersionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"autoRebuild\":\"OnBaseImageUpdate\",\"build\":{\"contextUri\":\"siecktybhj\",\"dockerfilePath\":\"idhhxomild\"},\"condaFile\":\"jxdugxwj\",\"environmentType\":\"Curated\",\"image\":\"qrslaate\",\"inferenceConfig\":{},\"osType\":\"Windows\",\"isAnonymous\":true,\"isArchived\":false,\"description\":\"wlxrhgt\",\"properties\":{\"korvvm\":\"tqqykbkkteozejog\",\"h\":\"mcofn\"},\"tags\":{\"li\":\"nosn\",\"z\":\"k\",\"etyalht\":\"j\",\"ttcucrcm\":\"mknazgbjbhrpgiq\"}},\"id\":\"ixpqj\",\"name\":\"wifhbksldttohq\",\"type\":\"lna\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - EnvironmentVersion response = - manager - .environmentVersions() - .getWithResponse("nsm", "ffiwjbctvbp", "ujqjtotdxp", "scsl", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("wlxrhgt", response.properties().description()); - Assertions.assertEquals("tqqykbkkteozejog", response.properties().properties().get("korvvm")); - Assertions.assertEquals("nosn", response.properties().tags().get("li")); - Assertions.assertEquals(true, response.properties().isAnonymous()); - Assertions.assertEquals(false, response.properties().isArchived()); - Assertions.assertEquals(AutoRebuildSetting.ON_BASE_IMAGE_UPDATE, response.properties().autoRebuild()); - Assertions.assertEquals("siecktybhj", response.properties().build().contextUri()); - Assertions.assertEquals("idhhxomild", response.properties().build().dockerfilePath()); - Assertions.assertEquals("jxdugxwj", response.properties().condaFile()); - Assertions.assertEquals("qrslaate", response.properties().image()); - Assertions.assertEquals(OperatingSystemType.WINDOWS, response.properties().osType()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsListMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsListMockTests.java deleted file mode 100644 index bb4f62f6016d0..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EnvironmentVersionsListMockTests.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.AutoRebuildSetting; -import com.azure.resourcemanager.machinelearning.models.EnvironmentVersion; -import com.azure.resourcemanager.machinelearning.models.ListViewType; -import com.azure.resourcemanager.machinelearning.models.OperatingSystemType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class EnvironmentVersionsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"autoRebuild\":\"OnBaseImageUpdate\",\"build\":{\"contextUri\":\"yljurkeposehqqyl\",\"dockerfilePath\":\"ctwjwdsdlzm\"},\"condaFile\":\"erxxxoteehkhowgo\",\"environmentType\":\"UserCreated\",\"image\":\"xowpcbapn\",\"inferenceConfig\":{},\"osType\":\"Windows\",\"isAnonymous\":true,\"isArchived\":true,\"description\":\"fey\",\"properties\":{\"jnmzp\":\"ocvvujexayglxrk\",\"ieidzlv\":\"slavxjfiuof\",\"ydv\":\"sqywjopacky\",\"izwgsoriobijeiyd\":\"kmfngpmillxgjs\"},\"tags\":{\"ybriop\":\"ynhbokayrg\",\"igsioctqkm\":\"weoftnorw\",\"xvzfffhtjnwos\":\"ja\",\"zqfcwrriomxee\":\"tfjxtvlx\"}},\"id\":\"yhjm\",\"name\":\"jiqegmxdbs\",\"type\":\"hc\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .environmentVersions() - .list( - "eu", - "rbgpxeb", - "ludca", - "tujraxdtpryjm", - 1855345037, - "nsewouxl", - ListViewType.ACTIVE_ONLY, - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("fey", response.iterator().next().properties().description()); - Assertions.assertEquals("ocvvujexayglxrk", response.iterator().next().properties().properties().get("jnmzp")); - Assertions.assertEquals("ynhbokayrg", response.iterator().next().properties().tags().get("ybriop")); - Assertions.assertEquals(true, response.iterator().next().properties().isAnonymous()); - Assertions.assertEquals(true, response.iterator().next().properties().isArchived()); - Assertions - .assertEquals( - AutoRebuildSetting.ON_BASE_IMAGE_UPDATE, response.iterator().next().properties().autoRebuild()); - Assertions.assertEquals("yljurkeposehqqyl", response.iterator().next().properties().build().contextUri()); - Assertions.assertEquals("ctwjwdsdlzm", response.iterator().next().properties().build().dockerfilePath()); - Assertions.assertEquals("erxxxoteehkhowgo", response.iterator().next().properties().condaFile()); - Assertions.assertEquals("xowpcbapn", response.iterator().next().properties().image()); - Assertions.assertEquals(OperatingSystemType.WINDOWS, response.iterator().next().properties().osType()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EstimatedVMPriceTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EstimatedVMPriceTests.java deleted file mode 100644 index 74cbfb4f49607..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EstimatedVMPriceTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.EstimatedVMPrice; -import com.azure.resourcemanager.machinelearning.models.VMPriceOSType; -import com.azure.resourcemanager.machinelearning.models.VMTier; -import org.junit.jupiter.api.Assertions; - -public final class EstimatedVMPriceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EstimatedVMPrice model = - BinaryData - .fromString("{\"retailPrice\":57.931778810567735,\"osType\":\"Linux\",\"vmTier\":\"LowPriority\"}") - .toObject(EstimatedVMPrice.class); - Assertions.assertEquals(57.931778810567735, model.retailPrice()); - Assertions.assertEquals(VMPriceOSType.LINUX, model.osType()); - Assertions.assertEquals(VMTier.LOW_PRIORITY, model.vmTier()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EstimatedVMPrice model = - new EstimatedVMPrice() - .withRetailPrice(57.931778810567735) - .withOsType(VMPriceOSType.LINUX) - .withVmTier(VMTier.LOW_PRIORITY); - model = BinaryData.fromObject(model).toObject(EstimatedVMPrice.class); - Assertions.assertEquals(57.931778810567735, model.retailPrice()); - Assertions.assertEquals(VMPriceOSType.LINUX, model.osType()); - Assertions.assertEquals(VMTier.LOW_PRIORITY, model.vmTier()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EstimatedVMPricesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EstimatedVMPricesTests.java deleted file mode 100644 index 5af3ad025fa0c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/EstimatedVMPricesTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.BillingCurrency; -import com.azure.resourcemanager.machinelearning.models.EstimatedVMPrice; -import com.azure.resourcemanager.machinelearning.models.EstimatedVMPrices; -import com.azure.resourcemanager.machinelearning.models.UnitOfMeasure; -import com.azure.resourcemanager.machinelearning.models.VMPriceOSType; -import com.azure.resourcemanager.machinelearning.models.VMTier; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class EstimatedVMPricesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EstimatedVMPrices model = - BinaryData - .fromString( - "{\"billingCurrency\":\"USD\",\"unitOfMeasure\":\"OneHour\",\"values\":[{\"retailPrice\":45.736942050047844,\"osType\":\"Windows\",\"vmTier\":\"LowPriority\"}]}") - .toObject(EstimatedVMPrices.class); - Assertions.assertEquals(BillingCurrency.USD, model.billingCurrency()); - Assertions.assertEquals(UnitOfMeasure.ONE_HOUR, model.unitOfMeasure()); - Assertions.assertEquals(45.736942050047844, model.values().get(0).retailPrice()); - Assertions.assertEquals(VMPriceOSType.WINDOWS, model.values().get(0).osType()); - Assertions.assertEquals(VMTier.LOW_PRIORITY, model.values().get(0).vmTier()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EstimatedVMPrices model = - new EstimatedVMPrices() - .withBillingCurrency(BillingCurrency.USD) - .withUnitOfMeasure(UnitOfMeasure.ONE_HOUR) - .withValues( - Arrays - .asList( - new EstimatedVMPrice() - .withRetailPrice(45.736942050047844) - .withOsType(VMPriceOSType.WINDOWS) - .withVmTier(VMTier.LOW_PRIORITY))); - model = BinaryData.fromObject(model).toObject(EstimatedVMPrices.class); - Assertions.assertEquals(BillingCurrency.USD, model.billingCurrency()); - Assertions.assertEquals(UnitOfMeasure.ONE_HOUR, model.unitOfMeasure()); - Assertions.assertEquals(45.736942050047844, model.values().get(0).retailPrice()); - Assertions.assertEquals(VMPriceOSType.WINDOWS, model.values().get(0).osType()); - Assertions.assertEquals(VMTier.LOW_PRIORITY, model.values().get(0).vmTier()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ExternalFqdnResponseInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ExternalFqdnResponseInnerTests.java deleted file mode 100644 index a75cd9b0fcc19..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ExternalFqdnResponseInnerTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.ExternalFqdnResponseInner; -import com.azure.resourcemanager.machinelearning.models.FqdnEndpoints; -import com.azure.resourcemanager.machinelearning.models.FqdnEndpointsProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ExternalFqdnResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExternalFqdnResponseInner model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"category\":\"jflcxog\",\"endpoints\":[]}},{\"properties\":{\"category\":\"nzmnsikvm\",\"endpoints\":[]}}]}") - .toObject(ExternalFqdnResponseInner.class); - Assertions.assertEquals("jflcxog", model.value().get(0).properties().category()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExternalFqdnResponseInner model = - new ExternalFqdnResponseInner() - .withValue( - Arrays - .asList( - new FqdnEndpoints() - .withProperties( - new FqdnEndpointsProperties() - .withCategory("jflcxog") - .withEndpoints(Arrays.asList())), - new FqdnEndpoints() - .withProperties( - new FqdnEndpointsProperties() - .withCategory("nzmnsikvm") - .withEndpoints(Arrays.asList())))); - model = BinaryData.fromObject(model).toObject(ExternalFqdnResponseInner.class); - Assertions.assertEquals("jflcxog", model.value().get(0).properties().category()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FeaturizationSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FeaturizationSettingsTests.java deleted file mode 100644 index f57fccd72e815..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FeaturizationSettingsTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.FeaturizationSettings; -import org.junit.jupiter.api.Assertions; - -public final class FeaturizationSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FeaturizationSettings model = - BinaryData.fromString("{\"datasetLanguage\":\"hwtbbaedorvvm\"}").toObject(FeaturizationSettings.class); - Assertions.assertEquals("hwtbbaedorvvm", model.datasetLanguage()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FeaturizationSettings model = new FeaturizationSettings().withDatasetLanguage("hwtbbaedorvvm"); - model = BinaryData.fromObject(model).toObject(FeaturizationSettings.class); - Assertions.assertEquals("hwtbbaedorvvm", model.datasetLanguage()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FlavorDataTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FlavorDataTests.java deleted file mode 100644 index 11c126dd5b978..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FlavorDataTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.FlavorData; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class FlavorDataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FlavorData model = - BinaryData - .fromString( - "{\"data\":{\"sdbccxjmonfdgnwn\":\"bdkelvidizo\",\"keifzzhmkdasv\":\"ypuuwwltvuqjctze\",\"cu\":\"lyhb\"}}") - .toObject(FlavorData.class); - Assertions.assertEquals("bdkelvidizo", model.data().get("sdbccxjmonfdgnwn")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FlavorData model = - new FlavorData() - .withData(mapOf("sdbccxjmonfdgnwn", "bdkelvidizo", "keifzzhmkdasv", "ypuuwwltvuqjctze", "cu", "lyhb")); - model = BinaryData.fromObject(model).toObject(FlavorData.class); - Assertions.assertEquals("bdkelvidizo", model.data().get("sdbccxjmonfdgnwn")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ForecastHorizonTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ForecastHorizonTests.java deleted file mode 100644 index ba53d60d641c0..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ForecastHorizonTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ForecastHorizon; - -public final class ForecastHorizonTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ForecastHorizon model = BinaryData.fromString("{\"mode\":\"ForecastHorizon\"}").toObject(ForecastHorizon.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ForecastHorizon model = new ForecastHorizon(); - model = BinaryData.fromObject(model).toObject(ForecastHorizon.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ForecastingSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ForecastingSettingsTests.java deleted file mode 100644 index bafd52e7516cd..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ForecastingSettingsTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.FeatureLags; -import com.azure.resourcemanager.machinelearning.models.ForecastHorizon; -import com.azure.resourcemanager.machinelearning.models.ForecastingSettings; -import com.azure.resourcemanager.machinelearning.models.Seasonality; -import com.azure.resourcemanager.machinelearning.models.ShortSeriesHandlingConfiguration; -import com.azure.resourcemanager.machinelearning.models.TargetAggregationFunction; -import com.azure.resourcemanager.machinelearning.models.TargetLags; -import com.azure.resourcemanager.machinelearning.models.TargetRollingWindowSize; -import com.azure.resourcemanager.machinelearning.models.UseStl; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ForecastingSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ForecastingSettings model = - BinaryData - .fromString( - "{\"countryOrRegionForHolidays\":\"thuqolyahluq\",\"cvStepSize\":608197313,\"featureLags\":\"Auto\",\"forecastHorizon\":{\"mode\":\"ForecastHorizon\"},\"frequency\":\"rjb\",\"seasonality\":{\"mode\":\"Seasonality\"},\"shortSeriesHandlingConfig\":\"None\",\"targetAggregateFunction\":\"None\",\"targetLags\":{\"mode\":\"TargetLags\"},\"targetRollingWindowSize\":{\"mode\":\"TargetRollingWindowSize\"},\"timeColumnName\":\"zvqqugdrftbcvexr\",\"timeSeriesIdColumnNames\":[\"uowtljvfwhrea\",\"khyxvrqtvbcz\",\"ulmdgglm\",\"pjpfseykgs\"],\"useStl\":\"Season\"}") - .toObject(ForecastingSettings.class); - Assertions.assertEquals("thuqolyahluq", model.countryOrRegionForHolidays()); - Assertions.assertEquals(608197313, model.cvStepSize()); - Assertions.assertEquals(FeatureLags.AUTO, model.featureLags()); - Assertions.assertEquals("rjb", model.frequency()); - Assertions.assertEquals(ShortSeriesHandlingConfiguration.NONE, model.shortSeriesHandlingConfig()); - Assertions.assertEquals(TargetAggregationFunction.NONE, model.targetAggregateFunction()); - Assertions.assertEquals("zvqqugdrftbcvexr", model.timeColumnName()); - Assertions.assertEquals("uowtljvfwhrea", model.timeSeriesIdColumnNames().get(0)); - Assertions.assertEquals(UseStl.SEASON, model.useStl()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ForecastingSettings model = - new ForecastingSettings() - .withCountryOrRegionForHolidays("thuqolyahluq") - .withCvStepSize(608197313) - .withFeatureLags(FeatureLags.AUTO) - .withForecastHorizon(new ForecastHorizon()) - .withFrequency("rjb") - .withSeasonality(new Seasonality()) - .withShortSeriesHandlingConfig(ShortSeriesHandlingConfiguration.NONE) - .withTargetAggregateFunction(TargetAggregationFunction.NONE) - .withTargetLags(new TargetLags()) - .withTargetRollingWindowSize(new TargetRollingWindowSize()) - .withTimeColumnName("zvqqugdrftbcvexr") - .withTimeSeriesIdColumnNames(Arrays.asList("uowtljvfwhrea", "khyxvrqtvbcz", "ulmdgglm", "pjpfseykgs")) - .withUseStl(UseStl.SEASON); - model = BinaryData.fromObject(model).toObject(ForecastingSettings.class); - Assertions.assertEquals("thuqolyahluq", model.countryOrRegionForHolidays()); - Assertions.assertEquals(608197313, model.cvStepSize()); - Assertions.assertEquals(FeatureLags.AUTO, model.featureLags()); - Assertions.assertEquals("rjb", model.frequency()); - Assertions.assertEquals(ShortSeriesHandlingConfiguration.NONE, model.shortSeriesHandlingConfig()); - Assertions.assertEquals(TargetAggregationFunction.NONE, model.targetAggregateFunction()); - Assertions.assertEquals("zvqqugdrftbcvexr", model.timeColumnName()); - Assertions.assertEquals("uowtljvfwhrea", model.timeSeriesIdColumnNames().get(0)); - Assertions.assertEquals(UseStl.SEASON, model.useStl()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ForecastingTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ForecastingTests.java deleted file mode 100644 index 3a4e3ae50a89e..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ForecastingTests.java +++ /dev/null @@ -1,268 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.BlockedTransformers; -import com.azure.resourcemanager.machinelearning.models.FeatureLags; -import com.azure.resourcemanager.machinelearning.models.FeaturizationMode; -import com.azure.resourcemanager.machinelearning.models.ForecastHorizon; -import com.azure.resourcemanager.machinelearning.models.Forecasting; -import com.azure.resourcemanager.machinelearning.models.ForecastingModels; -import com.azure.resourcemanager.machinelearning.models.ForecastingPrimaryMetrics; -import com.azure.resourcemanager.machinelearning.models.ForecastingSettings; -import com.azure.resourcemanager.machinelearning.models.ForecastingTrainingSettings; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.LogVerbosity; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import com.azure.resourcemanager.machinelearning.models.NCrossValidations; -import com.azure.resourcemanager.machinelearning.models.Seasonality; -import com.azure.resourcemanager.machinelearning.models.ShortSeriesHandlingConfiguration; -import com.azure.resourcemanager.machinelearning.models.StackEnsembleSettings; -import com.azure.resourcemanager.machinelearning.models.StackMetaLearnerType; -import com.azure.resourcemanager.machinelearning.models.TableVerticalFeaturizationSettings; -import com.azure.resourcemanager.machinelearning.models.TableVerticalLimitSettings; -import com.azure.resourcemanager.machinelearning.models.TargetAggregationFunction; -import com.azure.resourcemanager.machinelearning.models.TargetLags; -import com.azure.resourcemanager.machinelearning.models.TargetRollingWindowSize; -import com.azure.resourcemanager.machinelearning.models.UseStl; -import java.time.Duration; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ForecastingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Forecasting model = - BinaryData - .fromString( - "{\"taskType\":\"Forecasting\",\"forecastingSettings\":{\"countryOrRegionForHolidays\":\"zxmdew\",\"cvStepSize\":1373177035,\"featureLags\":\"Auto\",\"forecastHorizon\":{\"mode\":\"ForecastHorizon\"},\"frequency\":\"lbjazejww\",\"seasonality\":{\"mode\":\"Seasonality\"},\"shortSeriesHandlingConfig\":\"Pad\",\"targetAggregateFunction\":\"Min\",\"targetLags\":{\"mode\":\"TargetLags\"},\"targetRollingWindowSize\":{\"mode\":\"TargetRollingWindowSize\"},\"timeColumnName\":\"brnnhjxsqw\",\"timeSeriesIdColumnNames\":[\"kbiwetpozyc\",\"qiqyhgfsetzlexbs\"],\"useStl\":\"None\"},\"primaryMetric\":\"R2Score\",\"trainingSettings\":{\"allowedTrainingAlgorithms\":[\"GradientBoosting\",\"SeasonalNaive\"],\"blockedTrainingAlgorithms\":[\"RandomForest\",\"Arimax\",\"Arimax\",\"Prophet\"],\"enableDnnTraining\":true,\"enableModelExplainability\":false,\"enableOnnxCompatibleModels\":true,\"enableStackEnsemble\":false,\"enableVoteEnsemble\":false,\"ensembleModelDownloadTimeout\":\"PT225H4M15S\",\"stackEnsembleSettings\":{\"stackMetaLearnerKWargs\":\"datalpkpbafvafhl\",\"stackMetaLearnerTrainPercentage\":11.719010334787338,\"stackMetaLearnerType\":\"ElasticNet\"}},\"cvSplitColumnNames\":[\"xrhyzdfwrsofplt\"],\"featurizationSettings\":{\"blockedTransformers\":[\"WordEmbedding\",\"TextTargetEncoder\",\"TfIdf\",\"TfIdf\"],\"columnNameAndTypes\":{\"npq\":\"fnrac\",\"uuj\":\"g\"},\"enableDnnFeaturization\":false,\"mode\":\"Auto\",\"transformerParams\":{\"igrb\":[],\"xsjybvitvqk\":[],\"az\":[]},\"datasetLanguage\":\"mtggmu\"},\"limitSettings\":{\"enableEarlyTermination\":false,\"exitScore\":73.03774094829895,\"maxConcurrentTrials\":1401154430,\"maxCoresPerTrial\":737761166,\"maxTrials\":273920655,\"timeout\":\"PT29H11M39S\",\"trialTimeout\":\"PT238H15M11S\"},\"nCrossValidations\":{\"mode\":\"NCrossValidations\"},\"testData\":{\"jobInputType\":\"mltable\",\"mode\":\"ReadOnlyMount\",\"uri\":\"voaiknaqlnuw\",\"description\":\"uyxlykwphvxzcw\"},\"testDataSize\":14.530784309792832,\"validationData\":{\"jobInputType\":\"mltable\",\"mode\":\"EvalDownload\",\"uri\":\"lkexaonwivkcqh\",\"description\":\"hxknlccrmmkyupi\"},\"validationDataSize\":89.69731810693186,\"weightColumnName\":\"jfkakfqfrke\",\"logVerbosity\":\"Error\",\"targetColumnName\":\"dudxjascowvfdjk\",\"trainingData\":{\"jobInputType\":\"mltable\",\"mode\":\"Direct\",\"uri\":\"phlkksnm\",\"description\":\"vyfijdkzuqnw\"}}") - .toObject(Forecasting.class); - Assertions.assertEquals(LogVerbosity.ERROR, model.logVerbosity()); - Assertions.assertEquals("dudxjascowvfdjk", model.targetColumnName()); - Assertions.assertEquals("vyfijdkzuqnw", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.trainingData().mode()); - Assertions.assertEquals("phlkksnm", model.trainingData().uri()); - Assertions.assertEquals("zxmdew", model.forecastingSettings().countryOrRegionForHolidays()); - Assertions.assertEquals(1373177035, model.forecastingSettings().cvStepSize()); - Assertions.assertEquals(FeatureLags.AUTO, model.forecastingSettings().featureLags()); - Assertions.assertEquals("lbjazejww", model.forecastingSettings().frequency()); - Assertions - .assertEquals( - ShortSeriesHandlingConfiguration.PAD, model.forecastingSettings().shortSeriesHandlingConfig()); - Assertions.assertEquals(TargetAggregationFunction.MIN, model.forecastingSettings().targetAggregateFunction()); - Assertions.assertEquals("brnnhjxsqw", model.forecastingSettings().timeColumnName()); - Assertions.assertEquals("kbiwetpozyc", model.forecastingSettings().timeSeriesIdColumnNames().get(0)); - Assertions.assertEquals(UseStl.NONE, model.forecastingSettings().useStl()); - Assertions.assertEquals(ForecastingPrimaryMetrics.R2SCORE, model.primaryMetric()); - Assertions.assertEquals(true, model.trainingSettings().enableDnnTraining()); - Assertions.assertEquals(false, model.trainingSettings().enableModelExplainability()); - Assertions.assertEquals(true, model.trainingSettings().enableOnnxCompatibleModels()); - Assertions.assertEquals(false, model.trainingSettings().enableStackEnsemble()); - Assertions.assertEquals(false, model.trainingSettings().enableVoteEnsemble()); - Assertions.assertEquals(Duration.parse("PT225H4M15S"), model.trainingSettings().ensembleModelDownloadTimeout()); - Assertions - .assertEquals( - 11.719010334787338D, - model.trainingSettings().stackEnsembleSettings().stackMetaLearnerTrainPercentage()); - Assertions - .assertEquals( - StackMetaLearnerType.ELASTIC_NET, - model.trainingSettings().stackEnsembleSettings().stackMetaLearnerType()); - Assertions - .assertEquals( - ForecastingModels.GRADIENT_BOOSTING, model.trainingSettings().allowedTrainingAlgorithms().get(0)); - Assertions - .assertEquals(ForecastingModels.RANDOM_FOREST, model.trainingSettings().blockedTrainingAlgorithms().get(0)); - Assertions.assertEquals("xrhyzdfwrsofplt", model.cvSplitColumnNames().get(0)); - Assertions.assertEquals("mtggmu", model.featurizationSettings().datasetLanguage()); - Assertions - .assertEquals( - BlockedTransformers.WORD_EMBEDDING, model.featurizationSettings().blockedTransformers().get(0)); - Assertions.assertEquals("fnrac", model.featurizationSettings().columnNameAndTypes().get("npq")); - Assertions.assertEquals(false, model.featurizationSettings().enableDnnFeaturization()); - Assertions.assertEquals(FeaturizationMode.AUTO, model.featurizationSettings().mode()); - Assertions.assertEquals(false, model.limitSettings().enableEarlyTermination()); - Assertions.assertEquals(73.03774094829895D, model.limitSettings().exitScore()); - Assertions.assertEquals(1401154430, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(737761166, model.limitSettings().maxCoresPerTrial()); - Assertions.assertEquals(273920655, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT29H11M39S"), model.limitSettings().timeout()); - Assertions.assertEquals(Duration.parse("PT238H15M11S"), model.limitSettings().trialTimeout()); - Assertions.assertEquals("uyxlykwphvxzcw", model.testData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_ONLY_MOUNT, model.testData().mode()); - Assertions.assertEquals("voaiknaqlnuw", model.testData().uri()); - Assertions.assertEquals(14.530784309792832D, model.testDataSize()); - Assertions.assertEquals("hxknlccrmmkyupi", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_DOWNLOAD, model.validationData().mode()); - Assertions.assertEquals("lkexaonwivkcqh", model.validationData().uri()); - Assertions.assertEquals(89.69731810693186D, model.validationDataSize()); - Assertions.assertEquals("jfkakfqfrke", model.weightColumnName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Forecasting model = - new Forecasting() - .withLogVerbosity(LogVerbosity.ERROR) - .withTargetColumnName("dudxjascowvfdjk") - .withTrainingData( - new MLTableJobInput() - .withDescription("vyfijdkzuqnw") - .withMode(InputDeliveryMode.DIRECT) - .withUri("phlkksnm")) - .withForecastingSettings( - new ForecastingSettings() - .withCountryOrRegionForHolidays("zxmdew") - .withCvStepSize(1373177035) - .withFeatureLags(FeatureLags.AUTO) - .withForecastHorizon(new ForecastHorizon()) - .withFrequency("lbjazejww") - .withSeasonality(new Seasonality()) - .withShortSeriesHandlingConfig(ShortSeriesHandlingConfiguration.PAD) - .withTargetAggregateFunction(TargetAggregationFunction.MIN) - .withTargetLags(new TargetLags()) - .withTargetRollingWindowSize(new TargetRollingWindowSize()) - .withTimeColumnName("brnnhjxsqw") - .withTimeSeriesIdColumnNames(Arrays.asList("kbiwetpozyc", "qiqyhgfsetzlexbs")) - .withUseStl(UseStl.NONE)) - .withPrimaryMetric(ForecastingPrimaryMetrics.R2SCORE) - .withTrainingSettings( - new ForecastingTrainingSettings() - .withEnableDnnTraining(true) - .withEnableModelExplainability(false) - .withEnableOnnxCompatibleModels(true) - .withEnableStackEnsemble(false) - .withEnableVoteEnsemble(false) - .withEnsembleModelDownloadTimeout(Duration.parse("PT225H4M15S")) - .withStackEnsembleSettings( - new StackEnsembleSettings() - .withStackMetaLearnerKWargs("datalpkpbafvafhl") - .withStackMetaLearnerTrainPercentage(11.719010334787338D) - .withStackMetaLearnerType(StackMetaLearnerType.ELASTIC_NET)) - .withAllowedTrainingAlgorithms( - Arrays.asList(ForecastingModels.GRADIENT_BOOSTING, ForecastingModels.SEASONAL_NAIVE)) - .withBlockedTrainingAlgorithms( - Arrays - .asList( - ForecastingModels.RANDOM_FOREST, - ForecastingModels.ARIMAX, - ForecastingModels.ARIMAX, - ForecastingModels.PROPHET))) - .withCvSplitColumnNames(Arrays.asList("xrhyzdfwrsofplt")) - .withFeaturizationSettings( - new TableVerticalFeaturizationSettings() - .withDatasetLanguage("mtggmu") - .withBlockedTransformers( - Arrays - .asList( - BlockedTransformers.WORD_EMBEDDING, - BlockedTransformers.TEXT_TARGET_ENCODER, - BlockedTransformers.TF_IDF, - BlockedTransformers.TF_IDF)) - .withColumnNameAndTypes(mapOf("npq", "fnrac", "uuj", "g")) - .withEnableDnnFeaturization(false) - .withMode(FeaturizationMode.AUTO) - .withTransformerParams( - mapOf("igrb", Arrays.asList(), "xsjybvitvqk", Arrays.asList(), "az", Arrays.asList()))) - .withLimitSettings( - new TableVerticalLimitSettings() - .withEnableEarlyTermination(false) - .withExitScore(73.03774094829895D) - .withMaxConcurrentTrials(1401154430) - .withMaxCoresPerTrial(737761166) - .withMaxTrials(273920655) - .withTimeout(Duration.parse("PT29H11M39S")) - .withTrialTimeout(Duration.parse("PT238H15M11S"))) - .withNCrossValidations(new NCrossValidations()) - .withTestData( - new MLTableJobInput() - .withDescription("uyxlykwphvxzcw") - .withMode(InputDeliveryMode.READ_ONLY_MOUNT) - .withUri("voaiknaqlnuw")) - .withTestDataSize(14.530784309792832D) - .withValidationData( - new MLTableJobInput() - .withDescription("hxknlccrmmkyupi") - .withMode(InputDeliveryMode.EVAL_DOWNLOAD) - .withUri("lkexaonwivkcqh")) - .withValidationDataSize(89.69731810693186D) - .withWeightColumnName("jfkakfqfrke"); - model = BinaryData.fromObject(model).toObject(Forecasting.class); - Assertions.assertEquals(LogVerbosity.ERROR, model.logVerbosity()); - Assertions.assertEquals("dudxjascowvfdjk", model.targetColumnName()); - Assertions.assertEquals("vyfijdkzuqnw", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.trainingData().mode()); - Assertions.assertEquals("phlkksnm", model.trainingData().uri()); - Assertions.assertEquals("zxmdew", model.forecastingSettings().countryOrRegionForHolidays()); - Assertions.assertEquals(1373177035, model.forecastingSettings().cvStepSize()); - Assertions.assertEquals(FeatureLags.AUTO, model.forecastingSettings().featureLags()); - Assertions.assertEquals("lbjazejww", model.forecastingSettings().frequency()); - Assertions - .assertEquals( - ShortSeriesHandlingConfiguration.PAD, model.forecastingSettings().shortSeriesHandlingConfig()); - Assertions.assertEquals(TargetAggregationFunction.MIN, model.forecastingSettings().targetAggregateFunction()); - Assertions.assertEquals("brnnhjxsqw", model.forecastingSettings().timeColumnName()); - Assertions.assertEquals("kbiwetpozyc", model.forecastingSettings().timeSeriesIdColumnNames().get(0)); - Assertions.assertEquals(UseStl.NONE, model.forecastingSettings().useStl()); - Assertions.assertEquals(ForecastingPrimaryMetrics.R2SCORE, model.primaryMetric()); - Assertions.assertEquals(true, model.trainingSettings().enableDnnTraining()); - Assertions.assertEquals(false, model.trainingSettings().enableModelExplainability()); - Assertions.assertEquals(true, model.trainingSettings().enableOnnxCompatibleModels()); - Assertions.assertEquals(false, model.trainingSettings().enableStackEnsemble()); - Assertions.assertEquals(false, model.trainingSettings().enableVoteEnsemble()); - Assertions.assertEquals(Duration.parse("PT225H4M15S"), model.trainingSettings().ensembleModelDownloadTimeout()); - Assertions - .assertEquals( - 11.719010334787338D, - model.trainingSettings().stackEnsembleSettings().stackMetaLearnerTrainPercentage()); - Assertions - .assertEquals( - StackMetaLearnerType.ELASTIC_NET, - model.trainingSettings().stackEnsembleSettings().stackMetaLearnerType()); - Assertions - .assertEquals( - ForecastingModels.GRADIENT_BOOSTING, model.trainingSettings().allowedTrainingAlgorithms().get(0)); - Assertions - .assertEquals(ForecastingModels.RANDOM_FOREST, model.trainingSettings().blockedTrainingAlgorithms().get(0)); - Assertions.assertEquals("xrhyzdfwrsofplt", model.cvSplitColumnNames().get(0)); - Assertions.assertEquals("mtggmu", model.featurizationSettings().datasetLanguage()); - Assertions - .assertEquals( - BlockedTransformers.WORD_EMBEDDING, model.featurizationSettings().blockedTransformers().get(0)); - Assertions.assertEquals("fnrac", model.featurizationSettings().columnNameAndTypes().get("npq")); - Assertions.assertEquals(false, model.featurizationSettings().enableDnnFeaturization()); - Assertions.assertEquals(FeaturizationMode.AUTO, model.featurizationSettings().mode()); - Assertions.assertEquals(false, model.limitSettings().enableEarlyTermination()); - Assertions.assertEquals(73.03774094829895D, model.limitSettings().exitScore()); - Assertions.assertEquals(1401154430, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(737761166, model.limitSettings().maxCoresPerTrial()); - Assertions.assertEquals(273920655, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT29H11M39S"), model.limitSettings().timeout()); - Assertions.assertEquals(Duration.parse("PT238H15M11S"), model.limitSettings().trialTimeout()); - Assertions.assertEquals("uyxlykwphvxzcw", model.testData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_ONLY_MOUNT, model.testData().mode()); - Assertions.assertEquals("voaiknaqlnuw", model.testData().uri()); - Assertions.assertEquals(14.530784309792832D, model.testDataSize()); - Assertions.assertEquals("hxknlccrmmkyupi", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_DOWNLOAD, model.validationData().mode()); - Assertions.assertEquals("lkexaonwivkcqh", model.validationData().uri()); - Assertions.assertEquals(89.69731810693186D, model.validationDataSize()); - Assertions.assertEquals("jfkakfqfrke", model.weightColumnName()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ForecastingTrainingSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ForecastingTrainingSettingsTests.java deleted file mode 100644 index c87e4250da7bc..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ForecastingTrainingSettingsTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ForecastingModels; -import com.azure.resourcemanager.machinelearning.models.ForecastingTrainingSettings; -import com.azure.resourcemanager.machinelearning.models.StackEnsembleSettings; -import com.azure.resourcemanager.machinelearning.models.StackMetaLearnerType; -import java.time.Duration; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ForecastingTrainingSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ForecastingTrainingSettings model = - BinaryData - .fromString( - "{\"allowedTrainingAlgorithms\":[\"RandomForest\",\"TCNForecaster\",\"LightGBM\"],\"blockedTrainingAlgorithms\":[\"RandomForest\",\"Prophet\"],\"enableDnnTraining\":false,\"enableModelExplainability\":false,\"enableOnnxCompatibleModels\":false,\"enableStackEnsemble\":false,\"enableVoteEnsemble\":true,\"ensembleModelDownloadTimeout\":\"PT217H25M43S\",\"stackEnsembleSettings\":{\"stackMetaLearnerKWargs\":\"datadyedmzrgjfo\",\"stackMetaLearnerTrainPercentage\":17.660910285057906,\"stackMetaLearnerType\":\"LightGBMRegressor\"}}") - .toObject(ForecastingTrainingSettings.class); - Assertions.assertEquals(false, model.enableDnnTraining()); - Assertions.assertEquals(false, model.enableModelExplainability()); - Assertions.assertEquals(false, model.enableOnnxCompatibleModels()); - Assertions.assertEquals(false, model.enableStackEnsemble()); - Assertions.assertEquals(true, model.enableVoteEnsemble()); - Assertions.assertEquals(Duration.parse("PT217H25M43S"), model.ensembleModelDownloadTimeout()); - Assertions.assertEquals(17.660910285057906D, model.stackEnsembleSettings().stackMetaLearnerTrainPercentage()); - Assertions - .assertEquals( - StackMetaLearnerType.LIGHT_GBMREGRESSOR, model.stackEnsembleSettings().stackMetaLearnerType()); - Assertions.assertEquals(ForecastingModels.RANDOM_FOREST, model.allowedTrainingAlgorithms().get(0)); - Assertions.assertEquals(ForecastingModels.RANDOM_FOREST, model.blockedTrainingAlgorithms().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ForecastingTrainingSettings model = - new ForecastingTrainingSettings() - .withEnableDnnTraining(false) - .withEnableModelExplainability(false) - .withEnableOnnxCompatibleModels(false) - .withEnableStackEnsemble(false) - .withEnableVoteEnsemble(true) - .withEnsembleModelDownloadTimeout(Duration.parse("PT217H25M43S")) - .withStackEnsembleSettings( - new StackEnsembleSettings() - .withStackMetaLearnerKWargs("datadyedmzrgjfo") - .withStackMetaLearnerTrainPercentage(17.660910285057906D) - .withStackMetaLearnerType(StackMetaLearnerType.LIGHT_GBMREGRESSOR)) - .withAllowedTrainingAlgorithms( - Arrays - .asList( - ForecastingModels.RANDOM_FOREST, - ForecastingModels.TCNFORECASTER, - ForecastingModels.LIGHT_GBM)) - .withBlockedTrainingAlgorithms( - Arrays.asList(ForecastingModels.RANDOM_FOREST, ForecastingModels.PROPHET)); - model = BinaryData.fromObject(model).toObject(ForecastingTrainingSettings.class); - Assertions.assertEquals(false, model.enableDnnTraining()); - Assertions.assertEquals(false, model.enableModelExplainability()); - Assertions.assertEquals(false, model.enableOnnxCompatibleModels()); - Assertions.assertEquals(false, model.enableStackEnsemble()); - Assertions.assertEquals(true, model.enableVoteEnsemble()); - Assertions.assertEquals(Duration.parse("PT217H25M43S"), model.ensembleModelDownloadTimeout()); - Assertions.assertEquals(17.660910285057906D, model.stackEnsembleSettings().stackMetaLearnerTrainPercentage()); - Assertions - .assertEquals( - StackMetaLearnerType.LIGHT_GBMREGRESSOR, model.stackEnsembleSettings().stackMetaLearnerType()); - Assertions.assertEquals(ForecastingModels.RANDOM_FOREST, model.allowedTrainingAlgorithms().get(0)); - Assertions.assertEquals(ForecastingModels.RANDOM_FOREST, model.blockedTrainingAlgorithms().get(0)); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FqdnEndpointDetailTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FqdnEndpointDetailTests.java deleted file mode 100644 index f09ae260cee0a..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FqdnEndpointDetailTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.FqdnEndpointDetail; -import org.junit.jupiter.api.Assertions; - -public final class FqdnEndpointDetailTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FqdnEndpointDetail model = BinaryData.fromString("{\"port\":1808760283}").toObject(FqdnEndpointDetail.class); - Assertions.assertEquals(1808760283, model.port()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FqdnEndpointDetail model = new FqdnEndpointDetail().withPort(1808760283); - model = BinaryData.fromObject(model).toObject(FqdnEndpointDetail.class); - Assertions.assertEquals(1808760283, model.port()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FqdnEndpointTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FqdnEndpointTests.java deleted file mode 100644 index 5a44acf3e5782..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FqdnEndpointTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.FqdnEndpoint; -import com.azure.resourcemanager.machinelearning.models.FqdnEndpointDetail; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class FqdnEndpointTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FqdnEndpoint model = - BinaryData - .fromString( - "{\"domainName\":\"ievseotgqrllt\",\"endpointDetails\":[{\"port\":883294723},{\"port\":1914003848},{\"port\":779410918},{\"port\":1035303462}]}") - .toObject(FqdnEndpoint.class); - Assertions.assertEquals("ievseotgqrllt", model.domainName()); - Assertions.assertEquals(883294723, model.endpointDetails().get(0).port()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FqdnEndpoint model = - new FqdnEndpoint() - .withDomainName("ievseotgqrllt") - .withEndpointDetails( - Arrays - .asList( - new FqdnEndpointDetail().withPort(883294723), - new FqdnEndpointDetail().withPort(1914003848), - new FqdnEndpointDetail().withPort(779410918), - new FqdnEndpointDetail().withPort(1035303462))); - model = BinaryData.fromObject(model).toObject(FqdnEndpoint.class); - Assertions.assertEquals("ievseotgqrllt", model.domainName()); - Assertions.assertEquals(883294723, model.endpointDetails().get(0).port()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FqdnEndpointsPropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FqdnEndpointsPropertiesTests.java deleted file mode 100644 index d3543134f5a7c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FqdnEndpointsPropertiesTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.FqdnEndpoint; -import com.azure.resourcemanager.machinelearning.models.FqdnEndpointsProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class FqdnEndpointsPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FqdnEndpointsProperties model = - BinaryData - .fromString( - "{\"category\":\"qxn\",\"endpoints\":[{\"domainName\":\"gxhuriplbp\",\"endpointDetails\":[]},{\"domainName\":\"nkbebxmuby\",\"endpointDetails\":[]},{\"domainName\":\"lrb\",\"endpointDetails\":[]}]}") - .toObject(FqdnEndpointsProperties.class); - Assertions.assertEquals("qxn", model.category()); - Assertions.assertEquals("gxhuriplbp", model.endpoints().get(0).domainName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FqdnEndpointsProperties model = - new FqdnEndpointsProperties() - .withCategory("qxn") - .withEndpoints( - Arrays - .asList( - new FqdnEndpoint().withDomainName("gxhuriplbp").withEndpointDetails(Arrays.asList()), - new FqdnEndpoint().withDomainName("nkbebxmuby").withEndpointDetails(Arrays.asList()), - new FqdnEndpoint().withDomainName("lrb").withEndpointDetails(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(FqdnEndpointsProperties.class); - Assertions.assertEquals("qxn", model.category()); - Assertions.assertEquals("gxhuriplbp", model.endpoints().get(0).domainName()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FqdnEndpointsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FqdnEndpointsTests.java deleted file mode 100644 index c2bc2b182d72f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/FqdnEndpointsTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.FqdnEndpoint; -import com.azure.resourcemanager.machinelearning.models.FqdnEndpoints; -import com.azure.resourcemanager.machinelearning.models.FqdnEndpointsProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class FqdnEndpointsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FqdnEndpoints model = - BinaryData - .fromString( - "{\"properties\":{\"category\":\"qqkdltfzxmhhvhgu\",\"endpoints\":[{\"domainName\":\"kwobdagxtibq\",\"endpointDetails\":[]},{\"domainName\":\"xwak\",\"endpointDetails\":[]}]}}") - .toObject(FqdnEndpoints.class); - Assertions.assertEquals("qqkdltfzxmhhvhgu", model.properties().category()); - Assertions.assertEquals("kwobdagxtibq", model.properties().endpoints().get(0).domainName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FqdnEndpoints model = - new FqdnEndpoints() - .withProperties( - new FqdnEndpointsProperties() - .withCategory("qqkdltfzxmhhvhgu") - .withEndpoints( - Arrays - .asList( - new FqdnEndpoint() - .withDomainName("kwobdagxtibq") - .withEndpointDetails(Arrays.asList()), - new FqdnEndpoint().withDomainName("xwak").withEndpointDetails(Arrays.asList())))); - model = BinaryData.fromObject(model).toObject(FqdnEndpoints.class); - Assertions.assertEquals("qqkdltfzxmhhvhgu", model.properties().category()); - Assertions.assertEquals("kwobdagxtibq", model.properties().endpoints().get(0).domainName()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/GridSamplingAlgorithmTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/GridSamplingAlgorithmTests.java deleted file mode 100644 index 451f4b5b2a136..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/GridSamplingAlgorithmTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.GridSamplingAlgorithm; - -public final class GridSamplingAlgorithmTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GridSamplingAlgorithm model = - BinaryData.fromString("{\"samplingAlgorithmType\":\"Grid\"}").toObject(GridSamplingAlgorithm.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GridSamplingAlgorithm model = new GridSamplingAlgorithm(); - model = BinaryData.fromObject(model).toObject(GridSamplingAlgorithm.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/IdAssetReferenceTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/IdAssetReferenceTests.java deleted file mode 100644 index d070ba11cf157..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/IdAssetReferenceTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.IdAssetReference; -import org.junit.jupiter.api.Assertions; - -public final class IdAssetReferenceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IdAssetReference model = - BinaryData - .fromString("{\"referenceType\":\"Id\",\"assetId\":\"itpkpztrgdg\"}") - .toObject(IdAssetReference.class); - Assertions.assertEquals("itpkpztrgdg", model.assetId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IdAssetReference model = new IdAssetReference().withAssetId("itpkpztrgdg"); - model = BinaryData.fromObject(model).toObject(IdAssetReference.class); - Assertions.assertEquals("itpkpztrgdg", model.assetId()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/IdentityConfigurationTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/IdentityConfigurationTests.java deleted file mode 100644 index e4457f12102bd..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/IdentityConfigurationTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.IdentityConfiguration; - -public final class IdentityConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IdentityConfiguration model = - BinaryData.fromString("{\"identityType\":\"IdentityConfiguration\"}").toObject(IdentityConfiguration.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IdentityConfiguration model = new IdentityConfiguration(); - model = BinaryData.fromObject(model).toObject(IdentityConfiguration.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/IdentityForCmkTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/IdentityForCmkTests.java deleted file mode 100644 index 9ebb9969d0c24..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/IdentityForCmkTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.IdentityForCmk; -import org.junit.jupiter.api.Assertions; - -public final class IdentityForCmkTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IdentityForCmk model = - BinaryData.fromString("{\"userAssignedIdentity\":\"hanufhfcbjysagi\"}").toObject(IdentityForCmk.class); - Assertions.assertEquals("hanufhfcbjysagi", model.userAssignedIdentity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IdentityForCmk model = new IdentityForCmk().withUserAssignedIdentity("hanufhfcbjysagi"); - model = BinaryData.fromObject(model).toObject(IdentityForCmk.class); - Assertions.assertEquals("hanufhfcbjysagi", model.userAssignedIdentity()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageClassificationBaseTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageClassificationBaseTests.java deleted file mode 100644 index 2dbbce706d3a4..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageClassificationBaseTests.java +++ /dev/null @@ -1,362 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.EarlyTerminationPolicy; -import com.azure.resourcemanager.machinelearning.models.ImageClassificationBase; -import com.azure.resourcemanager.machinelearning.models.ImageLimitSettings; -import com.azure.resourcemanager.machinelearning.models.ImageModelDistributionSettingsClassification; -import com.azure.resourcemanager.machinelearning.models.ImageModelSettingsClassification; -import com.azure.resourcemanager.machinelearning.models.ImageSweepSettings; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.LearningRateScheduler; -import com.azure.resourcemanager.machinelearning.models.MLFlowModelJobInput; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import com.azure.resourcemanager.machinelearning.models.SamplingAlgorithmType; -import com.azure.resourcemanager.machinelearning.models.StochasticOptimizer; -import java.time.Duration; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ImageClassificationBaseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageClassificationBase model = - BinaryData - .fromString( - "{\"modelSettings\":{\"trainingCropSize\":632161025,\"validationCropSize\":1319895932,\"validationResizeSize\":1773341425,\"weightedLoss\":2065297037,\"advancedSettings\":\"a\",\"amsGradient\":true,\"augmentations\":\"nhsenwphpzfng\",\"beta1\":24.413616,\"beta2\":87.05071,\"checkpointFrequency\":304312927,\"checkpointModel\":{\"jobInputType\":\"mlflow_model\",\"mode\":\"Download\",\"uri\":\"wjjufwbe\",\"description\":\"k\"},\"checkpointRunId\":\"rhtssr\",\"distributed\":false,\"earlyStopping\":true,\"earlyStoppingDelay\":1979060010,\"earlyStoppingPatience\":1774020224,\"enableOnnxNormalization\":true,\"evaluationFrequency\":853491099,\"gradientAccumulationStep\":1971606507,\"layersToFreeze\":323558985,\"learningRate\":42.430317,\"learningRateScheduler\":\"Step\",\"modelName\":\"zwxiytx\",\"momentum\":51.025497,\"nesterov\":true,\"numberOfEpochs\":1378257495,\"numberOfWorkers\":1753150962,\"optimizer\":\"Adam\",\"randomSeed\":1914645473,\"stepLRGamma\":97.39071,\"stepLRStepSize\":218117716,\"trainingBatchSize\":1079594168,\"validationBatchSize\":2132424945,\"warmupCosineLRCycles\":66.13355,\"warmupCosineLRWarmupEpochs\":568274703,\"weightDecay\":67.716774},\"searchSpace\":[{\"trainingCropSize\":\"egmmuteyxe\",\"validationCropSize\":\"uqi\",\"validationResizeSize\":\"jiitnspxlzdesygr\",\"weightedLoss\":\"waiufanra\",\"amsGradient\":\"fueqfrojs\",\"augmentations\":\"grhydk\",\"beta1\":\"ywezskiecafyg\",\"beta2\":\"xieqv\",\"distributed\":\"makli\",\"earlyStopping\":\"cahyhx\",\"earlyStoppingDelay\":\"ybxawoijpodtblx\",\"earlyStoppingPatience\":\"kwjdjodqhy\",\"enableOnnxNormalization\":\"ncn\",\"evaluationFrequency\":\"mehllizhceu\",\"gradientAccumulationStep\":\"qodkadppyibngql\",\"layersToFreeze\":\"ywrxw\",\"learningRate\":\"dtluvvadswzsn\",\"learningRateScheduler\":\"emlowuowhl\",\"modelName\":\"nwyrmouv\",\"momentum\":\"gmokzkltrfowt\",\"nesterov\":\"rfmvlihcvjdrqcrj\",\"numberOfEpochs\":\"h\",\"numberOfWorkers\":\"ukvhd\",\"optimizer\":\"wyojbfqzdkfnjyi\",\"randomSeed\":\"afr\",\"stepLRGamma\":\"qxmbjroumzzn\",\"stepLRStepSize\":\"l\",\"trainingBatchSize\":\"rhuzgfxonjtpu\",\"validationBatchSize\":\"l\",\"warmupCosineLRCycles\":\"pvti\",\"warmupCosineLRWarmupEpochs\":\"zbpdbo\",\"weightDecay\":\"gryfqiuasig\"},{\"trainingCropSize\":\"wsocnequygdjbo\",\"validationCropSize\":\"rmtqjkqevadr\",\"validationResizeSize\":\"wiu\",\"weightedLoss\":\"vcmjzkxiidisczsk\",\"amsGradient\":\"woqiqazugamxzkrr\",\"augmentations\":\"iisb\",\"beta1\":\"nppcce\",\"beta2\":\"ztdsbeza\",\"distributed\":\"f\",\"earlyStopping\":\"zxuizhyhnepkpe\",\"earlyStoppingDelay\":\"arxqiubx\",\"earlyStoppingPatience\":\"kecpxdazvdh\",\"enableOnnxNormalization\":\"mmkoszudb\",\"evaluationFrequency\":\"s\",\"gradientAccumulationStep\":\"rpcaqkiofkbtf\",\"layersToFreeze\":\"kl\",\"learningRate\":\"l\",\"learningRateScheduler\":\"vcb\",\"modelName\":\"ezyquw\",\"momentum\":\"qxutrpbrruyuua\",\"nesterov\":\"lmbjwcolbmxlbnw\",\"numberOfEpochs\":\"cpahprzrvxhm\",\"numberOfWorkers\":\"hocn\",\"optimizer\":\"cmj\",\"randomSeed\":\"gxnoqrxtdis\",\"stepLRGamma\":\"evhdlmydid\",\"stepLRStepSize\":\"epfwwt\",\"trainingBatchSize\":\"doesxxhmwcdb\",\"validationBatchSize\":\"yo\",\"warmupCosineLRCycles\":\"xkxhnegknjzrbhtm\",\"warmupCosineLRWarmupEpochs\":\"lvukaobrlb\",\"weightDecay\":\"snbagnchjhg\"},{\"trainingCropSize\":\"uowakyw\",\"validationCropSize\":\"hjym\",\"validationResizeSize\":\"gqtagd\",\"weightedLoss\":\"lss\",\"amsGradient\":\"jomevtfycnlb\",\"augmentations\":\"jcodkkgjiiytssi\",\"beta1\":\"z\",\"beta2\":\"ufqbvntnr\",\"distributed\":\"qsorh\",\"earlyStopping\":\"kxgnlykmxcpwzvmd\",\"earlyStoppingDelay\":\"sqdtiwlwxlbon\",\"earlyStoppingPatience\":\"bazqicqchygtvxby\",\"enableOnnxNormalization\":\"nepubdpkxyqvgx\",\"evaluationFrequency\":\"od\",\"gradientAccumulationStep\":\"vohkxdxuws\",\"layersToFreeze\":\"fmcwnosb\",\"learningRate\":\"ehgcvkbcknjo\",\"learningRateScheduler\":\"jy\",\"modelName\":\"pvelszerqze\",\"momentum\":\"o\",\"nesterov\":\"intxwa\",\"numberOfEpochs\":\"glzoblqwa\",\"numberOfWorkers\":\"r\",\"optimizer\":\"lhm\",\"randomSeed\":\"qb\",\"stepLRGamma\":\"vafjrqpjiyrqj\",\"stepLRStepSize\":\"gaxwmzwdfkbnrzo\",\"trainingBatchSize\":\"dltb\",\"validationBatchSize\":\"tqjfgxxsaet\",\"warmupCosineLRCycles\":\"dgvpyig\",\"warmupCosineLRWarmupEpochs\":\"qqil\",\"weightDecay\":\"cduwjoedx\"}],\"limitSettings\":{\"maxConcurrentTrials\":1780634429,\"maxTrials\":899036768,\"timeout\":\"PT30H59M40S\"},\"sweepSettings\":{\"earlyTermination\":{\"policyType\":\"EarlyTerminationPolicy\",\"delayEvaluation\":1408151149,\"evaluationInterval\":505810781},\"samplingAlgorithm\":\"Random\"},\"validationData\":{\"jobInputType\":\"mltable\",\"mode\":\"Direct\",\"uri\":\"jqqacdmkx\",\"description\":\"dcvjwc\"},\"validationDataSize\":47.866367600253014}") - .toObject(ImageClassificationBase.class); - Assertions.assertEquals(1780634429, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(899036768, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT30H59M40S"), model.limitSettings().timeout()); - Assertions.assertEquals(1408151149, model.sweepSettings().earlyTermination().delayEvaluation()); - Assertions.assertEquals(505810781, model.sweepSettings().earlyTermination().evaluationInterval()); - Assertions.assertEquals(SamplingAlgorithmType.RANDOM, model.sweepSettings().samplingAlgorithm()); - Assertions.assertEquals("dcvjwc", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.validationData().mode()); - Assertions.assertEquals("jqqacdmkx", model.validationData().uri()); - Assertions.assertEquals(47.866367600253014D, model.validationDataSize()); - Assertions.assertEquals("a", model.modelSettings().advancedSettings()); - Assertions.assertEquals(true, model.modelSettings().amsGradient()); - Assertions.assertEquals("nhsenwphpzfng", model.modelSettings().augmentations()); - Assertions.assertEquals(24.413616F, model.modelSettings().beta1()); - Assertions.assertEquals(87.05071F, model.modelSettings().beta2()); - Assertions.assertEquals(304312927, model.modelSettings().checkpointFrequency()); - Assertions.assertEquals("k", model.modelSettings().checkpointModel().description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.modelSettings().checkpointModel().mode()); - Assertions.assertEquals("wjjufwbe", model.modelSettings().checkpointModel().uri()); - Assertions.assertEquals("rhtssr", model.modelSettings().checkpointRunId()); - Assertions.assertEquals(false, model.modelSettings().distributed()); - Assertions.assertEquals(true, model.modelSettings().earlyStopping()); - Assertions.assertEquals(1979060010, model.modelSettings().earlyStoppingDelay()); - Assertions.assertEquals(1774020224, model.modelSettings().earlyStoppingPatience()); - Assertions.assertEquals(true, model.modelSettings().enableOnnxNormalization()); - Assertions.assertEquals(853491099, model.modelSettings().evaluationFrequency()); - Assertions.assertEquals(1971606507, model.modelSettings().gradientAccumulationStep()); - Assertions.assertEquals(323558985, model.modelSettings().layersToFreeze()); - Assertions.assertEquals(42.430317F, model.modelSettings().learningRate()); - Assertions.assertEquals(LearningRateScheduler.STEP, model.modelSettings().learningRateScheduler()); - Assertions.assertEquals("zwxiytx", model.modelSettings().modelName()); - Assertions.assertEquals(51.025497F, model.modelSettings().momentum()); - Assertions.assertEquals(true, model.modelSettings().nesterov()); - Assertions.assertEquals(1378257495, model.modelSettings().numberOfEpochs()); - Assertions.assertEquals(1753150962, model.modelSettings().numberOfWorkers()); - Assertions.assertEquals(StochasticOptimizer.ADAM, model.modelSettings().optimizer()); - Assertions.assertEquals(1914645473, model.modelSettings().randomSeed()); - Assertions.assertEquals(97.39071F, model.modelSettings().stepLRGamma()); - Assertions.assertEquals(218117716, model.modelSettings().stepLRStepSize()); - Assertions.assertEquals(1079594168, model.modelSettings().trainingBatchSize()); - Assertions.assertEquals(2132424945, model.modelSettings().validationBatchSize()); - Assertions.assertEquals(66.13355F, model.modelSettings().warmupCosineLRCycles()); - Assertions.assertEquals(568274703, model.modelSettings().warmupCosineLRWarmupEpochs()); - Assertions.assertEquals(67.716774F, model.modelSettings().weightDecay()); - Assertions.assertEquals(632161025, model.modelSettings().trainingCropSize()); - Assertions.assertEquals(1319895932, model.modelSettings().validationCropSize()); - Assertions.assertEquals(1773341425, model.modelSettings().validationResizeSize()); - Assertions.assertEquals(2065297037, model.modelSettings().weightedLoss()); - Assertions.assertEquals("fueqfrojs", model.searchSpace().get(0).amsGradient()); - Assertions.assertEquals("grhydk", model.searchSpace().get(0).augmentations()); - Assertions.assertEquals("ywezskiecafyg", model.searchSpace().get(0).beta1()); - Assertions.assertEquals("xieqv", model.searchSpace().get(0).beta2()); - Assertions.assertEquals("makli", model.searchSpace().get(0).distributed()); - Assertions.assertEquals("cahyhx", model.searchSpace().get(0).earlyStopping()); - Assertions.assertEquals("ybxawoijpodtblx", model.searchSpace().get(0).earlyStoppingDelay()); - Assertions.assertEquals("kwjdjodqhy", model.searchSpace().get(0).earlyStoppingPatience()); - Assertions.assertEquals("ncn", model.searchSpace().get(0).enableOnnxNormalization()); - Assertions.assertEquals("mehllizhceu", model.searchSpace().get(0).evaluationFrequency()); - Assertions.assertEquals("qodkadppyibngql", model.searchSpace().get(0).gradientAccumulationStep()); - Assertions.assertEquals("ywrxw", model.searchSpace().get(0).layersToFreeze()); - Assertions.assertEquals("dtluvvadswzsn", model.searchSpace().get(0).learningRate()); - Assertions.assertEquals("emlowuowhl", model.searchSpace().get(0).learningRateScheduler()); - Assertions.assertEquals("nwyrmouv", model.searchSpace().get(0).modelName()); - Assertions.assertEquals("gmokzkltrfowt", model.searchSpace().get(0).momentum()); - Assertions.assertEquals("rfmvlihcvjdrqcrj", model.searchSpace().get(0).nesterov()); - Assertions.assertEquals("h", model.searchSpace().get(0).numberOfEpochs()); - Assertions.assertEquals("ukvhd", model.searchSpace().get(0).numberOfWorkers()); - Assertions.assertEquals("wyojbfqzdkfnjyi", model.searchSpace().get(0).optimizer()); - Assertions.assertEquals("afr", model.searchSpace().get(0).randomSeed()); - Assertions.assertEquals("qxmbjroumzzn", model.searchSpace().get(0).stepLRGamma()); - Assertions.assertEquals("l", model.searchSpace().get(0).stepLRStepSize()); - Assertions.assertEquals("rhuzgfxonjtpu", model.searchSpace().get(0).trainingBatchSize()); - Assertions.assertEquals("l", model.searchSpace().get(0).validationBatchSize()); - Assertions.assertEquals("pvti", model.searchSpace().get(0).warmupCosineLRCycles()); - Assertions.assertEquals("zbpdbo", model.searchSpace().get(0).warmupCosineLRWarmupEpochs()); - Assertions.assertEquals("gryfqiuasig", model.searchSpace().get(0).weightDecay()); - Assertions.assertEquals("egmmuteyxe", model.searchSpace().get(0).trainingCropSize()); - Assertions.assertEquals("uqi", model.searchSpace().get(0).validationCropSize()); - Assertions.assertEquals("jiitnspxlzdesygr", model.searchSpace().get(0).validationResizeSize()); - Assertions.assertEquals("waiufanra", model.searchSpace().get(0).weightedLoss()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageClassificationBase model = - new ImageClassificationBase() - .withLimitSettings( - new ImageLimitSettings() - .withMaxConcurrentTrials(1780634429) - .withMaxTrials(899036768) - .withTimeout(Duration.parse("PT30H59M40S"))) - .withSweepSettings( - new ImageSweepSettings() - .withEarlyTermination( - new EarlyTerminationPolicy() - .withDelayEvaluation(1408151149) - .withEvaluationInterval(505810781)) - .withSamplingAlgorithm(SamplingAlgorithmType.RANDOM)) - .withValidationData( - new MLTableJobInput() - .withDescription("dcvjwc") - .withMode(InputDeliveryMode.DIRECT) - .withUri("jqqacdmkx")) - .withValidationDataSize(47.866367600253014D) - .withModelSettings( - new ImageModelSettingsClassification() - .withAdvancedSettings("a") - .withAmsGradient(true) - .withAugmentations("nhsenwphpzfng") - .withBeta1(24.413616F) - .withBeta2(87.05071F) - .withCheckpointFrequency(304312927) - .withCheckpointModel( - new MLFlowModelJobInput() - .withDescription("k") - .withMode(InputDeliveryMode.DOWNLOAD) - .withUri("wjjufwbe")) - .withCheckpointRunId("rhtssr") - .withDistributed(false) - .withEarlyStopping(true) - .withEarlyStoppingDelay(1979060010) - .withEarlyStoppingPatience(1774020224) - .withEnableOnnxNormalization(true) - .withEvaluationFrequency(853491099) - .withGradientAccumulationStep(1971606507) - .withLayersToFreeze(323558985) - .withLearningRate(42.430317F) - .withLearningRateScheduler(LearningRateScheduler.STEP) - .withModelName("zwxiytx") - .withMomentum(51.025497F) - .withNesterov(true) - .withNumberOfEpochs(1378257495) - .withNumberOfWorkers(1753150962) - .withOptimizer(StochasticOptimizer.ADAM) - .withRandomSeed(1914645473) - .withStepLRGamma(97.39071F) - .withStepLRStepSize(218117716) - .withTrainingBatchSize(1079594168) - .withValidationBatchSize(2132424945) - .withWarmupCosineLRCycles(66.13355F) - .withWarmupCosineLRWarmupEpochs(568274703) - .withWeightDecay(67.716774F) - .withTrainingCropSize(632161025) - .withValidationCropSize(1319895932) - .withValidationResizeSize(1773341425) - .withWeightedLoss(2065297037)) - .withSearchSpace( - Arrays - .asList( - new ImageModelDistributionSettingsClassification() - .withAmsGradient("fueqfrojs") - .withAugmentations("grhydk") - .withBeta1("ywezskiecafyg") - .withBeta2("xieqv") - .withDistributed("makli") - .withEarlyStopping("cahyhx") - .withEarlyStoppingDelay("ybxawoijpodtblx") - .withEarlyStoppingPatience("kwjdjodqhy") - .withEnableOnnxNormalization("ncn") - .withEvaluationFrequency("mehllizhceu") - .withGradientAccumulationStep("qodkadppyibngql") - .withLayersToFreeze("ywrxw") - .withLearningRate("dtluvvadswzsn") - .withLearningRateScheduler("emlowuowhl") - .withModelName("nwyrmouv") - .withMomentum("gmokzkltrfowt") - .withNesterov("rfmvlihcvjdrqcrj") - .withNumberOfEpochs("h") - .withNumberOfWorkers("ukvhd") - .withOptimizer("wyojbfqzdkfnjyi") - .withRandomSeed("afr") - .withStepLRGamma("qxmbjroumzzn") - .withStepLRStepSize("l") - .withTrainingBatchSize("rhuzgfxonjtpu") - .withValidationBatchSize("l") - .withWarmupCosineLRCycles("pvti") - .withWarmupCosineLRWarmupEpochs("zbpdbo") - .withWeightDecay("gryfqiuasig") - .withTrainingCropSize("egmmuteyxe") - .withValidationCropSize("uqi") - .withValidationResizeSize("jiitnspxlzdesygr") - .withWeightedLoss("waiufanra"), - new ImageModelDistributionSettingsClassification() - .withAmsGradient("woqiqazugamxzkrr") - .withAugmentations("iisb") - .withBeta1("nppcce") - .withBeta2("ztdsbeza") - .withDistributed("f") - .withEarlyStopping("zxuizhyhnepkpe") - .withEarlyStoppingDelay("arxqiubx") - .withEarlyStoppingPatience("kecpxdazvdh") - .withEnableOnnxNormalization("mmkoszudb") - .withEvaluationFrequency("s") - .withGradientAccumulationStep("rpcaqkiofkbtf") - .withLayersToFreeze("kl") - .withLearningRate("l") - .withLearningRateScheduler("vcb") - .withModelName("ezyquw") - .withMomentum("qxutrpbrruyuua") - .withNesterov("lmbjwcolbmxlbnw") - .withNumberOfEpochs("cpahprzrvxhm") - .withNumberOfWorkers("hocn") - .withOptimizer("cmj") - .withRandomSeed("gxnoqrxtdis") - .withStepLRGamma("evhdlmydid") - .withStepLRStepSize("epfwwt") - .withTrainingBatchSize("doesxxhmwcdb") - .withValidationBatchSize("yo") - .withWarmupCosineLRCycles("xkxhnegknjzrbhtm") - .withWarmupCosineLRWarmupEpochs("lvukaobrlb") - .withWeightDecay("snbagnchjhg") - .withTrainingCropSize("wsocnequygdjbo") - .withValidationCropSize("rmtqjkqevadr") - .withValidationResizeSize("wiu") - .withWeightedLoss("vcmjzkxiidisczsk"), - new ImageModelDistributionSettingsClassification() - .withAmsGradient("jomevtfycnlb") - .withAugmentations("jcodkkgjiiytssi") - .withBeta1("z") - .withBeta2("ufqbvntnr") - .withDistributed("qsorh") - .withEarlyStopping("kxgnlykmxcpwzvmd") - .withEarlyStoppingDelay("sqdtiwlwxlbon") - .withEarlyStoppingPatience("bazqicqchygtvxby") - .withEnableOnnxNormalization("nepubdpkxyqvgx") - .withEvaluationFrequency("od") - .withGradientAccumulationStep("vohkxdxuws") - .withLayersToFreeze("fmcwnosb") - .withLearningRate("ehgcvkbcknjo") - .withLearningRateScheduler("jy") - .withModelName("pvelszerqze") - .withMomentum("o") - .withNesterov("intxwa") - .withNumberOfEpochs("glzoblqwa") - .withNumberOfWorkers("r") - .withOptimizer("lhm") - .withRandomSeed("qb") - .withStepLRGamma("vafjrqpjiyrqj") - .withStepLRStepSize("gaxwmzwdfkbnrzo") - .withTrainingBatchSize("dltb") - .withValidationBatchSize("tqjfgxxsaet") - .withWarmupCosineLRCycles("dgvpyig") - .withWarmupCosineLRWarmupEpochs("qqil") - .withWeightDecay("cduwjoedx") - .withTrainingCropSize("uowakyw") - .withValidationCropSize("hjym") - .withValidationResizeSize("gqtagd") - .withWeightedLoss("lss"))); - model = BinaryData.fromObject(model).toObject(ImageClassificationBase.class); - Assertions.assertEquals(1780634429, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(899036768, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT30H59M40S"), model.limitSettings().timeout()); - Assertions.assertEquals(1408151149, model.sweepSettings().earlyTermination().delayEvaluation()); - Assertions.assertEquals(505810781, model.sweepSettings().earlyTermination().evaluationInterval()); - Assertions.assertEquals(SamplingAlgorithmType.RANDOM, model.sweepSettings().samplingAlgorithm()); - Assertions.assertEquals("dcvjwc", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.validationData().mode()); - Assertions.assertEquals("jqqacdmkx", model.validationData().uri()); - Assertions.assertEquals(47.866367600253014D, model.validationDataSize()); - Assertions.assertEquals("a", model.modelSettings().advancedSettings()); - Assertions.assertEquals(true, model.modelSettings().amsGradient()); - Assertions.assertEquals("nhsenwphpzfng", model.modelSettings().augmentations()); - Assertions.assertEquals(24.413616F, model.modelSettings().beta1()); - Assertions.assertEquals(87.05071F, model.modelSettings().beta2()); - Assertions.assertEquals(304312927, model.modelSettings().checkpointFrequency()); - Assertions.assertEquals("k", model.modelSettings().checkpointModel().description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.modelSettings().checkpointModel().mode()); - Assertions.assertEquals("wjjufwbe", model.modelSettings().checkpointModel().uri()); - Assertions.assertEquals("rhtssr", model.modelSettings().checkpointRunId()); - Assertions.assertEquals(false, model.modelSettings().distributed()); - Assertions.assertEquals(true, model.modelSettings().earlyStopping()); - Assertions.assertEquals(1979060010, model.modelSettings().earlyStoppingDelay()); - Assertions.assertEquals(1774020224, model.modelSettings().earlyStoppingPatience()); - Assertions.assertEquals(true, model.modelSettings().enableOnnxNormalization()); - Assertions.assertEquals(853491099, model.modelSettings().evaluationFrequency()); - Assertions.assertEquals(1971606507, model.modelSettings().gradientAccumulationStep()); - Assertions.assertEquals(323558985, model.modelSettings().layersToFreeze()); - Assertions.assertEquals(42.430317F, model.modelSettings().learningRate()); - Assertions.assertEquals(LearningRateScheduler.STEP, model.modelSettings().learningRateScheduler()); - Assertions.assertEquals("zwxiytx", model.modelSettings().modelName()); - Assertions.assertEquals(51.025497F, model.modelSettings().momentum()); - Assertions.assertEquals(true, model.modelSettings().nesterov()); - Assertions.assertEquals(1378257495, model.modelSettings().numberOfEpochs()); - Assertions.assertEquals(1753150962, model.modelSettings().numberOfWorkers()); - Assertions.assertEquals(StochasticOptimizer.ADAM, model.modelSettings().optimizer()); - Assertions.assertEquals(1914645473, model.modelSettings().randomSeed()); - Assertions.assertEquals(97.39071F, model.modelSettings().stepLRGamma()); - Assertions.assertEquals(218117716, model.modelSettings().stepLRStepSize()); - Assertions.assertEquals(1079594168, model.modelSettings().trainingBatchSize()); - Assertions.assertEquals(2132424945, model.modelSettings().validationBatchSize()); - Assertions.assertEquals(66.13355F, model.modelSettings().warmupCosineLRCycles()); - Assertions.assertEquals(568274703, model.modelSettings().warmupCosineLRWarmupEpochs()); - Assertions.assertEquals(67.716774F, model.modelSettings().weightDecay()); - Assertions.assertEquals(632161025, model.modelSettings().trainingCropSize()); - Assertions.assertEquals(1319895932, model.modelSettings().validationCropSize()); - Assertions.assertEquals(1773341425, model.modelSettings().validationResizeSize()); - Assertions.assertEquals(2065297037, model.modelSettings().weightedLoss()); - Assertions.assertEquals("fueqfrojs", model.searchSpace().get(0).amsGradient()); - Assertions.assertEquals("grhydk", model.searchSpace().get(0).augmentations()); - Assertions.assertEquals("ywezskiecafyg", model.searchSpace().get(0).beta1()); - Assertions.assertEquals("xieqv", model.searchSpace().get(0).beta2()); - Assertions.assertEquals("makli", model.searchSpace().get(0).distributed()); - Assertions.assertEquals("cahyhx", model.searchSpace().get(0).earlyStopping()); - Assertions.assertEquals("ybxawoijpodtblx", model.searchSpace().get(0).earlyStoppingDelay()); - Assertions.assertEquals("kwjdjodqhy", model.searchSpace().get(0).earlyStoppingPatience()); - Assertions.assertEquals("ncn", model.searchSpace().get(0).enableOnnxNormalization()); - Assertions.assertEquals("mehllizhceu", model.searchSpace().get(0).evaluationFrequency()); - Assertions.assertEquals("qodkadppyibngql", model.searchSpace().get(0).gradientAccumulationStep()); - Assertions.assertEquals("ywrxw", model.searchSpace().get(0).layersToFreeze()); - Assertions.assertEquals("dtluvvadswzsn", model.searchSpace().get(0).learningRate()); - Assertions.assertEquals("emlowuowhl", model.searchSpace().get(0).learningRateScheduler()); - Assertions.assertEquals("nwyrmouv", model.searchSpace().get(0).modelName()); - Assertions.assertEquals("gmokzkltrfowt", model.searchSpace().get(0).momentum()); - Assertions.assertEquals("rfmvlihcvjdrqcrj", model.searchSpace().get(0).nesterov()); - Assertions.assertEquals("h", model.searchSpace().get(0).numberOfEpochs()); - Assertions.assertEquals("ukvhd", model.searchSpace().get(0).numberOfWorkers()); - Assertions.assertEquals("wyojbfqzdkfnjyi", model.searchSpace().get(0).optimizer()); - Assertions.assertEquals("afr", model.searchSpace().get(0).randomSeed()); - Assertions.assertEquals("qxmbjroumzzn", model.searchSpace().get(0).stepLRGamma()); - Assertions.assertEquals("l", model.searchSpace().get(0).stepLRStepSize()); - Assertions.assertEquals("rhuzgfxonjtpu", model.searchSpace().get(0).trainingBatchSize()); - Assertions.assertEquals("l", model.searchSpace().get(0).validationBatchSize()); - Assertions.assertEquals("pvti", model.searchSpace().get(0).warmupCosineLRCycles()); - Assertions.assertEquals("zbpdbo", model.searchSpace().get(0).warmupCosineLRWarmupEpochs()); - Assertions.assertEquals("gryfqiuasig", model.searchSpace().get(0).weightDecay()); - Assertions.assertEquals("egmmuteyxe", model.searchSpace().get(0).trainingCropSize()); - Assertions.assertEquals("uqi", model.searchSpace().get(0).validationCropSize()); - Assertions.assertEquals("jiitnspxlzdesygr", model.searchSpace().get(0).validationResizeSize()); - Assertions.assertEquals("waiufanra", model.searchSpace().get(0).weightedLoss()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageClassificationMultilabelTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageClassificationMultilabelTests.java deleted file mode 100644 index 8e2df216288ff..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageClassificationMultilabelTests.java +++ /dev/null @@ -1,414 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ClassificationMultilabelPrimaryMetrics; -import com.azure.resourcemanager.machinelearning.models.EarlyTerminationPolicy; -import com.azure.resourcemanager.machinelearning.models.ImageClassificationMultilabel; -import com.azure.resourcemanager.machinelearning.models.ImageLimitSettings; -import com.azure.resourcemanager.machinelearning.models.ImageModelDistributionSettingsClassification; -import com.azure.resourcemanager.machinelearning.models.ImageModelSettingsClassification; -import com.azure.resourcemanager.machinelearning.models.ImageSweepSettings; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.LearningRateScheduler; -import com.azure.resourcemanager.machinelearning.models.LogVerbosity; -import com.azure.resourcemanager.machinelearning.models.MLFlowModelJobInput; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import com.azure.resourcemanager.machinelearning.models.SamplingAlgorithmType; -import com.azure.resourcemanager.machinelearning.models.StochasticOptimizer; -import java.time.Duration; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ImageClassificationMultilabelTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageClassificationMultilabel model = - BinaryData - .fromString( - "{\"taskType\":\"ImageClassificationMultilabel\",\"primaryMetric\":\"AUCWeighted\",\"modelSettings\":{\"trainingCropSize\":417240457,\"validationCropSize\":789963505,\"validationResizeSize\":69598333,\"weightedLoss\":1308483372,\"advancedSettings\":\"bjkdtfohf\",\"amsGradient\":true,\"augmentations\":\"vkiwrsiwdyjqu\",\"beta1\":22.829306,\"beta2\":15.07703,\"checkpointFrequency\":405607966,\"checkpointModel\":{\"jobInputType\":\"mlflow_model\",\"mode\":\"EvalMount\",\"uri\":\"kcsueho\",\"description\":\"dac\"},\"checkpointRunId\":\"bgydlqidywm\",\"distributed\":true,\"earlyStopping\":false,\"earlyStoppingDelay\":750629994,\"earlyStoppingPatience\":1002138354,\"enableOnnxNormalization\":false,\"evaluationFrequency\":1214590834,\"gradientAccumulationStep\":1690234008,\"layersToFreeze\":541884766,\"learningRate\":83.81946,\"learningRateScheduler\":\"None\",\"modelName\":\"fnqt\",\"momentum\":10.774154,\"nesterov\":false,\"numberOfEpochs\":1583628489,\"numberOfWorkers\":10545664,\"optimizer\":\"Adamw\",\"randomSeed\":645986055,\"stepLRGamma\":13.888711,\"stepLRStepSize\":1004373323,\"trainingBatchSize\":1424628175,\"validationBatchSize\":1893405653,\"warmupCosineLRCycles\":73.06933,\"warmupCosineLRWarmupEpochs\":669991542,\"weightDecay\":8.02623},\"searchSpace\":[{\"trainingCropSize\":\"x\",\"validationCropSize\":\"vmywhsbrcarycsjj\",\"validationResizeSize\":\"voaqajuvehzptdmk\",\"weightedLoss\":\"bhmpfulubefgybp\",\"amsGradient\":\"bfununmpzkrv\",\"augmentations\":\"ifkdschlzvf\",\"beta1\":\"tnkjjwgcwnphb\",\"beta2\":\"fyrtogmhmjp\",\"distributed\":\"cdf\",\"earlyStopping\":\"qwtygevgwmseharx\",\"earlyStoppingDelay\":\"vqnrxtmbpj\",\"earlyStoppingPatience\":\"nvwjhrsidqpxl\",\"enableOnnxNormalization\":\"pakftngatwm\",\"evaluationFrequency\":\"yutrymd\",\"gradientAccumulationStep\":\"fj\",\"layersToFreeze\":\"y\",\"learningRate\":\"jqdvdwkqpldrlefg\",\"learningRateScheduler\":\"avuagnteta\",\"modelName\":\"tnpdctuhspfefy\",\"momentum\":\"duyeuyl\",\"nesterov\":\"hmtybkcgsuthhll\",\"numberOfEpochs\":\"wynefx\",\"numberOfWorkers\":\"lf\",\"optimizer\":\"atxtjrrlkmdskjhh\",\"randomSeed\":\"lajfoxcxscvslxlh\",\"stepLRGamma\":\"vkrmukmyjmkx\",\"stepLRStepSize\":\"tcsloj\",\"trainingBatchSize\":\"qid\",\"validationBatchSize\":\"toqxjh\",\"warmupCosineLRCycles\":\"csqhtkbtnqlrng\",\"warmupCosineLRWarmupEpochs\":\"mbiipsnawwlqk\",\"weightDecay\":\"xhhllxricct\"},{\"trainingCropSize\":\"muqqoajxei\",\"validationCropSize\":\"lesrwva\",\"validationResizeSize\":\"hdctrceqn\",\"weightedLoss\":\"rupobehd\",\"amsGradient\":\"jzacvumepjpbibn\",\"augmentations\":\"phepifexleqirc\",\"beta1\":\"cly\",\"beta2\":\"gxvrpjl\",\"distributed\":\"zuodacpun\",\"earlyStopping\":\"tepdjxqes\",\"earlyStoppingDelay\":\"ynu\",\"earlyStoppingPatience\":\"lpckaewsedves\",\"enableOnnxNormalization\":\"xegqphr\",\"evaluationFrequency\":\"nzhctmjtsgh\",\"gradientAccumulationStep\":\"c\",\"layersToFreeze\":\"pzarpzeqacdld\",\"learningRate\":\"mpypefcpczshnuq\",\"learningRateScheduler\":\"aizu\",\"modelName\":\"kh\",\"momentum\":\"tu\",\"nesterov\":\"xhmt\",\"numberOfEpochs\":\"vegwqiukvz\",\"numberOfWorkers\":\"dwttha\",\"optimizer\":\"gkskjivbss\",\"randomSeed\":\"jqf\",\"stepLRGamma\":\"peexpgeumilhwuit\",\"stepLRStepSize\":\"exyionofninbd\",\"trainingBatchSize\":\"s\",\"validationBatchSize\":\"wqqrsmpcbbprtuga\",\"warmupCosineLRCycles\":\"zbcyksiv\",\"warmupCosineLRWarmupEpochs\":\"ogd\",\"weightDecay\":\"bfcmkrfts\"},{\"trainingCropSize\":\"wjjxsgm\",\"validationCropSize\":\"wvif\",\"validationResizeSize\":\"kecifhocjxwklo\",\"weightedLoss\":\"rvtxvcmufunlc\",\"amsGradient\":\"xvi\",\"augmentations\":\"eyngjg\",\"beta1\":\"quv\",\"beta2\":\"gglpmcrdcuelj\",\"distributed\":\"ahxm\",\"earlyStopping\":\"ryarvsxzqb\",\"earlyStoppingDelay\":\"cjkay\",\"earlyStoppingPatience\":\"thzodubtlmjtgbl\",\"enableOnnxNormalization\":\"skkfmk\",\"evaluationFrequency\":\"djxyxgbkkqvjcteo\",\"gradientAccumulationStep\":\"l\",\"layersToFreeze\":\"lskkzpxvj\",\"learningRate\":\"dpvocojhpcn\",\"learningRateScheduler\":\"xzfsnggytexvzilm\",\"modelName\":\"vzkwwwncknr\",\"momentum\":\"ajlskzptj\",\"nesterov\":\"lwe\",\"numberOfEpochs\":\"yrth\",\"numberOfWorkers\":\"lehmcgcjeinueho\",\"optimizer\":\"mvfejvqnttmbqd\",\"randomSeed\":\"zfivfokpysthhzag\",\"stepLRGamma\":\"wyy\",\"stepLRStepSize\":\"hgenuzejgvkveb\",\"trainingBatchSize\":\"szllrzlsmmdqgmi\",\"validationBatchSize\":\"pimcqrhn\",\"warmupCosineLRCycles\":\"minkl\",\"warmupCosineLRWarmupEpochs\":\"xsvtzarhzvqnsqk\",\"weightDecay\":\"mbjwzzoslpkyb\"},{\"trainingCropSize\":\"lwkzpgajsqjcem\",\"validationCropSize\":\"mfuvqarwzxuqr\",\"validationResizeSize\":\"lui\",\"weightedLoss\":\"bwxsfgtdm\",\"amsGradient\":\"xekr\",\"augmentations\":\"k\",\"beta1\":\"budbt\",\"beta2\":\"okbavlyttaak\",\"distributed\":\"frkebsmhpd\",\"earlyStopping\":\"dig\",\"earlyStoppingDelay\":\"olekscbctnanqim\",\"earlyStoppingPatience\":\"zxpdcldpkawnsnl\",\"enableOnnxNormalization\":\"mouxwksqmudmfco\",\"evaluationFrequency\":\"icziuswswjrkb\",\"gradientAccumulationStep\":\"jhbtqq\",\"layersToFreeze\":\"fs\",\"learningRate\":\"rfwb\",\"learningRateScheduler\":\"qvogfuyz\",\"modelName\":\"bhli\",\"momentum\":\"yqe\",\"nesterov\":\"ood\",\"numberOfEpochs\":\"kcdrdaasaxxobsm\",\"numberOfWorkers\":\"wiyjvzuko\",\"optimizer\":\"nawnvz\",\"randomSeed\":\"n\",\"stepLRGamma\":\"ywsxvjabjqqaxu\",\"stepLRStepSize\":\"y\",\"trainingBatchSize\":\"nudn\",\"validationBatchSize\":\"abhjx\",\"warmupCosineLRCycles\":\"qweuip\",\"warmupCosineLRWarmupEpochs\":\"vk\",\"weightDecay\":\"itnsqxtltc\"}],\"limitSettings\":{\"maxConcurrentTrials\":2077569332,\"maxTrials\":49498731,\"timeout\":\"PT39H45M28S\"},\"sweepSettings\":{\"earlyTermination\":{\"policyType\":\"EarlyTerminationPolicy\",\"delayEvaluation\":1996640929,\"evaluationInterval\":1459369662},\"samplingAlgorithm\":\"Bayesian\"},\"validationData\":{\"jobInputType\":\"mltable\",\"mode\":\"EvalMount\",\"uri\":\"d\",\"description\":\"c\"},\"validationDataSize\":60.747284942704425,\"logVerbosity\":\"Debug\",\"targetColumnName\":\"rjajqmatxjtie\",\"trainingData\":{\"jobInputType\":\"mltable\",\"mode\":\"Direct\",\"uri\":\"qgxxgfbb\",\"description\":\"lpqagyn\"}}") - .toObject(ImageClassificationMultilabel.class); - Assertions.assertEquals(LogVerbosity.DEBUG, model.logVerbosity()); - Assertions.assertEquals("rjajqmatxjtie", model.targetColumnName()); - Assertions.assertEquals("lpqagyn", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.trainingData().mode()); - Assertions.assertEquals("qgxxgfbb", model.trainingData().uri()); - Assertions.assertEquals(ClassificationMultilabelPrimaryMetrics.AUCWEIGHTED, model.primaryMetric()); - Assertions.assertEquals("bjkdtfohf", model.modelSettings().advancedSettings()); - Assertions.assertEquals(true, model.modelSettings().amsGradient()); - Assertions.assertEquals("vkiwrsiwdyjqu", model.modelSettings().augmentations()); - Assertions.assertEquals(22.829306F, model.modelSettings().beta1()); - Assertions.assertEquals(15.07703F, model.modelSettings().beta2()); - Assertions.assertEquals(405607966, model.modelSettings().checkpointFrequency()); - Assertions.assertEquals("dac", model.modelSettings().checkpointModel().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_MOUNT, model.modelSettings().checkpointModel().mode()); - Assertions.assertEquals("kcsueho", model.modelSettings().checkpointModel().uri()); - Assertions.assertEquals("bgydlqidywm", model.modelSettings().checkpointRunId()); - Assertions.assertEquals(true, model.modelSettings().distributed()); - Assertions.assertEquals(false, model.modelSettings().earlyStopping()); - Assertions.assertEquals(750629994, model.modelSettings().earlyStoppingDelay()); - Assertions.assertEquals(1002138354, model.modelSettings().earlyStoppingPatience()); - Assertions.assertEquals(false, model.modelSettings().enableOnnxNormalization()); - Assertions.assertEquals(1214590834, model.modelSettings().evaluationFrequency()); - Assertions.assertEquals(1690234008, model.modelSettings().gradientAccumulationStep()); - Assertions.assertEquals(541884766, model.modelSettings().layersToFreeze()); - Assertions.assertEquals(83.81946F, model.modelSettings().learningRate()); - Assertions.assertEquals(LearningRateScheduler.NONE, model.modelSettings().learningRateScheduler()); - Assertions.assertEquals("fnqt", model.modelSettings().modelName()); - Assertions.assertEquals(10.774154F, model.modelSettings().momentum()); - Assertions.assertEquals(false, model.modelSettings().nesterov()); - Assertions.assertEquals(1583628489, model.modelSettings().numberOfEpochs()); - Assertions.assertEquals(10545664, model.modelSettings().numberOfWorkers()); - Assertions.assertEquals(StochasticOptimizer.ADAMW, model.modelSettings().optimizer()); - Assertions.assertEquals(645986055, model.modelSettings().randomSeed()); - Assertions.assertEquals(13.888711F, model.modelSettings().stepLRGamma()); - Assertions.assertEquals(1004373323, model.modelSettings().stepLRStepSize()); - Assertions.assertEquals(1424628175, model.modelSettings().trainingBatchSize()); - Assertions.assertEquals(1893405653, model.modelSettings().validationBatchSize()); - Assertions.assertEquals(73.06933F, model.modelSettings().warmupCosineLRCycles()); - Assertions.assertEquals(669991542, model.modelSettings().warmupCosineLRWarmupEpochs()); - Assertions.assertEquals(8.02623F, model.modelSettings().weightDecay()); - Assertions.assertEquals(417240457, model.modelSettings().trainingCropSize()); - Assertions.assertEquals(789963505, model.modelSettings().validationCropSize()); - Assertions.assertEquals(69598333, model.modelSettings().validationResizeSize()); - Assertions.assertEquals(1308483372, model.modelSettings().weightedLoss()); - Assertions.assertEquals("bfununmpzkrv", model.searchSpace().get(0).amsGradient()); - Assertions.assertEquals("ifkdschlzvf", model.searchSpace().get(0).augmentations()); - Assertions.assertEquals("tnkjjwgcwnphb", model.searchSpace().get(0).beta1()); - Assertions.assertEquals("fyrtogmhmjp", model.searchSpace().get(0).beta2()); - Assertions.assertEquals("cdf", model.searchSpace().get(0).distributed()); - Assertions.assertEquals("qwtygevgwmseharx", model.searchSpace().get(0).earlyStopping()); - Assertions.assertEquals("vqnrxtmbpj", model.searchSpace().get(0).earlyStoppingDelay()); - Assertions.assertEquals("nvwjhrsidqpxl", model.searchSpace().get(0).earlyStoppingPatience()); - Assertions.assertEquals("pakftngatwm", model.searchSpace().get(0).enableOnnxNormalization()); - Assertions.assertEquals("yutrymd", model.searchSpace().get(0).evaluationFrequency()); - Assertions.assertEquals("fj", model.searchSpace().get(0).gradientAccumulationStep()); - Assertions.assertEquals("y", model.searchSpace().get(0).layersToFreeze()); - Assertions.assertEquals("jqdvdwkqpldrlefg", model.searchSpace().get(0).learningRate()); - Assertions.assertEquals("avuagnteta", model.searchSpace().get(0).learningRateScheduler()); - Assertions.assertEquals("tnpdctuhspfefy", model.searchSpace().get(0).modelName()); - Assertions.assertEquals("duyeuyl", model.searchSpace().get(0).momentum()); - Assertions.assertEquals("hmtybkcgsuthhll", model.searchSpace().get(0).nesterov()); - Assertions.assertEquals("wynefx", model.searchSpace().get(0).numberOfEpochs()); - Assertions.assertEquals("lf", model.searchSpace().get(0).numberOfWorkers()); - Assertions.assertEquals("atxtjrrlkmdskjhh", model.searchSpace().get(0).optimizer()); - Assertions.assertEquals("lajfoxcxscvslxlh", model.searchSpace().get(0).randomSeed()); - Assertions.assertEquals("vkrmukmyjmkx", model.searchSpace().get(0).stepLRGamma()); - Assertions.assertEquals("tcsloj", model.searchSpace().get(0).stepLRStepSize()); - Assertions.assertEquals("qid", model.searchSpace().get(0).trainingBatchSize()); - Assertions.assertEquals("toqxjh", model.searchSpace().get(0).validationBatchSize()); - Assertions.assertEquals("csqhtkbtnqlrng", model.searchSpace().get(0).warmupCosineLRCycles()); - Assertions.assertEquals("mbiipsnawwlqk", model.searchSpace().get(0).warmupCosineLRWarmupEpochs()); - Assertions.assertEquals("xhhllxricct", model.searchSpace().get(0).weightDecay()); - Assertions.assertEquals("x", model.searchSpace().get(0).trainingCropSize()); - Assertions.assertEquals("vmywhsbrcarycsjj", model.searchSpace().get(0).validationCropSize()); - Assertions.assertEquals("voaqajuvehzptdmk", model.searchSpace().get(0).validationResizeSize()); - Assertions.assertEquals("bhmpfulubefgybp", model.searchSpace().get(0).weightedLoss()); - Assertions.assertEquals(2077569332, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(49498731, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT39H45M28S"), model.limitSettings().timeout()); - Assertions.assertEquals(1996640929, model.sweepSettings().earlyTermination().delayEvaluation()); - Assertions.assertEquals(1459369662, model.sweepSettings().earlyTermination().evaluationInterval()); - Assertions.assertEquals(SamplingAlgorithmType.BAYESIAN, model.sweepSettings().samplingAlgorithm()); - Assertions.assertEquals("c", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_MOUNT, model.validationData().mode()); - Assertions.assertEquals("d", model.validationData().uri()); - Assertions.assertEquals(60.747284942704425D, model.validationDataSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageClassificationMultilabel model = - new ImageClassificationMultilabel() - .withLogVerbosity(LogVerbosity.DEBUG) - .withTargetColumnName("rjajqmatxjtie") - .withTrainingData( - new MLTableJobInput() - .withDescription("lpqagyn") - .withMode(InputDeliveryMode.DIRECT) - .withUri("qgxxgfbb")) - .withPrimaryMetric(ClassificationMultilabelPrimaryMetrics.AUCWEIGHTED) - .withModelSettings( - new ImageModelSettingsClassification() - .withAdvancedSettings("bjkdtfohf") - .withAmsGradient(true) - .withAugmentations("vkiwrsiwdyjqu") - .withBeta1(22.829306F) - .withBeta2(15.07703F) - .withCheckpointFrequency(405607966) - .withCheckpointModel( - new MLFlowModelJobInput() - .withDescription("dac") - .withMode(InputDeliveryMode.EVAL_MOUNT) - .withUri("kcsueho")) - .withCheckpointRunId("bgydlqidywm") - .withDistributed(true) - .withEarlyStopping(false) - .withEarlyStoppingDelay(750629994) - .withEarlyStoppingPatience(1002138354) - .withEnableOnnxNormalization(false) - .withEvaluationFrequency(1214590834) - .withGradientAccumulationStep(1690234008) - .withLayersToFreeze(541884766) - .withLearningRate(83.81946F) - .withLearningRateScheduler(LearningRateScheduler.NONE) - .withModelName("fnqt") - .withMomentum(10.774154F) - .withNesterov(false) - .withNumberOfEpochs(1583628489) - .withNumberOfWorkers(10545664) - .withOptimizer(StochasticOptimizer.ADAMW) - .withRandomSeed(645986055) - .withStepLRGamma(13.888711F) - .withStepLRStepSize(1004373323) - .withTrainingBatchSize(1424628175) - .withValidationBatchSize(1893405653) - .withWarmupCosineLRCycles(73.06933F) - .withWarmupCosineLRWarmupEpochs(669991542) - .withWeightDecay(8.02623F) - .withTrainingCropSize(417240457) - .withValidationCropSize(789963505) - .withValidationResizeSize(69598333) - .withWeightedLoss(1308483372)) - .withSearchSpace( - Arrays - .asList( - new ImageModelDistributionSettingsClassification() - .withAmsGradient("bfununmpzkrv") - .withAugmentations("ifkdschlzvf") - .withBeta1("tnkjjwgcwnphb") - .withBeta2("fyrtogmhmjp") - .withDistributed("cdf") - .withEarlyStopping("qwtygevgwmseharx") - .withEarlyStoppingDelay("vqnrxtmbpj") - .withEarlyStoppingPatience("nvwjhrsidqpxl") - .withEnableOnnxNormalization("pakftngatwm") - .withEvaluationFrequency("yutrymd") - .withGradientAccumulationStep("fj") - .withLayersToFreeze("y") - .withLearningRate("jqdvdwkqpldrlefg") - .withLearningRateScheduler("avuagnteta") - .withModelName("tnpdctuhspfefy") - .withMomentum("duyeuyl") - .withNesterov("hmtybkcgsuthhll") - .withNumberOfEpochs("wynefx") - .withNumberOfWorkers("lf") - .withOptimizer("atxtjrrlkmdskjhh") - .withRandomSeed("lajfoxcxscvslxlh") - .withStepLRGamma("vkrmukmyjmkx") - .withStepLRStepSize("tcsloj") - .withTrainingBatchSize("qid") - .withValidationBatchSize("toqxjh") - .withWarmupCosineLRCycles("csqhtkbtnqlrng") - .withWarmupCosineLRWarmupEpochs("mbiipsnawwlqk") - .withWeightDecay("xhhllxricct") - .withTrainingCropSize("x") - .withValidationCropSize("vmywhsbrcarycsjj") - .withValidationResizeSize("voaqajuvehzptdmk") - .withWeightedLoss("bhmpfulubefgybp"), - new ImageModelDistributionSettingsClassification() - .withAmsGradient("jzacvumepjpbibn") - .withAugmentations("phepifexleqirc") - .withBeta1("cly") - .withBeta2("gxvrpjl") - .withDistributed("zuodacpun") - .withEarlyStopping("tepdjxqes") - .withEarlyStoppingDelay("ynu") - .withEarlyStoppingPatience("lpckaewsedves") - .withEnableOnnxNormalization("xegqphr") - .withEvaluationFrequency("nzhctmjtsgh") - .withGradientAccumulationStep("c") - .withLayersToFreeze("pzarpzeqacdld") - .withLearningRate("mpypefcpczshnuq") - .withLearningRateScheduler("aizu") - .withModelName("kh") - .withMomentum("tu") - .withNesterov("xhmt") - .withNumberOfEpochs("vegwqiukvz") - .withNumberOfWorkers("dwttha") - .withOptimizer("gkskjivbss") - .withRandomSeed("jqf") - .withStepLRGamma("peexpgeumilhwuit") - .withStepLRStepSize("exyionofninbd") - .withTrainingBatchSize("s") - .withValidationBatchSize("wqqrsmpcbbprtuga") - .withWarmupCosineLRCycles("zbcyksiv") - .withWarmupCosineLRWarmupEpochs("ogd") - .withWeightDecay("bfcmkrfts") - .withTrainingCropSize("muqqoajxei") - .withValidationCropSize("lesrwva") - .withValidationResizeSize("hdctrceqn") - .withWeightedLoss("rupobehd"), - new ImageModelDistributionSettingsClassification() - .withAmsGradient("xvi") - .withAugmentations("eyngjg") - .withBeta1("quv") - .withBeta2("gglpmcrdcuelj") - .withDistributed("ahxm") - .withEarlyStopping("ryarvsxzqb") - .withEarlyStoppingDelay("cjkay") - .withEarlyStoppingPatience("thzodubtlmjtgbl") - .withEnableOnnxNormalization("skkfmk") - .withEvaluationFrequency("djxyxgbkkqvjcteo") - .withGradientAccumulationStep("l") - .withLayersToFreeze("lskkzpxvj") - .withLearningRate("dpvocojhpcn") - .withLearningRateScheduler("xzfsnggytexvzilm") - .withModelName("vzkwwwncknr") - .withMomentum("ajlskzptj") - .withNesterov("lwe") - .withNumberOfEpochs("yrth") - .withNumberOfWorkers("lehmcgcjeinueho") - .withOptimizer("mvfejvqnttmbqd") - .withRandomSeed("zfivfokpysthhzag") - .withStepLRGamma("wyy") - .withStepLRStepSize("hgenuzejgvkveb") - .withTrainingBatchSize("szllrzlsmmdqgmi") - .withValidationBatchSize("pimcqrhn") - .withWarmupCosineLRCycles("minkl") - .withWarmupCosineLRWarmupEpochs("xsvtzarhzvqnsqk") - .withWeightDecay("mbjwzzoslpkyb") - .withTrainingCropSize("wjjxsgm") - .withValidationCropSize("wvif") - .withValidationResizeSize("kecifhocjxwklo") - .withWeightedLoss("rvtxvcmufunlc"), - new ImageModelDistributionSettingsClassification() - .withAmsGradient("xekr") - .withAugmentations("k") - .withBeta1("budbt") - .withBeta2("okbavlyttaak") - .withDistributed("frkebsmhpd") - .withEarlyStopping("dig") - .withEarlyStoppingDelay("olekscbctnanqim") - .withEarlyStoppingPatience("zxpdcldpkawnsnl") - .withEnableOnnxNormalization("mouxwksqmudmfco") - .withEvaluationFrequency("icziuswswjrkb") - .withGradientAccumulationStep("jhbtqq") - .withLayersToFreeze("fs") - .withLearningRate("rfwb") - .withLearningRateScheduler("qvogfuyz") - .withModelName("bhli") - .withMomentum("yqe") - .withNesterov("ood") - .withNumberOfEpochs("kcdrdaasaxxobsm") - .withNumberOfWorkers("wiyjvzuko") - .withOptimizer("nawnvz") - .withRandomSeed("n") - .withStepLRGamma("ywsxvjabjqqaxu") - .withStepLRStepSize("y") - .withTrainingBatchSize("nudn") - .withValidationBatchSize("abhjx") - .withWarmupCosineLRCycles("qweuip") - .withWarmupCosineLRWarmupEpochs("vk") - .withWeightDecay("itnsqxtltc") - .withTrainingCropSize("lwkzpgajsqjcem") - .withValidationCropSize("mfuvqarwzxuqr") - .withValidationResizeSize("lui") - .withWeightedLoss("bwxsfgtdm"))) - .withLimitSettings( - new ImageLimitSettings() - .withMaxConcurrentTrials(2077569332) - .withMaxTrials(49498731) - .withTimeout(Duration.parse("PT39H45M28S"))) - .withSweepSettings( - new ImageSweepSettings() - .withEarlyTermination( - new EarlyTerminationPolicy() - .withDelayEvaluation(1996640929) - .withEvaluationInterval(1459369662)) - .withSamplingAlgorithm(SamplingAlgorithmType.BAYESIAN)) - .withValidationData( - new MLTableJobInput().withDescription("c").withMode(InputDeliveryMode.EVAL_MOUNT).withUri("d")) - .withValidationDataSize(60.747284942704425D); - model = BinaryData.fromObject(model).toObject(ImageClassificationMultilabel.class); - Assertions.assertEquals(LogVerbosity.DEBUG, model.logVerbosity()); - Assertions.assertEquals("rjajqmatxjtie", model.targetColumnName()); - Assertions.assertEquals("lpqagyn", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.trainingData().mode()); - Assertions.assertEquals("qgxxgfbb", model.trainingData().uri()); - Assertions.assertEquals(ClassificationMultilabelPrimaryMetrics.AUCWEIGHTED, model.primaryMetric()); - Assertions.assertEquals("bjkdtfohf", model.modelSettings().advancedSettings()); - Assertions.assertEquals(true, model.modelSettings().amsGradient()); - Assertions.assertEquals("vkiwrsiwdyjqu", model.modelSettings().augmentations()); - Assertions.assertEquals(22.829306F, model.modelSettings().beta1()); - Assertions.assertEquals(15.07703F, model.modelSettings().beta2()); - Assertions.assertEquals(405607966, model.modelSettings().checkpointFrequency()); - Assertions.assertEquals("dac", model.modelSettings().checkpointModel().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_MOUNT, model.modelSettings().checkpointModel().mode()); - Assertions.assertEquals("kcsueho", model.modelSettings().checkpointModel().uri()); - Assertions.assertEquals("bgydlqidywm", model.modelSettings().checkpointRunId()); - Assertions.assertEquals(true, model.modelSettings().distributed()); - Assertions.assertEquals(false, model.modelSettings().earlyStopping()); - Assertions.assertEquals(750629994, model.modelSettings().earlyStoppingDelay()); - Assertions.assertEquals(1002138354, model.modelSettings().earlyStoppingPatience()); - Assertions.assertEquals(false, model.modelSettings().enableOnnxNormalization()); - Assertions.assertEquals(1214590834, model.modelSettings().evaluationFrequency()); - Assertions.assertEquals(1690234008, model.modelSettings().gradientAccumulationStep()); - Assertions.assertEquals(541884766, model.modelSettings().layersToFreeze()); - Assertions.assertEquals(83.81946F, model.modelSettings().learningRate()); - Assertions.assertEquals(LearningRateScheduler.NONE, model.modelSettings().learningRateScheduler()); - Assertions.assertEquals("fnqt", model.modelSettings().modelName()); - Assertions.assertEquals(10.774154F, model.modelSettings().momentum()); - Assertions.assertEquals(false, model.modelSettings().nesterov()); - Assertions.assertEquals(1583628489, model.modelSettings().numberOfEpochs()); - Assertions.assertEquals(10545664, model.modelSettings().numberOfWorkers()); - Assertions.assertEquals(StochasticOptimizer.ADAMW, model.modelSettings().optimizer()); - Assertions.assertEquals(645986055, model.modelSettings().randomSeed()); - Assertions.assertEquals(13.888711F, model.modelSettings().stepLRGamma()); - Assertions.assertEquals(1004373323, model.modelSettings().stepLRStepSize()); - Assertions.assertEquals(1424628175, model.modelSettings().trainingBatchSize()); - Assertions.assertEquals(1893405653, model.modelSettings().validationBatchSize()); - Assertions.assertEquals(73.06933F, model.modelSettings().warmupCosineLRCycles()); - Assertions.assertEquals(669991542, model.modelSettings().warmupCosineLRWarmupEpochs()); - Assertions.assertEquals(8.02623F, model.modelSettings().weightDecay()); - Assertions.assertEquals(417240457, model.modelSettings().trainingCropSize()); - Assertions.assertEquals(789963505, model.modelSettings().validationCropSize()); - Assertions.assertEquals(69598333, model.modelSettings().validationResizeSize()); - Assertions.assertEquals(1308483372, model.modelSettings().weightedLoss()); - Assertions.assertEquals("bfununmpzkrv", model.searchSpace().get(0).amsGradient()); - Assertions.assertEquals("ifkdschlzvf", model.searchSpace().get(0).augmentations()); - Assertions.assertEquals("tnkjjwgcwnphb", model.searchSpace().get(0).beta1()); - Assertions.assertEquals("fyrtogmhmjp", model.searchSpace().get(0).beta2()); - Assertions.assertEquals("cdf", model.searchSpace().get(0).distributed()); - Assertions.assertEquals("qwtygevgwmseharx", model.searchSpace().get(0).earlyStopping()); - Assertions.assertEquals("vqnrxtmbpj", model.searchSpace().get(0).earlyStoppingDelay()); - Assertions.assertEquals("nvwjhrsidqpxl", model.searchSpace().get(0).earlyStoppingPatience()); - Assertions.assertEquals("pakftngatwm", model.searchSpace().get(0).enableOnnxNormalization()); - Assertions.assertEquals("yutrymd", model.searchSpace().get(0).evaluationFrequency()); - Assertions.assertEquals("fj", model.searchSpace().get(0).gradientAccumulationStep()); - Assertions.assertEquals("y", model.searchSpace().get(0).layersToFreeze()); - Assertions.assertEquals("jqdvdwkqpldrlefg", model.searchSpace().get(0).learningRate()); - Assertions.assertEquals("avuagnteta", model.searchSpace().get(0).learningRateScheduler()); - Assertions.assertEquals("tnpdctuhspfefy", model.searchSpace().get(0).modelName()); - Assertions.assertEquals("duyeuyl", model.searchSpace().get(0).momentum()); - Assertions.assertEquals("hmtybkcgsuthhll", model.searchSpace().get(0).nesterov()); - Assertions.assertEquals("wynefx", model.searchSpace().get(0).numberOfEpochs()); - Assertions.assertEquals("lf", model.searchSpace().get(0).numberOfWorkers()); - Assertions.assertEquals("atxtjrrlkmdskjhh", model.searchSpace().get(0).optimizer()); - Assertions.assertEquals("lajfoxcxscvslxlh", model.searchSpace().get(0).randomSeed()); - Assertions.assertEquals("vkrmukmyjmkx", model.searchSpace().get(0).stepLRGamma()); - Assertions.assertEquals("tcsloj", model.searchSpace().get(0).stepLRStepSize()); - Assertions.assertEquals("qid", model.searchSpace().get(0).trainingBatchSize()); - Assertions.assertEquals("toqxjh", model.searchSpace().get(0).validationBatchSize()); - Assertions.assertEquals("csqhtkbtnqlrng", model.searchSpace().get(0).warmupCosineLRCycles()); - Assertions.assertEquals("mbiipsnawwlqk", model.searchSpace().get(0).warmupCosineLRWarmupEpochs()); - Assertions.assertEquals("xhhllxricct", model.searchSpace().get(0).weightDecay()); - Assertions.assertEquals("x", model.searchSpace().get(0).trainingCropSize()); - Assertions.assertEquals("vmywhsbrcarycsjj", model.searchSpace().get(0).validationCropSize()); - Assertions.assertEquals("voaqajuvehzptdmk", model.searchSpace().get(0).validationResizeSize()); - Assertions.assertEquals("bhmpfulubefgybp", model.searchSpace().get(0).weightedLoss()); - Assertions.assertEquals(2077569332, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(49498731, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT39H45M28S"), model.limitSettings().timeout()); - Assertions.assertEquals(1996640929, model.sweepSettings().earlyTermination().delayEvaluation()); - Assertions.assertEquals(1459369662, model.sweepSettings().earlyTermination().evaluationInterval()); - Assertions.assertEquals(SamplingAlgorithmType.BAYESIAN, model.sweepSettings().samplingAlgorithm()); - Assertions.assertEquals("c", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_MOUNT, model.validationData().mode()); - Assertions.assertEquals("d", model.validationData().uri()); - Assertions.assertEquals(60.747284942704425D, model.validationDataSize()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageClassificationTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageClassificationTests.java deleted file mode 100644 index 7fd05a78c2d6d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageClassificationTests.java +++ /dev/null @@ -1,384 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ClassificationPrimaryMetrics; -import com.azure.resourcemanager.machinelearning.models.EarlyTerminationPolicy; -import com.azure.resourcemanager.machinelearning.models.ImageClassification; -import com.azure.resourcemanager.machinelearning.models.ImageLimitSettings; -import com.azure.resourcemanager.machinelearning.models.ImageModelDistributionSettingsClassification; -import com.azure.resourcemanager.machinelearning.models.ImageModelSettingsClassification; -import com.azure.resourcemanager.machinelearning.models.ImageSweepSettings; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.LearningRateScheduler; -import com.azure.resourcemanager.machinelearning.models.LogVerbosity; -import com.azure.resourcemanager.machinelearning.models.MLFlowModelJobInput; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import com.azure.resourcemanager.machinelearning.models.SamplingAlgorithmType; -import com.azure.resourcemanager.machinelearning.models.StochasticOptimizer; -import java.time.Duration; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ImageClassificationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageClassification model = - BinaryData - .fromString( - "{\"taskType\":\"ImageClassification\",\"primaryMetric\":\"NormMacroRecall\",\"modelSettings\":{\"trainingCropSize\":857070249,\"validationCropSize\":372879313,\"validationResizeSize\":2040757308,\"weightedLoss\":601079141,\"advancedSettings\":\"pqitwe\",\"amsGradient\":false,\"augmentations\":\"vskbuhzacaq\",\"beta1\":35.776882,\"beta2\":7.5552106,\"checkpointFrequency\":1409246256,\"checkpointModel\":{\"jobInputType\":\"mlflow_model\",\"mode\":\"Download\",\"uri\":\"pdsxzakuejkm\",\"description\":\"iztjof\"},\"checkpointRunId\":\"vovjufycsjmlbe\",\"distributed\":false,\"earlyStopping\":true,\"earlyStoppingDelay\":1797904663,\"earlyStoppingPatience\":544161528,\"enableOnnxNormalization\":true,\"evaluationFrequency\":1168175827,\"gradientAccumulationStep\":920753916,\"layersToFreeze\":979183363,\"learningRate\":75.56595,\"learningRateScheduler\":\"None\",\"modelName\":\"jfel\",\"momentum\":99.81994,\"nesterov\":true,\"numberOfEpochs\":902490226,\"numberOfWorkers\":1270842979,\"optimizer\":\"Adam\",\"randomSeed\":1405675230,\"stepLRGamma\":4.9547615,\"stepLRStepSize\":462800461,\"trainingBatchSize\":1308773307,\"validationBatchSize\":1918220645,\"warmupCosineLRCycles\":88.28787,\"warmupCosineLRWarmupEpochs\":1219612283,\"weightDecay\":35.093628},\"searchSpace\":[{\"trainingCropSize\":\"ccgzpraoxnyu\",\"validationCropSize\":\"a\",\"validationResizeSize\":\"gftipwc\",\"weightedLoss\":\"yubhiqdx\",\"amsGradient\":\"rnpnuhzafccnuh\",\"augmentations\":\"gbylbuig\",\"beta1\":\"vatvcrkd\",\"beta2\":\"nbqxvhcsyhzlwxae\",\"distributed\":\"vurex\",\"earlyStopping\":\"d\",\"earlyStoppingDelay\":\"dwead\",\"earlyStoppingPatience\":\"zmwntopagt\",\"enableOnnxNormalization\":\"v\",\"evaluationFrequency\":\"agoaqylkjztji\",\"gradientAccumulationStep\":\"zjcg\",\"layersToFreeze\":\"itpfinzcpdl\",\"learningRate\":\"rlgjm\",\"learningRateScheduler\":\"drvcqguef\",\"modelName\":\"ompheqdur\",\"momentum\":\"yujlfyoumpckyecl\",\"nesterov\":\"igptajbrzmqxucyc\",\"numberOfEpochs\":\"oclxiut\",\"numberOfWorkers\":\"cyzyzjdnrqjbt\",\"optimizer\":\"eaoqaqbzgyhf\",\"randomSeed\":\"v\",\"stepLRGamma\":\"tbwbqamteuli\",\"stepLRStepSize\":\"lpkcvmwfauxxep\",\"trainingBatchSize\":\"wbormcqmi\",\"validationBatchSize\":\"ijqpkzfbojxjmcs\",\"warmupCosineLRCycles\":\"qwixvcpwnk\",\"warmupCosineLRWarmupEpochs\":\"wzwofalickduo\",\"weightDecay\":\"tamtyv\"},{\"trainingCropSize\":\"nxrwzawnvs\",\"validationCropSize\":\"fhzag\",\"validationResizeSize\":\"vhycvdimwrzregzg\",\"weightedLoss\":\"futrwpweryekzkd\",\"amsGradient\":\"eotta\",\"augmentations\":\"yos\",\"beta1\":\"whnhjtfv\",\"beta2\":\"dpmiljpn\",\"distributed\":\"nudqllz\",\"earlyStopping\":\"uzpjlxeehux\",\"earlyStoppingDelay\":\"hzlraymezxlsk\",\"earlyStoppingPatience\":\"mxrfdsa\",\"enableOnnxNormalization\":\"ednwyyshtu\",\"evaluationFrequency\":\"mevuafpwzy\",\"gradientAccumulationStep\":\"rkgwltxeqip\",\"layersToFreeze\":\"zdyi\",\"learningRate\":\"fayorpravkjoges\",\"learningRateScheduler\":\"bnsmjkwynqxaek\",\"modelName\":\"ykvwjtqpkevmyltj\",\"momentum\":\"spxklu\",\"nesterov\":\"clf\",\"numberOfEpochs\":\"annnoytzposewx\",\"numberOfWorkers\":\"pxvkqma\",\"optimizer\":\"xvpif\",\"randomSeed\":\"aifyzyzeyuubeids\",\"stepLRGamma\":\"fytoi\",\"stepLRStepSize\":\"gygvfltgvdiho\",\"trainingBatchSize\":\"krxwet\",\"validationBatchSize\":\"drcyrucpcun\",\"warmupCosineLRCycles\":\"zdqumoe\",\"warmupCosineLRWarmupEpochs\":\"dnaienhqhskndnel\",\"weightDecay\":\"aadl\"},{\"trainingCropSize\":\"wf\",\"validationCropSize\":\"nniyopetxi\",\"validationResizeSize\":\"nrlyxnuc\",\"weightedLoss\":\"p\",\"amsGradient\":\"lkwq\",\"augmentations\":\"tv\",\"beta1\":\"sdtcjbctvivuzqym\",\"beta2\":\"owog\",\"distributed\":\"it\",\"earlyStopping\":\"hzvb\",\"earlyStoppingDelay\":\"cdb\",\"earlyStoppingPatience\":\"fzndscxmxeatkd\",\"enableOnnxNormalization\":\"wnrdjyibqbnaom\",\"evaluationFrequency\":\"rmkuh\",\"gradientAccumulationStep\":\"xljalfihc\",\"layersToFreeze\":\"obcancdexxqcw\",\"learningRate\":\"xf\",\"learningRateScheduler\":\"aknokzwjjzrl\",\"modelName\":\"xldzyyfytpqsix\",\"momentum\":\"m\",\"nesterov\":\"jivyqlkjuv\",\"numberOfEpochs\":\"bmslzoyov\",\"numberOfWorkers\":\"dbpqvybefgvm\",\"optimizer\":\"okcvtlubses\",\"randomSeed\":\"cua\",\"stepLRGamma\":\"rhunlp\",\"stepLRStepSize\":\"ykycndzfqi\",\"trainingBatchSize\":\"reuykbbmnwagl\",\"validationBatchSize\":\"xoe\",\"warmupCosineLRCycles\":\"nqlnfwmyymvqd\",\"warmupCosineLRWarmupEpochs\":\"bhfckdvezcrcssb\",\"weightDecay\":\"ddubbnqfblhkal\"}],\"limitSettings\":{\"maxConcurrentTrials\":1165708950,\"maxTrials\":893248980,\"timeout\":\"PT229H8M42S\"},\"sweepSettings\":{\"earlyTermination\":{\"policyType\":\"EarlyTerminationPolicy\",\"delayEvaluation\":536414260,\"evaluationInterval\":693878843},\"samplingAlgorithm\":\"Bayesian\"},\"validationData\":{\"jobInputType\":\"mltable\",\"mode\":\"ReadOnlyMount\",\"uri\":\"gdmin\",\"description\":\"tteajohiygs\"},\"validationDataSize\":75.70753002197551,\"logVerbosity\":\"Debug\",\"targetColumnName\":\"czykmktpvw\",\"trainingData\":{\"jobInputType\":\"mltable\",\"mode\":\"EvalMount\",\"uri\":\"sehch\",\"description\":\"ufmpqumqyjgy\"}}") - .toObject(ImageClassification.class); - Assertions.assertEquals(LogVerbosity.DEBUG, model.logVerbosity()); - Assertions.assertEquals("czykmktpvw", model.targetColumnName()); - Assertions.assertEquals("ufmpqumqyjgy", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_MOUNT, model.trainingData().mode()); - Assertions.assertEquals("sehch", model.trainingData().uri()); - Assertions.assertEquals(ClassificationPrimaryMetrics.NORM_MACRO_RECALL, model.primaryMetric()); - Assertions.assertEquals("pqitwe", model.modelSettings().advancedSettings()); - Assertions.assertEquals(false, model.modelSettings().amsGradient()); - Assertions.assertEquals("vskbuhzacaq", model.modelSettings().augmentations()); - Assertions.assertEquals(35.776882F, model.modelSettings().beta1()); - Assertions.assertEquals(7.5552106F, model.modelSettings().beta2()); - Assertions.assertEquals(1409246256, model.modelSettings().checkpointFrequency()); - Assertions.assertEquals("iztjof", model.modelSettings().checkpointModel().description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.modelSettings().checkpointModel().mode()); - Assertions.assertEquals("pdsxzakuejkm", model.modelSettings().checkpointModel().uri()); - Assertions.assertEquals("vovjufycsjmlbe", model.modelSettings().checkpointRunId()); - Assertions.assertEquals(false, model.modelSettings().distributed()); - Assertions.assertEquals(true, model.modelSettings().earlyStopping()); - Assertions.assertEquals(1797904663, model.modelSettings().earlyStoppingDelay()); - Assertions.assertEquals(544161528, model.modelSettings().earlyStoppingPatience()); - Assertions.assertEquals(true, model.modelSettings().enableOnnxNormalization()); - Assertions.assertEquals(1168175827, model.modelSettings().evaluationFrequency()); - Assertions.assertEquals(920753916, model.modelSettings().gradientAccumulationStep()); - Assertions.assertEquals(979183363, model.modelSettings().layersToFreeze()); - Assertions.assertEquals(75.56595F, model.modelSettings().learningRate()); - Assertions.assertEquals(LearningRateScheduler.NONE, model.modelSettings().learningRateScheduler()); - Assertions.assertEquals("jfel", model.modelSettings().modelName()); - Assertions.assertEquals(99.81994F, model.modelSettings().momentum()); - Assertions.assertEquals(true, model.modelSettings().nesterov()); - Assertions.assertEquals(902490226, model.modelSettings().numberOfEpochs()); - Assertions.assertEquals(1270842979, model.modelSettings().numberOfWorkers()); - Assertions.assertEquals(StochasticOptimizer.ADAM, model.modelSettings().optimizer()); - Assertions.assertEquals(1405675230, model.modelSettings().randomSeed()); - Assertions.assertEquals(4.9547615F, model.modelSettings().stepLRGamma()); - Assertions.assertEquals(462800461, model.modelSettings().stepLRStepSize()); - Assertions.assertEquals(1308773307, model.modelSettings().trainingBatchSize()); - Assertions.assertEquals(1918220645, model.modelSettings().validationBatchSize()); - Assertions.assertEquals(88.28787F, model.modelSettings().warmupCosineLRCycles()); - Assertions.assertEquals(1219612283, model.modelSettings().warmupCosineLRWarmupEpochs()); - Assertions.assertEquals(35.093628F, model.modelSettings().weightDecay()); - Assertions.assertEquals(857070249, model.modelSettings().trainingCropSize()); - Assertions.assertEquals(372879313, model.modelSettings().validationCropSize()); - Assertions.assertEquals(2040757308, model.modelSettings().validationResizeSize()); - Assertions.assertEquals(601079141, model.modelSettings().weightedLoss()); - Assertions.assertEquals("rnpnuhzafccnuh", model.searchSpace().get(0).amsGradient()); - Assertions.assertEquals("gbylbuig", model.searchSpace().get(0).augmentations()); - Assertions.assertEquals("vatvcrkd", model.searchSpace().get(0).beta1()); - Assertions.assertEquals("nbqxvhcsyhzlwxae", model.searchSpace().get(0).beta2()); - Assertions.assertEquals("vurex", model.searchSpace().get(0).distributed()); - Assertions.assertEquals("d", model.searchSpace().get(0).earlyStopping()); - Assertions.assertEquals("dwead", model.searchSpace().get(0).earlyStoppingDelay()); - Assertions.assertEquals("zmwntopagt", model.searchSpace().get(0).earlyStoppingPatience()); - Assertions.assertEquals("v", model.searchSpace().get(0).enableOnnxNormalization()); - Assertions.assertEquals("agoaqylkjztji", model.searchSpace().get(0).evaluationFrequency()); - Assertions.assertEquals("zjcg", model.searchSpace().get(0).gradientAccumulationStep()); - Assertions.assertEquals("itpfinzcpdl", model.searchSpace().get(0).layersToFreeze()); - Assertions.assertEquals("rlgjm", model.searchSpace().get(0).learningRate()); - Assertions.assertEquals("drvcqguef", model.searchSpace().get(0).learningRateScheduler()); - Assertions.assertEquals("ompheqdur", model.searchSpace().get(0).modelName()); - Assertions.assertEquals("yujlfyoumpckyecl", model.searchSpace().get(0).momentum()); - Assertions.assertEquals("igptajbrzmqxucyc", model.searchSpace().get(0).nesterov()); - Assertions.assertEquals("oclxiut", model.searchSpace().get(0).numberOfEpochs()); - Assertions.assertEquals("cyzyzjdnrqjbt", model.searchSpace().get(0).numberOfWorkers()); - Assertions.assertEquals("eaoqaqbzgyhf", model.searchSpace().get(0).optimizer()); - Assertions.assertEquals("v", model.searchSpace().get(0).randomSeed()); - Assertions.assertEquals("tbwbqamteuli", model.searchSpace().get(0).stepLRGamma()); - Assertions.assertEquals("lpkcvmwfauxxep", model.searchSpace().get(0).stepLRStepSize()); - Assertions.assertEquals("wbormcqmi", model.searchSpace().get(0).trainingBatchSize()); - Assertions.assertEquals("ijqpkzfbojxjmcs", model.searchSpace().get(0).validationBatchSize()); - Assertions.assertEquals("qwixvcpwnk", model.searchSpace().get(0).warmupCosineLRCycles()); - Assertions.assertEquals("wzwofalickduo", model.searchSpace().get(0).warmupCosineLRWarmupEpochs()); - Assertions.assertEquals("tamtyv", model.searchSpace().get(0).weightDecay()); - Assertions.assertEquals("ccgzpraoxnyu", model.searchSpace().get(0).trainingCropSize()); - Assertions.assertEquals("a", model.searchSpace().get(0).validationCropSize()); - Assertions.assertEquals("gftipwc", model.searchSpace().get(0).validationResizeSize()); - Assertions.assertEquals("yubhiqdx", model.searchSpace().get(0).weightedLoss()); - Assertions.assertEquals(1165708950, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(893248980, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT229H8M42S"), model.limitSettings().timeout()); - Assertions.assertEquals(536414260, model.sweepSettings().earlyTermination().delayEvaluation()); - Assertions.assertEquals(693878843, model.sweepSettings().earlyTermination().evaluationInterval()); - Assertions.assertEquals(SamplingAlgorithmType.BAYESIAN, model.sweepSettings().samplingAlgorithm()); - Assertions.assertEquals("tteajohiygs", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_ONLY_MOUNT, model.validationData().mode()); - Assertions.assertEquals("gdmin", model.validationData().uri()); - Assertions.assertEquals(75.70753002197551D, model.validationDataSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageClassification model = - new ImageClassification() - .withLogVerbosity(LogVerbosity.DEBUG) - .withTargetColumnName("czykmktpvw") - .withTrainingData( - new MLTableJobInput() - .withDescription("ufmpqumqyjgy") - .withMode(InputDeliveryMode.EVAL_MOUNT) - .withUri("sehch")) - .withPrimaryMetric(ClassificationPrimaryMetrics.NORM_MACRO_RECALL) - .withModelSettings( - new ImageModelSettingsClassification() - .withAdvancedSettings("pqitwe") - .withAmsGradient(false) - .withAugmentations("vskbuhzacaq") - .withBeta1(35.776882F) - .withBeta2(7.5552106F) - .withCheckpointFrequency(1409246256) - .withCheckpointModel( - new MLFlowModelJobInput() - .withDescription("iztjof") - .withMode(InputDeliveryMode.DOWNLOAD) - .withUri("pdsxzakuejkm")) - .withCheckpointRunId("vovjufycsjmlbe") - .withDistributed(false) - .withEarlyStopping(true) - .withEarlyStoppingDelay(1797904663) - .withEarlyStoppingPatience(544161528) - .withEnableOnnxNormalization(true) - .withEvaluationFrequency(1168175827) - .withGradientAccumulationStep(920753916) - .withLayersToFreeze(979183363) - .withLearningRate(75.56595F) - .withLearningRateScheduler(LearningRateScheduler.NONE) - .withModelName("jfel") - .withMomentum(99.81994F) - .withNesterov(true) - .withNumberOfEpochs(902490226) - .withNumberOfWorkers(1270842979) - .withOptimizer(StochasticOptimizer.ADAM) - .withRandomSeed(1405675230) - .withStepLRGamma(4.9547615F) - .withStepLRStepSize(462800461) - .withTrainingBatchSize(1308773307) - .withValidationBatchSize(1918220645) - .withWarmupCosineLRCycles(88.28787F) - .withWarmupCosineLRWarmupEpochs(1219612283) - .withWeightDecay(35.093628F) - .withTrainingCropSize(857070249) - .withValidationCropSize(372879313) - .withValidationResizeSize(2040757308) - .withWeightedLoss(601079141)) - .withSearchSpace( - Arrays - .asList( - new ImageModelDistributionSettingsClassification() - .withAmsGradient("rnpnuhzafccnuh") - .withAugmentations("gbylbuig") - .withBeta1("vatvcrkd") - .withBeta2("nbqxvhcsyhzlwxae") - .withDistributed("vurex") - .withEarlyStopping("d") - .withEarlyStoppingDelay("dwead") - .withEarlyStoppingPatience("zmwntopagt") - .withEnableOnnxNormalization("v") - .withEvaluationFrequency("agoaqylkjztji") - .withGradientAccumulationStep("zjcg") - .withLayersToFreeze("itpfinzcpdl") - .withLearningRate("rlgjm") - .withLearningRateScheduler("drvcqguef") - .withModelName("ompheqdur") - .withMomentum("yujlfyoumpckyecl") - .withNesterov("igptajbrzmqxucyc") - .withNumberOfEpochs("oclxiut") - .withNumberOfWorkers("cyzyzjdnrqjbt") - .withOptimizer("eaoqaqbzgyhf") - .withRandomSeed("v") - .withStepLRGamma("tbwbqamteuli") - .withStepLRStepSize("lpkcvmwfauxxep") - .withTrainingBatchSize("wbormcqmi") - .withValidationBatchSize("ijqpkzfbojxjmcs") - .withWarmupCosineLRCycles("qwixvcpwnk") - .withWarmupCosineLRWarmupEpochs("wzwofalickduo") - .withWeightDecay("tamtyv") - .withTrainingCropSize("ccgzpraoxnyu") - .withValidationCropSize("a") - .withValidationResizeSize("gftipwc") - .withWeightedLoss("yubhiqdx"), - new ImageModelDistributionSettingsClassification() - .withAmsGradient("eotta") - .withAugmentations("yos") - .withBeta1("whnhjtfv") - .withBeta2("dpmiljpn") - .withDistributed("nudqllz") - .withEarlyStopping("uzpjlxeehux") - .withEarlyStoppingDelay("hzlraymezxlsk") - .withEarlyStoppingPatience("mxrfdsa") - .withEnableOnnxNormalization("ednwyyshtu") - .withEvaluationFrequency("mevuafpwzy") - .withGradientAccumulationStep("rkgwltxeqip") - .withLayersToFreeze("zdyi") - .withLearningRate("fayorpravkjoges") - .withLearningRateScheduler("bnsmjkwynqxaek") - .withModelName("ykvwjtqpkevmyltj") - .withMomentum("spxklu") - .withNesterov("clf") - .withNumberOfEpochs("annnoytzposewx") - .withNumberOfWorkers("pxvkqma") - .withOptimizer("xvpif") - .withRandomSeed("aifyzyzeyuubeids") - .withStepLRGamma("fytoi") - .withStepLRStepSize("gygvfltgvdiho") - .withTrainingBatchSize("krxwet") - .withValidationBatchSize("drcyrucpcun") - .withWarmupCosineLRCycles("zdqumoe") - .withWarmupCosineLRWarmupEpochs("dnaienhqhskndnel") - .withWeightDecay("aadl") - .withTrainingCropSize("nxrwzawnvs") - .withValidationCropSize("fhzag") - .withValidationResizeSize("vhycvdimwrzregzg") - .withWeightedLoss("futrwpweryekzkd"), - new ImageModelDistributionSettingsClassification() - .withAmsGradient("lkwq") - .withAugmentations("tv") - .withBeta1("sdtcjbctvivuzqym") - .withBeta2("owog") - .withDistributed("it") - .withEarlyStopping("hzvb") - .withEarlyStoppingDelay("cdb") - .withEarlyStoppingPatience("fzndscxmxeatkd") - .withEnableOnnxNormalization("wnrdjyibqbnaom") - .withEvaluationFrequency("rmkuh") - .withGradientAccumulationStep("xljalfihc") - .withLayersToFreeze("obcancdexxqcw") - .withLearningRate("xf") - .withLearningRateScheduler("aknokzwjjzrl") - .withModelName("xldzyyfytpqsix") - .withMomentum("m") - .withNesterov("jivyqlkjuv") - .withNumberOfEpochs("bmslzoyov") - .withNumberOfWorkers("dbpqvybefgvm") - .withOptimizer("okcvtlubses") - .withRandomSeed("cua") - .withStepLRGamma("rhunlp") - .withStepLRStepSize("ykycndzfqi") - .withTrainingBatchSize("reuykbbmnwagl") - .withValidationBatchSize("xoe") - .withWarmupCosineLRCycles("nqlnfwmyymvqd") - .withWarmupCosineLRWarmupEpochs("bhfckdvezcrcssb") - .withWeightDecay("ddubbnqfblhkal") - .withTrainingCropSize("wf") - .withValidationCropSize("nniyopetxi") - .withValidationResizeSize("nrlyxnuc") - .withWeightedLoss("p"))) - .withLimitSettings( - new ImageLimitSettings() - .withMaxConcurrentTrials(1165708950) - .withMaxTrials(893248980) - .withTimeout(Duration.parse("PT229H8M42S"))) - .withSweepSettings( - new ImageSweepSettings() - .withEarlyTermination( - new EarlyTerminationPolicy() - .withDelayEvaluation(536414260) - .withEvaluationInterval(693878843)) - .withSamplingAlgorithm(SamplingAlgorithmType.BAYESIAN)) - .withValidationData( - new MLTableJobInput() - .withDescription("tteajohiygs") - .withMode(InputDeliveryMode.READ_ONLY_MOUNT) - .withUri("gdmin")) - .withValidationDataSize(75.70753002197551D); - model = BinaryData.fromObject(model).toObject(ImageClassification.class); - Assertions.assertEquals(LogVerbosity.DEBUG, model.logVerbosity()); - Assertions.assertEquals("czykmktpvw", model.targetColumnName()); - Assertions.assertEquals("ufmpqumqyjgy", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_MOUNT, model.trainingData().mode()); - Assertions.assertEquals("sehch", model.trainingData().uri()); - Assertions.assertEquals(ClassificationPrimaryMetrics.NORM_MACRO_RECALL, model.primaryMetric()); - Assertions.assertEquals("pqitwe", model.modelSettings().advancedSettings()); - Assertions.assertEquals(false, model.modelSettings().amsGradient()); - Assertions.assertEquals("vskbuhzacaq", model.modelSettings().augmentations()); - Assertions.assertEquals(35.776882F, model.modelSettings().beta1()); - Assertions.assertEquals(7.5552106F, model.modelSettings().beta2()); - Assertions.assertEquals(1409246256, model.modelSettings().checkpointFrequency()); - Assertions.assertEquals("iztjof", model.modelSettings().checkpointModel().description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.modelSettings().checkpointModel().mode()); - Assertions.assertEquals("pdsxzakuejkm", model.modelSettings().checkpointModel().uri()); - Assertions.assertEquals("vovjufycsjmlbe", model.modelSettings().checkpointRunId()); - Assertions.assertEquals(false, model.modelSettings().distributed()); - Assertions.assertEquals(true, model.modelSettings().earlyStopping()); - Assertions.assertEquals(1797904663, model.modelSettings().earlyStoppingDelay()); - Assertions.assertEquals(544161528, model.modelSettings().earlyStoppingPatience()); - Assertions.assertEquals(true, model.modelSettings().enableOnnxNormalization()); - Assertions.assertEquals(1168175827, model.modelSettings().evaluationFrequency()); - Assertions.assertEquals(920753916, model.modelSettings().gradientAccumulationStep()); - Assertions.assertEquals(979183363, model.modelSettings().layersToFreeze()); - Assertions.assertEquals(75.56595F, model.modelSettings().learningRate()); - Assertions.assertEquals(LearningRateScheduler.NONE, model.modelSettings().learningRateScheduler()); - Assertions.assertEquals("jfel", model.modelSettings().modelName()); - Assertions.assertEquals(99.81994F, model.modelSettings().momentum()); - Assertions.assertEquals(true, model.modelSettings().nesterov()); - Assertions.assertEquals(902490226, model.modelSettings().numberOfEpochs()); - Assertions.assertEquals(1270842979, model.modelSettings().numberOfWorkers()); - Assertions.assertEquals(StochasticOptimizer.ADAM, model.modelSettings().optimizer()); - Assertions.assertEquals(1405675230, model.modelSettings().randomSeed()); - Assertions.assertEquals(4.9547615F, model.modelSettings().stepLRGamma()); - Assertions.assertEquals(462800461, model.modelSettings().stepLRStepSize()); - Assertions.assertEquals(1308773307, model.modelSettings().trainingBatchSize()); - Assertions.assertEquals(1918220645, model.modelSettings().validationBatchSize()); - Assertions.assertEquals(88.28787F, model.modelSettings().warmupCosineLRCycles()); - Assertions.assertEquals(1219612283, model.modelSettings().warmupCosineLRWarmupEpochs()); - Assertions.assertEquals(35.093628F, model.modelSettings().weightDecay()); - Assertions.assertEquals(857070249, model.modelSettings().trainingCropSize()); - Assertions.assertEquals(372879313, model.modelSettings().validationCropSize()); - Assertions.assertEquals(2040757308, model.modelSettings().validationResizeSize()); - Assertions.assertEquals(601079141, model.modelSettings().weightedLoss()); - Assertions.assertEquals("rnpnuhzafccnuh", model.searchSpace().get(0).amsGradient()); - Assertions.assertEquals("gbylbuig", model.searchSpace().get(0).augmentations()); - Assertions.assertEquals("vatvcrkd", model.searchSpace().get(0).beta1()); - Assertions.assertEquals("nbqxvhcsyhzlwxae", model.searchSpace().get(0).beta2()); - Assertions.assertEquals("vurex", model.searchSpace().get(0).distributed()); - Assertions.assertEquals("d", model.searchSpace().get(0).earlyStopping()); - Assertions.assertEquals("dwead", model.searchSpace().get(0).earlyStoppingDelay()); - Assertions.assertEquals("zmwntopagt", model.searchSpace().get(0).earlyStoppingPatience()); - Assertions.assertEquals("v", model.searchSpace().get(0).enableOnnxNormalization()); - Assertions.assertEquals("agoaqylkjztji", model.searchSpace().get(0).evaluationFrequency()); - Assertions.assertEquals("zjcg", model.searchSpace().get(0).gradientAccumulationStep()); - Assertions.assertEquals("itpfinzcpdl", model.searchSpace().get(0).layersToFreeze()); - Assertions.assertEquals("rlgjm", model.searchSpace().get(0).learningRate()); - Assertions.assertEquals("drvcqguef", model.searchSpace().get(0).learningRateScheduler()); - Assertions.assertEquals("ompheqdur", model.searchSpace().get(0).modelName()); - Assertions.assertEquals("yujlfyoumpckyecl", model.searchSpace().get(0).momentum()); - Assertions.assertEquals("igptajbrzmqxucyc", model.searchSpace().get(0).nesterov()); - Assertions.assertEquals("oclxiut", model.searchSpace().get(0).numberOfEpochs()); - Assertions.assertEquals("cyzyzjdnrqjbt", model.searchSpace().get(0).numberOfWorkers()); - Assertions.assertEquals("eaoqaqbzgyhf", model.searchSpace().get(0).optimizer()); - Assertions.assertEquals("v", model.searchSpace().get(0).randomSeed()); - Assertions.assertEquals("tbwbqamteuli", model.searchSpace().get(0).stepLRGamma()); - Assertions.assertEquals("lpkcvmwfauxxep", model.searchSpace().get(0).stepLRStepSize()); - Assertions.assertEquals("wbormcqmi", model.searchSpace().get(0).trainingBatchSize()); - Assertions.assertEquals("ijqpkzfbojxjmcs", model.searchSpace().get(0).validationBatchSize()); - Assertions.assertEquals("qwixvcpwnk", model.searchSpace().get(0).warmupCosineLRCycles()); - Assertions.assertEquals("wzwofalickduo", model.searchSpace().get(0).warmupCosineLRWarmupEpochs()); - Assertions.assertEquals("tamtyv", model.searchSpace().get(0).weightDecay()); - Assertions.assertEquals("ccgzpraoxnyu", model.searchSpace().get(0).trainingCropSize()); - Assertions.assertEquals("a", model.searchSpace().get(0).validationCropSize()); - Assertions.assertEquals("gftipwc", model.searchSpace().get(0).validationResizeSize()); - Assertions.assertEquals("yubhiqdx", model.searchSpace().get(0).weightedLoss()); - Assertions.assertEquals(1165708950, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(893248980, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT229H8M42S"), model.limitSettings().timeout()); - Assertions.assertEquals(536414260, model.sweepSettings().earlyTermination().delayEvaluation()); - Assertions.assertEquals(693878843, model.sweepSettings().earlyTermination().evaluationInterval()); - Assertions.assertEquals(SamplingAlgorithmType.BAYESIAN, model.sweepSettings().samplingAlgorithm()); - Assertions.assertEquals("tteajohiygs", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_ONLY_MOUNT, model.validationData().mode()); - Assertions.assertEquals("gdmin", model.validationData().uri()); - Assertions.assertEquals(75.70753002197551D, model.validationDataSize()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageInstanceSegmentationTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageInstanceSegmentationTests.java deleted file mode 100644 index 2f1c7507aca2c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageInstanceSegmentationTests.java +++ /dev/null @@ -1,374 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.EarlyTerminationPolicy; -import com.azure.resourcemanager.machinelearning.models.ImageInstanceSegmentation; -import com.azure.resourcemanager.machinelearning.models.ImageLimitSettings; -import com.azure.resourcemanager.machinelearning.models.ImageModelDistributionSettingsObjectDetection; -import com.azure.resourcemanager.machinelearning.models.ImageModelSettingsObjectDetection; -import com.azure.resourcemanager.machinelearning.models.ImageSweepSettings; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.InstanceSegmentationPrimaryMetrics; -import com.azure.resourcemanager.machinelearning.models.LearningRateScheduler; -import com.azure.resourcemanager.machinelearning.models.LogVerbosity; -import com.azure.resourcemanager.machinelearning.models.MLFlowModelJobInput; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import com.azure.resourcemanager.machinelearning.models.ModelSize; -import com.azure.resourcemanager.machinelearning.models.SamplingAlgorithmType; -import com.azure.resourcemanager.machinelearning.models.StochasticOptimizer; -import com.azure.resourcemanager.machinelearning.models.ValidationMetricType; -import java.time.Duration; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ImageInstanceSegmentationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageInstanceSegmentation model = - BinaryData - .fromString( - "{\"taskType\":\"ImageInstanceSegmentation\",\"primaryMetric\":\"MeanAveragePrecision\",\"modelSettings\":{\"boxDetectionsPerImage\":411999278,\"boxScoreThreshold\":18.429447,\"imageSize\":26955343,\"maxSize\":1642764526,\"minSize\":1482263286,\"modelSize\":\"Large\",\"multiScale\":false,\"nmsIouThreshold\":1.44642,\"tileGridSize\":\"ibmq\",\"tileOverlapRatio\":25.447088,\"tilePredictionsNmsThreshold\":69.32719,\"validationIouThreshold\":22.681719,\"validationMetricType\":\"CocoVoc\",\"advancedSettings\":\"u\",\"amsGradient\":false,\"augmentations\":\"etasvvoqsbp\",\"beta1\":60.15215,\"beta2\":97.623566,\"checkpointFrequency\":94750043,\"checkpointModel\":{\"jobInputType\":\"mlflow_model\",\"mode\":\"EvalDownload\",\"uri\":\"yao\",\"description\":\"zowpuohdkcprgukx\"},\"checkpointRunId\":\"tiochlutixmqr\",\"distributed\":true,\"earlyStopping\":false,\"earlyStoppingDelay\":917093220,\"earlyStoppingPatience\":1837159570,\"enableOnnxNormalization\":false,\"evaluationFrequency\":1130120951,\"gradientAccumulationStep\":695678022,\"layersToFreeze\":1955906279,\"learningRate\":2.7083278,\"learningRateScheduler\":\"WarmupCosine\",\"modelName\":\"bcpaqktkrumzued\",\"momentum\":70.79762,\"nesterov\":false,\"numberOfEpochs\":306505202,\"numberOfWorkers\":886379161,\"optimizer\":\"Adam\",\"randomSeed\":113581490,\"stepLRGamma\":42.95044,\"stepLRStepSize\":1447634405,\"trainingBatchSize\":1828475728,\"validationBatchSize\":91831981,\"warmupCosineLRCycles\":61.42521,\"warmupCosineLRWarmupEpochs\":2131168360,\"weightDecay\":87.82275},\"searchSpace\":[{\"boxDetectionsPerImage\":\"qggjhf\",\"boxScoreThreshold\":\"xrqrkijpeuqlsd\",\"imageSize\":\"qztvx\",\"maxSize\":\"wwmjs\",\"minSize\":\"na\",\"modelSize\":\"amecle\",\"multiScale\":\"oulndhzyoeojhto\",\"nmsIouThreshold\":\"h\",\"tileGridSize\":\"idmytzln\",\"tileOverlapRatio\":\"xpno\",\"tilePredictionsNmsThreshold\":\"oanfbcswqagyw\",\"validationIouThreshold\":\"xigvjrktpgaeuk\",\"validationMetricType\":\"wohpmwhqnucs\",\"amsGradient\":\"hsidsjtdlpbnin\",\"augmentations\":\"azlsvbzfcpuo\",\"beta1\":\"dwjcciklhs\",\"beta2\":\"krdre\",\"distributed\":\"olr\",\"earlyStopping\":\"ehqbeivdlhydwbdb\",\"earlyStoppingDelay\":\"rlpunytjlkesmmpa\",\"earlyStoppingPatience\":\"ubt\",\"enableOnnxNormalization\":\"deani\",\"evaluationFrequency\":\"llbvgwzsfftedous\",\"gradientAccumulationStep\":\"tjtgravaqogfkb\",\"layersToFreeze\":\"auzlqbtxxw\",\"learningRate\":\"h\",\"learningRateScheduler\":\"zudrtpzk\",\"modelName\":\"eboywhczzqrhm\",\"momentum\":\"qbedygisrzwn\",\"nesterov\":\"d\",\"numberOfEpochs\":\"jch\",\"numberOfWorkers\":\"mpwctoflds\",\"optimizer\":\"cdhz\",\"randomSeed\":\"kbrfgdrwji\",\"stepLRGamma\":\"whfjsrwqrxe\",\"stepLRStepSize\":\"gcwvrrmdqntycna\",\"trainingBatchSize\":\"hvmaxgnuyeamcmhu\",\"validationBatchSize\":\"jecehokwc\",\"warmupCosineLRCycles\":\"twloesqr\",\"warmupCosineLRWarmupEpochs\":\"vrbnyrukoil\",\"weightDecay\":\"iduw\"}],\"limitSettings\":{\"maxConcurrentTrials\":111210342,\"maxTrials\":844410077,\"timeout\":\"PT37H28M23S\"},\"sweepSettings\":{\"earlyTermination\":{\"policyType\":\"EarlyTerminationPolicy\",\"delayEvaluation\":814563749,\"evaluationInterval\":400227130},\"samplingAlgorithm\":\"Random\"},\"validationData\":{\"jobInputType\":\"mltable\",\"mode\":\"Direct\",\"uri\":\"thqkkwhbgxvellv\",\"description\":\"nxdmnitmujdtv\"},\"validationDataSize\":82.02510999731906,\"logVerbosity\":\"NotSet\",\"targetColumnName\":\"fhmjp\",\"trainingData\":{\"jobInputType\":\"mltable\",\"mode\":\"ReadWriteMount\",\"uri\":\"yx\",\"description\":\"uvrzmzqmzjqrb\"}}") - .toObject(ImageInstanceSegmentation.class); - Assertions.assertEquals(LogVerbosity.NOT_SET, model.logVerbosity()); - Assertions.assertEquals("fhmjp", model.targetColumnName()); - Assertions.assertEquals("uvrzmzqmzjqrb", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_WRITE_MOUNT, model.trainingData().mode()); - Assertions.assertEquals("yx", model.trainingData().uri()); - Assertions.assertEquals(InstanceSegmentationPrimaryMetrics.MEAN_AVERAGE_PRECISION, model.primaryMetric()); - Assertions.assertEquals("u", model.modelSettings().advancedSettings()); - Assertions.assertEquals(false, model.modelSettings().amsGradient()); - Assertions.assertEquals("etasvvoqsbp", model.modelSettings().augmentations()); - Assertions.assertEquals(60.15215F, model.modelSettings().beta1()); - Assertions.assertEquals(97.623566F, model.modelSettings().beta2()); - Assertions.assertEquals(94750043, model.modelSettings().checkpointFrequency()); - Assertions.assertEquals("zowpuohdkcprgukx", model.modelSettings().checkpointModel().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_DOWNLOAD, model.modelSettings().checkpointModel().mode()); - Assertions.assertEquals("yao", model.modelSettings().checkpointModel().uri()); - Assertions.assertEquals("tiochlutixmqr", model.modelSettings().checkpointRunId()); - Assertions.assertEquals(true, model.modelSettings().distributed()); - Assertions.assertEquals(false, model.modelSettings().earlyStopping()); - Assertions.assertEquals(917093220, model.modelSettings().earlyStoppingDelay()); - Assertions.assertEquals(1837159570, model.modelSettings().earlyStoppingPatience()); - Assertions.assertEquals(false, model.modelSettings().enableOnnxNormalization()); - Assertions.assertEquals(1130120951, model.modelSettings().evaluationFrequency()); - Assertions.assertEquals(695678022, model.modelSettings().gradientAccumulationStep()); - Assertions.assertEquals(1955906279, model.modelSettings().layersToFreeze()); - Assertions.assertEquals(2.7083278F, model.modelSettings().learningRate()); - Assertions.assertEquals(LearningRateScheduler.WARMUP_COSINE, model.modelSettings().learningRateScheduler()); - Assertions.assertEquals("bcpaqktkrumzued", model.modelSettings().modelName()); - Assertions.assertEquals(70.79762F, model.modelSettings().momentum()); - Assertions.assertEquals(false, model.modelSettings().nesterov()); - Assertions.assertEquals(306505202, model.modelSettings().numberOfEpochs()); - Assertions.assertEquals(886379161, model.modelSettings().numberOfWorkers()); - Assertions.assertEquals(StochasticOptimizer.ADAM, model.modelSettings().optimizer()); - Assertions.assertEquals(113581490, model.modelSettings().randomSeed()); - Assertions.assertEquals(42.95044F, model.modelSettings().stepLRGamma()); - Assertions.assertEquals(1447634405, model.modelSettings().stepLRStepSize()); - Assertions.assertEquals(1828475728, model.modelSettings().trainingBatchSize()); - Assertions.assertEquals(91831981, model.modelSettings().validationBatchSize()); - Assertions.assertEquals(61.42521F, model.modelSettings().warmupCosineLRCycles()); - Assertions.assertEquals(2131168360, model.modelSettings().warmupCosineLRWarmupEpochs()); - Assertions.assertEquals(87.82275F, model.modelSettings().weightDecay()); - Assertions.assertEquals(411999278, model.modelSettings().boxDetectionsPerImage()); - Assertions.assertEquals(18.429447F, model.modelSettings().boxScoreThreshold()); - Assertions.assertEquals(26955343, model.modelSettings().imageSize()); - Assertions.assertEquals(1642764526, model.modelSettings().maxSize()); - Assertions.assertEquals(1482263286, model.modelSettings().minSize()); - Assertions.assertEquals(ModelSize.LARGE, model.modelSettings().modelSize()); - Assertions.assertEquals(false, model.modelSettings().multiScale()); - Assertions.assertEquals(1.44642F, model.modelSettings().nmsIouThreshold()); - Assertions.assertEquals("ibmq", model.modelSettings().tileGridSize()); - Assertions.assertEquals(25.447088F, model.modelSettings().tileOverlapRatio()); - Assertions.assertEquals(69.32719F, model.modelSettings().tilePredictionsNmsThreshold()); - Assertions.assertEquals(22.681719F, model.modelSettings().validationIouThreshold()); - Assertions.assertEquals(ValidationMetricType.COCO_VOC, model.modelSettings().validationMetricType()); - Assertions.assertEquals("hsidsjtdlpbnin", model.searchSpace().get(0).amsGradient()); - Assertions.assertEquals("azlsvbzfcpuo", model.searchSpace().get(0).augmentations()); - Assertions.assertEquals("dwjcciklhs", model.searchSpace().get(0).beta1()); - Assertions.assertEquals("krdre", model.searchSpace().get(0).beta2()); - Assertions.assertEquals("olr", model.searchSpace().get(0).distributed()); - Assertions.assertEquals("ehqbeivdlhydwbdb", model.searchSpace().get(0).earlyStopping()); - Assertions.assertEquals("rlpunytjlkesmmpa", model.searchSpace().get(0).earlyStoppingDelay()); - Assertions.assertEquals("ubt", model.searchSpace().get(0).earlyStoppingPatience()); - Assertions.assertEquals("deani", model.searchSpace().get(0).enableOnnxNormalization()); - Assertions.assertEquals("llbvgwzsfftedous", model.searchSpace().get(0).evaluationFrequency()); - Assertions.assertEquals("tjtgravaqogfkb", model.searchSpace().get(0).gradientAccumulationStep()); - Assertions.assertEquals("auzlqbtxxw", model.searchSpace().get(0).layersToFreeze()); - Assertions.assertEquals("h", model.searchSpace().get(0).learningRate()); - Assertions.assertEquals("zudrtpzk", model.searchSpace().get(0).learningRateScheduler()); - Assertions.assertEquals("eboywhczzqrhm", model.searchSpace().get(0).modelName()); - Assertions.assertEquals("qbedygisrzwn", model.searchSpace().get(0).momentum()); - Assertions.assertEquals("d", model.searchSpace().get(0).nesterov()); - Assertions.assertEquals("jch", model.searchSpace().get(0).numberOfEpochs()); - Assertions.assertEquals("mpwctoflds", model.searchSpace().get(0).numberOfWorkers()); - Assertions.assertEquals("cdhz", model.searchSpace().get(0).optimizer()); - Assertions.assertEquals("kbrfgdrwji", model.searchSpace().get(0).randomSeed()); - Assertions.assertEquals("whfjsrwqrxe", model.searchSpace().get(0).stepLRGamma()); - Assertions.assertEquals("gcwvrrmdqntycna", model.searchSpace().get(0).stepLRStepSize()); - Assertions.assertEquals("hvmaxgnuyeamcmhu", model.searchSpace().get(0).trainingBatchSize()); - Assertions.assertEquals("jecehokwc", model.searchSpace().get(0).validationBatchSize()); - Assertions.assertEquals("twloesqr", model.searchSpace().get(0).warmupCosineLRCycles()); - Assertions.assertEquals("vrbnyrukoil", model.searchSpace().get(0).warmupCosineLRWarmupEpochs()); - Assertions.assertEquals("iduw", model.searchSpace().get(0).weightDecay()); - Assertions.assertEquals("qggjhf", model.searchSpace().get(0).boxDetectionsPerImage()); - Assertions.assertEquals("xrqrkijpeuqlsd", model.searchSpace().get(0).boxScoreThreshold()); - Assertions.assertEquals("qztvx", model.searchSpace().get(0).imageSize()); - Assertions.assertEquals("wwmjs", model.searchSpace().get(0).maxSize()); - Assertions.assertEquals("na", model.searchSpace().get(0).minSize()); - Assertions.assertEquals("amecle", model.searchSpace().get(0).modelSize()); - Assertions.assertEquals("oulndhzyoeojhto", model.searchSpace().get(0).multiScale()); - Assertions.assertEquals("h", model.searchSpace().get(0).nmsIouThreshold()); - Assertions.assertEquals("idmytzln", model.searchSpace().get(0).tileGridSize()); - Assertions.assertEquals("xpno", model.searchSpace().get(0).tileOverlapRatio()); - Assertions.assertEquals("oanfbcswqagyw", model.searchSpace().get(0).tilePredictionsNmsThreshold()); - Assertions.assertEquals("xigvjrktpgaeuk", model.searchSpace().get(0).validationIouThreshold()); - Assertions.assertEquals("wohpmwhqnucs", model.searchSpace().get(0).validationMetricType()); - Assertions.assertEquals(111210342, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(844410077, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT37H28M23S"), model.limitSettings().timeout()); - Assertions.assertEquals(814563749, model.sweepSettings().earlyTermination().delayEvaluation()); - Assertions.assertEquals(400227130, model.sweepSettings().earlyTermination().evaluationInterval()); - Assertions.assertEquals(SamplingAlgorithmType.RANDOM, model.sweepSettings().samplingAlgorithm()); - Assertions.assertEquals("nxdmnitmujdtv", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.validationData().mode()); - Assertions.assertEquals("thqkkwhbgxvellv", model.validationData().uri()); - Assertions.assertEquals(82.02510999731906D, model.validationDataSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageInstanceSegmentation model = - new ImageInstanceSegmentation() - .withLogVerbosity(LogVerbosity.NOT_SET) - .withTargetColumnName("fhmjp") - .withTrainingData( - new MLTableJobInput() - .withDescription("uvrzmzqmzjqrb") - .withMode(InputDeliveryMode.READ_WRITE_MOUNT) - .withUri("yx")) - .withPrimaryMetric(InstanceSegmentationPrimaryMetrics.MEAN_AVERAGE_PRECISION) - .withModelSettings( - new ImageModelSettingsObjectDetection() - .withAdvancedSettings("u") - .withAmsGradient(false) - .withAugmentations("etasvvoqsbp") - .withBeta1(60.15215F) - .withBeta2(97.623566F) - .withCheckpointFrequency(94750043) - .withCheckpointModel( - new MLFlowModelJobInput() - .withDescription("zowpuohdkcprgukx") - .withMode(InputDeliveryMode.EVAL_DOWNLOAD) - .withUri("yao")) - .withCheckpointRunId("tiochlutixmqr") - .withDistributed(true) - .withEarlyStopping(false) - .withEarlyStoppingDelay(917093220) - .withEarlyStoppingPatience(1837159570) - .withEnableOnnxNormalization(false) - .withEvaluationFrequency(1130120951) - .withGradientAccumulationStep(695678022) - .withLayersToFreeze(1955906279) - .withLearningRate(2.7083278F) - .withLearningRateScheduler(LearningRateScheduler.WARMUP_COSINE) - .withModelName("bcpaqktkrumzued") - .withMomentum(70.79762F) - .withNesterov(false) - .withNumberOfEpochs(306505202) - .withNumberOfWorkers(886379161) - .withOptimizer(StochasticOptimizer.ADAM) - .withRandomSeed(113581490) - .withStepLRGamma(42.95044F) - .withStepLRStepSize(1447634405) - .withTrainingBatchSize(1828475728) - .withValidationBatchSize(91831981) - .withWarmupCosineLRCycles(61.42521F) - .withWarmupCosineLRWarmupEpochs(2131168360) - .withWeightDecay(87.82275F) - .withBoxDetectionsPerImage(411999278) - .withBoxScoreThreshold(18.429447F) - .withImageSize(26955343) - .withMaxSize(1642764526) - .withMinSize(1482263286) - .withModelSize(ModelSize.LARGE) - .withMultiScale(false) - .withNmsIouThreshold(1.44642F) - .withTileGridSize("ibmq") - .withTileOverlapRatio(25.447088F) - .withTilePredictionsNmsThreshold(69.32719F) - .withValidationIouThreshold(22.681719F) - .withValidationMetricType(ValidationMetricType.COCO_VOC)) - .withSearchSpace( - Arrays - .asList( - new ImageModelDistributionSettingsObjectDetection() - .withAmsGradient("hsidsjtdlpbnin") - .withAugmentations("azlsvbzfcpuo") - .withBeta1("dwjcciklhs") - .withBeta2("krdre") - .withDistributed("olr") - .withEarlyStopping("ehqbeivdlhydwbdb") - .withEarlyStoppingDelay("rlpunytjlkesmmpa") - .withEarlyStoppingPatience("ubt") - .withEnableOnnxNormalization("deani") - .withEvaluationFrequency("llbvgwzsfftedous") - .withGradientAccumulationStep("tjtgravaqogfkb") - .withLayersToFreeze("auzlqbtxxw") - .withLearningRate("h") - .withLearningRateScheduler("zudrtpzk") - .withModelName("eboywhczzqrhm") - .withMomentum("qbedygisrzwn") - .withNesterov("d") - .withNumberOfEpochs("jch") - .withNumberOfWorkers("mpwctoflds") - .withOptimizer("cdhz") - .withRandomSeed("kbrfgdrwji") - .withStepLRGamma("whfjsrwqrxe") - .withStepLRStepSize("gcwvrrmdqntycna") - .withTrainingBatchSize("hvmaxgnuyeamcmhu") - .withValidationBatchSize("jecehokwc") - .withWarmupCosineLRCycles("twloesqr") - .withWarmupCosineLRWarmupEpochs("vrbnyrukoil") - .withWeightDecay("iduw") - .withBoxDetectionsPerImage("qggjhf") - .withBoxScoreThreshold("xrqrkijpeuqlsd") - .withImageSize("qztvx") - .withMaxSize("wwmjs") - .withMinSize("na") - .withModelSize("amecle") - .withMultiScale("oulndhzyoeojhto") - .withNmsIouThreshold("h") - .withTileGridSize("idmytzln") - .withTileOverlapRatio("xpno") - .withTilePredictionsNmsThreshold("oanfbcswqagyw") - .withValidationIouThreshold("xigvjrktpgaeuk") - .withValidationMetricType("wohpmwhqnucs"))) - .withLimitSettings( - new ImageLimitSettings() - .withMaxConcurrentTrials(111210342) - .withMaxTrials(844410077) - .withTimeout(Duration.parse("PT37H28M23S"))) - .withSweepSettings( - new ImageSweepSettings() - .withEarlyTermination( - new EarlyTerminationPolicy() - .withDelayEvaluation(814563749) - .withEvaluationInterval(400227130)) - .withSamplingAlgorithm(SamplingAlgorithmType.RANDOM)) - .withValidationData( - new MLTableJobInput() - .withDescription("nxdmnitmujdtv") - .withMode(InputDeliveryMode.DIRECT) - .withUri("thqkkwhbgxvellv")) - .withValidationDataSize(82.02510999731906D); - model = BinaryData.fromObject(model).toObject(ImageInstanceSegmentation.class); - Assertions.assertEquals(LogVerbosity.NOT_SET, model.logVerbosity()); - Assertions.assertEquals("fhmjp", model.targetColumnName()); - Assertions.assertEquals("uvrzmzqmzjqrb", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_WRITE_MOUNT, model.trainingData().mode()); - Assertions.assertEquals("yx", model.trainingData().uri()); - Assertions.assertEquals(InstanceSegmentationPrimaryMetrics.MEAN_AVERAGE_PRECISION, model.primaryMetric()); - Assertions.assertEquals("u", model.modelSettings().advancedSettings()); - Assertions.assertEquals(false, model.modelSettings().amsGradient()); - Assertions.assertEquals("etasvvoqsbp", model.modelSettings().augmentations()); - Assertions.assertEquals(60.15215F, model.modelSettings().beta1()); - Assertions.assertEquals(97.623566F, model.modelSettings().beta2()); - Assertions.assertEquals(94750043, model.modelSettings().checkpointFrequency()); - Assertions.assertEquals("zowpuohdkcprgukx", model.modelSettings().checkpointModel().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_DOWNLOAD, model.modelSettings().checkpointModel().mode()); - Assertions.assertEquals("yao", model.modelSettings().checkpointModel().uri()); - Assertions.assertEquals("tiochlutixmqr", model.modelSettings().checkpointRunId()); - Assertions.assertEquals(true, model.modelSettings().distributed()); - Assertions.assertEquals(false, model.modelSettings().earlyStopping()); - Assertions.assertEquals(917093220, model.modelSettings().earlyStoppingDelay()); - Assertions.assertEquals(1837159570, model.modelSettings().earlyStoppingPatience()); - Assertions.assertEquals(false, model.modelSettings().enableOnnxNormalization()); - Assertions.assertEquals(1130120951, model.modelSettings().evaluationFrequency()); - Assertions.assertEquals(695678022, model.modelSettings().gradientAccumulationStep()); - Assertions.assertEquals(1955906279, model.modelSettings().layersToFreeze()); - Assertions.assertEquals(2.7083278F, model.modelSettings().learningRate()); - Assertions.assertEquals(LearningRateScheduler.WARMUP_COSINE, model.modelSettings().learningRateScheduler()); - Assertions.assertEquals("bcpaqktkrumzued", model.modelSettings().modelName()); - Assertions.assertEquals(70.79762F, model.modelSettings().momentum()); - Assertions.assertEquals(false, model.modelSettings().nesterov()); - Assertions.assertEquals(306505202, model.modelSettings().numberOfEpochs()); - Assertions.assertEquals(886379161, model.modelSettings().numberOfWorkers()); - Assertions.assertEquals(StochasticOptimizer.ADAM, model.modelSettings().optimizer()); - Assertions.assertEquals(113581490, model.modelSettings().randomSeed()); - Assertions.assertEquals(42.95044F, model.modelSettings().stepLRGamma()); - Assertions.assertEquals(1447634405, model.modelSettings().stepLRStepSize()); - Assertions.assertEquals(1828475728, model.modelSettings().trainingBatchSize()); - Assertions.assertEquals(91831981, model.modelSettings().validationBatchSize()); - Assertions.assertEquals(61.42521F, model.modelSettings().warmupCosineLRCycles()); - Assertions.assertEquals(2131168360, model.modelSettings().warmupCosineLRWarmupEpochs()); - Assertions.assertEquals(87.82275F, model.modelSettings().weightDecay()); - Assertions.assertEquals(411999278, model.modelSettings().boxDetectionsPerImage()); - Assertions.assertEquals(18.429447F, model.modelSettings().boxScoreThreshold()); - Assertions.assertEquals(26955343, model.modelSettings().imageSize()); - Assertions.assertEquals(1642764526, model.modelSettings().maxSize()); - Assertions.assertEquals(1482263286, model.modelSettings().minSize()); - Assertions.assertEquals(ModelSize.LARGE, model.modelSettings().modelSize()); - Assertions.assertEquals(false, model.modelSettings().multiScale()); - Assertions.assertEquals(1.44642F, model.modelSettings().nmsIouThreshold()); - Assertions.assertEquals("ibmq", model.modelSettings().tileGridSize()); - Assertions.assertEquals(25.447088F, model.modelSettings().tileOverlapRatio()); - Assertions.assertEquals(69.32719F, model.modelSettings().tilePredictionsNmsThreshold()); - Assertions.assertEquals(22.681719F, model.modelSettings().validationIouThreshold()); - Assertions.assertEquals(ValidationMetricType.COCO_VOC, model.modelSettings().validationMetricType()); - Assertions.assertEquals("hsidsjtdlpbnin", model.searchSpace().get(0).amsGradient()); - Assertions.assertEquals("azlsvbzfcpuo", model.searchSpace().get(0).augmentations()); - Assertions.assertEquals("dwjcciklhs", model.searchSpace().get(0).beta1()); - Assertions.assertEquals("krdre", model.searchSpace().get(0).beta2()); - Assertions.assertEquals("olr", model.searchSpace().get(0).distributed()); - Assertions.assertEquals("ehqbeivdlhydwbdb", model.searchSpace().get(0).earlyStopping()); - Assertions.assertEquals("rlpunytjlkesmmpa", model.searchSpace().get(0).earlyStoppingDelay()); - Assertions.assertEquals("ubt", model.searchSpace().get(0).earlyStoppingPatience()); - Assertions.assertEquals("deani", model.searchSpace().get(0).enableOnnxNormalization()); - Assertions.assertEquals("llbvgwzsfftedous", model.searchSpace().get(0).evaluationFrequency()); - Assertions.assertEquals("tjtgravaqogfkb", model.searchSpace().get(0).gradientAccumulationStep()); - Assertions.assertEquals("auzlqbtxxw", model.searchSpace().get(0).layersToFreeze()); - Assertions.assertEquals("h", model.searchSpace().get(0).learningRate()); - Assertions.assertEquals("zudrtpzk", model.searchSpace().get(0).learningRateScheduler()); - Assertions.assertEquals("eboywhczzqrhm", model.searchSpace().get(0).modelName()); - Assertions.assertEquals("qbedygisrzwn", model.searchSpace().get(0).momentum()); - Assertions.assertEquals("d", model.searchSpace().get(0).nesterov()); - Assertions.assertEquals("jch", model.searchSpace().get(0).numberOfEpochs()); - Assertions.assertEquals("mpwctoflds", model.searchSpace().get(0).numberOfWorkers()); - Assertions.assertEquals("cdhz", model.searchSpace().get(0).optimizer()); - Assertions.assertEquals("kbrfgdrwji", model.searchSpace().get(0).randomSeed()); - Assertions.assertEquals("whfjsrwqrxe", model.searchSpace().get(0).stepLRGamma()); - Assertions.assertEquals("gcwvrrmdqntycna", model.searchSpace().get(0).stepLRStepSize()); - Assertions.assertEquals("hvmaxgnuyeamcmhu", model.searchSpace().get(0).trainingBatchSize()); - Assertions.assertEquals("jecehokwc", model.searchSpace().get(0).validationBatchSize()); - Assertions.assertEquals("twloesqr", model.searchSpace().get(0).warmupCosineLRCycles()); - Assertions.assertEquals("vrbnyrukoil", model.searchSpace().get(0).warmupCosineLRWarmupEpochs()); - Assertions.assertEquals("iduw", model.searchSpace().get(0).weightDecay()); - Assertions.assertEquals("qggjhf", model.searchSpace().get(0).boxDetectionsPerImage()); - Assertions.assertEquals("xrqrkijpeuqlsd", model.searchSpace().get(0).boxScoreThreshold()); - Assertions.assertEquals("qztvx", model.searchSpace().get(0).imageSize()); - Assertions.assertEquals("wwmjs", model.searchSpace().get(0).maxSize()); - Assertions.assertEquals("na", model.searchSpace().get(0).minSize()); - Assertions.assertEquals("amecle", model.searchSpace().get(0).modelSize()); - Assertions.assertEquals("oulndhzyoeojhto", model.searchSpace().get(0).multiScale()); - Assertions.assertEquals("h", model.searchSpace().get(0).nmsIouThreshold()); - Assertions.assertEquals("idmytzln", model.searchSpace().get(0).tileGridSize()); - Assertions.assertEquals("xpno", model.searchSpace().get(0).tileOverlapRatio()); - Assertions.assertEquals("oanfbcswqagyw", model.searchSpace().get(0).tilePredictionsNmsThreshold()); - Assertions.assertEquals("xigvjrktpgaeuk", model.searchSpace().get(0).validationIouThreshold()); - Assertions.assertEquals("wohpmwhqnucs", model.searchSpace().get(0).validationMetricType()); - Assertions.assertEquals(111210342, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(844410077, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT37H28M23S"), model.limitSettings().timeout()); - Assertions.assertEquals(814563749, model.sweepSettings().earlyTermination().delayEvaluation()); - Assertions.assertEquals(400227130, model.sweepSettings().earlyTermination().evaluationInterval()); - Assertions.assertEquals(SamplingAlgorithmType.RANDOM, model.sweepSettings().samplingAlgorithm()); - Assertions.assertEquals("nxdmnitmujdtv", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.validationData().mode()); - Assertions.assertEquals("thqkkwhbgxvellv", model.validationData().uri()); - Assertions.assertEquals(82.02510999731906D, model.validationDataSize()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageLimitSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageLimitSettingsTests.java deleted file mode 100644 index 6cb12aca74fbf..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageLimitSettingsTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ImageLimitSettings; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class ImageLimitSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageLimitSettings model = - BinaryData - .fromString("{\"maxConcurrentTrials\":543709562,\"maxTrials\":848455814,\"timeout\":\"PT224H41M46S\"}") - .toObject(ImageLimitSettings.class); - Assertions.assertEquals(543709562, model.maxConcurrentTrials()); - Assertions.assertEquals(848455814, model.maxTrials()); - Assertions.assertEquals(Duration.parse("PT224H41M46S"), model.timeout()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageLimitSettings model = - new ImageLimitSettings() - .withMaxConcurrentTrials(543709562) - .withMaxTrials(848455814) - .withTimeout(Duration.parse("PT224H41M46S")); - model = BinaryData.fromObject(model).toObject(ImageLimitSettings.class); - Assertions.assertEquals(543709562, model.maxConcurrentTrials()); - Assertions.assertEquals(848455814, model.maxTrials()); - Assertions.assertEquals(Duration.parse("PT224H41M46S"), model.timeout()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelDistributionSettingsClassificationTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelDistributionSettingsClassificationTests.java deleted file mode 100644 index b8076b71567dc..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelDistributionSettingsClassificationTests.java +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ImageModelDistributionSettingsClassification; -import org.junit.jupiter.api.Assertions; - -public final class ImageModelDistributionSettingsClassificationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageModelDistributionSettingsClassification model = - BinaryData - .fromString( - "{\"trainingCropSize\":\"jmfczlfsyqkf\",\"validationCropSize\":\"zgowox\",\"validationResizeSize\":\"je\",\"weightedLoss\":\"cxn\",\"amsGradient\":\"gxhlusr\",\"augmentations\":\"i\",\"beta1\":\"mjceagbjqvls\",\"beta2\":\"ywzash\",\"distributed\":\"onoyjf\",\"earlyStopping\":\"puby\",\"earlyStoppingDelay\":\"clkfkee\",\"earlyStoppingPatience\":\"vop\",\"enableOnnxNormalization\":\"tuoqujlyegqavni\",\"evaluationFrequency\":\"lqqbtnyjpylxdbfv\",\"gradientAccumulationStep\":\"mvmsxbae\",\"layersToFreeze\":\"jcnkottlwu\",\"learningRate\":\"ajmailfemjjza\",\"learningRateScheduler\":\"wjiqullqxb\",\"modelName\":\"vr\",\"momentum\":\"mqerndb\",\"nesterov\":\"yeofltfnnxrkad\",\"numberOfEpochs\":\"ynnfmuiii\",\"numberOfWorkers\":\"pfoh\",\"optimizer\":\"fkx\",\"randomSeed\":\"cbrwjiutgnjizbe\",\"stepLRGamma\":\"oiymrvzbjuyrsrzi\",\"stepLRStepSize\":\"tixgbd\",\"trainingBatchSize\":\"ifrevk\",\"validationBatchSize\":\"pezkis\",\"warmupCosineLRCycles\":\"jm\",\"warmupCosineLRWarmupEpochs\":\"hsyparybjuf\",\"weightDecay\":\"bjczjnciuiyqvlda\"}") - .toObject(ImageModelDistributionSettingsClassification.class); - Assertions.assertEquals("gxhlusr", model.amsGradient()); - Assertions.assertEquals("i", model.augmentations()); - Assertions.assertEquals("mjceagbjqvls", model.beta1()); - Assertions.assertEquals("ywzash", model.beta2()); - Assertions.assertEquals("onoyjf", model.distributed()); - Assertions.assertEquals("puby", model.earlyStopping()); - Assertions.assertEquals("clkfkee", model.earlyStoppingDelay()); - Assertions.assertEquals("vop", model.earlyStoppingPatience()); - Assertions.assertEquals("tuoqujlyegqavni", model.enableOnnxNormalization()); - Assertions.assertEquals("lqqbtnyjpylxdbfv", model.evaluationFrequency()); - Assertions.assertEquals("mvmsxbae", model.gradientAccumulationStep()); - Assertions.assertEquals("jcnkottlwu", model.layersToFreeze()); - Assertions.assertEquals("ajmailfemjjza", model.learningRate()); - Assertions.assertEquals("wjiqullqxb", model.learningRateScheduler()); - Assertions.assertEquals("vr", model.modelName()); - Assertions.assertEquals("mqerndb", model.momentum()); - Assertions.assertEquals("yeofltfnnxrkad", model.nesterov()); - Assertions.assertEquals("ynnfmuiii", model.numberOfEpochs()); - Assertions.assertEquals("pfoh", model.numberOfWorkers()); - Assertions.assertEquals("fkx", model.optimizer()); - Assertions.assertEquals("cbrwjiutgnjizbe", model.randomSeed()); - Assertions.assertEquals("oiymrvzbjuyrsrzi", model.stepLRGamma()); - Assertions.assertEquals("tixgbd", model.stepLRStepSize()); - Assertions.assertEquals("ifrevk", model.trainingBatchSize()); - Assertions.assertEquals("pezkis", model.validationBatchSize()); - Assertions.assertEquals("jm", model.warmupCosineLRCycles()); - Assertions.assertEquals("hsyparybjuf", model.warmupCosineLRWarmupEpochs()); - Assertions.assertEquals("bjczjnciuiyqvlda", model.weightDecay()); - Assertions.assertEquals("jmfczlfsyqkf", model.trainingCropSize()); - Assertions.assertEquals("zgowox", model.validationCropSize()); - Assertions.assertEquals("je", model.validationResizeSize()); - Assertions.assertEquals("cxn", model.weightedLoss()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageModelDistributionSettingsClassification model = - new ImageModelDistributionSettingsClassification() - .withAmsGradient("gxhlusr") - .withAugmentations("i") - .withBeta1("mjceagbjqvls") - .withBeta2("ywzash") - .withDistributed("onoyjf") - .withEarlyStopping("puby") - .withEarlyStoppingDelay("clkfkee") - .withEarlyStoppingPatience("vop") - .withEnableOnnxNormalization("tuoqujlyegqavni") - .withEvaluationFrequency("lqqbtnyjpylxdbfv") - .withGradientAccumulationStep("mvmsxbae") - .withLayersToFreeze("jcnkottlwu") - .withLearningRate("ajmailfemjjza") - .withLearningRateScheduler("wjiqullqxb") - .withModelName("vr") - .withMomentum("mqerndb") - .withNesterov("yeofltfnnxrkad") - .withNumberOfEpochs("ynnfmuiii") - .withNumberOfWorkers("pfoh") - .withOptimizer("fkx") - .withRandomSeed("cbrwjiutgnjizbe") - .withStepLRGamma("oiymrvzbjuyrsrzi") - .withStepLRStepSize("tixgbd") - .withTrainingBatchSize("ifrevk") - .withValidationBatchSize("pezkis") - .withWarmupCosineLRCycles("jm") - .withWarmupCosineLRWarmupEpochs("hsyparybjuf") - .withWeightDecay("bjczjnciuiyqvlda") - .withTrainingCropSize("jmfczlfsyqkf") - .withValidationCropSize("zgowox") - .withValidationResizeSize("je") - .withWeightedLoss("cxn"); - model = BinaryData.fromObject(model).toObject(ImageModelDistributionSettingsClassification.class); - Assertions.assertEquals("gxhlusr", model.amsGradient()); - Assertions.assertEquals("i", model.augmentations()); - Assertions.assertEquals("mjceagbjqvls", model.beta1()); - Assertions.assertEquals("ywzash", model.beta2()); - Assertions.assertEquals("onoyjf", model.distributed()); - Assertions.assertEquals("puby", model.earlyStopping()); - Assertions.assertEquals("clkfkee", model.earlyStoppingDelay()); - Assertions.assertEquals("vop", model.earlyStoppingPatience()); - Assertions.assertEquals("tuoqujlyegqavni", model.enableOnnxNormalization()); - Assertions.assertEquals("lqqbtnyjpylxdbfv", model.evaluationFrequency()); - Assertions.assertEquals("mvmsxbae", model.gradientAccumulationStep()); - Assertions.assertEquals("jcnkottlwu", model.layersToFreeze()); - Assertions.assertEquals("ajmailfemjjza", model.learningRate()); - Assertions.assertEquals("wjiqullqxb", model.learningRateScheduler()); - Assertions.assertEquals("vr", model.modelName()); - Assertions.assertEquals("mqerndb", model.momentum()); - Assertions.assertEquals("yeofltfnnxrkad", model.nesterov()); - Assertions.assertEquals("ynnfmuiii", model.numberOfEpochs()); - Assertions.assertEquals("pfoh", model.numberOfWorkers()); - Assertions.assertEquals("fkx", model.optimizer()); - Assertions.assertEquals("cbrwjiutgnjizbe", model.randomSeed()); - Assertions.assertEquals("oiymrvzbjuyrsrzi", model.stepLRGamma()); - Assertions.assertEquals("tixgbd", model.stepLRStepSize()); - Assertions.assertEquals("ifrevk", model.trainingBatchSize()); - Assertions.assertEquals("pezkis", model.validationBatchSize()); - Assertions.assertEquals("jm", model.warmupCosineLRCycles()); - Assertions.assertEquals("hsyparybjuf", model.warmupCosineLRWarmupEpochs()); - Assertions.assertEquals("bjczjnciuiyqvlda", model.weightDecay()); - Assertions.assertEquals("jmfczlfsyqkf", model.trainingCropSize()); - Assertions.assertEquals("zgowox", model.validationCropSize()); - Assertions.assertEquals("je", model.validationResizeSize()); - Assertions.assertEquals("cxn", model.weightedLoss()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelDistributionSettingsObjectDetectionTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelDistributionSettingsObjectDetectionTests.java deleted file mode 100644 index 968465a57c12a..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelDistributionSettingsObjectDetectionTests.java +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ImageModelDistributionSettingsObjectDetection; -import org.junit.jupiter.api.Assertions; - -public final class ImageModelDistributionSettingsObjectDetectionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageModelDistributionSettingsObjectDetection model = - BinaryData - .fromString( - "{\"boxDetectionsPerImage\":\"isubxbteog\",\"boxScoreThreshold\":\"fiijrykwlefksxqc\",\"imageSize\":\"zfpxgnmqvzvluy\",\"maxSize\":\"aiossscyvaifp\",\"minSize\":\"acvfyeowps\",\"modelSize\":\"tjdhsoymhpvtyq\",\"multiScale\":\"tehdpboujs\",\"nmsIouThreshold\":\"fvvdshxcdedsue\",\"tileGridSize\":\"gnxcgjtfrnquktr\",\"tileOverlapRatio\":\"s\",\"tilePredictionsNmsThreshold\":\"lr\",\"validationIouThreshold\":\"myltrwntfmtbg\",\"validationMetricType\":\"dxwnazkurrd\",\"amsGradient\":\"yzjwhsetwwjwzzq\",\"augmentations\":\"uzu\",\"beta1\":\"y\",\"beta2\":\"yqhyqqzzdcykey\",\"distributed\":\"ewfopazdazg\",\"earlyStopping\":\"qgpewqcfutmdpvoz\",\"earlyStoppingDelay\":\"qjbknl\",\"earlyStoppingPatience\":\"lctzeyowmndcovd\",\"enableOnnxNormalization\":\"qauxzan\",\"evaluationFrequency\":\"kvfruwkudr\",\"gradientAccumulationStep\":\"pftxudqyeme\",\"layersToFreeze\":\"naucmcirtnee\",\"learningRate\":\"jauwcgxefnohaitr\",\"learningRateScheduler\":\"izerw\",\"modelName\":\"dasmxu\",\"momentum\":\"fbngfcocef\",\"nesterov\":\"riylfmpztra\",\"numberOfEpochs\":\"svhl\",\"numberOfWorkers\":\"culregpqt\",\"optimizer\":\"jhvrztnvgyshqrdg\",\"randomSeed\":\"wmewjzlpyk\",\"stepLRGamma\":\"azzwjcay\",\"stepLRStepSize\":\"zrransyb\",\"trainingBatchSize\":\"polwzrghsrlei\",\"validationBatchSize\":\"fscjfn\",\"warmupCosineLRCycles\":\"wvuagfqwtl\",\"warmupCosineLRWarmupEpochs\":\"gvmreuptrklzmi\",\"weightDecay\":\"jwolxfsvaghmpynw\"}") - .toObject(ImageModelDistributionSettingsObjectDetection.class); - Assertions.assertEquals("yzjwhsetwwjwzzq", model.amsGradient()); - Assertions.assertEquals("uzu", model.augmentations()); - Assertions.assertEquals("y", model.beta1()); - Assertions.assertEquals("yqhyqqzzdcykey", model.beta2()); - Assertions.assertEquals("ewfopazdazg", model.distributed()); - Assertions.assertEquals("qgpewqcfutmdpvoz", model.earlyStopping()); - Assertions.assertEquals("qjbknl", model.earlyStoppingDelay()); - Assertions.assertEquals("lctzeyowmndcovd", model.earlyStoppingPatience()); - Assertions.assertEquals("qauxzan", model.enableOnnxNormalization()); - Assertions.assertEquals("kvfruwkudr", model.evaluationFrequency()); - Assertions.assertEquals("pftxudqyeme", model.gradientAccumulationStep()); - Assertions.assertEquals("naucmcirtnee", model.layersToFreeze()); - Assertions.assertEquals("jauwcgxefnohaitr", model.learningRate()); - Assertions.assertEquals("izerw", model.learningRateScheduler()); - Assertions.assertEquals("dasmxu", model.modelName()); - Assertions.assertEquals("fbngfcocef", model.momentum()); - Assertions.assertEquals("riylfmpztra", model.nesterov()); - Assertions.assertEquals("svhl", model.numberOfEpochs()); - Assertions.assertEquals("culregpqt", model.numberOfWorkers()); - Assertions.assertEquals("jhvrztnvgyshqrdg", model.optimizer()); - Assertions.assertEquals("wmewjzlpyk", model.randomSeed()); - Assertions.assertEquals("azzwjcay", model.stepLRGamma()); - Assertions.assertEquals("zrransyb", model.stepLRStepSize()); - Assertions.assertEquals("polwzrghsrlei", model.trainingBatchSize()); - Assertions.assertEquals("fscjfn", model.validationBatchSize()); - Assertions.assertEquals("wvuagfqwtl", model.warmupCosineLRCycles()); - Assertions.assertEquals("gvmreuptrklzmi", model.warmupCosineLRWarmupEpochs()); - Assertions.assertEquals("jwolxfsvaghmpynw", model.weightDecay()); - Assertions.assertEquals("isubxbteog", model.boxDetectionsPerImage()); - Assertions.assertEquals("fiijrykwlefksxqc", model.boxScoreThreshold()); - Assertions.assertEquals("zfpxgnmqvzvluy", model.imageSize()); - Assertions.assertEquals("aiossscyvaifp", model.maxSize()); - Assertions.assertEquals("acvfyeowps", model.minSize()); - Assertions.assertEquals("tjdhsoymhpvtyq", model.modelSize()); - Assertions.assertEquals("tehdpboujs", model.multiScale()); - Assertions.assertEquals("fvvdshxcdedsue", model.nmsIouThreshold()); - Assertions.assertEquals("gnxcgjtfrnquktr", model.tileGridSize()); - Assertions.assertEquals("s", model.tileOverlapRatio()); - Assertions.assertEquals("lr", model.tilePredictionsNmsThreshold()); - Assertions.assertEquals("myltrwntfmtbg", model.validationIouThreshold()); - Assertions.assertEquals("dxwnazkurrd", model.validationMetricType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageModelDistributionSettingsObjectDetection model = - new ImageModelDistributionSettingsObjectDetection() - .withAmsGradient("yzjwhsetwwjwzzq") - .withAugmentations("uzu") - .withBeta1("y") - .withBeta2("yqhyqqzzdcykey") - .withDistributed("ewfopazdazg") - .withEarlyStopping("qgpewqcfutmdpvoz") - .withEarlyStoppingDelay("qjbknl") - .withEarlyStoppingPatience("lctzeyowmndcovd") - .withEnableOnnxNormalization("qauxzan") - .withEvaluationFrequency("kvfruwkudr") - .withGradientAccumulationStep("pftxudqyeme") - .withLayersToFreeze("naucmcirtnee") - .withLearningRate("jauwcgxefnohaitr") - .withLearningRateScheduler("izerw") - .withModelName("dasmxu") - .withMomentum("fbngfcocef") - .withNesterov("riylfmpztra") - .withNumberOfEpochs("svhl") - .withNumberOfWorkers("culregpqt") - .withOptimizer("jhvrztnvgyshqrdg") - .withRandomSeed("wmewjzlpyk") - .withStepLRGamma("azzwjcay") - .withStepLRStepSize("zrransyb") - .withTrainingBatchSize("polwzrghsrlei") - .withValidationBatchSize("fscjfn") - .withWarmupCosineLRCycles("wvuagfqwtl") - .withWarmupCosineLRWarmupEpochs("gvmreuptrklzmi") - .withWeightDecay("jwolxfsvaghmpynw") - .withBoxDetectionsPerImage("isubxbteog") - .withBoxScoreThreshold("fiijrykwlefksxqc") - .withImageSize("zfpxgnmqvzvluy") - .withMaxSize("aiossscyvaifp") - .withMinSize("acvfyeowps") - .withModelSize("tjdhsoymhpvtyq") - .withMultiScale("tehdpboujs") - .withNmsIouThreshold("fvvdshxcdedsue") - .withTileGridSize("gnxcgjtfrnquktr") - .withTileOverlapRatio("s") - .withTilePredictionsNmsThreshold("lr") - .withValidationIouThreshold("myltrwntfmtbg") - .withValidationMetricType("dxwnazkurrd"); - model = BinaryData.fromObject(model).toObject(ImageModelDistributionSettingsObjectDetection.class); - Assertions.assertEquals("yzjwhsetwwjwzzq", model.amsGradient()); - Assertions.assertEquals("uzu", model.augmentations()); - Assertions.assertEquals("y", model.beta1()); - Assertions.assertEquals("yqhyqqzzdcykey", model.beta2()); - Assertions.assertEquals("ewfopazdazg", model.distributed()); - Assertions.assertEquals("qgpewqcfutmdpvoz", model.earlyStopping()); - Assertions.assertEquals("qjbknl", model.earlyStoppingDelay()); - Assertions.assertEquals("lctzeyowmndcovd", model.earlyStoppingPatience()); - Assertions.assertEquals("qauxzan", model.enableOnnxNormalization()); - Assertions.assertEquals("kvfruwkudr", model.evaluationFrequency()); - Assertions.assertEquals("pftxudqyeme", model.gradientAccumulationStep()); - Assertions.assertEquals("naucmcirtnee", model.layersToFreeze()); - Assertions.assertEquals("jauwcgxefnohaitr", model.learningRate()); - Assertions.assertEquals("izerw", model.learningRateScheduler()); - Assertions.assertEquals("dasmxu", model.modelName()); - Assertions.assertEquals("fbngfcocef", model.momentum()); - Assertions.assertEquals("riylfmpztra", model.nesterov()); - Assertions.assertEquals("svhl", model.numberOfEpochs()); - Assertions.assertEquals("culregpqt", model.numberOfWorkers()); - Assertions.assertEquals("jhvrztnvgyshqrdg", model.optimizer()); - Assertions.assertEquals("wmewjzlpyk", model.randomSeed()); - Assertions.assertEquals("azzwjcay", model.stepLRGamma()); - Assertions.assertEquals("zrransyb", model.stepLRStepSize()); - Assertions.assertEquals("polwzrghsrlei", model.trainingBatchSize()); - Assertions.assertEquals("fscjfn", model.validationBatchSize()); - Assertions.assertEquals("wvuagfqwtl", model.warmupCosineLRCycles()); - Assertions.assertEquals("gvmreuptrklzmi", model.warmupCosineLRWarmupEpochs()); - Assertions.assertEquals("jwolxfsvaghmpynw", model.weightDecay()); - Assertions.assertEquals("isubxbteog", model.boxDetectionsPerImage()); - Assertions.assertEquals("fiijrykwlefksxqc", model.boxScoreThreshold()); - Assertions.assertEquals("zfpxgnmqvzvluy", model.imageSize()); - Assertions.assertEquals("aiossscyvaifp", model.maxSize()); - Assertions.assertEquals("acvfyeowps", model.minSize()); - Assertions.assertEquals("tjdhsoymhpvtyq", model.modelSize()); - Assertions.assertEquals("tehdpboujs", model.multiScale()); - Assertions.assertEquals("fvvdshxcdedsue", model.nmsIouThreshold()); - Assertions.assertEquals("gnxcgjtfrnquktr", model.tileGridSize()); - Assertions.assertEquals("s", model.tileOverlapRatio()); - Assertions.assertEquals("lr", model.tilePredictionsNmsThreshold()); - Assertions.assertEquals("myltrwntfmtbg", model.validationIouThreshold()); - Assertions.assertEquals("dxwnazkurrd", model.validationMetricType()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelDistributionSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelDistributionSettingsTests.java deleted file mode 100644 index eff5f61e7e721..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelDistributionSettingsTests.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ImageModelDistributionSettings; -import org.junit.jupiter.api.Assertions; - -public final class ImageModelDistributionSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageModelDistributionSettings model = - BinaryData - .fromString( - "{\"amsGradient\":\"v\",\"augmentations\":\"i\",\"beta1\":\"qzlgcndhzxrrfcfs\",\"beta2\":\"khgsnxuwwkpphefs\",\"distributed\":\"xlb\",\"earlyStopping\":\"omeikjcl\",\"earlyStoppingDelay\":\"acnmwpfsuqtaaz\",\"earlyStoppingPatience\":\"bxyxoy\",\"enableOnnxNormalization\":\"uqqiqezxlhd\",\"evaluationFrequency\":\"qdcadwvps\",\"gradientAccumulationStep\":\"j\",\"layersToFreeze\":\"hjriyb\",\"learningRate\":\"zo\",\"learningRateScheduler\":\"nxwdvwnjkg\",\"modelName\":\"nmx\",\"momentum\":\"rsqftib\",\"nesterov\":\"ibuyvpirf\",\"numberOfEpochs\":\"pnqn\",\"numberOfWorkers\":\"w\",\"optimizer\":\"edenrexkxbhxv\",\"randomSeed\":\"nul\",\"stepLRGamma\":\"nhj\",\"stepLRStepSize\":\"dyznfajsvks\",\"trainingBatchSize\":\"qozzkivyhjrliizj\",\"validationBatchSize\":\"lqfhefkwabs\",\"warmupCosineLRCycles\":\"ron\",\"warmupCosineLRWarmupEpochs\":\"lmgnlqxsjx\",\"weightDecay\":\"lexhv\"}") - .toObject(ImageModelDistributionSettings.class); - Assertions.assertEquals("v", model.amsGradient()); - Assertions.assertEquals("i", model.augmentations()); - Assertions.assertEquals("qzlgcndhzxrrfcfs", model.beta1()); - Assertions.assertEquals("khgsnxuwwkpphefs", model.beta2()); - Assertions.assertEquals("xlb", model.distributed()); - Assertions.assertEquals("omeikjcl", model.earlyStopping()); - Assertions.assertEquals("acnmwpfsuqtaaz", model.earlyStoppingDelay()); - Assertions.assertEquals("bxyxoy", model.earlyStoppingPatience()); - Assertions.assertEquals("uqqiqezxlhd", model.enableOnnxNormalization()); - Assertions.assertEquals("qdcadwvps", model.evaluationFrequency()); - Assertions.assertEquals("j", model.gradientAccumulationStep()); - Assertions.assertEquals("hjriyb", model.layersToFreeze()); - Assertions.assertEquals("zo", model.learningRate()); - Assertions.assertEquals("nxwdvwnjkg", model.learningRateScheduler()); - Assertions.assertEquals("nmx", model.modelName()); - Assertions.assertEquals("rsqftib", model.momentum()); - Assertions.assertEquals("ibuyvpirf", model.nesterov()); - Assertions.assertEquals("pnqn", model.numberOfEpochs()); - Assertions.assertEquals("w", model.numberOfWorkers()); - Assertions.assertEquals("edenrexkxbhxv", model.optimizer()); - Assertions.assertEquals("nul", model.randomSeed()); - Assertions.assertEquals("nhj", model.stepLRGamma()); - Assertions.assertEquals("dyznfajsvks", model.stepLRStepSize()); - Assertions.assertEquals("qozzkivyhjrliizj", model.trainingBatchSize()); - Assertions.assertEquals("lqfhefkwabs", model.validationBatchSize()); - Assertions.assertEquals("ron", model.warmupCosineLRCycles()); - Assertions.assertEquals("lmgnlqxsjx", model.warmupCosineLRWarmupEpochs()); - Assertions.assertEquals("lexhv", model.weightDecay()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageModelDistributionSettings model = - new ImageModelDistributionSettings() - .withAmsGradient("v") - .withAugmentations("i") - .withBeta1("qzlgcndhzxrrfcfs") - .withBeta2("khgsnxuwwkpphefs") - .withDistributed("xlb") - .withEarlyStopping("omeikjcl") - .withEarlyStoppingDelay("acnmwpfsuqtaaz") - .withEarlyStoppingPatience("bxyxoy") - .withEnableOnnxNormalization("uqqiqezxlhd") - .withEvaluationFrequency("qdcadwvps") - .withGradientAccumulationStep("j") - .withLayersToFreeze("hjriyb") - .withLearningRate("zo") - .withLearningRateScheduler("nxwdvwnjkg") - .withModelName("nmx") - .withMomentum("rsqftib") - .withNesterov("ibuyvpirf") - .withNumberOfEpochs("pnqn") - .withNumberOfWorkers("w") - .withOptimizer("edenrexkxbhxv") - .withRandomSeed("nul") - .withStepLRGamma("nhj") - .withStepLRStepSize("dyznfajsvks") - .withTrainingBatchSize("qozzkivyhjrliizj") - .withValidationBatchSize("lqfhefkwabs") - .withWarmupCosineLRCycles("ron") - .withWarmupCosineLRWarmupEpochs("lmgnlqxsjx") - .withWeightDecay("lexhv"); - model = BinaryData.fromObject(model).toObject(ImageModelDistributionSettings.class); - Assertions.assertEquals("v", model.amsGradient()); - Assertions.assertEquals("i", model.augmentations()); - Assertions.assertEquals("qzlgcndhzxrrfcfs", model.beta1()); - Assertions.assertEquals("khgsnxuwwkpphefs", model.beta2()); - Assertions.assertEquals("xlb", model.distributed()); - Assertions.assertEquals("omeikjcl", model.earlyStopping()); - Assertions.assertEquals("acnmwpfsuqtaaz", model.earlyStoppingDelay()); - Assertions.assertEquals("bxyxoy", model.earlyStoppingPatience()); - Assertions.assertEquals("uqqiqezxlhd", model.enableOnnxNormalization()); - Assertions.assertEquals("qdcadwvps", model.evaluationFrequency()); - Assertions.assertEquals("j", model.gradientAccumulationStep()); - Assertions.assertEquals("hjriyb", model.layersToFreeze()); - Assertions.assertEquals("zo", model.learningRate()); - Assertions.assertEquals("nxwdvwnjkg", model.learningRateScheduler()); - Assertions.assertEquals("nmx", model.modelName()); - Assertions.assertEquals("rsqftib", model.momentum()); - Assertions.assertEquals("ibuyvpirf", model.nesterov()); - Assertions.assertEquals("pnqn", model.numberOfEpochs()); - Assertions.assertEquals("w", model.numberOfWorkers()); - Assertions.assertEquals("edenrexkxbhxv", model.optimizer()); - Assertions.assertEquals("nul", model.randomSeed()); - Assertions.assertEquals("nhj", model.stepLRGamma()); - Assertions.assertEquals("dyznfajsvks", model.stepLRStepSize()); - Assertions.assertEquals("qozzkivyhjrliizj", model.trainingBatchSize()); - Assertions.assertEquals("lqfhefkwabs", model.validationBatchSize()); - Assertions.assertEquals("ron", model.warmupCosineLRCycles()); - Assertions.assertEquals("lmgnlqxsjx", model.warmupCosineLRWarmupEpochs()); - Assertions.assertEquals("lexhv", model.weightDecay()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelSettingsClassificationTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelSettingsClassificationTests.java deleted file mode 100644 index 5f68719c85e16..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelSettingsClassificationTests.java +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ImageModelSettingsClassification; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.LearningRateScheduler; -import com.azure.resourcemanager.machinelearning.models.MLFlowModelJobInput; -import com.azure.resourcemanager.machinelearning.models.StochasticOptimizer; -import org.junit.jupiter.api.Assertions; - -public final class ImageModelSettingsClassificationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageModelSettingsClassification model = - BinaryData - .fromString( - "{\"trainingCropSize\":1924497192,\"validationCropSize\":919883073,\"validationResizeSize\":1735818040,\"weightedLoss\":2030366014,\"advancedSettings\":\"tuicds\",\"amsGradient\":true,\"augmentations\":\"m\",\"beta1\":59.436913,\"beta2\":62.807377,\"checkpointFrequency\":1080891031,\"checkpointModel\":{\"jobInputType\":\"mlflow_model\",\"mode\":\"Download\",\"uri\":\"rgyngydgrpxnca\",\"description\":\"qao\"},\"checkpointRunId\":\"jrkc\",\"distributed\":true,\"earlyStopping\":true,\"earlyStoppingDelay\":1511007702,\"earlyStoppingPatience\":1521830595,\"enableOnnxNormalization\":true,\"evaluationFrequency\":1183182643,\"gradientAccumulationStep\":588395160,\"layersToFreeze\":1092712252,\"learningRate\":63.37043,\"learningRateScheduler\":\"WarmupCosine\",\"modelName\":\"gxhqfgqkayejs\",\"momentum\":38.807606,\"nesterov\":true,\"numberOfEpochs\":390611386,\"numberOfWorkers\":883853554,\"optimizer\":\"None\",\"randomSeed\":9965556,\"stepLRGamma\":33.88037,\"stepLRStepSize\":1346771342,\"trainingBatchSize\":1977652281,\"validationBatchSize\":503751381,\"warmupCosineLRCycles\":23.360283,\"warmupCosineLRWarmupEpochs\":1142072535,\"weightDecay\":68.338776}") - .toObject(ImageModelSettingsClassification.class); - Assertions.assertEquals("tuicds", model.advancedSettings()); - Assertions.assertEquals(true, model.amsGradient()); - Assertions.assertEquals("m", model.augmentations()); - Assertions.assertEquals(59.436913F, model.beta1()); - Assertions.assertEquals(62.807377F, model.beta2()); - Assertions.assertEquals(1080891031, model.checkpointFrequency()); - Assertions.assertEquals("qao", model.checkpointModel().description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.checkpointModel().mode()); - Assertions.assertEquals("rgyngydgrpxnca", model.checkpointModel().uri()); - Assertions.assertEquals("jrkc", model.checkpointRunId()); - Assertions.assertEquals(true, model.distributed()); - Assertions.assertEquals(true, model.earlyStopping()); - Assertions.assertEquals(1511007702, model.earlyStoppingDelay()); - Assertions.assertEquals(1521830595, model.earlyStoppingPatience()); - Assertions.assertEquals(true, model.enableOnnxNormalization()); - Assertions.assertEquals(1183182643, model.evaluationFrequency()); - Assertions.assertEquals(588395160, model.gradientAccumulationStep()); - Assertions.assertEquals(1092712252, model.layersToFreeze()); - Assertions.assertEquals(63.37043F, model.learningRate()); - Assertions.assertEquals(LearningRateScheduler.WARMUP_COSINE, model.learningRateScheduler()); - Assertions.assertEquals("gxhqfgqkayejs", model.modelName()); - Assertions.assertEquals(38.807606F, model.momentum()); - Assertions.assertEquals(true, model.nesterov()); - Assertions.assertEquals(390611386, model.numberOfEpochs()); - Assertions.assertEquals(883853554, model.numberOfWorkers()); - Assertions.assertEquals(StochasticOptimizer.NONE, model.optimizer()); - Assertions.assertEquals(9965556, model.randomSeed()); - Assertions.assertEquals(33.88037F, model.stepLRGamma()); - Assertions.assertEquals(1346771342, model.stepLRStepSize()); - Assertions.assertEquals(1977652281, model.trainingBatchSize()); - Assertions.assertEquals(503751381, model.validationBatchSize()); - Assertions.assertEquals(23.360283F, model.warmupCosineLRCycles()); - Assertions.assertEquals(1142072535, model.warmupCosineLRWarmupEpochs()); - Assertions.assertEquals(68.338776F, model.weightDecay()); - Assertions.assertEquals(1924497192, model.trainingCropSize()); - Assertions.assertEquals(919883073, model.validationCropSize()); - Assertions.assertEquals(1735818040, model.validationResizeSize()); - Assertions.assertEquals(2030366014, model.weightedLoss()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageModelSettingsClassification model = - new ImageModelSettingsClassification() - .withAdvancedSettings("tuicds") - .withAmsGradient(true) - .withAugmentations("m") - .withBeta1(59.436913F) - .withBeta2(62.807377F) - .withCheckpointFrequency(1080891031) - .withCheckpointModel( - new MLFlowModelJobInput() - .withDescription("qao") - .withMode(InputDeliveryMode.DOWNLOAD) - .withUri("rgyngydgrpxnca")) - .withCheckpointRunId("jrkc") - .withDistributed(true) - .withEarlyStopping(true) - .withEarlyStoppingDelay(1511007702) - .withEarlyStoppingPatience(1521830595) - .withEnableOnnxNormalization(true) - .withEvaluationFrequency(1183182643) - .withGradientAccumulationStep(588395160) - .withLayersToFreeze(1092712252) - .withLearningRate(63.37043F) - .withLearningRateScheduler(LearningRateScheduler.WARMUP_COSINE) - .withModelName("gxhqfgqkayejs") - .withMomentum(38.807606F) - .withNesterov(true) - .withNumberOfEpochs(390611386) - .withNumberOfWorkers(883853554) - .withOptimizer(StochasticOptimizer.NONE) - .withRandomSeed(9965556) - .withStepLRGamma(33.88037F) - .withStepLRStepSize(1346771342) - .withTrainingBatchSize(1977652281) - .withValidationBatchSize(503751381) - .withWarmupCosineLRCycles(23.360283F) - .withWarmupCosineLRWarmupEpochs(1142072535) - .withWeightDecay(68.338776F) - .withTrainingCropSize(1924497192) - .withValidationCropSize(919883073) - .withValidationResizeSize(1735818040) - .withWeightedLoss(2030366014); - model = BinaryData.fromObject(model).toObject(ImageModelSettingsClassification.class); - Assertions.assertEquals("tuicds", model.advancedSettings()); - Assertions.assertEquals(true, model.amsGradient()); - Assertions.assertEquals("m", model.augmentations()); - Assertions.assertEquals(59.436913F, model.beta1()); - Assertions.assertEquals(62.807377F, model.beta2()); - Assertions.assertEquals(1080891031, model.checkpointFrequency()); - Assertions.assertEquals("qao", model.checkpointModel().description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.checkpointModel().mode()); - Assertions.assertEquals("rgyngydgrpxnca", model.checkpointModel().uri()); - Assertions.assertEquals("jrkc", model.checkpointRunId()); - Assertions.assertEquals(true, model.distributed()); - Assertions.assertEquals(true, model.earlyStopping()); - Assertions.assertEquals(1511007702, model.earlyStoppingDelay()); - Assertions.assertEquals(1521830595, model.earlyStoppingPatience()); - Assertions.assertEquals(true, model.enableOnnxNormalization()); - Assertions.assertEquals(1183182643, model.evaluationFrequency()); - Assertions.assertEquals(588395160, model.gradientAccumulationStep()); - Assertions.assertEquals(1092712252, model.layersToFreeze()); - Assertions.assertEquals(63.37043F, model.learningRate()); - Assertions.assertEquals(LearningRateScheduler.WARMUP_COSINE, model.learningRateScheduler()); - Assertions.assertEquals("gxhqfgqkayejs", model.modelName()); - Assertions.assertEquals(38.807606F, model.momentum()); - Assertions.assertEquals(true, model.nesterov()); - Assertions.assertEquals(390611386, model.numberOfEpochs()); - Assertions.assertEquals(883853554, model.numberOfWorkers()); - Assertions.assertEquals(StochasticOptimizer.NONE, model.optimizer()); - Assertions.assertEquals(9965556, model.randomSeed()); - Assertions.assertEquals(33.88037F, model.stepLRGamma()); - Assertions.assertEquals(1346771342, model.stepLRStepSize()); - Assertions.assertEquals(1977652281, model.trainingBatchSize()); - Assertions.assertEquals(503751381, model.validationBatchSize()); - Assertions.assertEquals(23.360283F, model.warmupCosineLRCycles()); - Assertions.assertEquals(1142072535, model.warmupCosineLRWarmupEpochs()); - Assertions.assertEquals(68.338776F, model.weightDecay()); - Assertions.assertEquals(1924497192, model.trainingCropSize()); - Assertions.assertEquals(919883073, model.validationCropSize()); - Assertions.assertEquals(1735818040, model.validationResizeSize()); - Assertions.assertEquals(2030366014, model.weightedLoss()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelSettingsObjectDetectionTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelSettingsObjectDetectionTests.java deleted file mode 100644 index 71eeb63331538..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelSettingsObjectDetectionTests.java +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ImageModelSettingsObjectDetection; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.LearningRateScheduler; -import com.azure.resourcemanager.machinelearning.models.MLFlowModelJobInput; -import com.azure.resourcemanager.machinelearning.models.ModelSize; -import com.azure.resourcemanager.machinelearning.models.StochasticOptimizer; -import com.azure.resourcemanager.machinelearning.models.ValidationMetricType; -import org.junit.jupiter.api.Assertions; - -public final class ImageModelSettingsObjectDetectionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageModelSettingsObjectDetection model = - BinaryData - .fromString( - "{\"boxDetectionsPerImage\":101641984,\"boxScoreThreshold\":16.755789,\"imageSize\":1076058960,\"maxSize\":191759687,\"minSize\":1378586528,\"modelSize\":\"ExtraLarge\",\"multiScale\":true,\"nmsIouThreshold\":18.348568,\"tileGridSize\":\"ljzgdy\",\"tileOverlapRatio\":96.23886,\"tilePredictionsNmsThreshold\":36.949356,\"validationIouThreshold\":45.30077,\"validationMetricType\":\"CocoVoc\",\"advancedSettings\":\"rqhbjnqogdxwbsfp\",\"amsGradient\":false,\"augmentations\":\"jlf\",\"beta1\":75.122604,\"beta2\":77.73417,\"checkpointFrequency\":1341111685,\"checkpointModel\":{\"jobInputType\":\"mlflow_model\",\"mode\":\"Download\",\"uri\":\"jluxxdhi\",\"description\":\"zd\"},\"checkpointRunId\":\"qjm\",\"distributed\":false,\"earlyStopping\":false,\"earlyStoppingDelay\":954713869,\"earlyStoppingPatience\":1623513694,\"enableOnnxNormalization\":false,\"evaluationFrequency\":1227246383,\"gradientAccumulationStep\":445418051,\"layersToFreeze\":1633383721,\"learningRate\":20.159918,\"learningRateScheduler\":\"WarmupCosine\",\"modelName\":\"znkcqwwxwjy\",\"momentum\":68.34347,\"nesterov\":true,\"numberOfEpochs\":370561675,\"numberOfWorkers\":561740795,\"optimizer\":\"None\",\"randomSeed\":1563473495,\"stepLRGamma\":32.891335,\"stepLRStepSize\":795985008,\"trainingBatchSize\":485145114,\"validationBatchSize\":638318099,\"warmupCosineLRCycles\":34.38207,\"warmupCosineLRWarmupEpochs\":771716822,\"weightDecay\":76.72818}") - .toObject(ImageModelSettingsObjectDetection.class); - Assertions.assertEquals("rqhbjnqogdxwbsfp", model.advancedSettings()); - Assertions.assertEquals(false, model.amsGradient()); - Assertions.assertEquals("jlf", model.augmentations()); - Assertions.assertEquals(75.122604F, model.beta1()); - Assertions.assertEquals(77.73417F, model.beta2()); - Assertions.assertEquals(1341111685, model.checkpointFrequency()); - Assertions.assertEquals("zd", model.checkpointModel().description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.checkpointModel().mode()); - Assertions.assertEquals("jluxxdhi", model.checkpointModel().uri()); - Assertions.assertEquals("qjm", model.checkpointRunId()); - Assertions.assertEquals(false, model.distributed()); - Assertions.assertEquals(false, model.earlyStopping()); - Assertions.assertEquals(954713869, model.earlyStoppingDelay()); - Assertions.assertEquals(1623513694, model.earlyStoppingPatience()); - Assertions.assertEquals(false, model.enableOnnxNormalization()); - Assertions.assertEquals(1227246383, model.evaluationFrequency()); - Assertions.assertEquals(445418051, model.gradientAccumulationStep()); - Assertions.assertEquals(1633383721, model.layersToFreeze()); - Assertions.assertEquals(20.159918F, model.learningRate()); - Assertions.assertEquals(LearningRateScheduler.WARMUP_COSINE, model.learningRateScheduler()); - Assertions.assertEquals("znkcqwwxwjy", model.modelName()); - Assertions.assertEquals(68.34347F, model.momentum()); - Assertions.assertEquals(true, model.nesterov()); - Assertions.assertEquals(370561675, model.numberOfEpochs()); - Assertions.assertEquals(561740795, model.numberOfWorkers()); - Assertions.assertEquals(StochasticOptimizer.NONE, model.optimizer()); - Assertions.assertEquals(1563473495, model.randomSeed()); - Assertions.assertEquals(32.891335F, model.stepLRGamma()); - Assertions.assertEquals(795985008, model.stepLRStepSize()); - Assertions.assertEquals(485145114, model.trainingBatchSize()); - Assertions.assertEquals(638318099, model.validationBatchSize()); - Assertions.assertEquals(34.38207F, model.warmupCosineLRCycles()); - Assertions.assertEquals(771716822, model.warmupCosineLRWarmupEpochs()); - Assertions.assertEquals(76.72818F, model.weightDecay()); - Assertions.assertEquals(101641984, model.boxDetectionsPerImage()); - Assertions.assertEquals(16.755789F, model.boxScoreThreshold()); - Assertions.assertEquals(1076058960, model.imageSize()); - Assertions.assertEquals(191759687, model.maxSize()); - Assertions.assertEquals(1378586528, model.minSize()); - Assertions.assertEquals(ModelSize.EXTRA_LARGE, model.modelSize()); - Assertions.assertEquals(true, model.multiScale()); - Assertions.assertEquals(18.348568F, model.nmsIouThreshold()); - Assertions.assertEquals("ljzgdy", model.tileGridSize()); - Assertions.assertEquals(96.23886F, model.tileOverlapRatio()); - Assertions.assertEquals(36.949356F, model.tilePredictionsNmsThreshold()); - Assertions.assertEquals(45.30077F, model.validationIouThreshold()); - Assertions.assertEquals(ValidationMetricType.COCO_VOC, model.validationMetricType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageModelSettingsObjectDetection model = - new ImageModelSettingsObjectDetection() - .withAdvancedSettings("rqhbjnqogdxwbsfp") - .withAmsGradient(false) - .withAugmentations("jlf") - .withBeta1(75.122604F) - .withBeta2(77.73417F) - .withCheckpointFrequency(1341111685) - .withCheckpointModel( - new MLFlowModelJobInput() - .withDescription("zd") - .withMode(InputDeliveryMode.DOWNLOAD) - .withUri("jluxxdhi")) - .withCheckpointRunId("qjm") - .withDistributed(false) - .withEarlyStopping(false) - .withEarlyStoppingDelay(954713869) - .withEarlyStoppingPatience(1623513694) - .withEnableOnnxNormalization(false) - .withEvaluationFrequency(1227246383) - .withGradientAccumulationStep(445418051) - .withLayersToFreeze(1633383721) - .withLearningRate(20.159918F) - .withLearningRateScheduler(LearningRateScheduler.WARMUP_COSINE) - .withModelName("znkcqwwxwjy") - .withMomentum(68.34347F) - .withNesterov(true) - .withNumberOfEpochs(370561675) - .withNumberOfWorkers(561740795) - .withOptimizer(StochasticOptimizer.NONE) - .withRandomSeed(1563473495) - .withStepLRGamma(32.891335F) - .withStepLRStepSize(795985008) - .withTrainingBatchSize(485145114) - .withValidationBatchSize(638318099) - .withWarmupCosineLRCycles(34.38207F) - .withWarmupCosineLRWarmupEpochs(771716822) - .withWeightDecay(76.72818F) - .withBoxDetectionsPerImage(101641984) - .withBoxScoreThreshold(16.755789F) - .withImageSize(1076058960) - .withMaxSize(191759687) - .withMinSize(1378586528) - .withModelSize(ModelSize.EXTRA_LARGE) - .withMultiScale(true) - .withNmsIouThreshold(18.348568F) - .withTileGridSize("ljzgdy") - .withTileOverlapRatio(96.23886F) - .withTilePredictionsNmsThreshold(36.949356F) - .withValidationIouThreshold(45.30077F) - .withValidationMetricType(ValidationMetricType.COCO_VOC); - model = BinaryData.fromObject(model).toObject(ImageModelSettingsObjectDetection.class); - Assertions.assertEquals("rqhbjnqogdxwbsfp", model.advancedSettings()); - Assertions.assertEquals(false, model.amsGradient()); - Assertions.assertEquals("jlf", model.augmentations()); - Assertions.assertEquals(75.122604F, model.beta1()); - Assertions.assertEquals(77.73417F, model.beta2()); - Assertions.assertEquals(1341111685, model.checkpointFrequency()); - Assertions.assertEquals("zd", model.checkpointModel().description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.checkpointModel().mode()); - Assertions.assertEquals("jluxxdhi", model.checkpointModel().uri()); - Assertions.assertEquals("qjm", model.checkpointRunId()); - Assertions.assertEquals(false, model.distributed()); - Assertions.assertEquals(false, model.earlyStopping()); - Assertions.assertEquals(954713869, model.earlyStoppingDelay()); - Assertions.assertEquals(1623513694, model.earlyStoppingPatience()); - Assertions.assertEquals(false, model.enableOnnxNormalization()); - Assertions.assertEquals(1227246383, model.evaluationFrequency()); - Assertions.assertEquals(445418051, model.gradientAccumulationStep()); - Assertions.assertEquals(1633383721, model.layersToFreeze()); - Assertions.assertEquals(20.159918F, model.learningRate()); - Assertions.assertEquals(LearningRateScheduler.WARMUP_COSINE, model.learningRateScheduler()); - Assertions.assertEquals("znkcqwwxwjy", model.modelName()); - Assertions.assertEquals(68.34347F, model.momentum()); - Assertions.assertEquals(true, model.nesterov()); - Assertions.assertEquals(370561675, model.numberOfEpochs()); - Assertions.assertEquals(561740795, model.numberOfWorkers()); - Assertions.assertEquals(StochasticOptimizer.NONE, model.optimizer()); - Assertions.assertEquals(1563473495, model.randomSeed()); - Assertions.assertEquals(32.891335F, model.stepLRGamma()); - Assertions.assertEquals(795985008, model.stepLRStepSize()); - Assertions.assertEquals(485145114, model.trainingBatchSize()); - Assertions.assertEquals(638318099, model.validationBatchSize()); - Assertions.assertEquals(34.38207F, model.warmupCosineLRCycles()); - Assertions.assertEquals(771716822, model.warmupCosineLRWarmupEpochs()); - Assertions.assertEquals(76.72818F, model.weightDecay()); - Assertions.assertEquals(101641984, model.boxDetectionsPerImage()); - Assertions.assertEquals(16.755789F, model.boxScoreThreshold()); - Assertions.assertEquals(1076058960, model.imageSize()); - Assertions.assertEquals(191759687, model.maxSize()); - Assertions.assertEquals(1378586528, model.minSize()); - Assertions.assertEquals(ModelSize.EXTRA_LARGE, model.modelSize()); - Assertions.assertEquals(true, model.multiScale()); - Assertions.assertEquals(18.348568F, model.nmsIouThreshold()); - Assertions.assertEquals("ljzgdy", model.tileGridSize()); - Assertions.assertEquals(96.23886F, model.tileOverlapRatio()); - Assertions.assertEquals(36.949356F, model.tilePredictionsNmsThreshold()); - Assertions.assertEquals(45.30077F, model.validationIouThreshold()); - Assertions.assertEquals(ValidationMetricType.COCO_VOC, model.validationMetricType()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelSettingsTests.java deleted file mode 100644 index 432642cac511b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageModelSettingsTests.java +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ImageModelSettings; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.LearningRateScheduler; -import com.azure.resourcemanager.machinelearning.models.MLFlowModelJobInput; -import com.azure.resourcemanager.machinelearning.models.StochasticOptimizer; -import org.junit.jupiter.api.Assertions; - -public final class ImageModelSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageModelSettings model = - BinaryData - .fromString( - "{\"advancedSettings\":\"va\",\"amsGradient\":false,\"augmentations\":\"zknxkv\",\"beta1\":37.521465,\"beta2\":75.73106,\"checkpointFrequency\":2099620376,\"checkpointModel\":{\"jobInputType\":\"mlflow_model\",\"mode\":\"Download\",\"uri\":\"mignohikkg\",\"description\":\"g\"},\"checkpointRunId\":\"pinde\",\"distributed\":true,\"earlyStopping\":true,\"earlyStoppingDelay\":1931875786,\"earlyStoppingPatience\":1421822703,\"enableOnnxNormalization\":false,\"evaluationFrequency\":785027108,\"gradientAccumulationStep\":332997027,\"layersToFreeze\":1895771662,\"learningRate\":85.75601,\"learningRateScheduler\":\"None\",\"modelName\":\"zir\",\"momentum\":31.809593,\"nesterov\":true,\"numberOfEpochs\":1519861948,\"numberOfWorkers\":833365863,\"optimizer\":\"None\",\"randomSeed\":688700290,\"stepLRGamma\":36.495888,\"stepLRStepSize\":829672692,\"trainingBatchSize\":1420035701,\"validationBatchSize\":450644888,\"warmupCosineLRCycles\":51.71764,\"warmupCosineLRWarmupEpochs\":1150687421,\"weightDecay\":80.28705}") - .toObject(ImageModelSettings.class); - Assertions.assertEquals("va", model.advancedSettings()); - Assertions.assertEquals(false, model.amsGradient()); - Assertions.assertEquals("zknxkv", model.augmentations()); - Assertions.assertEquals(37.521465F, model.beta1()); - Assertions.assertEquals(75.73106F, model.beta2()); - Assertions.assertEquals(2099620376, model.checkpointFrequency()); - Assertions.assertEquals("g", model.checkpointModel().description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.checkpointModel().mode()); - Assertions.assertEquals("mignohikkg", model.checkpointModel().uri()); - Assertions.assertEquals("pinde", model.checkpointRunId()); - Assertions.assertEquals(true, model.distributed()); - Assertions.assertEquals(true, model.earlyStopping()); - Assertions.assertEquals(1931875786, model.earlyStoppingDelay()); - Assertions.assertEquals(1421822703, model.earlyStoppingPatience()); - Assertions.assertEquals(false, model.enableOnnxNormalization()); - Assertions.assertEquals(785027108, model.evaluationFrequency()); - Assertions.assertEquals(332997027, model.gradientAccumulationStep()); - Assertions.assertEquals(1895771662, model.layersToFreeze()); - Assertions.assertEquals(85.75601F, model.learningRate()); - Assertions.assertEquals(LearningRateScheduler.NONE, model.learningRateScheduler()); - Assertions.assertEquals("zir", model.modelName()); - Assertions.assertEquals(31.809593F, model.momentum()); - Assertions.assertEquals(true, model.nesterov()); - Assertions.assertEquals(1519861948, model.numberOfEpochs()); - Assertions.assertEquals(833365863, model.numberOfWorkers()); - Assertions.assertEquals(StochasticOptimizer.NONE, model.optimizer()); - Assertions.assertEquals(688700290, model.randomSeed()); - Assertions.assertEquals(36.495888F, model.stepLRGamma()); - Assertions.assertEquals(829672692, model.stepLRStepSize()); - Assertions.assertEquals(1420035701, model.trainingBatchSize()); - Assertions.assertEquals(450644888, model.validationBatchSize()); - Assertions.assertEquals(51.71764F, model.warmupCosineLRCycles()); - Assertions.assertEquals(1150687421, model.warmupCosineLRWarmupEpochs()); - Assertions.assertEquals(80.28705F, model.weightDecay()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageModelSettings model = - new ImageModelSettings() - .withAdvancedSettings("va") - .withAmsGradient(false) - .withAugmentations("zknxkv") - .withBeta1(37.521465F) - .withBeta2(75.73106F) - .withCheckpointFrequency(2099620376) - .withCheckpointModel( - new MLFlowModelJobInput() - .withDescription("g") - .withMode(InputDeliveryMode.DOWNLOAD) - .withUri("mignohikkg")) - .withCheckpointRunId("pinde") - .withDistributed(true) - .withEarlyStopping(true) - .withEarlyStoppingDelay(1931875786) - .withEarlyStoppingPatience(1421822703) - .withEnableOnnxNormalization(false) - .withEvaluationFrequency(785027108) - .withGradientAccumulationStep(332997027) - .withLayersToFreeze(1895771662) - .withLearningRate(85.75601F) - .withLearningRateScheduler(LearningRateScheduler.NONE) - .withModelName("zir") - .withMomentum(31.809593F) - .withNesterov(true) - .withNumberOfEpochs(1519861948) - .withNumberOfWorkers(833365863) - .withOptimizer(StochasticOptimizer.NONE) - .withRandomSeed(688700290) - .withStepLRGamma(36.495888F) - .withStepLRStepSize(829672692) - .withTrainingBatchSize(1420035701) - .withValidationBatchSize(450644888) - .withWarmupCosineLRCycles(51.71764F) - .withWarmupCosineLRWarmupEpochs(1150687421) - .withWeightDecay(80.28705F); - model = BinaryData.fromObject(model).toObject(ImageModelSettings.class); - Assertions.assertEquals("va", model.advancedSettings()); - Assertions.assertEquals(false, model.amsGradient()); - Assertions.assertEquals("zknxkv", model.augmentations()); - Assertions.assertEquals(37.521465F, model.beta1()); - Assertions.assertEquals(75.73106F, model.beta2()); - Assertions.assertEquals(2099620376, model.checkpointFrequency()); - Assertions.assertEquals("g", model.checkpointModel().description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.checkpointModel().mode()); - Assertions.assertEquals("mignohikkg", model.checkpointModel().uri()); - Assertions.assertEquals("pinde", model.checkpointRunId()); - Assertions.assertEquals(true, model.distributed()); - Assertions.assertEquals(true, model.earlyStopping()); - Assertions.assertEquals(1931875786, model.earlyStoppingDelay()); - Assertions.assertEquals(1421822703, model.earlyStoppingPatience()); - Assertions.assertEquals(false, model.enableOnnxNormalization()); - Assertions.assertEquals(785027108, model.evaluationFrequency()); - Assertions.assertEquals(332997027, model.gradientAccumulationStep()); - Assertions.assertEquals(1895771662, model.layersToFreeze()); - Assertions.assertEquals(85.75601F, model.learningRate()); - Assertions.assertEquals(LearningRateScheduler.NONE, model.learningRateScheduler()); - Assertions.assertEquals("zir", model.modelName()); - Assertions.assertEquals(31.809593F, model.momentum()); - Assertions.assertEquals(true, model.nesterov()); - Assertions.assertEquals(1519861948, model.numberOfEpochs()); - Assertions.assertEquals(833365863, model.numberOfWorkers()); - Assertions.assertEquals(StochasticOptimizer.NONE, model.optimizer()); - Assertions.assertEquals(688700290, model.randomSeed()); - Assertions.assertEquals(36.495888F, model.stepLRGamma()); - Assertions.assertEquals(829672692, model.stepLRStepSize()); - Assertions.assertEquals(1420035701, model.trainingBatchSize()); - Assertions.assertEquals(450644888, model.validationBatchSize()); - Assertions.assertEquals(51.71764F, model.warmupCosineLRCycles()); - Assertions.assertEquals(1150687421, model.warmupCosineLRWarmupEpochs()); - Assertions.assertEquals(80.28705F, model.weightDecay()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageObjectDetectionBaseTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageObjectDetectionBaseTests.java deleted file mode 100644 index 563ad809fa991..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageObjectDetectionBaseTests.java +++ /dev/null @@ -1,394 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.EarlyTerminationPolicy; -import com.azure.resourcemanager.machinelearning.models.ImageLimitSettings; -import com.azure.resourcemanager.machinelearning.models.ImageModelDistributionSettingsObjectDetection; -import com.azure.resourcemanager.machinelearning.models.ImageModelSettingsObjectDetection; -import com.azure.resourcemanager.machinelearning.models.ImageObjectDetectionBase; -import com.azure.resourcemanager.machinelearning.models.ImageSweepSettings; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.LearningRateScheduler; -import com.azure.resourcemanager.machinelearning.models.MLFlowModelJobInput; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import com.azure.resourcemanager.machinelearning.models.ModelSize; -import com.azure.resourcemanager.machinelearning.models.SamplingAlgorithmType; -import com.azure.resourcemanager.machinelearning.models.StochasticOptimizer; -import com.azure.resourcemanager.machinelearning.models.ValidationMetricType; -import java.time.Duration; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ImageObjectDetectionBaseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageObjectDetectionBase model = - BinaryData - .fromString( - "{\"modelSettings\":{\"boxDetectionsPerImage\":220622186,\"boxScoreThreshold\":34.980453,\"imageSize\":1257411321,\"maxSize\":921466837,\"minSize\":2015686275,\"modelSize\":\"None\",\"multiScale\":false,\"nmsIouThreshold\":0.77554584,\"tileGridSize\":\"aohoqkpjtnq\",\"tileOverlapRatio\":5.6527376,\"tilePredictionsNmsThreshold\":62.38328,\"validationIouThreshold\":84.67642,\"validationMetricType\":\"None\",\"advancedSettings\":\"m\",\"amsGradient\":true,\"augmentations\":\"ilm\",\"beta1\":66.63753,\"beta2\":77.31098,\"checkpointFrequency\":1645404857,\"checkpointModel\":{\"jobInputType\":\"mlflow_model\",\"mode\":\"Download\",\"uri\":\"nkkbjpjvlywltmfw\",\"description\":\"bjwhlwyjfnqzocr\"},\"checkpointRunId\":\"gczeuntgx\",\"distributed\":false,\"earlyStopping\":false,\"earlyStoppingDelay\":1555790042,\"earlyStoppingPatience\":1557956860,\"enableOnnxNormalization\":true,\"evaluationFrequency\":1852855933,\"gradientAccumulationStep\":1891446844,\"layersToFreeze\":888077010,\"learningRate\":91.16553,\"learningRateScheduler\":\"None\",\"modelName\":\"xgyrihlgmgbehlqt\",\"momentum\":35.669476,\"nesterov\":true,\"numberOfEpochs\":2104814940,\"numberOfWorkers\":2146718478,\"optimizer\":\"None\",\"randomSeed\":961397870,\"stepLRGamma\":84.43488,\"stepLRStepSize\":1159798592,\"trainingBatchSize\":1968957759,\"validationBatchSize\":1595039473,\"warmupCosineLRCycles\":26.42473,\"warmupCosineLRWarmupEpochs\":1300894444,\"weightDecay\":80.86428},\"searchSpace\":[{\"boxDetectionsPerImage\":\"gsabvcipowzafc\",\"boxScoreThreshold\":\"umljcirvpef\",\"imageSize\":\"dvei\",\"maxSize\":\"tjnsx\",\"minSize\":\"jlnsj\",\"modelSize\":\"ju\",\"multiScale\":\"xbxq\",\"nmsIouThreshold\":\"vuaytuad\",\"tileGridSize\":\"xeqbwp\",\"tileOverlapRatio\":\"ghyksarcdrnxs\",\"tilePredictionsNmsThreshold\":\"vlzladl\",\"validationIouThreshold\":\"kpbqhvfdqqjw\",\"validationMetricType\":\"hwzdanojisgglmv\",\"amsGradient\":\"atuztjct\",\"augmentations\":\"pvbkaehxsmzyg\",\"beta1\":\"wakwseivmakxhys\",\"beta2\":\"ljuxl\",\"distributed\":\"ect\",\"earlyStopping\":\"fjmskdchmaiu\",\"earlyStoppingDelay\":\"vlzw\",\"earlyStoppingPatience\":\"gmfalkzazmgoked\",\"enableOnnxNormalization\":\"qafkmkrokzrth\",\"evaluationFrequency\":\"twpqrtva\",\"gradientAccumulationStep\":\"nqnixiezeagmce\",\"layersToFreeze\":\"uugedhfp\",\"learningRate\":\"tlzm\",\"learningRateScheduler\":\"syjdeolctae\",\"modelName\":\"syrled\",\"momentum\":\"ustbvtqigdx\",\"nesterov\":\"sgeafgfosehx\",\"numberOfEpochs\":\"sxezppkkwaa\",\"numberOfWorkers\":\"k\",\"optimizer\":\"jlpzeqtoyrp\",\"randomSeed\":\"xlaj\",\"stepLRGamma\":\"lpquevhamfow\",\"stepLRStepSize\":\"btmkekxpkzwaq\",\"trainingBatchSize\":\"fqovc\",\"validationBatchSize\":\"qbplvfiduszte\",\"warmupCosineLRCycles\":\"byjgmsfepx\",\"warmupCosineLRWarmupEpochs\":\"hpqadagrhrdicxdw\",\"weightDecay\":\"fowxwyovcxjsgbi\"},{\"boxDetectionsPerImage\":\"ukdveksbuhoduc\",\"boxScoreThreshold\":\"lscrdpibfdyjduss\",\"imageSize\":\"szekbh\",\"maxSize\":\"kaaggkreh\",\"minSize\":\"rnuybffljfii\",\"modelSize\":\"eoagsqta\",\"multiScale\":\"usrexxf\",\"nmsIouThreshold\":\"sqwudohzilfmnli\",\"tileGridSize\":\"simsfeypofqpmb\",\"tileOverlapRatio\":\"qgsdr\",\"tilePredictionsNmsThreshold\":\"ttjxophgerhsmvgo\",\"validationIouThreshold\":\"wzm\",\"validationMetricType\":\"lrixysfnimsq\",\"amsGradient\":\"wwmhkruwae\",\"augmentations\":\"ympmlqoin\",\"beta1\":\"duewihapfj\",\"beta2\":\"knjdiqfliejhp\",\"distributed\":\"bi\",\"earlyStopping\":\"fsbw\",\"earlyStoppingDelay\":\"ivbvzi\",\"earlyStoppingPatience\":\"wxgoooxzpra\",\"enableOnnxNormalization\":\"s\",\"evaluationFrequency\":\"knpdgzigjsu\",\"gradientAccumulationStep\":\"whgsaodkww\",\"layersToFreeze\":\"afoctohz\",\"learningRate\":\"quvwsxbgn\",\"learningRateScheduler\":\"ervqchoadhrsxqvz\",\"modelName\":\"pabdsrg\",\"momentum\":\"jglzrsubklrxhjnl\",\"nesterov\":\"etjdvqydieqqkwa\",\"numberOfEpochs\":\"wdxvqzxoebwg\",\"numberOfWorkers\":\"bibanbau\",\"optimizer\":\"tzvp\",\"randomSeed\":\"lozkxbzrp\",\"stepLRGamma\":\"plssanbtttk\",\"stepLRStepSize\":\"uxunrswg\",\"trainingBatchSize\":\"jhboyikebhuhks\",\"validationBatchSize\":\"wlokhueoijyzcq\",\"warmupCosineLRCycles\":\"zqzu\",\"warmupCosineLRWarmupEpochs\":\"s\",\"weightDecay\":\"ej\"}],\"limitSettings\":{\"maxConcurrentTrials\":1158343098,\"maxTrials\":2133185621,\"timeout\":\"PT173H26M33S\"},\"sweepSettings\":{\"earlyTermination\":{\"policyType\":\"EarlyTerminationPolicy\",\"delayEvaluation\":1464302974,\"evaluationInterval\":539908072},\"samplingAlgorithm\":\"Grid\"},\"validationData\":{\"jobInputType\":\"mltable\",\"mode\":\"ReadOnlyMount\",\"uri\":\"cf\",\"description\":\"bmxsnxoc\"},\"validationDataSize\":82.41225782753845}") - .toObject(ImageObjectDetectionBase.class); - Assertions.assertEquals(1158343098, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(2133185621, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT173H26M33S"), model.limitSettings().timeout()); - Assertions.assertEquals(1464302974, model.sweepSettings().earlyTermination().delayEvaluation()); - Assertions.assertEquals(539908072, model.sweepSettings().earlyTermination().evaluationInterval()); - Assertions.assertEquals(SamplingAlgorithmType.GRID, model.sweepSettings().samplingAlgorithm()); - Assertions.assertEquals("bmxsnxoc", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_ONLY_MOUNT, model.validationData().mode()); - Assertions.assertEquals("cf", model.validationData().uri()); - Assertions.assertEquals(82.41225782753845D, model.validationDataSize()); - Assertions.assertEquals("m", model.modelSettings().advancedSettings()); - Assertions.assertEquals(true, model.modelSettings().amsGradient()); - Assertions.assertEquals("ilm", model.modelSettings().augmentations()); - Assertions.assertEquals(66.63753F, model.modelSettings().beta1()); - Assertions.assertEquals(77.31098F, model.modelSettings().beta2()); - Assertions.assertEquals(1645404857, model.modelSettings().checkpointFrequency()); - Assertions.assertEquals("bjwhlwyjfnqzocr", model.modelSettings().checkpointModel().description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.modelSettings().checkpointModel().mode()); - Assertions.assertEquals("nkkbjpjvlywltmfw", model.modelSettings().checkpointModel().uri()); - Assertions.assertEquals("gczeuntgx", model.modelSettings().checkpointRunId()); - Assertions.assertEquals(false, model.modelSettings().distributed()); - Assertions.assertEquals(false, model.modelSettings().earlyStopping()); - Assertions.assertEquals(1555790042, model.modelSettings().earlyStoppingDelay()); - Assertions.assertEquals(1557956860, model.modelSettings().earlyStoppingPatience()); - Assertions.assertEquals(true, model.modelSettings().enableOnnxNormalization()); - Assertions.assertEquals(1852855933, model.modelSettings().evaluationFrequency()); - Assertions.assertEquals(1891446844, model.modelSettings().gradientAccumulationStep()); - Assertions.assertEquals(888077010, model.modelSettings().layersToFreeze()); - Assertions.assertEquals(91.16553F, model.modelSettings().learningRate()); - Assertions.assertEquals(LearningRateScheduler.NONE, model.modelSettings().learningRateScheduler()); - Assertions.assertEquals("xgyrihlgmgbehlqt", model.modelSettings().modelName()); - Assertions.assertEquals(35.669476F, model.modelSettings().momentum()); - Assertions.assertEquals(true, model.modelSettings().nesterov()); - Assertions.assertEquals(2104814940, model.modelSettings().numberOfEpochs()); - Assertions.assertEquals(2146718478, model.modelSettings().numberOfWorkers()); - Assertions.assertEquals(StochasticOptimizer.NONE, model.modelSettings().optimizer()); - Assertions.assertEquals(961397870, model.modelSettings().randomSeed()); - Assertions.assertEquals(84.43488F, model.modelSettings().stepLRGamma()); - Assertions.assertEquals(1159798592, model.modelSettings().stepLRStepSize()); - Assertions.assertEquals(1968957759, model.modelSettings().trainingBatchSize()); - Assertions.assertEquals(1595039473, model.modelSettings().validationBatchSize()); - Assertions.assertEquals(26.42473F, model.modelSettings().warmupCosineLRCycles()); - Assertions.assertEquals(1300894444, model.modelSettings().warmupCosineLRWarmupEpochs()); - Assertions.assertEquals(80.86428F, model.modelSettings().weightDecay()); - Assertions.assertEquals(220622186, model.modelSettings().boxDetectionsPerImage()); - Assertions.assertEquals(34.980453F, model.modelSettings().boxScoreThreshold()); - Assertions.assertEquals(1257411321, model.modelSettings().imageSize()); - Assertions.assertEquals(921466837, model.modelSettings().maxSize()); - Assertions.assertEquals(2015686275, model.modelSettings().minSize()); - Assertions.assertEquals(ModelSize.NONE, model.modelSettings().modelSize()); - Assertions.assertEquals(false, model.modelSettings().multiScale()); - Assertions.assertEquals(0.77554584F, model.modelSettings().nmsIouThreshold()); - Assertions.assertEquals("aohoqkpjtnq", model.modelSettings().tileGridSize()); - Assertions.assertEquals(5.6527376F, model.modelSettings().tileOverlapRatio()); - Assertions.assertEquals(62.38328F, model.modelSettings().tilePredictionsNmsThreshold()); - Assertions.assertEquals(84.67642F, model.modelSettings().validationIouThreshold()); - Assertions.assertEquals(ValidationMetricType.NONE, model.modelSettings().validationMetricType()); - Assertions.assertEquals("atuztjct", model.searchSpace().get(0).amsGradient()); - Assertions.assertEquals("pvbkaehxsmzyg", model.searchSpace().get(0).augmentations()); - Assertions.assertEquals("wakwseivmakxhys", model.searchSpace().get(0).beta1()); - Assertions.assertEquals("ljuxl", model.searchSpace().get(0).beta2()); - Assertions.assertEquals("ect", model.searchSpace().get(0).distributed()); - Assertions.assertEquals("fjmskdchmaiu", model.searchSpace().get(0).earlyStopping()); - Assertions.assertEquals("vlzw", model.searchSpace().get(0).earlyStoppingDelay()); - Assertions.assertEquals("gmfalkzazmgoked", model.searchSpace().get(0).earlyStoppingPatience()); - Assertions.assertEquals("qafkmkrokzrth", model.searchSpace().get(0).enableOnnxNormalization()); - Assertions.assertEquals("twpqrtva", model.searchSpace().get(0).evaluationFrequency()); - Assertions.assertEquals("nqnixiezeagmce", model.searchSpace().get(0).gradientAccumulationStep()); - Assertions.assertEquals("uugedhfp", model.searchSpace().get(0).layersToFreeze()); - Assertions.assertEquals("tlzm", model.searchSpace().get(0).learningRate()); - Assertions.assertEquals("syjdeolctae", model.searchSpace().get(0).learningRateScheduler()); - Assertions.assertEquals("syrled", model.searchSpace().get(0).modelName()); - Assertions.assertEquals("ustbvtqigdx", model.searchSpace().get(0).momentum()); - Assertions.assertEquals("sgeafgfosehx", model.searchSpace().get(0).nesterov()); - Assertions.assertEquals("sxezppkkwaa", model.searchSpace().get(0).numberOfEpochs()); - Assertions.assertEquals("k", model.searchSpace().get(0).numberOfWorkers()); - Assertions.assertEquals("jlpzeqtoyrp", model.searchSpace().get(0).optimizer()); - Assertions.assertEquals("xlaj", model.searchSpace().get(0).randomSeed()); - Assertions.assertEquals("lpquevhamfow", model.searchSpace().get(0).stepLRGamma()); - Assertions.assertEquals("btmkekxpkzwaq", model.searchSpace().get(0).stepLRStepSize()); - Assertions.assertEquals("fqovc", model.searchSpace().get(0).trainingBatchSize()); - Assertions.assertEquals("qbplvfiduszte", model.searchSpace().get(0).validationBatchSize()); - Assertions.assertEquals("byjgmsfepx", model.searchSpace().get(0).warmupCosineLRCycles()); - Assertions.assertEquals("hpqadagrhrdicxdw", model.searchSpace().get(0).warmupCosineLRWarmupEpochs()); - Assertions.assertEquals("fowxwyovcxjsgbi", model.searchSpace().get(0).weightDecay()); - Assertions.assertEquals("gsabvcipowzafc", model.searchSpace().get(0).boxDetectionsPerImage()); - Assertions.assertEquals("umljcirvpef", model.searchSpace().get(0).boxScoreThreshold()); - Assertions.assertEquals("dvei", model.searchSpace().get(0).imageSize()); - Assertions.assertEquals("tjnsx", model.searchSpace().get(0).maxSize()); - Assertions.assertEquals("jlnsj", model.searchSpace().get(0).minSize()); - Assertions.assertEquals("ju", model.searchSpace().get(0).modelSize()); - Assertions.assertEquals("xbxq", model.searchSpace().get(0).multiScale()); - Assertions.assertEquals("vuaytuad", model.searchSpace().get(0).nmsIouThreshold()); - Assertions.assertEquals("xeqbwp", model.searchSpace().get(0).tileGridSize()); - Assertions.assertEquals("ghyksarcdrnxs", model.searchSpace().get(0).tileOverlapRatio()); - Assertions.assertEquals("vlzladl", model.searchSpace().get(0).tilePredictionsNmsThreshold()); - Assertions.assertEquals("kpbqhvfdqqjw", model.searchSpace().get(0).validationIouThreshold()); - Assertions.assertEquals("hwzdanojisgglmv", model.searchSpace().get(0).validationMetricType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageObjectDetectionBase model = - new ImageObjectDetectionBase() - .withLimitSettings( - new ImageLimitSettings() - .withMaxConcurrentTrials(1158343098) - .withMaxTrials(2133185621) - .withTimeout(Duration.parse("PT173H26M33S"))) - .withSweepSettings( - new ImageSweepSettings() - .withEarlyTermination( - new EarlyTerminationPolicy() - .withDelayEvaluation(1464302974) - .withEvaluationInterval(539908072)) - .withSamplingAlgorithm(SamplingAlgorithmType.GRID)) - .withValidationData( - new MLTableJobInput() - .withDescription("bmxsnxoc") - .withMode(InputDeliveryMode.READ_ONLY_MOUNT) - .withUri("cf")) - .withValidationDataSize(82.41225782753845D) - .withModelSettings( - new ImageModelSettingsObjectDetection() - .withAdvancedSettings("m") - .withAmsGradient(true) - .withAugmentations("ilm") - .withBeta1(66.63753F) - .withBeta2(77.31098F) - .withCheckpointFrequency(1645404857) - .withCheckpointModel( - new MLFlowModelJobInput() - .withDescription("bjwhlwyjfnqzocr") - .withMode(InputDeliveryMode.DOWNLOAD) - .withUri("nkkbjpjvlywltmfw")) - .withCheckpointRunId("gczeuntgx") - .withDistributed(false) - .withEarlyStopping(false) - .withEarlyStoppingDelay(1555790042) - .withEarlyStoppingPatience(1557956860) - .withEnableOnnxNormalization(true) - .withEvaluationFrequency(1852855933) - .withGradientAccumulationStep(1891446844) - .withLayersToFreeze(888077010) - .withLearningRate(91.16553F) - .withLearningRateScheduler(LearningRateScheduler.NONE) - .withModelName("xgyrihlgmgbehlqt") - .withMomentum(35.669476F) - .withNesterov(true) - .withNumberOfEpochs(2104814940) - .withNumberOfWorkers(2146718478) - .withOptimizer(StochasticOptimizer.NONE) - .withRandomSeed(961397870) - .withStepLRGamma(84.43488F) - .withStepLRStepSize(1159798592) - .withTrainingBatchSize(1968957759) - .withValidationBatchSize(1595039473) - .withWarmupCosineLRCycles(26.42473F) - .withWarmupCosineLRWarmupEpochs(1300894444) - .withWeightDecay(80.86428F) - .withBoxDetectionsPerImage(220622186) - .withBoxScoreThreshold(34.980453F) - .withImageSize(1257411321) - .withMaxSize(921466837) - .withMinSize(2015686275) - .withModelSize(ModelSize.NONE) - .withMultiScale(false) - .withNmsIouThreshold(0.77554584F) - .withTileGridSize("aohoqkpjtnq") - .withTileOverlapRatio(5.6527376F) - .withTilePredictionsNmsThreshold(62.38328F) - .withValidationIouThreshold(84.67642F) - .withValidationMetricType(ValidationMetricType.NONE)) - .withSearchSpace( - Arrays - .asList( - new ImageModelDistributionSettingsObjectDetection() - .withAmsGradient("atuztjct") - .withAugmentations("pvbkaehxsmzyg") - .withBeta1("wakwseivmakxhys") - .withBeta2("ljuxl") - .withDistributed("ect") - .withEarlyStopping("fjmskdchmaiu") - .withEarlyStoppingDelay("vlzw") - .withEarlyStoppingPatience("gmfalkzazmgoked") - .withEnableOnnxNormalization("qafkmkrokzrth") - .withEvaluationFrequency("twpqrtva") - .withGradientAccumulationStep("nqnixiezeagmce") - .withLayersToFreeze("uugedhfp") - .withLearningRate("tlzm") - .withLearningRateScheduler("syjdeolctae") - .withModelName("syrled") - .withMomentum("ustbvtqigdx") - .withNesterov("sgeafgfosehx") - .withNumberOfEpochs("sxezppkkwaa") - .withNumberOfWorkers("k") - .withOptimizer("jlpzeqtoyrp") - .withRandomSeed("xlaj") - .withStepLRGamma("lpquevhamfow") - .withStepLRStepSize("btmkekxpkzwaq") - .withTrainingBatchSize("fqovc") - .withValidationBatchSize("qbplvfiduszte") - .withWarmupCosineLRCycles("byjgmsfepx") - .withWarmupCosineLRWarmupEpochs("hpqadagrhrdicxdw") - .withWeightDecay("fowxwyovcxjsgbi") - .withBoxDetectionsPerImage("gsabvcipowzafc") - .withBoxScoreThreshold("umljcirvpef") - .withImageSize("dvei") - .withMaxSize("tjnsx") - .withMinSize("jlnsj") - .withModelSize("ju") - .withMultiScale("xbxq") - .withNmsIouThreshold("vuaytuad") - .withTileGridSize("xeqbwp") - .withTileOverlapRatio("ghyksarcdrnxs") - .withTilePredictionsNmsThreshold("vlzladl") - .withValidationIouThreshold("kpbqhvfdqqjw") - .withValidationMetricType("hwzdanojisgglmv"), - new ImageModelDistributionSettingsObjectDetection() - .withAmsGradient("wwmhkruwae") - .withAugmentations("ympmlqoin") - .withBeta1("duewihapfj") - .withBeta2("knjdiqfliejhp") - .withDistributed("bi") - .withEarlyStopping("fsbw") - .withEarlyStoppingDelay("ivbvzi") - .withEarlyStoppingPatience("wxgoooxzpra") - .withEnableOnnxNormalization("s") - .withEvaluationFrequency("knpdgzigjsu") - .withGradientAccumulationStep("whgsaodkww") - .withLayersToFreeze("afoctohz") - .withLearningRate("quvwsxbgn") - .withLearningRateScheduler("ervqchoadhrsxqvz") - .withModelName("pabdsrg") - .withMomentum("jglzrsubklrxhjnl") - .withNesterov("etjdvqydieqqkwa") - .withNumberOfEpochs("wdxvqzxoebwg") - .withNumberOfWorkers("bibanbau") - .withOptimizer("tzvp") - .withRandomSeed("lozkxbzrp") - .withStepLRGamma("plssanbtttk") - .withStepLRStepSize("uxunrswg") - .withTrainingBatchSize("jhboyikebhuhks") - .withValidationBatchSize("wlokhueoijyzcq") - .withWarmupCosineLRCycles("zqzu") - .withWarmupCosineLRWarmupEpochs("s") - .withWeightDecay("ej") - .withBoxDetectionsPerImage("ukdveksbuhoduc") - .withBoxScoreThreshold("lscrdpibfdyjduss") - .withImageSize("szekbh") - .withMaxSize("kaaggkreh") - .withMinSize("rnuybffljfii") - .withModelSize("eoagsqta") - .withMultiScale("usrexxf") - .withNmsIouThreshold("sqwudohzilfmnli") - .withTileGridSize("simsfeypofqpmb") - .withTileOverlapRatio("qgsdr") - .withTilePredictionsNmsThreshold("ttjxophgerhsmvgo") - .withValidationIouThreshold("wzm") - .withValidationMetricType("lrixysfnimsq"))); - model = BinaryData.fromObject(model).toObject(ImageObjectDetectionBase.class); - Assertions.assertEquals(1158343098, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(2133185621, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT173H26M33S"), model.limitSettings().timeout()); - Assertions.assertEquals(1464302974, model.sweepSettings().earlyTermination().delayEvaluation()); - Assertions.assertEquals(539908072, model.sweepSettings().earlyTermination().evaluationInterval()); - Assertions.assertEquals(SamplingAlgorithmType.GRID, model.sweepSettings().samplingAlgorithm()); - Assertions.assertEquals("bmxsnxoc", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_ONLY_MOUNT, model.validationData().mode()); - Assertions.assertEquals("cf", model.validationData().uri()); - Assertions.assertEquals(82.41225782753845D, model.validationDataSize()); - Assertions.assertEquals("m", model.modelSettings().advancedSettings()); - Assertions.assertEquals(true, model.modelSettings().amsGradient()); - Assertions.assertEquals("ilm", model.modelSettings().augmentations()); - Assertions.assertEquals(66.63753F, model.modelSettings().beta1()); - Assertions.assertEquals(77.31098F, model.modelSettings().beta2()); - Assertions.assertEquals(1645404857, model.modelSettings().checkpointFrequency()); - Assertions.assertEquals("bjwhlwyjfnqzocr", model.modelSettings().checkpointModel().description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.modelSettings().checkpointModel().mode()); - Assertions.assertEquals("nkkbjpjvlywltmfw", model.modelSettings().checkpointModel().uri()); - Assertions.assertEquals("gczeuntgx", model.modelSettings().checkpointRunId()); - Assertions.assertEquals(false, model.modelSettings().distributed()); - Assertions.assertEquals(false, model.modelSettings().earlyStopping()); - Assertions.assertEquals(1555790042, model.modelSettings().earlyStoppingDelay()); - Assertions.assertEquals(1557956860, model.modelSettings().earlyStoppingPatience()); - Assertions.assertEquals(true, model.modelSettings().enableOnnxNormalization()); - Assertions.assertEquals(1852855933, model.modelSettings().evaluationFrequency()); - Assertions.assertEquals(1891446844, model.modelSettings().gradientAccumulationStep()); - Assertions.assertEquals(888077010, model.modelSettings().layersToFreeze()); - Assertions.assertEquals(91.16553F, model.modelSettings().learningRate()); - Assertions.assertEquals(LearningRateScheduler.NONE, model.modelSettings().learningRateScheduler()); - Assertions.assertEquals("xgyrihlgmgbehlqt", model.modelSettings().modelName()); - Assertions.assertEquals(35.669476F, model.modelSettings().momentum()); - Assertions.assertEquals(true, model.modelSettings().nesterov()); - Assertions.assertEquals(2104814940, model.modelSettings().numberOfEpochs()); - Assertions.assertEquals(2146718478, model.modelSettings().numberOfWorkers()); - Assertions.assertEquals(StochasticOptimizer.NONE, model.modelSettings().optimizer()); - Assertions.assertEquals(961397870, model.modelSettings().randomSeed()); - Assertions.assertEquals(84.43488F, model.modelSettings().stepLRGamma()); - Assertions.assertEquals(1159798592, model.modelSettings().stepLRStepSize()); - Assertions.assertEquals(1968957759, model.modelSettings().trainingBatchSize()); - Assertions.assertEquals(1595039473, model.modelSettings().validationBatchSize()); - Assertions.assertEquals(26.42473F, model.modelSettings().warmupCosineLRCycles()); - Assertions.assertEquals(1300894444, model.modelSettings().warmupCosineLRWarmupEpochs()); - Assertions.assertEquals(80.86428F, model.modelSettings().weightDecay()); - Assertions.assertEquals(220622186, model.modelSettings().boxDetectionsPerImage()); - Assertions.assertEquals(34.980453F, model.modelSettings().boxScoreThreshold()); - Assertions.assertEquals(1257411321, model.modelSettings().imageSize()); - Assertions.assertEquals(921466837, model.modelSettings().maxSize()); - Assertions.assertEquals(2015686275, model.modelSettings().minSize()); - Assertions.assertEquals(ModelSize.NONE, model.modelSettings().modelSize()); - Assertions.assertEquals(false, model.modelSettings().multiScale()); - Assertions.assertEquals(0.77554584F, model.modelSettings().nmsIouThreshold()); - Assertions.assertEquals("aohoqkpjtnq", model.modelSettings().tileGridSize()); - Assertions.assertEquals(5.6527376F, model.modelSettings().tileOverlapRatio()); - Assertions.assertEquals(62.38328F, model.modelSettings().tilePredictionsNmsThreshold()); - Assertions.assertEquals(84.67642F, model.modelSettings().validationIouThreshold()); - Assertions.assertEquals(ValidationMetricType.NONE, model.modelSettings().validationMetricType()); - Assertions.assertEquals("atuztjct", model.searchSpace().get(0).amsGradient()); - Assertions.assertEquals("pvbkaehxsmzyg", model.searchSpace().get(0).augmentations()); - Assertions.assertEquals("wakwseivmakxhys", model.searchSpace().get(0).beta1()); - Assertions.assertEquals("ljuxl", model.searchSpace().get(0).beta2()); - Assertions.assertEquals("ect", model.searchSpace().get(0).distributed()); - Assertions.assertEquals("fjmskdchmaiu", model.searchSpace().get(0).earlyStopping()); - Assertions.assertEquals("vlzw", model.searchSpace().get(0).earlyStoppingDelay()); - Assertions.assertEquals("gmfalkzazmgoked", model.searchSpace().get(0).earlyStoppingPatience()); - Assertions.assertEquals("qafkmkrokzrth", model.searchSpace().get(0).enableOnnxNormalization()); - Assertions.assertEquals("twpqrtva", model.searchSpace().get(0).evaluationFrequency()); - Assertions.assertEquals("nqnixiezeagmce", model.searchSpace().get(0).gradientAccumulationStep()); - Assertions.assertEquals("uugedhfp", model.searchSpace().get(0).layersToFreeze()); - Assertions.assertEquals("tlzm", model.searchSpace().get(0).learningRate()); - Assertions.assertEquals("syjdeolctae", model.searchSpace().get(0).learningRateScheduler()); - Assertions.assertEquals("syrled", model.searchSpace().get(0).modelName()); - Assertions.assertEquals("ustbvtqigdx", model.searchSpace().get(0).momentum()); - Assertions.assertEquals("sgeafgfosehx", model.searchSpace().get(0).nesterov()); - Assertions.assertEquals("sxezppkkwaa", model.searchSpace().get(0).numberOfEpochs()); - Assertions.assertEquals("k", model.searchSpace().get(0).numberOfWorkers()); - Assertions.assertEquals("jlpzeqtoyrp", model.searchSpace().get(0).optimizer()); - Assertions.assertEquals("xlaj", model.searchSpace().get(0).randomSeed()); - Assertions.assertEquals("lpquevhamfow", model.searchSpace().get(0).stepLRGamma()); - Assertions.assertEquals("btmkekxpkzwaq", model.searchSpace().get(0).stepLRStepSize()); - Assertions.assertEquals("fqovc", model.searchSpace().get(0).trainingBatchSize()); - Assertions.assertEquals("qbplvfiduszte", model.searchSpace().get(0).validationBatchSize()); - Assertions.assertEquals("byjgmsfepx", model.searchSpace().get(0).warmupCosineLRCycles()); - Assertions.assertEquals("hpqadagrhrdicxdw", model.searchSpace().get(0).warmupCosineLRWarmupEpochs()); - Assertions.assertEquals("fowxwyovcxjsgbi", model.searchSpace().get(0).weightDecay()); - Assertions.assertEquals("gsabvcipowzafc", model.searchSpace().get(0).boxDetectionsPerImage()); - Assertions.assertEquals("umljcirvpef", model.searchSpace().get(0).boxScoreThreshold()); - Assertions.assertEquals("dvei", model.searchSpace().get(0).imageSize()); - Assertions.assertEquals("tjnsx", model.searchSpace().get(0).maxSize()); - Assertions.assertEquals("jlnsj", model.searchSpace().get(0).minSize()); - Assertions.assertEquals("ju", model.searchSpace().get(0).modelSize()); - Assertions.assertEquals("xbxq", model.searchSpace().get(0).multiScale()); - Assertions.assertEquals("vuaytuad", model.searchSpace().get(0).nmsIouThreshold()); - Assertions.assertEquals("xeqbwp", model.searchSpace().get(0).tileGridSize()); - Assertions.assertEquals("ghyksarcdrnxs", model.searchSpace().get(0).tileOverlapRatio()); - Assertions.assertEquals("vlzladl", model.searchSpace().get(0).tilePredictionsNmsThreshold()); - Assertions.assertEquals("kpbqhvfdqqjw", model.searchSpace().get(0).validationIouThreshold()); - Assertions.assertEquals("hwzdanojisgglmv", model.searchSpace().get(0).validationMetricType()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageObjectDetectionTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageObjectDetectionTests.java deleted file mode 100644 index 020c235748c2a..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageObjectDetectionTests.java +++ /dev/null @@ -1,374 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.EarlyTerminationPolicy; -import com.azure.resourcemanager.machinelearning.models.ImageLimitSettings; -import com.azure.resourcemanager.machinelearning.models.ImageModelDistributionSettingsObjectDetection; -import com.azure.resourcemanager.machinelearning.models.ImageModelSettingsObjectDetection; -import com.azure.resourcemanager.machinelearning.models.ImageObjectDetection; -import com.azure.resourcemanager.machinelearning.models.ImageSweepSettings; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.LearningRateScheduler; -import com.azure.resourcemanager.machinelearning.models.LogVerbosity; -import com.azure.resourcemanager.machinelearning.models.MLFlowModelJobInput; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import com.azure.resourcemanager.machinelearning.models.ModelSize; -import com.azure.resourcemanager.machinelearning.models.ObjectDetectionPrimaryMetrics; -import com.azure.resourcemanager.machinelearning.models.SamplingAlgorithmType; -import com.azure.resourcemanager.machinelearning.models.StochasticOptimizer; -import com.azure.resourcemanager.machinelearning.models.ValidationMetricType; -import java.time.Duration; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ImageObjectDetectionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageObjectDetection model = - BinaryData - .fromString( - "{\"taskType\":\"ImageObjectDetection\",\"primaryMetric\":\"MeanAveragePrecision\",\"modelSettings\":{\"boxDetectionsPerImage\":667354640,\"boxScoreThreshold\":57.01898,\"imageSize\":920278919,\"maxSize\":546709544,\"minSize\":1447146223,\"modelSize\":\"Large\",\"multiScale\":true,\"nmsIouThreshold\":58.316856,\"tileGridSize\":\"sovyxpavidnievw\",\"tileOverlapRatio\":21.210634,\"tilePredictionsNmsThreshold\":54.720806,\"validationIouThreshold\":27.970045,\"validationMetricType\":\"Voc\",\"advancedSettings\":\"puxgcbdsvalpnpt\",\"amsGradient\":true,\"augmentations\":\"xgpazwugxyqv\",\"beta1\":72.82474,\"beta2\":87.86046,\"checkpointFrequency\":953919104,\"checkpointModel\":{\"jobInputType\":\"mlflow_model\",\"mode\":\"ReadWriteMount\",\"uri\":\"iuhzzgqlmfa\",\"description\":\"z\"},\"checkpointRunId\":\"udjpxpqht\",\"distributed\":true,\"earlyStopping\":false,\"earlyStoppingDelay\":1217471622,\"earlyStoppingPatience\":342924982,\"enableOnnxNormalization\":false,\"evaluationFrequency\":419853623,\"gradientAccumulationStep\":1049447036,\"layersToFreeze\":336351434,\"learningRate\":79.0951,\"learningRateScheduler\":\"None\",\"modelName\":\"uxsp\",\"momentum\":71.59348,\"nesterov\":false,\"numberOfEpochs\":1973063413,\"numberOfWorkers\":1796310561,\"optimizer\":\"Adamw\",\"randomSeed\":1409212705,\"stepLRGamma\":8.159346,\"stepLRStepSize\":99529171,\"trainingBatchSize\":1768553154,\"validationBatchSize\":385248466,\"warmupCosineLRCycles\":70.731415,\"warmupCosineLRWarmupEpochs\":2134877467,\"weightDecay\":72.09128},\"searchSpace\":[{\"boxDetectionsPerImage\":\"axdvwzaehp\",\"boxScoreThreshold\":\"thd\",\"imageSize\":\"mvetatlakfq\",\"maxSize\":\"xwgiks\",\"minSize\":\"vtooxrpo\",\"modelSize\":\"phchgjtnhtukfaci\",\"multiScale\":\"bfntumeezbxvq\",\"nmsIouThreshold\":\"nuvwcgasgomtmjzw\",\"tileGridSize\":\"qgo\",\"tileOverlapRatio\":\"xpwwzt\",\"tilePredictionsNmsThreshold\":\"mkkhtgfredml\",\"validationIouThreshold\":\"grllcc\",\"validationMetricType\":\"ovjowazhpabacom\",\"amsGradient\":\"otgkwsxnsrqorcg\",\"augmentations\":\"mv\",\"beta1\":\"bxeetqujxcxxqn\",\"beta2\":\"qjkedwqurc\",\"distributed\":\"jmrvvxwjongz\",\"earlyStopping\":\"hqqrsilcch\",\"earlyStoppingDelay\":\"xxkan\",\"earlyStoppingPatience\":\"vri\",\"enableOnnxNormalization\":\"gv\",\"evaluationFrequency\":\"jrulfucte\",\"gradientAccumulationStep\":\"thcfj\",\"layersToFreeze\":\"xlyubqjrostv\",\"learningRate\":\"eqmtzzbeqrz\",\"learningRateScheduler\":\"x\",\"modelName\":\"xrd\",\"momentum\":\"bsrwrsnrhpqat\",\"nesterov\":\"kkvyanxk\",\"numberOfEpochs\":\"csemsvuvd\",\"numberOfWorkers\":\"qxetqmmlivrjjx\",\"optimizer\":\"xdchp\",\"randomSeed\":\"xlehzlxpgfquwzp\",\"stepLRGamma\":\"ibelwcerwkw\",\"stepLRStepSize\":\"jxljtxbusq\",\"trainingBatchSize\":\"xxniuisdzhgbd\",\"validationBatchSize\":\"pagsecnad\",\"warmupCosineLRCycles\":\"wqrgxfllmqi\",\"warmupCosineLRWarmupEpochs\":\"ezoell\",\"weightDecay\":\"kiiwvmtu\"}],\"limitSettings\":{\"maxConcurrentTrials\":259319343,\"maxTrials\":1465106108,\"timeout\":\"PT14H16M47S\"},\"sweepSettings\":{\"earlyTermination\":{\"policyType\":\"EarlyTerminationPolicy\",\"delayEvaluation\":1028451528,\"evaluationInterval\":1879980006},\"samplingAlgorithm\":\"Bayesian\"},\"validationData\":{\"jobInputType\":\"mltable\",\"mode\":\"ReadOnlyMount\",\"uri\":\"ilrgun\",\"description\":\"nlduwzorxsbm\"},\"validationDataSize\":10.09388413403216,\"logVerbosity\":\"Warning\",\"targetColumnName\":\"mxkqvf\",\"trainingData\":{\"jobInputType\":\"mltable\",\"mode\":\"Download\",\"uri\":\"dxcltuubwyvpj\",\"description\":\"wcpjqduqgi\"}}") - .toObject(ImageObjectDetection.class); - Assertions.assertEquals(LogVerbosity.WARNING, model.logVerbosity()); - Assertions.assertEquals("mxkqvf", model.targetColumnName()); - Assertions.assertEquals("wcpjqduqgi", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.trainingData().mode()); - Assertions.assertEquals("dxcltuubwyvpj", model.trainingData().uri()); - Assertions.assertEquals(ObjectDetectionPrimaryMetrics.MEAN_AVERAGE_PRECISION, model.primaryMetric()); - Assertions.assertEquals("puxgcbdsvalpnpt", model.modelSettings().advancedSettings()); - Assertions.assertEquals(true, model.modelSettings().amsGradient()); - Assertions.assertEquals("xgpazwugxyqv", model.modelSettings().augmentations()); - Assertions.assertEquals(72.82474F, model.modelSettings().beta1()); - Assertions.assertEquals(87.86046F, model.modelSettings().beta2()); - Assertions.assertEquals(953919104, model.modelSettings().checkpointFrequency()); - Assertions.assertEquals("z", model.modelSettings().checkpointModel().description()); - Assertions.assertEquals(InputDeliveryMode.READ_WRITE_MOUNT, model.modelSettings().checkpointModel().mode()); - Assertions.assertEquals("iuhzzgqlmfa", model.modelSettings().checkpointModel().uri()); - Assertions.assertEquals("udjpxpqht", model.modelSettings().checkpointRunId()); - Assertions.assertEquals(true, model.modelSettings().distributed()); - Assertions.assertEquals(false, model.modelSettings().earlyStopping()); - Assertions.assertEquals(1217471622, model.modelSettings().earlyStoppingDelay()); - Assertions.assertEquals(342924982, model.modelSettings().earlyStoppingPatience()); - Assertions.assertEquals(false, model.modelSettings().enableOnnxNormalization()); - Assertions.assertEquals(419853623, model.modelSettings().evaluationFrequency()); - Assertions.assertEquals(1049447036, model.modelSettings().gradientAccumulationStep()); - Assertions.assertEquals(336351434, model.modelSettings().layersToFreeze()); - Assertions.assertEquals(79.0951F, model.modelSettings().learningRate()); - Assertions.assertEquals(LearningRateScheduler.NONE, model.modelSettings().learningRateScheduler()); - Assertions.assertEquals("uxsp", model.modelSettings().modelName()); - Assertions.assertEquals(71.59348F, model.modelSettings().momentum()); - Assertions.assertEquals(false, model.modelSettings().nesterov()); - Assertions.assertEquals(1973063413, model.modelSettings().numberOfEpochs()); - Assertions.assertEquals(1796310561, model.modelSettings().numberOfWorkers()); - Assertions.assertEquals(StochasticOptimizer.ADAMW, model.modelSettings().optimizer()); - Assertions.assertEquals(1409212705, model.modelSettings().randomSeed()); - Assertions.assertEquals(8.159346F, model.modelSettings().stepLRGamma()); - Assertions.assertEquals(99529171, model.modelSettings().stepLRStepSize()); - Assertions.assertEquals(1768553154, model.modelSettings().trainingBatchSize()); - Assertions.assertEquals(385248466, model.modelSettings().validationBatchSize()); - Assertions.assertEquals(70.731415F, model.modelSettings().warmupCosineLRCycles()); - Assertions.assertEquals(2134877467, model.modelSettings().warmupCosineLRWarmupEpochs()); - Assertions.assertEquals(72.09128F, model.modelSettings().weightDecay()); - Assertions.assertEquals(667354640, model.modelSettings().boxDetectionsPerImage()); - Assertions.assertEquals(57.01898F, model.modelSettings().boxScoreThreshold()); - Assertions.assertEquals(920278919, model.modelSettings().imageSize()); - Assertions.assertEquals(546709544, model.modelSettings().maxSize()); - Assertions.assertEquals(1447146223, model.modelSettings().minSize()); - Assertions.assertEquals(ModelSize.LARGE, model.modelSettings().modelSize()); - Assertions.assertEquals(true, model.modelSettings().multiScale()); - Assertions.assertEquals(58.316856F, model.modelSettings().nmsIouThreshold()); - Assertions.assertEquals("sovyxpavidnievw", model.modelSettings().tileGridSize()); - Assertions.assertEquals(21.210634F, model.modelSettings().tileOverlapRatio()); - Assertions.assertEquals(54.720806F, model.modelSettings().tilePredictionsNmsThreshold()); - Assertions.assertEquals(27.970045F, model.modelSettings().validationIouThreshold()); - Assertions.assertEquals(ValidationMetricType.VOC, model.modelSettings().validationMetricType()); - Assertions.assertEquals("otgkwsxnsrqorcg", model.searchSpace().get(0).amsGradient()); - Assertions.assertEquals("mv", model.searchSpace().get(0).augmentations()); - Assertions.assertEquals("bxeetqujxcxxqn", model.searchSpace().get(0).beta1()); - Assertions.assertEquals("qjkedwqurc", model.searchSpace().get(0).beta2()); - Assertions.assertEquals("jmrvvxwjongz", model.searchSpace().get(0).distributed()); - Assertions.assertEquals("hqqrsilcch", model.searchSpace().get(0).earlyStopping()); - Assertions.assertEquals("xxkan", model.searchSpace().get(0).earlyStoppingDelay()); - Assertions.assertEquals("vri", model.searchSpace().get(0).earlyStoppingPatience()); - Assertions.assertEquals("gv", model.searchSpace().get(0).enableOnnxNormalization()); - Assertions.assertEquals("jrulfucte", model.searchSpace().get(0).evaluationFrequency()); - Assertions.assertEquals("thcfj", model.searchSpace().get(0).gradientAccumulationStep()); - Assertions.assertEquals("xlyubqjrostv", model.searchSpace().get(0).layersToFreeze()); - Assertions.assertEquals("eqmtzzbeqrz", model.searchSpace().get(0).learningRate()); - Assertions.assertEquals("x", model.searchSpace().get(0).learningRateScheduler()); - Assertions.assertEquals("xrd", model.searchSpace().get(0).modelName()); - Assertions.assertEquals("bsrwrsnrhpqat", model.searchSpace().get(0).momentum()); - Assertions.assertEquals("kkvyanxk", model.searchSpace().get(0).nesterov()); - Assertions.assertEquals("csemsvuvd", model.searchSpace().get(0).numberOfEpochs()); - Assertions.assertEquals("qxetqmmlivrjjx", model.searchSpace().get(0).numberOfWorkers()); - Assertions.assertEquals("xdchp", model.searchSpace().get(0).optimizer()); - Assertions.assertEquals("xlehzlxpgfquwzp", model.searchSpace().get(0).randomSeed()); - Assertions.assertEquals("ibelwcerwkw", model.searchSpace().get(0).stepLRGamma()); - Assertions.assertEquals("jxljtxbusq", model.searchSpace().get(0).stepLRStepSize()); - Assertions.assertEquals("xxniuisdzhgbd", model.searchSpace().get(0).trainingBatchSize()); - Assertions.assertEquals("pagsecnad", model.searchSpace().get(0).validationBatchSize()); - Assertions.assertEquals("wqrgxfllmqi", model.searchSpace().get(0).warmupCosineLRCycles()); - Assertions.assertEquals("ezoell", model.searchSpace().get(0).warmupCosineLRWarmupEpochs()); - Assertions.assertEquals("kiiwvmtu", model.searchSpace().get(0).weightDecay()); - Assertions.assertEquals("axdvwzaehp", model.searchSpace().get(0).boxDetectionsPerImage()); - Assertions.assertEquals("thd", model.searchSpace().get(0).boxScoreThreshold()); - Assertions.assertEquals("mvetatlakfq", model.searchSpace().get(0).imageSize()); - Assertions.assertEquals("xwgiks", model.searchSpace().get(0).maxSize()); - Assertions.assertEquals("vtooxrpo", model.searchSpace().get(0).minSize()); - Assertions.assertEquals("phchgjtnhtukfaci", model.searchSpace().get(0).modelSize()); - Assertions.assertEquals("bfntumeezbxvq", model.searchSpace().get(0).multiScale()); - Assertions.assertEquals("nuvwcgasgomtmjzw", model.searchSpace().get(0).nmsIouThreshold()); - Assertions.assertEquals("qgo", model.searchSpace().get(0).tileGridSize()); - Assertions.assertEquals("xpwwzt", model.searchSpace().get(0).tileOverlapRatio()); - Assertions.assertEquals("mkkhtgfredml", model.searchSpace().get(0).tilePredictionsNmsThreshold()); - Assertions.assertEquals("grllcc", model.searchSpace().get(0).validationIouThreshold()); - Assertions.assertEquals("ovjowazhpabacom", model.searchSpace().get(0).validationMetricType()); - Assertions.assertEquals(259319343, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(1465106108, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT14H16M47S"), model.limitSettings().timeout()); - Assertions.assertEquals(1028451528, model.sweepSettings().earlyTermination().delayEvaluation()); - Assertions.assertEquals(1879980006, model.sweepSettings().earlyTermination().evaluationInterval()); - Assertions.assertEquals(SamplingAlgorithmType.BAYESIAN, model.sweepSettings().samplingAlgorithm()); - Assertions.assertEquals("nlduwzorxsbm", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_ONLY_MOUNT, model.validationData().mode()); - Assertions.assertEquals("ilrgun", model.validationData().uri()); - Assertions.assertEquals(10.09388413403216D, model.validationDataSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageObjectDetection model = - new ImageObjectDetection() - .withLogVerbosity(LogVerbosity.WARNING) - .withTargetColumnName("mxkqvf") - .withTrainingData( - new MLTableJobInput() - .withDescription("wcpjqduqgi") - .withMode(InputDeliveryMode.DOWNLOAD) - .withUri("dxcltuubwyvpj")) - .withPrimaryMetric(ObjectDetectionPrimaryMetrics.MEAN_AVERAGE_PRECISION) - .withModelSettings( - new ImageModelSettingsObjectDetection() - .withAdvancedSettings("puxgcbdsvalpnpt") - .withAmsGradient(true) - .withAugmentations("xgpazwugxyqv") - .withBeta1(72.82474F) - .withBeta2(87.86046F) - .withCheckpointFrequency(953919104) - .withCheckpointModel( - new MLFlowModelJobInput() - .withDescription("z") - .withMode(InputDeliveryMode.READ_WRITE_MOUNT) - .withUri("iuhzzgqlmfa")) - .withCheckpointRunId("udjpxpqht") - .withDistributed(true) - .withEarlyStopping(false) - .withEarlyStoppingDelay(1217471622) - .withEarlyStoppingPatience(342924982) - .withEnableOnnxNormalization(false) - .withEvaluationFrequency(419853623) - .withGradientAccumulationStep(1049447036) - .withLayersToFreeze(336351434) - .withLearningRate(79.0951F) - .withLearningRateScheduler(LearningRateScheduler.NONE) - .withModelName("uxsp") - .withMomentum(71.59348F) - .withNesterov(false) - .withNumberOfEpochs(1973063413) - .withNumberOfWorkers(1796310561) - .withOptimizer(StochasticOptimizer.ADAMW) - .withRandomSeed(1409212705) - .withStepLRGamma(8.159346F) - .withStepLRStepSize(99529171) - .withTrainingBatchSize(1768553154) - .withValidationBatchSize(385248466) - .withWarmupCosineLRCycles(70.731415F) - .withWarmupCosineLRWarmupEpochs(2134877467) - .withWeightDecay(72.09128F) - .withBoxDetectionsPerImage(667354640) - .withBoxScoreThreshold(57.01898F) - .withImageSize(920278919) - .withMaxSize(546709544) - .withMinSize(1447146223) - .withModelSize(ModelSize.LARGE) - .withMultiScale(true) - .withNmsIouThreshold(58.316856F) - .withTileGridSize("sovyxpavidnievw") - .withTileOverlapRatio(21.210634F) - .withTilePredictionsNmsThreshold(54.720806F) - .withValidationIouThreshold(27.970045F) - .withValidationMetricType(ValidationMetricType.VOC)) - .withSearchSpace( - Arrays - .asList( - new ImageModelDistributionSettingsObjectDetection() - .withAmsGradient("otgkwsxnsrqorcg") - .withAugmentations("mv") - .withBeta1("bxeetqujxcxxqn") - .withBeta2("qjkedwqurc") - .withDistributed("jmrvvxwjongz") - .withEarlyStopping("hqqrsilcch") - .withEarlyStoppingDelay("xxkan") - .withEarlyStoppingPatience("vri") - .withEnableOnnxNormalization("gv") - .withEvaluationFrequency("jrulfucte") - .withGradientAccumulationStep("thcfj") - .withLayersToFreeze("xlyubqjrostv") - .withLearningRate("eqmtzzbeqrz") - .withLearningRateScheduler("x") - .withModelName("xrd") - .withMomentum("bsrwrsnrhpqat") - .withNesterov("kkvyanxk") - .withNumberOfEpochs("csemsvuvd") - .withNumberOfWorkers("qxetqmmlivrjjx") - .withOptimizer("xdchp") - .withRandomSeed("xlehzlxpgfquwzp") - .withStepLRGamma("ibelwcerwkw") - .withStepLRStepSize("jxljtxbusq") - .withTrainingBatchSize("xxniuisdzhgbd") - .withValidationBatchSize("pagsecnad") - .withWarmupCosineLRCycles("wqrgxfllmqi") - .withWarmupCosineLRWarmupEpochs("ezoell") - .withWeightDecay("kiiwvmtu") - .withBoxDetectionsPerImage("axdvwzaehp") - .withBoxScoreThreshold("thd") - .withImageSize("mvetatlakfq") - .withMaxSize("xwgiks") - .withMinSize("vtooxrpo") - .withModelSize("phchgjtnhtukfaci") - .withMultiScale("bfntumeezbxvq") - .withNmsIouThreshold("nuvwcgasgomtmjzw") - .withTileGridSize("qgo") - .withTileOverlapRatio("xpwwzt") - .withTilePredictionsNmsThreshold("mkkhtgfredml") - .withValidationIouThreshold("grllcc") - .withValidationMetricType("ovjowazhpabacom"))) - .withLimitSettings( - new ImageLimitSettings() - .withMaxConcurrentTrials(259319343) - .withMaxTrials(1465106108) - .withTimeout(Duration.parse("PT14H16M47S"))) - .withSweepSettings( - new ImageSweepSettings() - .withEarlyTermination( - new EarlyTerminationPolicy() - .withDelayEvaluation(1028451528) - .withEvaluationInterval(1879980006)) - .withSamplingAlgorithm(SamplingAlgorithmType.BAYESIAN)) - .withValidationData( - new MLTableJobInput() - .withDescription("nlduwzorxsbm") - .withMode(InputDeliveryMode.READ_ONLY_MOUNT) - .withUri("ilrgun")) - .withValidationDataSize(10.09388413403216D); - model = BinaryData.fromObject(model).toObject(ImageObjectDetection.class); - Assertions.assertEquals(LogVerbosity.WARNING, model.logVerbosity()); - Assertions.assertEquals("mxkqvf", model.targetColumnName()); - Assertions.assertEquals("wcpjqduqgi", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.trainingData().mode()); - Assertions.assertEquals("dxcltuubwyvpj", model.trainingData().uri()); - Assertions.assertEquals(ObjectDetectionPrimaryMetrics.MEAN_AVERAGE_PRECISION, model.primaryMetric()); - Assertions.assertEquals("puxgcbdsvalpnpt", model.modelSettings().advancedSettings()); - Assertions.assertEquals(true, model.modelSettings().amsGradient()); - Assertions.assertEquals("xgpazwugxyqv", model.modelSettings().augmentations()); - Assertions.assertEquals(72.82474F, model.modelSettings().beta1()); - Assertions.assertEquals(87.86046F, model.modelSettings().beta2()); - Assertions.assertEquals(953919104, model.modelSettings().checkpointFrequency()); - Assertions.assertEquals("z", model.modelSettings().checkpointModel().description()); - Assertions.assertEquals(InputDeliveryMode.READ_WRITE_MOUNT, model.modelSettings().checkpointModel().mode()); - Assertions.assertEquals("iuhzzgqlmfa", model.modelSettings().checkpointModel().uri()); - Assertions.assertEquals("udjpxpqht", model.modelSettings().checkpointRunId()); - Assertions.assertEquals(true, model.modelSettings().distributed()); - Assertions.assertEquals(false, model.modelSettings().earlyStopping()); - Assertions.assertEquals(1217471622, model.modelSettings().earlyStoppingDelay()); - Assertions.assertEquals(342924982, model.modelSettings().earlyStoppingPatience()); - Assertions.assertEquals(false, model.modelSettings().enableOnnxNormalization()); - Assertions.assertEquals(419853623, model.modelSettings().evaluationFrequency()); - Assertions.assertEquals(1049447036, model.modelSettings().gradientAccumulationStep()); - Assertions.assertEquals(336351434, model.modelSettings().layersToFreeze()); - Assertions.assertEquals(79.0951F, model.modelSettings().learningRate()); - Assertions.assertEquals(LearningRateScheduler.NONE, model.modelSettings().learningRateScheduler()); - Assertions.assertEquals("uxsp", model.modelSettings().modelName()); - Assertions.assertEquals(71.59348F, model.modelSettings().momentum()); - Assertions.assertEquals(false, model.modelSettings().nesterov()); - Assertions.assertEquals(1973063413, model.modelSettings().numberOfEpochs()); - Assertions.assertEquals(1796310561, model.modelSettings().numberOfWorkers()); - Assertions.assertEquals(StochasticOptimizer.ADAMW, model.modelSettings().optimizer()); - Assertions.assertEquals(1409212705, model.modelSettings().randomSeed()); - Assertions.assertEquals(8.159346F, model.modelSettings().stepLRGamma()); - Assertions.assertEquals(99529171, model.modelSettings().stepLRStepSize()); - Assertions.assertEquals(1768553154, model.modelSettings().trainingBatchSize()); - Assertions.assertEquals(385248466, model.modelSettings().validationBatchSize()); - Assertions.assertEquals(70.731415F, model.modelSettings().warmupCosineLRCycles()); - Assertions.assertEquals(2134877467, model.modelSettings().warmupCosineLRWarmupEpochs()); - Assertions.assertEquals(72.09128F, model.modelSettings().weightDecay()); - Assertions.assertEquals(667354640, model.modelSettings().boxDetectionsPerImage()); - Assertions.assertEquals(57.01898F, model.modelSettings().boxScoreThreshold()); - Assertions.assertEquals(920278919, model.modelSettings().imageSize()); - Assertions.assertEquals(546709544, model.modelSettings().maxSize()); - Assertions.assertEquals(1447146223, model.modelSettings().minSize()); - Assertions.assertEquals(ModelSize.LARGE, model.modelSettings().modelSize()); - Assertions.assertEquals(true, model.modelSettings().multiScale()); - Assertions.assertEquals(58.316856F, model.modelSettings().nmsIouThreshold()); - Assertions.assertEquals("sovyxpavidnievw", model.modelSettings().tileGridSize()); - Assertions.assertEquals(21.210634F, model.modelSettings().tileOverlapRatio()); - Assertions.assertEquals(54.720806F, model.modelSettings().tilePredictionsNmsThreshold()); - Assertions.assertEquals(27.970045F, model.modelSettings().validationIouThreshold()); - Assertions.assertEquals(ValidationMetricType.VOC, model.modelSettings().validationMetricType()); - Assertions.assertEquals("otgkwsxnsrqorcg", model.searchSpace().get(0).amsGradient()); - Assertions.assertEquals("mv", model.searchSpace().get(0).augmentations()); - Assertions.assertEquals("bxeetqujxcxxqn", model.searchSpace().get(0).beta1()); - Assertions.assertEquals("qjkedwqurc", model.searchSpace().get(0).beta2()); - Assertions.assertEquals("jmrvvxwjongz", model.searchSpace().get(0).distributed()); - Assertions.assertEquals("hqqrsilcch", model.searchSpace().get(0).earlyStopping()); - Assertions.assertEquals("xxkan", model.searchSpace().get(0).earlyStoppingDelay()); - Assertions.assertEquals("vri", model.searchSpace().get(0).earlyStoppingPatience()); - Assertions.assertEquals("gv", model.searchSpace().get(0).enableOnnxNormalization()); - Assertions.assertEquals("jrulfucte", model.searchSpace().get(0).evaluationFrequency()); - Assertions.assertEquals("thcfj", model.searchSpace().get(0).gradientAccumulationStep()); - Assertions.assertEquals("xlyubqjrostv", model.searchSpace().get(0).layersToFreeze()); - Assertions.assertEquals("eqmtzzbeqrz", model.searchSpace().get(0).learningRate()); - Assertions.assertEquals("x", model.searchSpace().get(0).learningRateScheduler()); - Assertions.assertEquals("xrd", model.searchSpace().get(0).modelName()); - Assertions.assertEquals("bsrwrsnrhpqat", model.searchSpace().get(0).momentum()); - Assertions.assertEquals("kkvyanxk", model.searchSpace().get(0).nesterov()); - Assertions.assertEquals("csemsvuvd", model.searchSpace().get(0).numberOfEpochs()); - Assertions.assertEquals("qxetqmmlivrjjx", model.searchSpace().get(0).numberOfWorkers()); - Assertions.assertEquals("xdchp", model.searchSpace().get(0).optimizer()); - Assertions.assertEquals("xlehzlxpgfquwzp", model.searchSpace().get(0).randomSeed()); - Assertions.assertEquals("ibelwcerwkw", model.searchSpace().get(0).stepLRGamma()); - Assertions.assertEquals("jxljtxbusq", model.searchSpace().get(0).stepLRStepSize()); - Assertions.assertEquals("xxniuisdzhgbd", model.searchSpace().get(0).trainingBatchSize()); - Assertions.assertEquals("pagsecnad", model.searchSpace().get(0).validationBatchSize()); - Assertions.assertEquals("wqrgxfllmqi", model.searchSpace().get(0).warmupCosineLRCycles()); - Assertions.assertEquals("ezoell", model.searchSpace().get(0).warmupCosineLRWarmupEpochs()); - Assertions.assertEquals("kiiwvmtu", model.searchSpace().get(0).weightDecay()); - Assertions.assertEquals("axdvwzaehp", model.searchSpace().get(0).boxDetectionsPerImage()); - Assertions.assertEquals("thd", model.searchSpace().get(0).boxScoreThreshold()); - Assertions.assertEquals("mvetatlakfq", model.searchSpace().get(0).imageSize()); - Assertions.assertEquals("xwgiks", model.searchSpace().get(0).maxSize()); - Assertions.assertEquals("vtooxrpo", model.searchSpace().get(0).minSize()); - Assertions.assertEquals("phchgjtnhtukfaci", model.searchSpace().get(0).modelSize()); - Assertions.assertEquals("bfntumeezbxvq", model.searchSpace().get(0).multiScale()); - Assertions.assertEquals("nuvwcgasgomtmjzw", model.searchSpace().get(0).nmsIouThreshold()); - Assertions.assertEquals("qgo", model.searchSpace().get(0).tileGridSize()); - Assertions.assertEquals("xpwwzt", model.searchSpace().get(0).tileOverlapRatio()); - Assertions.assertEquals("mkkhtgfredml", model.searchSpace().get(0).tilePredictionsNmsThreshold()); - Assertions.assertEquals("grllcc", model.searchSpace().get(0).validationIouThreshold()); - Assertions.assertEquals("ovjowazhpabacom", model.searchSpace().get(0).validationMetricType()); - Assertions.assertEquals(259319343, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(1465106108, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT14H16M47S"), model.limitSettings().timeout()); - Assertions.assertEquals(1028451528, model.sweepSettings().earlyTermination().delayEvaluation()); - Assertions.assertEquals(1879980006, model.sweepSettings().earlyTermination().evaluationInterval()); - Assertions.assertEquals(SamplingAlgorithmType.BAYESIAN, model.sweepSettings().samplingAlgorithm()); - Assertions.assertEquals("nlduwzorxsbm", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_ONLY_MOUNT, model.validationData().mode()); - Assertions.assertEquals("ilrgun", model.validationData().uri()); - Assertions.assertEquals(10.09388413403216D, model.validationDataSize()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageSweepSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageSweepSettingsTests.java deleted file mode 100644 index 1fa3bcb215770..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageSweepSettingsTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.EarlyTerminationPolicy; -import com.azure.resourcemanager.machinelearning.models.ImageSweepSettings; -import com.azure.resourcemanager.machinelearning.models.SamplingAlgorithmType; -import org.junit.jupiter.api.Assertions; - -public final class ImageSweepSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageSweepSettings model = - BinaryData - .fromString( - "{\"earlyTermination\":{\"policyType\":\"EarlyTerminationPolicy\",\"delayEvaluation\":790899458,\"evaluationInterval\":2024803970},\"samplingAlgorithm\":\"Grid\"}") - .toObject(ImageSweepSettings.class); - Assertions.assertEquals(790899458, model.earlyTermination().delayEvaluation()); - Assertions.assertEquals(2024803970, model.earlyTermination().evaluationInterval()); - Assertions.assertEquals(SamplingAlgorithmType.GRID, model.samplingAlgorithm()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageSweepSettings model = - new ImageSweepSettings() - .withEarlyTermination( - new EarlyTerminationPolicy().withDelayEvaluation(790899458).withEvaluationInterval(2024803970)) - .withSamplingAlgorithm(SamplingAlgorithmType.GRID); - model = BinaryData.fromObject(model).toObject(ImageSweepSettings.class); - Assertions.assertEquals(790899458, model.earlyTermination().delayEvaluation()); - Assertions.assertEquals(2024803970, model.earlyTermination().evaluationInterval()); - Assertions.assertEquals(SamplingAlgorithmType.GRID, model.samplingAlgorithm()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageVerticalTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageVerticalTests.java deleted file mode 100644 index 1cfdd03fee4e0..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ImageVerticalTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.EarlyTerminationPolicy; -import com.azure.resourcemanager.machinelearning.models.ImageLimitSettings; -import com.azure.resourcemanager.machinelearning.models.ImageSweepSettings; -import com.azure.resourcemanager.machinelearning.models.ImageVertical; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import com.azure.resourcemanager.machinelearning.models.SamplingAlgorithmType; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class ImageVerticalTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageVertical model = - BinaryData - .fromString( - "{\"limitSettings\":{\"maxConcurrentTrials\":4557833,\"maxTrials\":267543853,\"timeout\":\"PT33H18M38S\"},\"sweepSettings\":{\"earlyTermination\":{\"policyType\":\"EarlyTerminationPolicy\",\"delayEvaluation\":1370366721,\"evaluationInterval\":1583622668},\"samplingAlgorithm\":\"Grid\"},\"validationData\":{\"jobInputType\":\"mltable\",\"mode\":\"ReadOnlyMount\",\"uri\":\"lbcnndt\",\"description\":\"xawqy\"},\"validationDataSize\":69.16610610373561}") - .toObject(ImageVertical.class); - Assertions.assertEquals(4557833, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(267543853, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT33H18M38S"), model.limitSettings().timeout()); - Assertions.assertEquals(1370366721, model.sweepSettings().earlyTermination().delayEvaluation()); - Assertions.assertEquals(1583622668, model.sweepSettings().earlyTermination().evaluationInterval()); - Assertions.assertEquals(SamplingAlgorithmType.GRID, model.sweepSettings().samplingAlgorithm()); - Assertions.assertEquals("xawqy", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_ONLY_MOUNT, model.validationData().mode()); - Assertions.assertEquals("lbcnndt", model.validationData().uri()); - Assertions.assertEquals(69.16610610373561D, model.validationDataSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageVertical model = - new ImageVertical() - .withLimitSettings( - new ImageLimitSettings() - .withMaxConcurrentTrials(4557833) - .withMaxTrials(267543853) - .withTimeout(Duration.parse("PT33H18M38S"))) - .withSweepSettings( - new ImageSweepSettings() - .withEarlyTermination( - new EarlyTerminationPolicy() - .withDelayEvaluation(1370366721) - .withEvaluationInterval(1583622668)) - .withSamplingAlgorithm(SamplingAlgorithmType.GRID)) - .withValidationData( - new MLTableJobInput() - .withDescription("xawqy") - .withMode(InputDeliveryMode.READ_ONLY_MOUNT) - .withUri("lbcnndt")) - .withValidationDataSize(69.16610610373561D); - model = BinaryData.fromObject(model).toObject(ImageVertical.class); - Assertions.assertEquals(4557833, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(267543853, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT33H18M38S"), model.limitSettings().timeout()); - Assertions.assertEquals(1370366721, model.sweepSettings().earlyTermination().delayEvaluation()); - Assertions.assertEquals(1583622668, model.sweepSettings().earlyTermination().evaluationInterval()); - Assertions.assertEquals(SamplingAlgorithmType.GRID, model.sweepSettings().samplingAlgorithm()); - Assertions.assertEquals("xawqy", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_ONLY_MOUNT, model.validationData().mode()); - Assertions.assertEquals("lbcnndt", model.validationData().uri()); - Assertions.assertEquals(69.16610610373561D, model.validationDataSize()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/InferenceContainerPropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/InferenceContainerPropertiesTests.java deleted file mode 100644 index bab5e5cf902d5..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/InferenceContainerPropertiesTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.InferenceContainerProperties; -import com.azure.resourcemanager.machinelearning.models.Route; -import org.junit.jupiter.api.Assertions; - -public final class InferenceContainerPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InferenceContainerProperties model = - BinaryData - .fromString( - "{\"livenessRoute\":{\"path\":\"xgqddrih\",\"port\":1351999302},\"readinessRoute\":{\"path\":\"oqcaaewdaomdj\",\"port\":68062218},\"scoringRoute\":{\"path\":\"jxxkzbrmsgei\",\"port\":1985792970}}") - .toObject(InferenceContainerProperties.class); - Assertions.assertEquals("xgqddrih", model.livenessRoute().path()); - Assertions.assertEquals(1351999302, model.livenessRoute().port()); - Assertions.assertEquals("oqcaaewdaomdj", model.readinessRoute().path()); - Assertions.assertEquals(68062218, model.readinessRoute().port()); - Assertions.assertEquals("jxxkzbrmsgei", model.scoringRoute().path()); - Assertions.assertEquals(1985792970, model.scoringRoute().port()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InferenceContainerProperties model = - new InferenceContainerProperties() - .withLivenessRoute(new Route().withPath("xgqddrih").withPort(1351999302)) - .withReadinessRoute(new Route().withPath("oqcaaewdaomdj").withPort(68062218)) - .withScoringRoute(new Route().withPath("jxxkzbrmsgei").withPort(1985792970)); - model = BinaryData.fromObject(model).toObject(InferenceContainerProperties.class); - Assertions.assertEquals("xgqddrih", model.livenessRoute().path()); - Assertions.assertEquals(1351999302, model.livenessRoute().port()); - Assertions.assertEquals("oqcaaewdaomdj", model.readinessRoute().path()); - Assertions.assertEquals(68062218, model.readinessRoute().port()); - Assertions.assertEquals("jxxkzbrmsgei", model.scoringRoute().path()); - Assertions.assertEquals(1985792970, model.scoringRoute().port()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/InstanceTypeSchemaResourcesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/InstanceTypeSchemaResourcesTests.java deleted file mode 100644 index c367b4075c1e8..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/InstanceTypeSchemaResourcesTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.InstanceTypeSchemaResources; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class InstanceTypeSchemaResourcesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InstanceTypeSchemaResources model = - BinaryData - .fromString( - "{\"requests\":{\"wnwvroevytlyokr\":\"bannovvoxczytp\",\"o\":\"rouuxvnsasbcry\",\"xnazpmkml\":\"izrxklob\"},\"limits\":{\"zxlioh\":\"vfxzopjh\",\"dtfgxqbawpcbb\":\"d\",\"ofyuicd\":\"zqcyknap\",\"ybww\":\"zb\"}}") - .toObject(InstanceTypeSchemaResources.class); - Assertions.assertEquals("bannovvoxczytp", model.requests().get("wnwvroevytlyokr")); - Assertions.assertEquals("vfxzopjh", model.limits().get("zxlioh")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InstanceTypeSchemaResources model = - new InstanceTypeSchemaResources() - .withRequests( - mapOf("wnwvroevytlyokr", "bannovvoxczytp", "o", "rouuxvnsasbcry", "xnazpmkml", "izrxklob")) - .withLimits(mapOf("zxlioh", "vfxzopjh", "dtfgxqbawpcbb", "d", "ofyuicd", "zqcyknap", "ybww", "zb")); - model = BinaryData.fromObject(model).toObject(InstanceTypeSchemaResources.class); - Assertions.assertEquals("bannovvoxczytp", model.requests().get("wnwvroevytlyokr")); - Assertions.assertEquals("vfxzopjh", model.limits().get("zxlioh")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/InstanceTypeSchemaTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/InstanceTypeSchemaTests.java deleted file mode 100644 index efe4a50a76957..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/InstanceTypeSchemaTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.InstanceTypeSchema; -import com.azure.resourcemanager.machinelearning.models.InstanceTypeSchemaResources; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class InstanceTypeSchemaTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InstanceTypeSchema model = - BinaryData - .fromString( - "{\"nodeSelector\":{\"bo\":\"v\"},\"resources\":{\"requests\":{\"q\":\"xypokkhmi\",\"ngnbdxxew\":\"ymc\",\"qecrqctmxx\":\"ninvudbchaqdt\"},\"limits\":{\"vtzn\":\"dmflhuytx\"}}}") - .toObject(InstanceTypeSchema.class); - Assertions.assertEquals("v", model.nodeSelector().get("bo")); - Assertions.assertEquals("xypokkhmi", model.resources().requests().get("q")); - Assertions.assertEquals("dmflhuytx", model.resources().limits().get("vtzn")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InstanceTypeSchema model = - new InstanceTypeSchema() - .withNodeSelector(mapOf("bo", "v")) - .withResources( - new InstanceTypeSchemaResources() - .withRequests(mapOf("q", "xypokkhmi", "ngnbdxxew", "ymc", "qecrqctmxx", "ninvudbchaqdt")) - .withLimits(mapOf("vtzn", "dmflhuytx"))); - model = BinaryData.fromObject(model).toObject(InstanceTypeSchema.class); - Assertions.assertEquals("v", model.nodeSelector().get("bo")); - Assertions.assertEquals("xypokkhmi", model.resources().requests().get("q")); - Assertions.assertEquals("dmflhuytx", model.resources().limits().get("vtzn")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobBaseInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobBaseInnerTests.java deleted file mode 100644 index 868c0bd7be76c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobBaseInnerTests.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.JobBaseInner; -import com.azure.resourcemanager.machinelearning.models.IdentityConfiguration; -import com.azure.resourcemanager.machinelearning.models.JobBaseProperties; -import com.azure.resourcemanager.machinelearning.models.JobService; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class JobBaseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JobBaseInner model = - BinaryData - .fromString( - "{\"properties\":{\"jobType\":\"JobBaseProperties\",\"componentId\":\"fvjlboxqvkjlmx\",\"computeId\":\"mdy\",\"displayName\":\"dwdigumb\",\"experimentName\":\"aauzzptjazysd\",\"identity\":{\"identityType\":\"IdentityConfiguration\"},\"isArchived\":false,\"services\":{\"y\":{\"endpoint\":\"aiqyuvvfo\",\"errorMessage\":\"p\",\"jobServiceType\":\"qyikvy\",\"port\":1053518025,\"properties\":{},\"status\":\"vluwmncsttij\"}},\"status\":\"NotResponding\",\"description\":\"ekrsgs\",\"properties\":{\"dgkynscliqhzvhxn\":\"huzqgn\",\"tppn\":\"omtkub\",\"frbbc\":\"dxzxhi\"},\"tags\":{\"ykvgtrdcnifmz\":\"agtltdhlfkqoj\"}},\"id\":\"dymbrny\",\"name\":\"u\",\"type\":\"m\"}") - .toObject(JobBaseInner.class); - Assertions.assertEquals("ekrsgs", model.properties().description()); - Assertions.assertEquals("huzqgn", model.properties().properties().get("dgkynscliqhzvhxn")); - Assertions.assertEquals("agtltdhlfkqoj", model.properties().tags().get("ykvgtrdcnifmz")); - Assertions.assertEquals("fvjlboxqvkjlmx", model.properties().componentId()); - Assertions.assertEquals("mdy", model.properties().computeId()); - Assertions.assertEquals("dwdigumb", model.properties().displayName()); - Assertions.assertEquals("aauzzptjazysd", model.properties().experimentName()); - Assertions.assertEquals(false, model.properties().isArchived()); - Assertions.assertEquals("aiqyuvvfo", model.properties().services().get("y").endpoint()); - Assertions.assertEquals("qyikvy", model.properties().services().get("y").jobServiceType()); - Assertions.assertEquals(1053518025, model.properties().services().get("y").port()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JobBaseInner model = - new JobBaseInner() - .withProperties( - new JobBaseProperties() - .withDescription("ekrsgs") - .withProperties(mapOf("dgkynscliqhzvhxn", "huzqgn", "tppn", "omtkub", "frbbc", "dxzxhi")) - .withTags(mapOf("ykvgtrdcnifmz", "agtltdhlfkqoj")) - .withComponentId("fvjlboxqvkjlmx") - .withComputeId("mdy") - .withDisplayName("dwdigumb") - .withExperimentName("aauzzptjazysd") - .withIdentity(new IdentityConfiguration()) - .withIsArchived(false) - .withServices( - mapOf( - "y", - new JobService() - .withEndpoint("aiqyuvvfo") - .withJobServiceType("qyikvy") - .withPort(1053518025) - .withProperties(mapOf())))); - model = BinaryData.fromObject(model).toObject(JobBaseInner.class); - Assertions.assertEquals("ekrsgs", model.properties().description()); - Assertions.assertEquals("huzqgn", model.properties().properties().get("dgkynscliqhzvhxn")); - Assertions.assertEquals("agtltdhlfkqoj", model.properties().tags().get("ykvgtrdcnifmz")); - Assertions.assertEquals("fvjlboxqvkjlmx", model.properties().componentId()); - Assertions.assertEquals("mdy", model.properties().computeId()); - Assertions.assertEquals("dwdigumb", model.properties().displayName()); - Assertions.assertEquals("aauzzptjazysd", model.properties().experimentName()); - Assertions.assertEquals(false, model.properties().isArchived()); - Assertions.assertEquals("aiqyuvvfo", model.properties().services().get("y").endpoint()); - Assertions.assertEquals("qyikvy", model.properties().services().get("y").jobServiceType()); - Assertions.assertEquals(1053518025, model.properties().services().get("y").port()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobBasePropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobBasePropertiesTests.java deleted file mode 100644 index 44ccda7459915..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobBasePropertiesTests.java +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.IdentityConfiguration; -import com.azure.resourcemanager.machinelearning.models.JobBaseProperties; -import com.azure.resourcemanager.machinelearning.models.JobService; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class JobBasePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JobBaseProperties model = - BinaryData - .fromString( - "{\"jobType\":\"JobBaseProperties\",\"componentId\":\"a\",\"computeId\":\"g\",\"displayName\":\"hocxvdfffwafqrou\",\"experimentName\":\"spave\",\"identity\":{\"identityType\":\"IdentityConfiguration\"},\"isArchived\":true,\"services\":{\"xdbeesmieknl\":{\"endpoint\":\"n\",\"errorMessage\":\"zudhcxg\",\"jobServiceType\":\"oyxcdyuib\",\"port\":595382657,\"properties\":{\"aeoisrvh\":\"bzydvfvfcj\",\"ukiscvwmzhw\":\"gorf\",\"nzeyqxtjj\":\"lefaxvxilcbtgn\"},\"status\":\"qlqhycavodg\"},\"cjhfgmvecactxmw\":{\"endpoint\":\"riaa\",\"errorMessage\":\"uagydwqfbylyrf\",\"jobServiceType\":\"agt\",\"port\":1621141865,\"properties\":{\"zldmozuxy\":\"qwogfnzjvus\",\"ysownbtgkbug\":\"fsbtkad\",\"pe\":\"jqctojcmisofie\",\"hihihlhzdsqtzbsr\":\"ojyqdhcuplcplcw\"},\"status\":\"o\"},\"etoge\":{\"endpoint\":\"e\",\"errorMessage\":\"wcluqovekqvgq\",\"jobServiceType\":\"wifzmp\",\"port\":1626415565,\"properties\":{\"rfsphuagrt\":\"qikfxcv\",\"xubyjaffmmfblcqc\":\"ikteusqczkvyk\",\"brta\":\"ubgq\",\"lqxihhrmooiz\":\"metttwgd\"},\"status\":\"eypxiutcxapzhyr\"}},\"status\":\"Preparing\",\"description\":\"slhvnhlab\",\"properties\":{\"hvv\":\"kkzjcjbtrga\"},\"tags\":{\"oqbeitpkxzt\":\"xjjs\",\"pimaqxzhemjyh\":\"oobklftidgfcwq\",\"bawpfajnjwltlwt\":\"hujswtwkozzwcul\",\"uktalhsnvkcdmxz\":\"j\"}}") - .toObject(JobBaseProperties.class); - Assertions.assertEquals("slhvnhlab", model.description()); - Assertions.assertEquals("kkzjcjbtrga", model.properties().get("hvv")); - Assertions.assertEquals("xjjs", model.tags().get("oqbeitpkxzt")); - Assertions.assertEquals("a", model.componentId()); - Assertions.assertEquals("g", model.computeId()); - Assertions.assertEquals("hocxvdfffwafqrou", model.displayName()); - Assertions.assertEquals("spave", model.experimentName()); - Assertions.assertEquals(true, model.isArchived()); - Assertions.assertEquals("n", model.services().get("xdbeesmieknl").endpoint()); - Assertions.assertEquals("oyxcdyuib", model.services().get("xdbeesmieknl").jobServiceType()); - Assertions.assertEquals(595382657, model.services().get("xdbeesmieknl").port()); - Assertions.assertEquals("bzydvfvfcj", model.services().get("xdbeesmieknl").properties().get("aeoisrvh")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JobBaseProperties model = - new JobBaseProperties() - .withDescription("slhvnhlab") - .withProperties(mapOf("hvv", "kkzjcjbtrga")) - .withTags( - mapOf( - "oqbeitpkxzt", - "xjjs", - "pimaqxzhemjyh", - "oobklftidgfcwq", - "bawpfajnjwltlwt", - "hujswtwkozzwcul", - "uktalhsnvkcdmxz", - "j")) - .withComponentId("a") - .withComputeId("g") - .withDisplayName("hocxvdfffwafqrou") - .withExperimentName("spave") - .withIdentity(new IdentityConfiguration()) - .withIsArchived(true) - .withServices( - mapOf( - "xdbeesmieknl", - new JobService() - .withEndpoint("n") - .withJobServiceType("oyxcdyuib") - .withPort(595382657) - .withProperties( - mapOf("aeoisrvh", "bzydvfvfcj", "ukiscvwmzhw", "gorf", "nzeyqxtjj", "lefaxvxilcbtgn")), - "cjhfgmvecactxmw", - new JobService() - .withEndpoint("riaa") - .withJobServiceType("agt") - .withPort(1621141865) - .withProperties( - mapOf( - "zldmozuxy", - "qwogfnzjvus", - "ysownbtgkbug", - "fsbtkad", - "pe", - "jqctojcmisofie", - "hihihlhzdsqtzbsr", - "ojyqdhcuplcplcw")), - "etoge", - new JobService() - .withEndpoint("e") - .withJobServiceType("wifzmp") - .withPort(1626415565) - .withProperties( - mapOf( - "rfsphuagrt", - "qikfxcv", - "xubyjaffmmfblcqc", - "ikteusqczkvyk", - "brta", - "ubgq", - "lqxihhrmooiz", - "metttwgd")))); - model = BinaryData.fromObject(model).toObject(JobBaseProperties.class); - Assertions.assertEquals("slhvnhlab", model.description()); - Assertions.assertEquals("kkzjcjbtrga", model.properties().get("hvv")); - Assertions.assertEquals("xjjs", model.tags().get("oqbeitpkxzt")); - Assertions.assertEquals("a", model.componentId()); - Assertions.assertEquals("g", model.computeId()); - Assertions.assertEquals("hocxvdfffwafqrou", model.displayName()); - Assertions.assertEquals("spave", model.experimentName()); - Assertions.assertEquals(true, model.isArchived()); - Assertions.assertEquals("n", model.services().get("xdbeesmieknl").endpoint()); - Assertions.assertEquals("oyxcdyuib", model.services().get("xdbeesmieknl").jobServiceType()); - Assertions.assertEquals(595382657, model.services().get("xdbeesmieknl").port()); - Assertions.assertEquals("bzydvfvfcj", model.services().get("xdbeesmieknl").properties().get("aeoisrvh")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobBaseResourceArmPaginatedResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobBaseResourceArmPaginatedResultTests.java deleted file mode 100644 index dfdc7ec3e5e6c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobBaseResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.JobBaseInner; -import com.azure.resourcemanager.machinelearning.models.JobBaseProperties; -import com.azure.resourcemanager.machinelearning.models.JobBaseResourceArmPaginatedResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class JobBaseResourceArmPaginatedResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JobBaseResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"nextLink\":\"zoggculapz\",\"value\":[{\"properties\":{\"jobType\":\"JobBaseProperties\",\"componentId\":\"gogtqxepnylbf\",\"computeId\":\"jlyjtlvofq\",\"displayName\":\"vfcibyfmowux\",\"experimentName\":\"jpvd\",\"isArchived\":true,\"services\":{},\"status\":\"Queued\",\"description\":\"wzjbh\",\"properties\":{},\"tags\":{}},\"id\":\"jrkambtrnegvmnv\",\"name\":\"q\",\"type\":\"qvldspastjbkkd\"},{\"properties\":{\"jobType\":\"JobBaseProperties\",\"componentId\":\"lves\",\"computeId\":\"jlxr\",\"displayName\":\"lozapeewchpxlk\",\"experimentName\":\"kuziycsle\",\"isArchived\":true,\"services\":{},\"status\":\"Preparing\",\"description\":\"tyh\",\"properties\":{},\"tags\":{}},\"id\":\"dcgzul\",\"name\":\"mmrqz\",\"type\":\"rr\"},{\"properties\":{\"jobType\":\"JobBaseProperties\",\"componentId\":\"pglydz\",\"computeId\":\"rvqeevtoepryutn\",\"displayName\":\"tpzdmovzvfvaawzq\",\"experimentName\":\"f\",\"isArchived\":false,\"services\":{},\"status\":\"Provisioning\",\"description\":\"aecxndtic\",\"properties\":{},\"tags\":{}},\"id\":\"zmlqtmldgxo\",\"name\":\"firclnpkciayz\",\"type\":\"iykhy\"}]}") - .toObject(JobBaseResourceArmPaginatedResult.class); - Assertions.assertEquals("zoggculapz", model.nextLink()); - Assertions.assertEquals("wzjbh", model.value().get(0).properties().description()); - Assertions.assertEquals("gogtqxepnylbf", model.value().get(0).properties().componentId()); - Assertions.assertEquals("jlyjtlvofq", model.value().get(0).properties().computeId()); - Assertions.assertEquals("vfcibyfmowux", model.value().get(0).properties().displayName()); - Assertions.assertEquals("jpvd", model.value().get(0).properties().experimentName()); - Assertions.assertEquals(true, model.value().get(0).properties().isArchived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JobBaseResourceArmPaginatedResult model = - new JobBaseResourceArmPaginatedResult() - .withNextLink("zoggculapz") - .withValue( - Arrays - .asList( - new JobBaseInner() - .withProperties( - new JobBaseProperties() - .withDescription("wzjbh") - .withProperties(mapOf()) - .withTags(mapOf()) - .withComponentId("gogtqxepnylbf") - .withComputeId("jlyjtlvofq") - .withDisplayName("vfcibyfmowux") - .withExperimentName("jpvd") - .withIsArchived(true) - .withServices(mapOf())), - new JobBaseInner() - .withProperties( - new JobBaseProperties() - .withDescription("tyh") - .withProperties(mapOf()) - .withTags(mapOf()) - .withComponentId("lves") - .withComputeId("jlxr") - .withDisplayName("lozapeewchpxlk") - .withExperimentName("kuziycsle") - .withIsArchived(true) - .withServices(mapOf())), - new JobBaseInner() - .withProperties( - new JobBaseProperties() - .withDescription("aecxndtic") - .withProperties(mapOf()) - .withTags(mapOf()) - .withComponentId("pglydz") - .withComputeId("rvqeevtoepryutn") - .withDisplayName("tpzdmovzvfvaawzq") - .withExperimentName("f") - .withIsArchived(false) - .withServices(mapOf())))); - model = BinaryData.fromObject(model).toObject(JobBaseResourceArmPaginatedResult.class); - Assertions.assertEquals("zoggculapz", model.nextLink()); - Assertions.assertEquals("wzjbh", model.value().get(0).properties().description()); - Assertions.assertEquals("gogtqxepnylbf", model.value().get(0).properties().componentId()); - Assertions.assertEquals("jlyjtlvofq", model.value().get(0).properties().computeId()); - Assertions.assertEquals("vfcibyfmowux", model.value().get(0).properties().displayName()); - Assertions.assertEquals("jpvd", model.value().get(0).properties().experimentName()); - Assertions.assertEquals(true, model.value().get(0).properties().isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobInputTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobInputTests.java deleted file mode 100644 index c2332d6a9fe18..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobInputTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.JobInput; -import org.junit.jupiter.api.Assertions; - -public final class JobInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JobInput model = - BinaryData.fromString("{\"jobInputType\":\"JobInput\",\"description\":\"pjby\"}").toObject(JobInput.class); - Assertions.assertEquals("pjby", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JobInput model = new JobInput().withDescription("pjby"); - model = BinaryData.fromObject(model).toObject(JobInput.class); - Assertions.assertEquals("pjby", model.description()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobLimitsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobLimitsTests.java deleted file mode 100644 index b656997bc9fa2..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobLimitsTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.JobLimits; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class JobLimitsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JobLimits model = - BinaryData - .fromString("{\"jobLimitsType\":\"JobLimits\",\"timeout\":\"PT90H18M40S\"}") - .toObject(JobLimits.class); - Assertions.assertEquals(Duration.parse("PT90H18M40S"), model.timeout()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JobLimits model = new JobLimits().withTimeout(Duration.parse("PT90H18M40S")); - model = BinaryData.fromObject(model).toObject(JobLimits.class); - Assertions.assertEquals(Duration.parse("PT90H18M40S"), model.timeout()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobOutputTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobOutputTests.java deleted file mode 100644 index 26db9eb1fe842..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobOutputTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.JobOutput; -import org.junit.jupiter.api.Assertions; - -public final class JobOutputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JobOutput model = - BinaryData - .fromString("{\"jobOutputType\":\"JobOutput\",\"description\":\"qmbzmq\"}") - .toObject(JobOutput.class); - Assertions.assertEquals("qmbzmq", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JobOutput model = new JobOutput().withDescription("qmbzmq"); - model = BinaryData.fromObject(model).toObject(JobOutput.class); - Assertions.assertEquals("qmbzmq", model.description()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobResourceConfigurationTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobResourceConfigurationTests.java deleted file mode 100644 index 016031d683192..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobResourceConfigurationTests.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.JobResourceConfiguration; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class JobResourceConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JobResourceConfiguration model = - BinaryData - .fromString( - "{\"dockerArgs\":\"atbnxwbj\",\"shmSize\":\"dbirkfpksokdgo\",\"instanceCount\":1548314621,\"instanceType\":\"jymrhbg\",\"properties\":{\"nfnzhhh\":\"datazkye\",\"mffjkutycyarn\":\"datao\",\"pyc\":\"dataoohguabzoghkt\"}}") - .toObject(JobResourceConfiguration.class); - Assertions.assertEquals(1548314621, model.instanceCount()); - Assertions.assertEquals("jymrhbg", model.instanceType()); - Assertions.assertEquals("atbnxwbj", model.dockerArgs()); - Assertions.assertEquals("dbirkfpksokdgo", model.shmSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JobResourceConfiguration model = - new JobResourceConfiguration() - .withInstanceCount(1548314621) - .withInstanceType("jymrhbg") - .withProperties(mapOf("nfnzhhh", "datazkye", "mffjkutycyarn", "datao", "pyc", "dataoohguabzoghkt")) - .withDockerArgs("atbnxwbj") - .withShmSize("dbirkfpksokdgo"); - model = BinaryData.fromObject(model).toObject(JobResourceConfiguration.class); - Assertions.assertEquals(1548314621, model.instanceCount()); - Assertions.assertEquals("jymrhbg", model.instanceType()); - Assertions.assertEquals("atbnxwbj", model.dockerArgs()); - Assertions.assertEquals("dbirkfpksokdgo", model.shmSize()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobScheduleActionTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobScheduleActionTests.java deleted file mode 100644 index 169695892b2ce..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobScheduleActionTests.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.IdentityConfiguration; -import com.azure.resourcemanager.machinelearning.models.JobBaseProperties; -import com.azure.resourcemanager.machinelearning.models.JobScheduleAction; -import com.azure.resourcemanager.machinelearning.models.JobService; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class JobScheduleActionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JobScheduleAction model = - BinaryData - .fromString( - "{\"actionType\":\"CreateJob\",\"jobDefinition\":{\"jobType\":\"JobBaseProperties\",\"componentId\":\"xkydfbwlja\",\"computeId\":\"uerkjddvrg\",\"displayName\":\"egftcvb\",\"experimentName\":\"ftksd\",\"identity\":{\"identityType\":\"IdentityConfiguration\"},\"isArchived\":true,\"services\":{\"jgmn\":{\"endpoint\":\"gmwdh\",\"errorMessage\":\"buvczldbglzoutb\",\"jobServiceType\":\"qgz\",\"port\":1543957529,\"properties\":{},\"status\":\"lyzgsnor\"},\"rswhbuubpyro\":{\"endpoint\":\"otvmrxk\",\"errorMessage\":\"obvvjbhvh\",\"jobServiceType\":\"qayfl\",\"port\":307514340,\"properties\":{},\"status\":\"snuudtelvhyibdr\"},\"km\":{\"endpoint\":\"joxztfwfqchvczev\",\"errorMessage\":\"nctagfyvrtpqpem\",\"jobServiceType\":\"cgkrepdqhqy\",\"port\":1873371469,\"properties\":{},\"status\":\"mvxqab\"}},\"status\":\"NotStarted\",\"description\":\"inhgre\",\"properties\":{\"angp\":\"whlpuzjpceezn\",\"phmsexroq\":\"bfaxyxzlbc\",\"nfee\":\"ndktxfv\"},\"tags\":{\"bgnixxoww\":\"krie\",\"p\":\"kyfwnwpiwxeiicr\",\"dm\":\"pk\"}}}") - .toObject(JobScheduleAction.class); - Assertions.assertEquals("inhgre", model.jobDefinition().description()); - Assertions.assertEquals("whlpuzjpceezn", model.jobDefinition().properties().get("angp")); - Assertions.assertEquals("krie", model.jobDefinition().tags().get("bgnixxoww")); - Assertions.assertEquals("xkydfbwlja", model.jobDefinition().componentId()); - Assertions.assertEquals("uerkjddvrg", model.jobDefinition().computeId()); - Assertions.assertEquals("egftcvb", model.jobDefinition().displayName()); - Assertions.assertEquals("ftksd", model.jobDefinition().experimentName()); - Assertions.assertEquals(true, model.jobDefinition().isArchived()); - Assertions.assertEquals("gmwdh", model.jobDefinition().services().get("jgmn").endpoint()); - Assertions.assertEquals("qgz", model.jobDefinition().services().get("jgmn").jobServiceType()); - Assertions.assertEquals(1543957529, model.jobDefinition().services().get("jgmn").port()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JobScheduleAction model = - new JobScheduleAction() - .withJobDefinition( - new JobBaseProperties() - .withDescription("inhgre") - .withProperties(mapOf("angp", "whlpuzjpceezn", "phmsexroq", "bfaxyxzlbc", "nfee", "ndktxfv")) - .withTags(mapOf("bgnixxoww", "krie", "p", "kyfwnwpiwxeiicr", "dm", "pk")) - .withComponentId("xkydfbwlja") - .withComputeId("uerkjddvrg") - .withDisplayName("egftcvb") - .withExperimentName("ftksd") - .withIdentity(new IdentityConfiguration()) - .withIsArchived(true) - .withServices( - mapOf( - "jgmn", - new JobService() - .withEndpoint("gmwdh") - .withJobServiceType("qgz") - .withPort(1543957529) - .withProperties(mapOf()), - "rswhbuubpyro", - new JobService() - .withEndpoint("otvmrxk") - .withJobServiceType("qayfl") - .withPort(307514340) - .withProperties(mapOf()), - "km", - new JobService() - .withEndpoint("joxztfwfqchvczev") - .withJobServiceType("cgkrepdqhqy") - .withPort(1873371469) - .withProperties(mapOf())))); - model = BinaryData.fromObject(model).toObject(JobScheduleAction.class); - Assertions.assertEquals("inhgre", model.jobDefinition().description()); - Assertions.assertEquals("whlpuzjpceezn", model.jobDefinition().properties().get("angp")); - Assertions.assertEquals("krie", model.jobDefinition().tags().get("bgnixxoww")); - Assertions.assertEquals("xkydfbwlja", model.jobDefinition().componentId()); - Assertions.assertEquals("uerkjddvrg", model.jobDefinition().computeId()); - Assertions.assertEquals("egftcvb", model.jobDefinition().displayName()); - Assertions.assertEquals("ftksd", model.jobDefinition().experimentName()); - Assertions.assertEquals(true, model.jobDefinition().isArchived()); - Assertions.assertEquals("gmwdh", model.jobDefinition().services().get("jgmn").endpoint()); - Assertions.assertEquals("qgz", model.jobDefinition().services().get("jgmn").jobServiceType()); - Assertions.assertEquals(1543957529, model.jobDefinition().services().get("jgmn").port()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobServiceTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobServiceTests.java deleted file mode 100644 index f6f30fc8c6188..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobServiceTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.JobService; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class JobServiceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JobService model = - BinaryData - .fromString( - "{\"endpoint\":\"oaimlnw\",\"errorMessage\":\"aomylwea\",\"jobServiceType\":\"lcsethwwnpj\",\"port\":307378678,\"properties\":{\"ousnfepgfewe\":\"wpchwahf\",\"hdjhlimmbcx\":\"wlyxgncxyk\",\"cporxvxcjz\":\"h\",\"juhdqazkmtgguwpi\":\"qizxfpxtgqscjavf\"},\"status\":\"ajc\"}") - .toObject(JobService.class); - Assertions.assertEquals("oaimlnw", model.endpoint()); - Assertions.assertEquals("lcsethwwnpj", model.jobServiceType()); - Assertions.assertEquals(307378678, model.port()); - Assertions.assertEquals("wpchwahf", model.properties().get("ousnfepgfewe")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JobService model = - new JobService() - .withEndpoint("oaimlnw") - .withJobServiceType("lcsethwwnpj") - .withPort(307378678) - .withProperties( - mapOf( - "ousnfepgfewe", - "wpchwahf", - "hdjhlimmbcx", - "wlyxgncxyk", - "cporxvxcjz", - "h", - "juhdqazkmtgguwpi", - "qizxfpxtgqscjavf")); - model = BinaryData.fromObject(model).toObject(JobService.class); - Assertions.assertEquals("oaimlnw", model.endpoint()); - Assertions.assertEquals("lcsethwwnpj", model.jobServiceType()); - Assertions.assertEquals(307378678, model.port()); - Assertions.assertEquals("wpchwahf", model.properties().get("ousnfepgfewe")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobsCancelMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobsCancelMockTests.java deleted file mode 100644 index 23838cb4b5c83..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobsCancelMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class JobsCancelMockTests { - @Test - public void testCancel() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.jobs().cancel("bdxmd", "esbrujbjpppktl", "dibfmthi", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobsCreateOrUpdateWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index cf71fac576b0a..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.IdentityConfiguration; -import com.azure.resourcemanager.machinelearning.models.JobBase; -import com.azure.resourcemanager.machinelearning.models.JobBaseProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class JobsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"jobType\":\"JobBaseProperties\",\"componentId\":\"qmrpahuuonjk\",\"computeId\":\"ukguehvvp\",\"displayName\":\"oegcjoj\",\"experimentName\":\"eui\",\"identity\":{\"identityType\":\"IdentityConfiguration\"},\"isArchived\":true,\"services\":{},\"status\":\"Preparing\",\"description\":\"nhtmeplhbp\",\"properties\":{\"uc\":\"pmummmkva\",\"chxwwuzdmh\":\"jiuaiqpmnufzh\"},\"tags\":{\"mlitqdsj\":\"vivjm\",\"efndslvrqoemwsi\":\"pdviscotyxbrii\"}},\"id\":\"ailwdqmqfyd\",\"name\":\"otmfxlkdlgwgna\",\"type\":\"kuuyiuyuaf\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - JobBase response = - manager - .jobs() - .define("zqpl") - .withExistingWorkspace("at", "ejrnmi") - .withProperties( - new JobBaseProperties() - .withDescription("xxkwykuqdndx") - .withProperties(mapOf("gga", "h")) - .withTags(mapOf("eerscdxrnrnjrcu", "gtf", "acnrgfdtncmspsan", "mb", "b", "ame")) - .withComponentId("kihonik") - .withComputeId("r") - .withDisplayName("ffjilzfbpnt") - .withExperimentName("kensckh") - .withIdentity(new IdentityConfiguration()) - .withIsArchived(false) - .withServices(mapOf())) - .create(); - - Assertions.assertEquals("nhtmeplhbp", response.properties().description()); - Assertions.assertEquals("pmummmkva", response.properties().properties().get("uc")); - Assertions.assertEquals("vivjm", response.properties().tags().get("mlitqdsj")); - Assertions.assertEquals("qmrpahuuonjk", response.properties().componentId()); - Assertions.assertEquals("ukguehvvp", response.properties().computeId()); - Assertions.assertEquals("oegcjoj", response.properties().displayName()); - Assertions.assertEquals("eui", response.properties().experimentName()); - Assertions.assertEquals(true, response.properties().isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobsDeleteMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobsDeleteMockTests.java deleted file mode 100644 index 58d8aeb6fb18c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobsDeleteMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class JobsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.jobs().delete("fvbennmfkbpjnr", "ekwwnthropmdudsy", "urz", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobsGetWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobsGetWithResponseMockTests.java deleted file mode 100644 index 99d19faeb69b7..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobsGetWithResponseMockTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.JobBase; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class JobsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"jobType\":\"JobBaseProperties\",\"componentId\":\"yedzfzq\",\"computeId\":\"uqhtdereuno\",\"displayName\":\"kzwhpj\",\"experimentName\":\"yxedznmx\",\"identity\":{\"identityType\":\"IdentityConfiguration\"},\"isArchived\":true,\"services\":{},\"status\":\"Queued\",\"description\":\"my\",\"properties\":{\"jjtpdyzoutxfptof\":\"px\",\"gaaqw\":\"gnuywezygva\",\"lufbortb\":\"kgjpytpmpvdnoge\"},\"tags\":{\"axzs\":\"k\"}},\"id\":\"xxyjisskobqoclfl\",\"name\":\"oewyhxessmvrkd\",\"type\":\"sqeq\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - JobBase response = - manager - .jobs() - .getWithResponse("vktjhffecqkoq", "ouergaghp", "zxkpyehhfdyld", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("my", response.properties().description()); - Assertions.assertEquals("px", response.properties().properties().get("jjtpdyzoutxfptof")); - Assertions.assertEquals("k", response.properties().tags().get("axzs")); - Assertions.assertEquals("yedzfzq", response.properties().componentId()); - Assertions.assertEquals("uqhtdereuno", response.properties().computeId()); - Assertions.assertEquals("kzwhpj", response.properties().displayName()); - Assertions.assertEquals("yxedznmx", response.properties().experimentName()); - Assertions.assertEquals(true, response.properties().isArchived()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobsListMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobsListMockTests.java deleted file mode 100644 index ae721a98aa718..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/JobsListMockTests.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.JobBase; -import com.azure.resourcemanager.machinelearning.models.ListViewType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class JobsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"jobType\":\"JobBaseProperties\",\"componentId\":\"tvzjyi\",\"computeId\":\"bqrvvbqv\",\"displayName\":\"mpe\",\"experimentName\":\"xgiqasifubn\",\"identity\":{\"identityType\":\"IdentityConfiguration\"},\"isArchived\":true,\"services\":{},\"status\":\"Completed\",\"description\":\"jnxjkht\",\"properties\":{\"xfwkz\":\"vyouweui\",\"kqytkztadopgfzdg\":\"smsfbevyllznf\"},\"tags\":{\"svloyyhigq\":\"yc\"}},\"id\":\"juqwqajq\",\"name\":\"zxpixhyo\",\"type\":\"pnfdbgsosciene\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .jobs() - .list( - "hrbkhtmqowi", - "asfgqgucyhfaimqv", - "ruozkgyfp", - "oehgfmqmskkixvlz", - "xplhpeva", - ListViewType.ALL, - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("jnxjkht", response.iterator().next().properties().description()); - Assertions.assertEquals("vyouweui", response.iterator().next().properties().properties().get("xfwkz")); - Assertions.assertEquals("yc", response.iterator().next().properties().tags().get("svloyyhigq")); - Assertions.assertEquals("tvzjyi", response.iterator().next().properties().componentId()); - Assertions.assertEquals("bqrvvbqv", response.iterator().next().properties().computeId()); - Assertions.assertEquals("mpe", response.iterator().next().properties().displayName()); - Assertions.assertEquals("xgiqasifubn", response.iterator().next().properties().experimentName()); - Assertions.assertEquals(true, response.iterator().next().properties().isArchived()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/KubernetesPropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/KubernetesPropertiesTests.java deleted file mode 100644 index 8bfd89ba8ca1f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/KubernetesPropertiesTests.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.InstanceTypeSchema; -import com.azure.resourcemanager.machinelearning.models.InstanceTypeSchemaResources; -import com.azure.resourcemanager.machinelearning.models.KubernetesProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class KubernetesPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - KubernetesProperties model = - BinaryData - .fromString( - "{\"relayConnectionString\":\"oyuelyetn\",\"serviceBusConnectionString\":\"bf\",\"extensionPrincipalId\":\"ggagfln\",\"extensionInstanceReleaseTrain\":\"mtrwah\",\"vcName\":\"mu\",\"namespace\":\"tb\",\"defaultInstanceType\":\"plrohkpigq\",\"instanceTypes\":{\"nmg\":{\"nodeSelector\":{\"alhhjnhgwydyynfs\":\"kzmkwklsnoxaxmqe\",\"qtanarfdlpuk\":\"khgb\",\"neizjcpe\":\"py\"},\"resources\":{\"requests\":{},\"limits\":{}}},\"f\":{\"nodeSelector\":{\"fpazjzoywjxhpd\":\"uxddbhfh\",\"tehtuevrhrljyoog\":\"lontacnpq\",\"sd\":\"xh\",\"arenlvhhtklnvnaf\":\"ugwbsreurfqkf\"},\"resources\":{\"requests\":{},\"limits\":{}}}}}") - .toObject(KubernetesProperties.class); - Assertions.assertEquals("oyuelyetn", model.relayConnectionString()); - Assertions.assertEquals("bf", model.serviceBusConnectionString()); - Assertions.assertEquals("ggagfln", model.extensionPrincipalId()); - Assertions.assertEquals("mtrwah", model.extensionInstanceReleaseTrain()); - Assertions.assertEquals("mu", model.vcName()); - Assertions.assertEquals("tb", model.namespace()); - Assertions.assertEquals("plrohkpigq", model.defaultInstanceType()); - Assertions - .assertEquals("kzmkwklsnoxaxmqe", model.instanceTypes().get("nmg").nodeSelector().get("alhhjnhgwydyynfs")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - KubernetesProperties model = - new KubernetesProperties() - .withRelayConnectionString("oyuelyetn") - .withServiceBusConnectionString("bf") - .withExtensionPrincipalId("ggagfln") - .withExtensionInstanceReleaseTrain("mtrwah") - .withVcName("mu") - .withNamespace("tb") - .withDefaultInstanceType("plrohkpigq") - .withInstanceTypes( - mapOf( - "nmg", - new InstanceTypeSchema() - .withNodeSelector( - mapOf("alhhjnhgwydyynfs", "kzmkwklsnoxaxmqe", "qtanarfdlpuk", "khgb", "neizjcpe", "py")) - .withResources(new InstanceTypeSchemaResources().withRequests(mapOf()).withLimits(mapOf())), - "f", - new InstanceTypeSchema() - .withNodeSelector( - mapOf( - "fpazjzoywjxhpd", - "uxddbhfh", - "tehtuevrhrljyoog", - "lontacnpq", - "sd", - "xh", - "arenlvhhtklnvnaf", - "ugwbsreurfqkf")) - .withResources( - new InstanceTypeSchemaResources().withRequests(mapOf()).withLimits(mapOf())))); - model = BinaryData.fromObject(model).toObject(KubernetesProperties.class); - Assertions.assertEquals("oyuelyetn", model.relayConnectionString()); - Assertions.assertEquals("bf", model.serviceBusConnectionString()); - Assertions.assertEquals("ggagfln", model.extensionPrincipalId()); - Assertions.assertEquals("mtrwah", model.extensionInstanceReleaseTrain()); - Assertions.assertEquals("mu", model.vcName()); - Assertions.assertEquals("tb", model.namespace()); - Assertions.assertEquals("plrohkpigq", model.defaultInstanceType()); - Assertions - .assertEquals("kzmkwklsnoxaxmqe", model.instanceTypes().get("nmg").nodeSelector().get("alhhjnhgwydyynfs")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/KubernetesSchemaTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/KubernetesSchemaTests.java deleted file mode 100644 index 453e44acde53b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/KubernetesSchemaTests.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.InstanceTypeSchema; -import com.azure.resourcemanager.machinelearning.models.KubernetesProperties; -import com.azure.resourcemanager.machinelearning.models.KubernetesSchema; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class KubernetesSchemaTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - KubernetesSchema model = - BinaryData - .fromString( - "{\"properties\":{\"relayConnectionString\":\"j\",\"serviceBusConnectionString\":\"nuygbqeqqekewvnq\",\"extensionPrincipalId\":\"dlguaucmfdjwn\",\"extensionInstanceReleaseTrain\":\"xpunjqi\",\"vcName\":\"zvvitacgxmfcs\",\"namespace\":\"rxhtvso\",\"defaultInstanceType\":\"lwntsjgqrs\",\"instanceTypes\":{\"uuybnchrsz\":{\"nodeSelector\":{}}}}}") - .toObject(KubernetesSchema.class); - Assertions.assertEquals("j", model.properties().relayConnectionString()); - Assertions.assertEquals("nuygbqeqqekewvnq", model.properties().serviceBusConnectionString()); - Assertions.assertEquals("dlguaucmfdjwn", model.properties().extensionPrincipalId()); - Assertions.assertEquals("xpunjqi", model.properties().extensionInstanceReleaseTrain()); - Assertions.assertEquals("zvvitacgxmfcs", model.properties().vcName()); - Assertions.assertEquals("rxhtvso", model.properties().namespace()); - Assertions.assertEquals("lwntsjgqrs", model.properties().defaultInstanceType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - KubernetesSchema model = - new KubernetesSchema() - .withProperties( - new KubernetesProperties() - .withRelayConnectionString("j") - .withServiceBusConnectionString("nuygbqeqqekewvnq") - .withExtensionPrincipalId("dlguaucmfdjwn") - .withExtensionInstanceReleaseTrain("xpunjqi") - .withVcName("zvvitacgxmfcs") - .withNamespace("rxhtvso") - .withDefaultInstanceType("lwntsjgqrs") - .withInstanceTypes(mapOf("uuybnchrsz", new InstanceTypeSchema().withNodeSelector(mapOf())))); - model = BinaryData.fromObject(model).toObject(KubernetesSchema.class); - Assertions.assertEquals("j", model.properties().relayConnectionString()); - Assertions.assertEquals("nuygbqeqqekewvnq", model.properties().serviceBusConnectionString()); - Assertions.assertEquals("dlguaucmfdjwn", model.properties().extensionPrincipalId()); - Assertions.assertEquals("xpunjqi", model.properties().extensionInstanceReleaseTrain()); - Assertions.assertEquals("zvvitacgxmfcs", model.properties().vcName()); - Assertions.assertEquals("rxhtvso", model.properties().namespace()); - Assertions.assertEquals("lwntsjgqrs", model.properties().defaultInstanceType()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/KubernetesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/KubernetesTests.java deleted file mode 100644 index 57777282d3033..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/KubernetesTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.InstanceTypeSchema; -import com.azure.resourcemanager.machinelearning.models.Kubernetes; -import com.azure.resourcemanager.machinelearning.models.KubernetesProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class KubernetesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Kubernetes model = - BinaryData - .fromString( - "{\"computeType\":\"Kubernetes\",\"properties\":{\"relayConnectionString\":\"nfxofvcj\",\"serviceBusConnectionString\":\"dirazf\",\"extensionPrincipalId\":\"ejwabmdujtmvco\",\"extensionInstanceReleaseTrain\":\"xcmjurbu\",\"vcName\":\"lkyqltqsrog\",\"namespace\":\"wkffdjkt\",\"defaultInstanceType\":\"sidfv\",\"instanceTypes\":{\"n\":{\"nodeSelector\":{}}}},\"computeLocation\":\"ijtk\",\"provisioningState\":\"Succeeded\",\"description\":\"ogsf\",\"createdOn\":\"2021-05-31T19:57:24Z\",\"modifiedOn\":\"2021-02-04T08:33:30Z\",\"resourceId\":\"nsharujtjiqxfzyj\",\"provisioningErrors\":[],\"isAttachedCompute\":true,\"disableLocalAuth\":true}") - .toObject(Kubernetes.class); - Assertions.assertEquals("ijtk", model.computeLocation()); - Assertions.assertEquals("ogsf", model.description()); - Assertions.assertEquals("nsharujtjiqxfzyj", model.resourceId()); - Assertions.assertEquals(true, model.disableLocalAuth()); - Assertions.assertEquals("nfxofvcj", model.properties().relayConnectionString()); - Assertions.assertEquals("dirazf", model.properties().serviceBusConnectionString()); - Assertions.assertEquals("ejwabmdujtmvco", model.properties().extensionPrincipalId()); - Assertions.assertEquals("xcmjurbu", model.properties().extensionInstanceReleaseTrain()); - Assertions.assertEquals("lkyqltqsrog", model.properties().vcName()); - Assertions.assertEquals("wkffdjkt", model.properties().namespace()); - Assertions.assertEquals("sidfv", model.properties().defaultInstanceType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Kubernetes model = - new Kubernetes() - .withComputeLocation("ijtk") - .withDescription("ogsf") - .withResourceId("nsharujtjiqxfzyj") - .withDisableLocalAuth(true) - .withProperties( - new KubernetesProperties() - .withRelayConnectionString("nfxofvcj") - .withServiceBusConnectionString("dirazf") - .withExtensionPrincipalId("ejwabmdujtmvco") - .withExtensionInstanceReleaseTrain("xcmjurbu") - .withVcName("lkyqltqsrog") - .withNamespace("wkffdjkt") - .withDefaultInstanceType("sidfv") - .withInstanceTypes(mapOf("n", new InstanceTypeSchema().withNodeSelector(mapOf())))); - model = BinaryData.fromObject(model).toObject(Kubernetes.class); - Assertions.assertEquals("ijtk", model.computeLocation()); - Assertions.assertEquals("ogsf", model.description()); - Assertions.assertEquals("nsharujtjiqxfzyj", model.resourceId()); - Assertions.assertEquals(true, model.disableLocalAuth()); - Assertions.assertEquals("nfxofvcj", model.properties().relayConnectionString()); - Assertions.assertEquals("dirazf", model.properties().serviceBusConnectionString()); - Assertions.assertEquals("ejwabmdujtmvco", model.properties().extensionPrincipalId()); - Assertions.assertEquals("xcmjurbu", model.properties().extensionInstanceReleaseTrain()); - Assertions.assertEquals("lkyqltqsrog", model.properties().vcName()); - Assertions.assertEquals("wkffdjkt", model.properties().namespace()); - Assertions.assertEquals("sidfv", model.properties().defaultInstanceType()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ListAmlUserFeatureResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ListAmlUserFeatureResultTests.java deleted file mode 100644 index ba013607d7ff1..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ListAmlUserFeatureResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ListAmlUserFeatureResult; - -public final class ListAmlUserFeatureResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ListAmlUserFeatureResult model = - BinaryData - .fromString( - "{\"value\":[{\"id\":\"cvclxynpdk\",\"displayName\":\"fabuiyjibu\",\"description\":\"hdugneiknpg\"},{\"id\":\"gjiuqhibto\",\"displayName\":\"pqwjedm\",\"description\":\"r\"}],\"nextLink\":\"g\"}") - .toObject(ListAmlUserFeatureResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ListAmlUserFeatureResult model = new ListAmlUserFeatureResult(); - model = BinaryData.fromObject(model).toObject(ListAmlUserFeatureResult.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ListUsagesResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ListUsagesResultTests.java deleted file mode 100644 index cac57a0271876..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ListUsagesResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ListUsagesResult; - -public final class ListUsagesResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ListUsagesResult model = - BinaryData - .fromString( - "{\"value\":[{\"id\":\"rvqdra\",\"amlWorkspaceLocation\":\"jybige\",\"type\":\"qfbow\",\"unit\":\"Count\",\"currentValue\":4187351799054769848,\"limit\":8321881464692032483,\"name\":{\"value\":\"iywgqywgndrvynh\",\"localizedValue\":\"pphrcgynco\"}},{\"id\":\"ecfvmm\",\"amlWorkspaceLocation\":\"ofsx\",\"type\":\"evgbmqjq\",\"unit\":\"Count\",\"currentValue\":596965066352142059,\"limit\":4744542296757351266,\"name\":{\"value\":\"zuvccfwnfnbacfio\",\"localizedValue\":\"ebxetqgtzxdp\"}}],\"nextLink\":\"bqqwxrj\"}") - .toObject(ListUsagesResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ListUsagesResult model = new ListUsagesResult(); - model = BinaryData.fromObject(model).toObject(ListUsagesResult.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ListWorkspaceQuotasTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ListWorkspaceQuotasTests.java deleted file mode 100644 index b8f8b806a1734..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ListWorkspaceQuotasTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ListWorkspaceQuotas; - -public final class ListWorkspaceQuotasTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ListWorkspaceQuotas model = - BinaryData - .fromString( - "{\"value\":[{\"id\":\"gidyjrrf\",\"amlWorkspaceLocation\":\"aos\",\"type\":\"xc\",\"name\":{\"value\":\"pclhocohslk\",\"localizedValue\":\"leggzfbu\"},\"limit\":5326513191162029025,\"unit\":\"Count\"},{\"id\":\"k\",\"amlWorkspaceLocation\":\"eiithlvmez\",\"type\":\"shxmzsbbzoggigrx\",\"name\":{\"value\":\"rvjx\",\"localizedValue\":\"nspydptkoenkoukn\"},\"limit\":5351704758336650999,\"unit\":\"Count\"},{\"id\":\"kbldngkpocipa\",\"amlWorkspaceLocation\":\"xoegukgjnpiucgy\",\"type\":\"vqzntypmrbpizcdr\",\"name\":{\"value\":\"dpydn\",\"localizedValue\":\"hxdeoejz\"},\"limit\":731748747615090484,\"unit\":\"Count\"}],\"nextLink\":\"ttgzfbis\"}") - .toObject(ListWorkspaceQuotas.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ListWorkspaceQuotas model = new ListWorkspaceQuotas(); - model = BinaryData.fromObject(model).toObject(ListWorkspaceQuotas.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/LiteralJobInputTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/LiteralJobInputTests.java deleted file mode 100644 index f129857a63a06..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/LiteralJobInputTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.LiteralJobInput; -import org.junit.jupiter.api.Assertions; - -public final class LiteralJobInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LiteralJobInput model = - BinaryData - .fromString("{\"jobInputType\":\"literal\",\"value\":\"mabeddqilwgdf\",\"description\":\"qfp\"}") - .toObject(LiteralJobInput.class); - Assertions.assertEquals("qfp", model.description()); - Assertions.assertEquals("mabeddqilwgdf", model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LiteralJobInput model = new LiteralJobInput().withDescription("qfp").withValue("mabeddqilwgdf"); - model = BinaryData.fromObject(model).toObject(LiteralJobInput.class); - Assertions.assertEquals("qfp", model.description()); - Assertions.assertEquals("mabeddqilwgdf", model.value()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MLFlowModelJobInputTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MLFlowModelJobInputTests.java deleted file mode 100644 index 3ea54481c38d8..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MLFlowModelJobInputTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.MLFlowModelJobInput; -import org.junit.jupiter.api.Assertions; - -public final class MLFlowModelJobInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MLFlowModelJobInput model = - BinaryData - .fromString( - "{\"jobInputType\":\"mlflow_model\",\"mode\":\"Direct\",\"uri\":\"vdmvxadqa\",\"description\":\"rgnawbabgfbk\"}") - .toObject(MLFlowModelJobInput.class); - Assertions.assertEquals("rgnawbabgfbk", model.description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.mode()); - Assertions.assertEquals("vdmvxadqa", model.uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MLFlowModelJobInput model = - new MLFlowModelJobInput() - .withDescription("rgnawbabgfbk") - .withMode(InputDeliveryMode.DIRECT) - .withUri("vdmvxadqa"); - model = BinaryData.fromObject(model).toObject(MLFlowModelJobInput.class); - Assertions.assertEquals("rgnawbabgfbk", model.description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.mode()); - Assertions.assertEquals("vdmvxadqa", model.uri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MLFlowModelJobOutputTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MLFlowModelJobOutputTests.java deleted file mode 100644 index f145c68c42973..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MLFlowModelJobOutputTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.MLFlowModelJobOutput; -import com.azure.resourcemanager.machinelearning.models.OutputDeliveryMode; -import org.junit.jupiter.api.Assertions; - -public final class MLFlowModelJobOutputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MLFlowModelJobOutput model = - BinaryData - .fromString( - "{\"jobOutputType\":\"mlflow_model\",\"mode\":\"Upload\",\"uri\":\"twmlmhjnqtqeah\",\"description\":\"dvragpokddxejhh\"}") - .toObject(MLFlowModelJobOutput.class); - Assertions.assertEquals("dvragpokddxejhh", model.description()); - Assertions.assertEquals(OutputDeliveryMode.UPLOAD, model.mode()); - Assertions.assertEquals("twmlmhjnqtqeah", model.uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MLFlowModelJobOutput model = - new MLFlowModelJobOutput() - .withDescription("dvragpokddxejhh") - .withMode(OutputDeliveryMode.UPLOAD) - .withUri("twmlmhjnqtqeah"); - model = BinaryData.fromObject(model).toObject(MLFlowModelJobOutput.class); - Assertions.assertEquals("dvragpokddxejhh", model.description()); - Assertions.assertEquals(OutputDeliveryMode.UPLOAD, model.mode()); - Assertions.assertEquals("twmlmhjnqtqeah", model.uri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MLTableDataTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MLTableDataTests.java deleted file mode 100644 index d878fc90c2169..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MLTableDataTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.MLTableData; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class MLTableDataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MLTableData model = - BinaryData - .fromString( - "{\"dataType\":\"mltable\",\"referencedUris\":[\"uavt\",\"tbkewkqynspg\"],\"dataUri\":\"voffbkkwvdxae\",\"isAnonymous\":false,\"isArchived\":false,\"description\":\"rlj\",\"properties\":{\"lpbcjtrpz\":\"zbnobr\",\"qelwgdhuruzytza\":\"yudivbxnhsqeaeo\",\"mpinmzvfkneerzzt\":\"ogatmoljiy\",\"bnhrxlelfjhkeiz\":\"knsjulugd\"},\"tags\":{\"wjekptycaydbj\":\"htdm\"}}") - .toObject(MLTableData.class); - Assertions.assertEquals("rlj", model.description()); - Assertions.assertEquals("zbnobr", model.properties().get("lpbcjtrpz")); - Assertions.assertEquals("htdm", model.tags().get("wjekptycaydbj")); - Assertions.assertEquals(false, model.isAnonymous()); - Assertions.assertEquals(false, model.isArchived()); - Assertions.assertEquals("voffbkkwvdxae", model.dataUri()); - Assertions.assertEquals("uavt", model.referencedUris().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MLTableData model = - new MLTableData() - .withDescription("rlj") - .withProperties( - mapOf( - "lpbcjtrpz", - "zbnobr", - "qelwgdhuruzytza", - "yudivbxnhsqeaeo", - "mpinmzvfkneerzzt", - "ogatmoljiy", - "bnhrxlelfjhkeiz", - "knsjulugd")) - .withTags(mapOf("wjekptycaydbj", "htdm")) - .withIsAnonymous(false) - .withIsArchived(false) - .withDataUri("voffbkkwvdxae") - .withReferencedUris(Arrays.asList("uavt", "tbkewkqynspg")); - model = BinaryData.fromObject(model).toObject(MLTableData.class); - Assertions.assertEquals("rlj", model.description()); - Assertions.assertEquals("zbnobr", model.properties().get("lpbcjtrpz")); - Assertions.assertEquals("htdm", model.tags().get("wjekptycaydbj")); - Assertions.assertEquals(false, model.isAnonymous()); - Assertions.assertEquals(false, model.isArchived()); - Assertions.assertEquals("voffbkkwvdxae", model.dataUri()); - Assertions.assertEquals("uavt", model.referencedUris().get(0)); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MLTableJobInputTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MLTableJobInputTests.java deleted file mode 100644 index b3dc0b4dc534e..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MLTableJobInputTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import org.junit.jupiter.api.Assertions; - -public final class MLTableJobInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MLTableJobInput model = - BinaryData - .fromString( - "{\"jobInputType\":\"mltable\",\"mode\":\"Direct\",\"uri\":\"pqinf\",\"description\":\"pyglqdhmrjzral\"}") - .toObject(MLTableJobInput.class); - Assertions.assertEquals("pyglqdhmrjzral", model.description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.mode()); - Assertions.assertEquals("pqinf", model.uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MLTableJobInput model = - new MLTableJobInput().withDescription("pyglqdhmrjzral").withMode(InputDeliveryMode.DIRECT).withUri("pqinf"); - model = BinaryData.fromObject(model).toObject(MLTableJobInput.class); - Assertions.assertEquals("pyglqdhmrjzral", model.description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.mode()); - Assertions.assertEquals("pqinf", model.uri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MLTableJobOutputTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MLTableJobOutputTests.java deleted file mode 100644 index 5c66587aba526..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MLTableJobOutputTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.MLTableJobOutput; -import com.azure.resourcemanager.machinelearning.models.OutputDeliveryMode; -import org.junit.jupiter.api.Assertions; - -public final class MLTableJobOutputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MLTableJobOutput model = - BinaryData - .fromString( - "{\"jobOutputType\":\"mltable\",\"mode\":\"ReadWriteMount\",\"uri\":\"mlcfnzhmhsurl\",\"description\":\"qkpmmzpstau\"}") - .toObject(MLTableJobOutput.class); - Assertions.assertEquals("qkpmmzpstau", model.description()); - Assertions.assertEquals(OutputDeliveryMode.READ_WRITE_MOUNT, model.mode()); - Assertions.assertEquals("mlcfnzhmhsurl", model.uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MLTableJobOutput model = - new MLTableJobOutput() - .withDescription("qkpmmzpstau") - .withMode(OutputDeliveryMode.READ_WRITE_MOUNT) - .withUri("mlcfnzhmhsurl"); - model = BinaryData.fromObject(model).toObject(MLTableJobOutput.class); - Assertions.assertEquals("qkpmmzpstau", model.description()); - Assertions.assertEquals(OutputDeliveryMode.READ_WRITE_MOUNT, model.mode()); - Assertions.assertEquals("mlcfnzhmhsurl", model.uri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ManagedIdentityTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ManagedIdentityTests.java deleted file mode 100644 index cd00ea9d950cf..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ManagedIdentityTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ManagedIdentity; -import java.util.UUID; -import org.junit.jupiter.api.Assertions; - -public final class ManagedIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ManagedIdentity model = - BinaryData - .fromString( - "{\"identityType\":\"Managed\",\"clientId\":\"49930aac-491a-4ce3-99bb-f763f6db3ac3\",\"objectId\":\"2fd57264-6306-4a7e-bd5d-0d45048516e5\",\"resourceId\":\"clg\"}") - .toObject(ManagedIdentity.class); - Assertions.assertEquals(UUID.fromString("49930aac-491a-4ce3-99bb-f763f6db3ac3"), model.clientId()); - Assertions.assertEquals(UUID.fromString("2fd57264-6306-4a7e-bd5d-0d45048516e5"), model.objectId()); - Assertions.assertEquals("clg", model.resourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagedIdentity model = - new ManagedIdentity() - .withClientId(UUID.fromString("49930aac-491a-4ce3-99bb-f763f6db3ac3")) - .withObjectId(UUID.fromString("2fd57264-6306-4a7e-bd5d-0d45048516e5")) - .withResourceId("clg"); - model = BinaryData.fromObject(model).toObject(ManagedIdentity.class); - Assertions.assertEquals(UUID.fromString("49930aac-491a-4ce3-99bb-f763f6db3ac3"), model.clientId()); - Assertions.assertEquals(UUID.fromString("2fd57264-6306-4a7e-bd5d-0d45048516e5"), model.objectId()); - Assertions.assertEquals("clg", model.resourceId()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ManagedServiceIdentityTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ManagedServiceIdentityTests.java deleted file mode 100644 index 1109f7fc49d4e..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ManagedServiceIdentityTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.UserAssignedIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ManagedServiceIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ManagedServiceIdentity model = - BinaryData - .fromString( - "{\"principalId\":\"eedebc97-7cf9-49d6-8058-af89513b30b7\",\"tenantId\":\"022e8374-0d41-4bc5-8365-0eb3372a635f\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"ginuvamih\":{\"principalId\":\"f6324d70-bc8b-4552-95e1-03d0c14617f7\",\"clientId\":\"334d5ff8-4410-4858-b84d-54862312e602\"}}}") - .toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagedServiceIdentity model = - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("ginuvamih", new UserAssignedIdentity())); - model = BinaryData.fromObject(model).toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.type()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MedianStoppingPolicyTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MedianStoppingPolicyTests.java deleted file mode 100644 index 36f27a2eb5f25..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MedianStoppingPolicyTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.MedianStoppingPolicy; -import org.junit.jupiter.api.Assertions; - -public final class MedianStoppingPolicyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MedianStoppingPolicy model = - BinaryData - .fromString( - "{\"policyType\":\"MedianStopping\",\"delayEvaluation\":2026820948,\"evaluationInterval\":660103653}") - .toObject(MedianStoppingPolicy.class); - Assertions.assertEquals(2026820948, model.delayEvaluation()); - Assertions.assertEquals(660103653, model.evaluationInterval()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MedianStoppingPolicy model = - new MedianStoppingPolicy().withDelayEvaluation(2026820948).withEvaluationInterval(660103653); - model = BinaryData.fromObject(model).toObject(MedianStoppingPolicy.class); - Assertions.assertEquals(2026820948, model.delayEvaluation()); - Assertions.assertEquals(660103653, model.evaluationInterval()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainerInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainerInnerTests.java deleted file mode 100644 index b1dce75cdfb41..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainerInnerTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.ModelContainerInner; -import com.azure.resourcemanager.machinelearning.models.ModelContainerProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ModelContainerInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ModelContainerInner model = - BinaryData - .fromString( - "{\"properties\":{\"isArchived\":false,\"latestVersion\":\"gaqvlgafcqusrd\",\"nextVersion\":\"t\",\"description\":\"sdtutnwlduyc\",\"properties\":{\"kuqgsjjxundxgket\":\"hyrmewipmvekdx\",\"gpmuneqsxvmhfbuz\":\"zhhzjhfjmhvvmu\",\"ms\":\"yihsasbhudypohyu\"},\"tags\":{\"pfoobr\":\"sqy\",\"qdnfwqzdz\":\"ttymsjny\",\"fhqlyvi\":\"tilaxh\",\"ti\":\"ouwivkxoyzunbixx\"}},\"id\":\"cpwpg\",\"name\":\"lrcivtsoxfrke\",\"type\":\"xpmyyefrpmpdnq\"}") - .toObject(ModelContainerInner.class); - Assertions.assertEquals("sdtutnwlduyc", model.properties().description()); - Assertions.assertEquals("hyrmewipmvekdx", model.properties().properties().get("kuqgsjjxundxgket")); - Assertions.assertEquals("sqy", model.properties().tags().get("pfoobr")); - Assertions.assertEquals(false, model.properties().isArchived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ModelContainerInner model = - new ModelContainerInner() - .withProperties( - new ModelContainerProperties() - .withDescription("sdtutnwlduyc") - .withProperties( - mapOf( - "kuqgsjjxundxgket", - "hyrmewipmvekdx", - "gpmuneqsxvmhfbuz", - "zhhzjhfjmhvvmu", - "ms", - "yihsasbhudypohyu")) - .withTags( - mapOf( - "pfoobr", - "sqy", - "qdnfwqzdz", - "ttymsjny", - "fhqlyvi", - "tilaxh", - "ti", - "ouwivkxoyzunbixx")) - .withIsArchived(false)); - model = BinaryData.fromObject(model).toObject(ModelContainerInner.class); - Assertions.assertEquals("sdtutnwlduyc", model.properties().description()); - Assertions.assertEquals("hyrmewipmvekdx", model.properties().properties().get("kuqgsjjxundxgket")); - Assertions.assertEquals("sqy", model.properties().tags().get("pfoobr")); - Assertions.assertEquals(false, model.properties().isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainerPropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainerPropertiesTests.java deleted file mode 100644 index db0008fce8e14..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainerPropertiesTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ModelContainerProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ModelContainerPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ModelContainerProperties model = - BinaryData - .fromString( - "{\"isArchived\":false,\"latestVersion\":\"waoqvmmb\",\"nextVersion\":\"qfr\",\"description\":\"lkzmegnitgvkxl\",\"properties\":{\"gcealzxwh\":\"drf\",\"yqhlwigdivbkbx\":\"ansym\",\"wasqvdaeyyg\":\"omfaj\",\"zkgimsid\":\"xakjsqzhzb\"},\"tags\":{\"hpqgatjeaahhvj\":\"icddyvvjskgfmocw\",\"jjidjk\":\"hnakzyb\"}}") - .toObject(ModelContainerProperties.class); - Assertions.assertEquals("lkzmegnitgvkxl", model.description()); - Assertions.assertEquals("drf", model.properties().get("gcealzxwh")); - Assertions.assertEquals("icddyvvjskgfmocw", model.tags().get("hpqgatjeaahhvj")); - Assertions.assertEquals(false, model.isArchived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ModelContainerProperties model = - new ModelContainerProperties() - .withDescription("lkzmegnitgvkxl") - .withProperties( - mapOf( - "gcealzxwh", - "drf", - "yqhlwigdivbkbx", - "ansym", - "wasqvdaeyyg", - "omfaj", - "zkgimsid", - "xakjsqzhzb")) - .withTags(mapOf("hpqgatjeaahhvj", "icddyvvjskgfmocw", "jjidjk", "hnakzyb")) - .withIsArchived(false); - model = BinaryData.fromObject(model).toObject(ModelContainerProperties.class); - Assertions.assertEquals("lkzmegnitgvkxl", model.description()); - Assertions.assertEquals("drf", model.properties().get("gcealzxwh")); - Assertions.assertEquals("icddyvvjskgfmocw", model.tags().get("hpqgatjeaahhvj")); - Assertions.assertEquals(false, model.isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainerResourceArmPaginatedResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainerResourceArmPaginatedResultTests.java deleted file mode 100644 index f1278bd93c0a8..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainerResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.ModelContainerInner; -import com.azure.resourcemanager.machinelearning.models.ModelContainerProperties; -import com.azure.resourcemanager.machinelearning.models.ModelContainerResourceArmPaginatedResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ModelContainerResourceArmPaginatedResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ModelContainerResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"nextLink\":\"m\",\"value\":[{\"properties\":{\"isArchived\":false,\"latestVersion\":\"iwrxgkn\",\"nextVersion\":\"vyi\",\"description\":\"qodfvp\",\"properties\":{},\"tags\":{}},\"id\":\"xgsg\",\"name\":\"p\",\"type\":\"gzdjtxvzf\"}]}") - .toObject(ModelContainerResourceArmPaginatedResult.class); - Assertions.assertEquals("m", model.nextLink()); - Assertions.assertEquals("qodfvp", model.value().get(0).properties().description()); - Assertions.assertEquals(false, model.value().get(0).properties().isArchived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ModelContainerResourceArmPaginatedResult model = - new ModelContainerResourceArmPaginatedResult() - .withNextLink("m") - .withValue( - Arrays - .asList( - new ModelContainerInner() - .withProperties( - new ModelContainerProperties() - .withDescription("qodfvp") - .withProperties(mapOf()) - .withTags(mapOf()) - .withIsArchived(false)))); - model = BinaryData.fromObject(model).toObject(ModelContainerResourceArmPaginatedResult.class); - Assertions.assertEquals("m", model.nextLink()); - Assertions.assertEquals("qodfvp", model.value().get(0).properties().description()); - Assertions.assertEquals(false, model.value().get(0).properties().isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersCreateOrUpdateWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index da6ac506a5730..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ModelContainer; -import com.azure.resourcemanager.machinelearning.models.ModelContainerProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ModelContainersCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"isArchived\":true,\"latestVersion\":\"ucfzluczdquu\",\"nextVersion\":\"ormvh\",\"description\":\"ielbprnq\",\"properties\":{\"nwsvhbngqiwye\":\"wzcqygg\",\"kunsbfjhhlwtpkv\":\"tobdrrpnre\",\"z\":\"geattbzkg\"},\"tags\":{\"x\":\"qsttewuvcysjeuf\",\"uxlvrhprrvbwonl\":\"lpditfnonpi\",\"huy\":\"qflvtlrvbst\"}},\"id\":\"n\",\"name\":\"nttlnrjd\",\"type\":\"zdbuzici\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ModelContainer response = - manager - .modelContainers() - .define("iuepmaxfnzlpqmp") - .withExistingWorkspace("kvy", "fbqvumkxqj") - .withProperties( - new ModelContainerProperties() - .withDescription("rhfcaeooifqdyw") - .withProperties(mapOf("corkfrocgbmxl", "obhahqmomf", "zezbjes", "j")) - .withTags(mapOf("fygpnyhgd", "lurb", "a", "uqs", "y", "qyvoupr")) - .withIsArchived(false)) - .create(); - - Assertions.assertEquals("ielbprnq", response.properties().description()); - Assertions.assertEquals("wzcqygg", response.properties().properties().get("nwsvhbngqiwye")); - Assertions.assertEquals("qsttewuvcysjeuf", response.properties().tags().get("x")); - Assertions.assertEquals(true, response.properties().isArchived()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersDeleteWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersDeleteWithResponseMockTests.java deleted file mode 100644 index e845861d1b84d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersDeleteWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ModelContainersDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .modelContainers() - .deleteWithResponse("dwsngkr", "ihscjvakmhzbhw", "hf", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersGetWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersGetWithResponseMockTests.java deleted file mode 100644 index ad48156c20db2..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersGetWithResponseMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ModelContainer; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ModelContainersGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"isArchived\":true,\"latestVersion\":\"yrletndqlmf\",\"nextVersion\":\"gnbbuypwovvvsfle\",\"description\":\"noqayrehjuqwvap\",\"properties\":{\"qzubfonfd\":\"zhpzihacenqqzlx\",\"jcw\":\"gmkfw\",\"zl\":\"ewfhxwyrkbre\"},\"tags\":{\"mkaeplrajubow\":\"jpch\",\"aoklfnis\":\"ywevtjrieikmw\",\"tjcyyuv\":\"xgucbmtredscnn\",\"ecwwtz\":\"zrxzhc\"}},\"id\":\"cloyhy\",\"name\":\"pgidhzgyresgzsdt\",\"type\":\"wbyorjplbchych\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ModelContainer response = - manager - .modelContainers() - .getWithResponse("wihbnnxemv", "nuqqkotauratnicp", "fzs", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("noqayrehjuqwvap", response.properties().description()); - Assertions.assertEquals("zhpzihacenqqzlx", response.properties().properties().get("qzubfonfd")); - Assertions.assertEquals("jpch", response.properties().tags().get("mkaeplrajubow")); - Assertions.assertEquals(true, response.properties().isArchived()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersListMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersListMockTests.java deleted file mode 100644 index 2dfc509206074..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelContainersListMockTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ListViewType; -import com.azure.resourcemanager.machinelearning.models.ModelContainer; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ModelContainersListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"isArchived\":true,\"latestVersion\":\"d\",\"nextVersion\":\"palvngtw\",\"description\":\"skwgqr\",\"properties\":{\"zuppiyx\":\"umdrcjlvkrkegty\"},\"tags\":{\"eqzqvabmhvs\":\"iydd\",\"ewxtrl\":\"xduetbapfc\",\"kjpirgzxvbczw\":\"bpxya\",\"i\":\"yegbthms\"}},\"id\":\"buiggrunozf\",\"name\":\"u\",\"type\":\"ljthoiv\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .modelContainers() - .list("xlxicwgp", "hdcfm", "z", 1474735813, ListViewType.ACTIVE_ONLY, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("skwgqr", response.iterator().next().properties().description()); - Assertions.assertEquals("umdrcjlvkrkegty", response.iterator().next().properties().properties().get("zuppiyx")); - Assertions.assertEquals("iydd", response.iterator().next().properties().tags().get("eqzqvabmhvs")); - Assertions.assertEquals(true, response.iterator().next().properties().isArchived()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionInnerTests.java deleted file mode 100644 index 7c9bfac16a2e8..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionInnerTests.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.ModelVersionInner; -import com.azure.resourcemanager.machinelearning.models.FlavorData; -import com.azure.resourcemanager.machinelearning.models.ModelVersionProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ModelVersionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ModelVersionInner model = - BinaryData - .fromString( - "{\"properties\":{\"flavors\":{\"ckknhxkizvy\":{\"data\":{}},\"rzvul\":{\"data\":{}},\"aaeranokqgukk\":{\"data\":{}},\"nvbroylaxx\":{\"data\":{}}},\"jobName\":\"cdisd\",\"modelType\":\"fj\",\"modelUri\":\"svgjrwhryvy\",\"isAnonymous\":false,\"isArchived\":false,\"description\":\"xgccknfnw\",\"properties\":{\"dxihc\":\"mvpdvjdhttzaef\",\"bg\":\"rphkmcrjdqnsdfz\",\"euutlwxezwzh\":\"gkylkdghr\"},\"tags\":{\"ehgpp\":\"bwnhhtql\",\"csheafidltugsr\":\"pifhpfeoajvgcxtx\"}},\"id\":\"mks\",\"name\":\"jhoiftxfkfweg\",\"type\":\"rhptilluc\"}") - .toObject(ModelVersionInner.class); - Assertions.assertEquals("xgccknfnw", model.properties().description()); - Assertions.assertEquals("mvpdvjdhttzaef", model.properties().properties().get("dxihc")); - Assertions.assertEquals("bwnhhtql", model.properties().tags().get("ehgpp")); - Assertions.assertEquals(false, model.properties().isAnonymous()); - Assertions.assertEquals(false, model.properties().isArchived()); - Assertions.assertEquals("cdisd", model.properties().jobName()); - Assertions.assertEquals("fj", model.properties().modelType()); - Assertions.assertEquals("svgjrwhryvy", model.properties().modelUri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ModelVersionInner model = - new ModelVersionInner() - .withProperties( - new ModelVersionProperties() - .withDescription("xgccknfnw") - .withProperties( - mapOf("dxihc", "mvpdvjdhttzaef", "bg", "rphkmcrjdqnsdfz", "euutlwxezwzh", "gkylkdghr")) - .withTags(mapOf("ehgpp", "bwnhhtql", "csheafidltugsr", "pifhpfeoajvgcxtx")) - .withIsAnonymous(false) - .withIsArchived(false) - .withFlavors( - mapOf( - "ckknhxkizvy", - new FlavorData().withData(mapOf()), - "rzvul", - new FlavorData().withData(mapOf()), - "aaeranokqgukk", - new FlavorData().withData(mapOf()), - "nvbroylaxx", - new FlavorData().withData(mapOf()))) - .withJobName("cdisd") - .withModelType("fj") - .withModelUri("svgjrwhryvy")); - model = BinaryData.fromObject(model).toObject(ModelVersionInner.class); - Assertions.assertEquals("xgccknfnw", model.properties().description()); - Assertions.assertEquals("mvpdvjdhttzaef", model.properties().properties().get("dxihc")); - Assertions.assertEquals("bwnhhtql", model.properties().tags().get("ehgpp")); - Assertions.assertEquals(false, model.properties().isAnonymous()); - Assertions.assertEquals(false, model.properties().isArchived()); - Assertions.assertEquals("cdisd", model.properties().jobName()); - Assertions.assertEquals("fj", model.properties().modelType()); - Assertions.assertEquals("svgjrwhryvy", model.properties().modelUri()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionPropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionPropertiesTests.java deleted file mode 100644 index ebd2e8723618e..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionPropertiesTests.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.FlavorData; -import com.azure.resourcemanager.machinelearning.models.ModelVersionProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ModelVersionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ModelVersionProperties model = - BinaryData - .fromString( - "{\"flavors\":{\"a\":{\"data\":{\"sldrizetpwbral\":\"dqohmc\",\"qzmiza\":\"libph\"}},\"thwtzol\":{\"data\":{\"lhjlmuoyxprimr\":\"kjpdnjzhajo\",\"eislstvasylwx\":\"opteecj\",\"eoohguufuzboyj\":\"zaum\"}},\"zaapmudqmeqwi\":{\"data\":{\"lxveabfqx\":\"mwmdxmebwjscjpa\",\"ijddtvqc\":\"mwmqtibx\",\"jaeukmrsieekpn\":\"tad\"}}},\"jobName\":\"ibudqwy\",\"modelType\":\"beybpmzznrtffyaq\",\"modelUri\":\"mhh\",\"isAnonymous\":true,\"isArchived\":false,\"description\":\"hvseufuqyrx\",\"properties\":{\"sismjqfrddga\":\"cgq\",\"disyirnxz\":\"quhiosrsjuivf\",\"revkhgnlnzo\":\"czexrxzbujrtrhqv\"},\"tags\":{\"tszcofizehtdhgb\":\"rpiqywncv\",\"reljeamur\":\"k\",\"xlpm\":\"zmlovuanash\"}}") - .toObject(ModelVersionProperties.class); - Assertions.assertEquals("hvseufuqyrx", model.description()); - Assertions.assertEquals("cgq", model.properties().get("sismjqfrddga")); - Assertions.assertEquals("rpiqywncv", model.tags().get("tszcofizehtdhgb")); - Assertions.assertEquals(true, model.isAnonymous()); - Assertions.assertEquals(false, model.isArchived()); - Assertions.assertEquals("dqohmc", model.flavors().get("a").data().get("sldrizetpwbral")); - Assertions.assertEquals("ibudqwy", model.jobName()); - Assertions.assertEquals("beybpmzznrtffyaq", model.modelType()); - Assertions.assertEquals("mhh", model.modelUri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ModelVersionProperties model = - new ModelVersionProperties() - .withDescription("hvseufuqyrx") - .withProperties( - mapOf("sismjqfrddga", "cgq", "disyirnxz", "quhiosrsjuivf", "revkhgnlnzo", "czexrxzbujrtrhqv")) - .withTags(mapOf("tszcofizehtdhgb", "rpiqywncv", "reljeamur", "k", "xlpm", "zmlovuanash")) - .withIsAnonymous(true) - .withIsArchived(false) - .withFlavors( - mapOf( - "a", - new FlavorData().withData(mapOf("sldrizetpwbral", "dqohmc", "qzmiza", "libph")), - "thwtzol", - new FlavorData() - .withData( - mapOf( - "lhjlmuoyxprimr", - "kjpdnjzhajo", - "eislstvasylwx", - "opteecj", - "eoohguufuzboyj", - "zaum")), - "zaapmudqmeqwi", - new FlavorData() - .withData( - mapOf( - "lxveabfqx", "mwmdxmebwjscjpa", "ijddtvqc", "mwmqtibx", "jaeukmrsieekpn", "tad")))) - .withJobName("ibudqwy") - .withModelType("beybpmzznrtffyaq") - .withModelUri("mhh"); - model = BinaryData.fromObject(model).toObject(ModelVersionProperties.class); - Assertions.assertEquals("hvseufuqyrx", model.description()); - Assertions.assertEquals("cgq", model.properties().get("sismjqfrddga")); - Assertions.assertEquals("rpiqywncv", model.tags().get("tszcofizehtdhgb")); - Assertions.assertEquals(true, model.isAnonymous()); - Assertions.assertEquals(false, model.isArchived()); - Assertions.assertEquals("dqohmc", model.flavors().get("a").data().get("sldrizetpwbral")); - Assertions.assertEquals("ibudqwy", model.jobName()); - Assertions.assertEquals("beybpmzznrtffyaq", model.modelType()); - Assertions.assertEquals("mhh", model.modelUri()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionResourceArmPaginatedResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionResourceArmPaginatedResultTests.java deleted file mode 100644 index bc48204938a5b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.ModelVersionInner; -import com.azure.resourcemanager.machinelearning.models.ModelVersionProperties; -import com.azure.resourcemanager.machinelearning.models.ModelVersionResourceArmPaginatedResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ModelVersionResourceArmPaginatedResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ModelVersionResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"nextLink\":\"xkyxvxevblbj\",\"value\":[{\"properties\":{\"flavors\":{},\"jobName\":\"lageuaulxun\",\"modelType\":\"jbnkpp\",\"modelUri\":\"nenlsvxeizzg\",\"isAnonymous\":false,\"isArchived\":true,\"description\":\"mffeycxcktpi\",\"properties\":{},\"tags\":{}},\"id\":\"teeammxqiekkkzd\",\"name\":\"rtkgdojbmxvavref\",\"type\":\"eesvecu\"},{\"properties\":{\"flavors\":{},\"jobName\":\"xtxsuwprtujw\",\"modelType\":\"wddji\",\"modelUri\":\"bxv\",\"isAnonymous\":true,\"isArchived\":false,\"description\":\"zeexavoxtfgle\",\"properties\":{},\"tags\":{}},\"id\":\"qbw\",\"name\":\"ypq\",\"type\":\"gsfjac\"},{\"properties\":{\"flavors\":{},\"jobName\":\"hhxud\",\"modelType\":\"vodhtn\",\"modelUri\":\"rudhzmmesckdl\",\"isAnonymous\":true,\"isArchived\":true,\"description\":\"x\",\"properties\":{},\"tags\":{}},\"id\":\"cfxwmdbox\",\"name\":\"fgsftufqob\",\"type\":\"jln\"}]}") - .toObject(ModelVersionResourceArmPaginatedResult.class); - Assertions.assertEquals("xkyxvxevblbj", model.nextLink()); - Assertions.assertEquals("mffeycxcktpi", model.value().get(0).properties().description()); - Assertions.assertEquals(false, model.value().get(0).properties().isAnonymous()); - Assertions.assertEquals(true, model.value().get(0).properties().isArchived()); - Assertions.assertEquals("lageuaulxun", model.value().get(0).properties().jobName()); - Assertions.assertEquals("jbnkpp", model.value().get(0).properties().modelType()); - Assertions.assertEquals("nenlsvxeizzg", model.value().get(0).properties().modelUri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ModelVersionResourceArmPaginatedResult model = - new ModelVersionResourceArmPaginatedResult() - .withNextLink("xkyxvxevblbj") - .withValue( - Arrays - .asList( - new ModelVersionInner() - .withProperties( - new ModelVersionProperties() - .withDescription("mffeycxcktpi") - .withProperties(mapOf()) - .withTags(mapOf()) - .withIsAnonymous(false) - .withIsArchived(true) - .withFlavors(mapOf()) - .withJobName("lageuaulxun") - .withModelType("jbnkpp") - .withModelUri("nenlsvxeizzg")), - new ModelVersionInner() - .withProperties( - new ModelVersionProperties() - .withDescription("zeexavoxtfgle") - .withProperties(mapOf()) - .withTags(mapOf()) - .withIsAnonymous(true) - .withIsArchived(false) - .withFlavors(mapOf()) - .withJobName("xtxsuwprtujw") - .withModelType("wddji") - .withModelUri("bxv")), - new ModelVersionInner() - .withProperties( - new ModelVersionProperties() - .withDescription("x") - .withProperties(mapOf()) - .withTags(mapOf()) - .withIsAnonymous(true) - .withIsArchived(true) - .withFlavors(mapOf()) - .withJobName("hhxud") - .withModelType("vodhtn") - .withModelUri("rudhzmmesckdl")))); - model = BinaryData.fromObject(model).toObject(ModelVersionResourceArmPaginatedResult.class); - Assertions.assertEquals("xkyxvxevblbj", model.nextLink()); - Assertions.assertEquals("mffeycxcktpi", model.value().get(0).properties().description()); - Assertions.assertEquals(false, model.value().get(0).properties().isAnonymous()); - Assertions.assertEquals(true, model.value().get(0).properties().isArchived()); - Assertions.assertEquals("lageuaulxun", model.value().get(0).properties().jobName()); - Assertions.assertEquals("jbnkpp", model.value().get(0).properties().modelType()); - Assertions.assertEquals("nenlsvxeizzg", model.value().get(0).properties().modelUri()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsCreateOrUpdateWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index c8e1e71d6e400..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ModelVersion; -import com.azure.resourcemanager.machinelearning.models.ModelVersionProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ModelVersionsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"flavors\":{},\"jobName\":\"icjuft\",\"modelType\":\"iooanduewfhv\",\"modelUri\":\"jhxzubfjzabbwzgv\",\"isAnonymous\":false,\"isArchived\":true,\"description\":\"dckixspsaigavkmv\",\"properties\":{\"yetjxryo\":\"erejrkpzj\",\"pemnrrabo\":\"taeitwhlbecgihz\"},\"tags\":{\"pskpeswyhhmif\":\"wxywpjhspboxhif\",\"y\":\"uajxwwvcmmpeg\",\"exbzbqufpnezsjza\":\"qvcml\",\"dror\":\"m\"}},\"id\":\"ogzmsimehtcuuwdh\",\"name\":\"qqhyhnimxtns\",\"type\":\"gi\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ModelVersion response = - manager - .modelVersions() - .define("nmxynlsuqbwzst") - .withExistingModel("tfbjampq", "c", "a") - .withProperties( - new ModelVersionProperties() - .withDescription("okr") - .withProperties( - mapOf( - "pujzfl", "sgaojbtqpqsdoctp", "wlluunxhfwlfxz", "cdsgxceluji", "eupcknecexkgrv", "wu")) - .withTags( - mapOf( - "wawoxcgzbejqf", - "jdmngsytqpdzfyxc", - "xdwdrpazqjkrfm", - "ifopf", - "gtji", - "wotfcuu", - "cjjkmqenh", - "pgayiawohfmhnnzm")) - .withIsAnonymous(false) - .withIsArchived(true) - .withFlavors(mapOf()) - .withJobName("vpatrgjjk") - .withModelType("i") - .withModelUri("hoksmmculwk")) - .create(); - - Assertions.assertEquals("dckixspsaigavkmv", response.properties().description()); - Assertions.assertEquals("erejrkpzj", response.properties().properties().get("yetjxryo")); - Assertions.assertEquals("wxywpjhspboxhif", response.properties().tags().get("pskpeswyhhmif")); - Assertions.assertEquals(false, response.properties().isAnonymous()); - Assertions.assertEquals(true, response.properties().isArchived()); - Assertions.assertEquals("icjuft", response.properties().jobName()); - Assertions.assertEquals("iooanduewfhv", response.properties().modelType()); - Assertions.assertEquals("jhxzubfjzabbwzgv", response.properties().modelUri()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsDeleteWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsDeleteWithResponseMockTests.java deleted file mode 100644 index ccb3cf60148a0..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ModelVersionsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .modelVersions() - .deleteWithResponse( - "rmuhcuhtuzlx", "wyopgarpfctwrapc", "dojq", "vzesipiys", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsGetWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsGetWithResponseMockTests.java deleted file mode 100644 index 4e24bc5af0c30..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsGetWithResponseMockTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ModelVersion; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ModelVersionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"flavors\":{},\"jobName\":\"yrkqa\",\"modelType\":\"fajfreprfvmki\",\"modelUri\":\"teyrqshi\",\"isAnonymous\":false,\"isArchived\":true,\"description\":\"pylblfsprrwc\",\"properties\":{\"rdytzfslxizhq\":\"mtcvvf\",\"cdiiisklbonx\":\"kmgobliqe\"},\"tags\":{\"wkosnyxigf\":\"jxvtrkfkgenjqnnp\",\"kwopswnyinxupr\":\"ujjcxgdqmrlhn\",\"uekdcpvu\":\"xyxwjezbfqplo\"}},\"id\":\"rsvjmnsvujnjktv\",\"name\":\"lefcjis\",\"type\":\"pkdbx\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ModelVersion response = - manager - .modelVersions() - .getWithResponse( - "jqyowaadc", "dazabundtse", "kaupwhlz", "ckremgjlmsvdorsi", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("pylblfsprrwc", response.properties().description()); - Assertions.assertEquals("mtcvvf", response.properties().properties().get("rdytzfslxizhq")); - Assertions.assertEquals("jxvtrkfkgenjqnnp", response.properties().tags().get("wkosnyxigf")); - Assertions.assertEquals(false, response.properties().isAnonymous()); - Assertions.assertEquals(true, response.properties().isArchived()); - Assertions.assertEquals("yrkqa", response.properties().jobName()); - Assertions.assertEquals("fajfreprfvmki", response.properties().modelType()); - Assertions.assertEquals("teyrqshi", response.properties().modelUri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsListMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsListMockTests.java deleted file mode 100644 index 3ce927ed9a2aa..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ModelVersionsListMockTests.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ListViewType; -import com.azure.resourcemanager.machinelearning.models.ModelVersion; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ModelVersionsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"flavors\":{},\"jobName\":\"cjiwgsxfaio\",\"modelType\":\"dgujjgnfgrzxbarc\",\"modelUri\":\"aefzqsy\",\"isAnonymous\":false,\"isArchived\":true,\"description\":\"cytesmf\",\"properties\":{\"uauzmz\":\"tfodq\"},\"tags\":{\"udxdyyrudmahswt\":\"trfzhhezvh\",\"sgfenffdxb\":\"dkxbq\"}},\"id\":\"fqjchivdrij\",\"name\":\"nxndmuvardlmzjo\",\"type\":\"p\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .modelVersions() - .list( - "ppoqvgpnewuhwfwj", - "oxuo", - "tfnressfepgck", - "cjmgvsnvbtqdxfm", - "ym", - 253482079, - "hjluqllbsupubdx", - "kdlhzwhc", - 1124583033, - "vbosjj", - "dizhrjqfyaytvsly", - "kcgn", - ListViewType.ARCHIVED_ONLY, - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("cytesmf", response.iterator().next().properties().description()); - Assertions.assertEquals("tfodq", response.iterator().next().properties().properties().get("uauzmz")); - Assertions.assertEquals("trfzhhezvh", response.iterator().next().properties().tags().get("udxdyyrudmahswt")); - Assertions.assertEquals(false, response.iterator().next().properties().isAnonymous()); - Assertions.assertEquals(true, response.iterator().next().properties().isArchived()); - Assertions.assertEquals("cjiwgsxfaio", response.iterator().next().properties().jobName()); - Assertions.assertEquals("dgujjgnfgrzxbarc", response.iterator().next().properties().modelType()); - Assertions.assertEquals("aefzqsy", response.iterator().next().properties().modelUri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MpiTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MpiTests.java deleted file mode 100644 index 44975c7627f61..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/MpiTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.Mpi; -import org.junit.jupiter.api.Assertions; - -public final class MpiTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Mpi model = - BinaryData - .fromString("{\"distributionType\":\"Mpi\",\"processCountPerInstance\":589201934}") - .toObject(Mpi.class); - Assertions.assertEquals(589201934, model.processCountPerInstance()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Mpi model = new Mpi().withProcessCountPerInstance(589201934); - model = BinaryData.fromObject(model).toObject(Mpi.class); - Assertions.assertEquals(589201934, model.processCountPerInstance()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NCrossValidationsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NCrossValidationsTests.java deleted file mode 100644 index a68e62ee8d8bf..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NCrossValidationsTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.NCrossValidations; - -public final class NCrossValidationsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NCrossValidations model = - BinaryData.fromString("{\"mode\":\"NCrossValidations\"}").toObject(NCrossValidations.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NCrossValidations model = new NCrossValidations(); - model = BinaryData.fromObject(model).toObject(NCrossValidations.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NlpVerticalFeaturizationSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NlpVerticalFeaturizationSettingsTests.java deleted file mode 100644 index 2ee39e50710c6..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NlpVerticalFeaturizationSettingsTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.NlpVerticalFeaturizationSettings; -import org.junit.jupiter.api.Assertions; - -public final class NlpVerticalFeaturizationSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NlpVerticalFeaturizationSettings model = - BinaryData.fromString("{\"datasetLanguage\":\"ns\"}").toObject(NlpVerticalFeaturizationSettings.class); - Assertions.assertEquals("ns", model.datasetLanguage()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NlpVerticalFeaturizationSettings model = new NlpVerticalFeaturizationSettings().withDatasetLanguage("ns"); - model = BinaryData.fromObject(model).toObject(NlpVerticalFeaturizationSettings.class); - Assertions.assertEquals("ns", model.datasetLanguage()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NlpVerticalLimitSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NlpVerticalLimitSettingsTests.java deleted file mode 100644 index 772b65dcba64f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NlpVerticalLimitSettingsTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.NlpVerticalLimitSettings; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class NlpVerticalLimitSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NlpVerticalLimitSettings model = - BinaryData - .fromString("{\"maxConcurrentTrials\":422661668,\"maxTrials\":768209268,\"timeout\":\"PT230H9M19S\"}") - .toObject(NlpVerticalLimitSettings.class); - Assertions.assertEquals(422661668, model.maxConcurrentTrials()); - Assertions.assertEquals(768209268, model.maxTrials()); - Assertions.assertEquals(Duration.parse("PT230H9M19S"), model.timeout()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NlpVerticalLimitSettings model = - new NlpVerticalLimitSettings() - .withMaxConcurrentTrials(422661668) - .withMaxTrials(768209268) - .withTimeout(Duration.parse("PT230H9M19S")); - model = BinaryData.fromObject(model).toObject(NlpVerticalLimitSettings.class); - Assertions.assertEquals(422661668, model.maxConcurrentTrials()); - Assertions.assertEquals(768209268, model.maxTrials()); - Assertions.assertEquals(Duration.parse("PT230H9M19S"), model.timeout()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NlpVerticalTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NlpVerticalTests.java deleted file mode 100644 index e9e0709289f0b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NlpVerticalTests.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import com.azure.resourcemanager.machinelearning.models.NlpVertical; -import com.azure.resourcemanager.machinelearning.models.NlpVerticalFeaturizationSettings; -import com.azure.resourcemanager.machinelearning.models.NlpVerticalLimitSettings; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class NlpVerticalTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NlpVertical model = - BinaryData - .fromString( - "{\"featurizationSettings\":{\"datasetLanguage\":\"ubmomsgvvjh\"},\"limitSettings\":{\"maxConcurrentTrials\":1113718862,\"maxTrials\":1386794835,\"timeout\":\"PT207H58M31S\"},\"validationData\":{\"jobInputType\":\"mltable\",\"mode\":\"EvalDownload\",\"uri\":\"majnkd\",\"description\":\"q\"}}") - .toObject(NlpVertical.class); - Assertions.assertEquals("ubmomsgvvjh", model.featurizationSettings().datasetLanguage()); - Assertions.assertEquals(1113718862, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(1386794835, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT207H58M31S"), model.limitSettings().timeout()); - Assertions.assertEquals("q", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_DOWNLOAD, model.validationData().mode()); - Assertions.assertEquals("majnkd", model.validationData().uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NlpVertical model = - new NlpVertical() - .withFeaturizationSettings(new NlpVerticalFeaturizationSettings().withDatasetLanguage("ubmomsgvvjh")) - .withLimitSettings( - new NlpVerticalLimitSettings() - .withMaxConcurrentTrials(1113718862) - .withMaxTrials(1386794835) - .withTimeout(Duration.parse("PT207H58M31S"))) - .withValidationData( - new MLTableJobInput() - .withDescription("q") - .withMode(InputDeliveryMode.EVAL_DOWNLOAD) - .withUri("majnkd")); - model = BinaryData.fromObject(model).toObject(NlpVertical.class); - Assertions.assertEquals("ubmomsgvvjh", model.featurizationSettings().datasetLanguage()); - Assertions.assertEquals(1113718862, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(1386794835, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT207H58M31S"), model.limitSettings().timeout()); - Assertions.assertEquals("q", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_DOWNLOAD, model.validationData().mode()); - Assertions.assertEquals("majnkd", model.validationData().uri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NodeStateCountsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NodeStateCountsTests.java deleted file mode 100644 index a7c0d6a48f646..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NodeStateCountsTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.NodeStateCounts; - -public final class NodeStateCountsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NodeStateCounts model = - BinaryData - .fromString( - "{\"idleNodeCount\":1191856604,\"runningNodeCount\":715935859,\"preparingNodeCount\":2047901283,\"unusableNodeCount\":1346181735,\"leavingNodeCount\":1358224808,\"preemptedNodeCount\":304822445}") - .toObject(NodeStateCounts.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NodeStateCounts model = new NodeStateCounts(); - model = BinaryData.fromObject(model).toObject(NodeStateCounts.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NoneAuthTypeWorkspaceConnectionPropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NoneAuthTypeWorkspaceConnectionPropertiesTests.java deleted file mode 100644 index 5eae0e57bdc61..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/NoneAuthTypeWorkspaceConnectionPropertiesTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ConnectionCategory; -import com.azure.resourcemanager.machinelearning.models.NoneAuthTypeWorkspaceConnectionProperties; -import com.azure.resourcemanager.machinelearning.models.ValueFormat; -import org.junit.jupiter.api.Assertions; - -public final class NoneAuthTypeWorkspaceConnectionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NoneAuthTypeWorkspaceConnectionProperties model = - BinaryData - .fromString( - "{\"authType\":\"None\",\"category\":\"Git\",\"target\":\"lazipbhpwvq\",\"value\":\"ny\",\"valueFormat\":\"JSON\"}") - .toObject(NoneAuthTypeWorkspaceConnectionProperties.class); - Assertions.assertEquals(ConnectionCategory.GIT, model.category()); - Assertions.assertEquals("lazipbhpwvq", model.target()); - Assertions.assertEquals("ny", model.value()); - Assertions.assertEquals(ValueFormat.JSON, model.valueFormat()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NoneAuthTypeWorkspaceConnectionProperties model = - new NoneAuthTypeWorkspaceConnectionProperties() - .withCategory(ConnectionCategory.GIT) - .withTarget("lazipbhpwvq") - .withValue("ny") - .withValueFormat(ValueFormat.JSON); - model = BinaryData.fromObject(model).toObject(NoneAuthTypeWorkspaceConnectionProperties.class); - Assertions.assertEquals(ConnectionCategory.GIT, model.category()); - Assertions.assertEquals("lazipbhpwvq", model.target()); - Assertions.assertEquals("ny", model.value()); - Assertions.assertEquals(ValueFormat.JSON, model.valueFormat()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ObjectiveTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ObjectiveTests.java deleted file mode 100644 index 9dd9d12151240..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ObjectiveTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.Goal; -import com.azure.resourcemanager.machinelearning.models.Objective; -import org.junit.jupiter.api.Assertions; - -public final class ObjectiveTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Objective model = - BinaryData - .fromString("{\"goal\":\"Minimize\",\"primaryMetric\":\"qxjoshohtotryeg\"}") - .toObject(Objective.class); - Assertions.assertEquals(Goal.MINIMIZE, model.goal()); - Assertions.assertEquals("qxjoshohtotryeg", model.primaryMetric()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Objective model = new Objective().withGoal(Goal.MINIMIZE).withPrimaryMetric("qxjoshohtotryeg"); - model = BinaryData.fromObject(model).toObject(Objective.class); - Assertions.assertEquals(Goal.MINIMIZE, model.goal()); - Assertions.assertEquals("qxjoshohtotryeg", model.primaryMetric()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentTrackedResourceArmPaginatedResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentTrackedResourceArmPaginatedResultTests.java deleted file mode 100644 index a326c433a7b9f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentTrackedResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.OnlineDeploymentInner; -import com.azure.resourcemanager.machinelearning.models.EgressPublicNetworkAccessType; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.OnlineDeploymentProperties; -import com.azure.resourcemanager.machinelearning.models.OnlineDeploymentTrackedResourceArmPaginatedResult; -import com.azure.resourcemanager.machinelearning.models.Sku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class OnlineDeploymentTrackedResourceArmPaginatedResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OnlineDeploymentTrackedResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"nextLink\":\"rprsnm\",\"value\":[{\"identity\":{\"principalId\":\"4da85e2a-d4e0-4d4c-95ab-041badbdf8b9\",\"tenantId\":\"16df482c-d39e-4be2-9abe-ddba471908e5\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{}},\"kind\":\"lbkpb\",\"properties\":{\"endpointComputeType\":\"OnlineDeploymentProperties\",\"appInsightsEnabled\":false,\"egressPublicNetworkAccess\":\"Enabled\",\"instanceType\":\"jh\",\"model\":\"vechndbnwiehole\",\"modelMountPath\":\"wiuub\",\"provisioningState\":\"Succeeded\",\"description\":\"aqtferr\",\"environmentId\":\"ex\",\"environmentVariables\":{},\"properties\":{}},\"sku\":{\"name\":\"xap\",\"tier\":\"Free\",\"size\":\"qqnobpudcd\",\"family\":\"tqwpwya\",\"capacity\":2036163978},\"location\":\"sqbuc\",\"tags\":{\"sdaultxij\":\"kyexaoguyaipi\",\"qwazlnqnmcjngzq\":\"um\",\"sf\":\"qxtbjwgnyf\"},\"id\":\"svtui\",\"name\":\"zh\",\"type\":\"jqg\"},{\"identity\":{\"principalId\":\"0ddd2460-1f6c-4ca7-a3bb-8be70bc2fc6a\",\"tenantId\":\"a55475da-8d74-41aa-b7bd-fc2075054554\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"kind\":\"qryxyn\",\"properties\":{\"endpointComputeType\":\"OnlineDeploymentProperties\",\"appInsightsEnabled\":true,\"egressPublicNetworkAccess\":\"Disabled\",\"instanceType\":\"sovwxznptgoeiyb\",\"model\":\"pfhvfslk\",\"modelMountPath\":\"tjlrigjksky\",\"provisioningState\":\"Creating\",\"description\":\"sxwaabzm\",\"environmentId\":\"rygznmmaxriz\",\"environmentVariables\":{},\"properties\":{}},\"sku\":{\"name\":\"gopxlhslnelxie\",\"tier\":\"Basic\",\"size\":\"llxecwc\",\"family\":\"jphslhcaw\",\"capacity\":224494261},\"location\":\"fdwfmvigorqj\",\"tags\":{\"n\":\"zhraglkafh\"},\"id\":\"juj\",\"name\":\"ickpz\",\"type\":\"cpopmxel\"},{\"identity\":{\"principalId\":\"0f14930d-5df5-4097-9b70-8c82d3a4bfcb\",\"tenantId\":\"bbf6d45e-ad6b-4e4a-97f7-a7c3941dcbf1\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{}},\"kind\":\"edexxmlfm\",\"properties\":{\"endpointComputeType\":\"OnlineDeploymentProperties\",\"appInsightsEnabled\":true,\"egressPublicNetworkAccess\":\"Enabled\",\"instanceType\":\"uawxtzx\",\"model\":\"mwabzxrvxc\",\"modelMountPath\":\"hsphaivmxyas\",\"provisioningState\":\"Deleting\",\"description\":\"ywakoihk\",\"environmentId\":\"mjblmljhlny\",\"environmentVariables\":{},\"properties\":{}},\"sku\":{\"name\":\"qyryuzcbmqqvxm\",\"tier\":\"Standard\",\"size\":\"tayx\",\"family\":\"supe\",\"capacity\":2074822274},\"location\":\"qnhcvsqltnzoibg\",\"tags\":{\"qoxwd\":\"nxfyqonm\"},\"id\":\"fdbxiqxeiiqbim\",\"name\":\"tmwwi\",\"type\":\"h\"},{\"identity\":{\"principalId\":\"8b9a4105-dd9b-43ff-91e1-ba1a28c9f57b\",\"tenantId\":\"2a050a31-f610-475f-948f-53b51c0d42ca\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{}},\"kind\":\"vwbcblembnkbwv\",\"properties\":{\"endpointComputeType\":\"OnlineDeploymentProperties\",\"appInsightsEnabled\":false,\"egressPublicNetworkAccess\":\"Enabled\",\"instanceType\":\"vqihebwtswbzuwf\",\"model\":\"ragegi\",\"modelMountPath\":\"cjfelisdjubgg\",\"provisioningState\":\"Failed\",\"description\":\"sazgakgacyrcmj\",\"environmentId\":\"spofapvuhry\",\"environmentVariables\":{},\"properties\":{}},\"sku\":{\"name\":\"frzgbzjed\",\"tier\":\"Premium\",\"size\":\"vnlvxbcuiiznktwf\",\"family\":\"snvpdibmi\",\"capacity\":1037622433},\"location\":\"bzbkiw\",\"tags\":{\"ophzfylsgcrp\":\"n\",\"fwyfwlwxjwet\":\"bcunezzceze\",\"zvaylptrsqqw\":\"psihcla\"},\"id\":\"tcmwqkchc\",\"name\":\"waxfewzjkj\",\"type\":\"xfdeqvhpsyl\"}]}") - .toObject(OnlineDeploymentTrackedResourceArmPaginatedResult.class); - Assertions.assertEquals("rprsnm", model.nextLink()); - Assertions.assertEquals("sqbuc", model.value().get(0).location()); - Assertions.assertEquals("kyexaoguyaipi", model.value().get(0).tags().get("sdaultxij")); - Assertions - .assertEquals( - ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("lbkpb", model.value().get(0).kind()); - Assertions.assertEquals("aqtferr", model.value().get(0).properties().description()); - Assertions.assertEquals("ex", model.value().get(0).properties().environmentId()); - Assertions.assertEquals(false, model.value().get(0).properties().appInsightsEnabled()); - Assertions - .assertEquals( - EgressPublicNetworkAccessType.ENABLED, model.value().get(0).properties().egressPublicNetworkAccess()); - Assertions.assertEquals("jh", model.value().get(0).properties().instanceType()); - Assertions.assertEquals("vechndbnwiehole", model.value().get(0).properties().model()); - Assertions.assertEquals("wiuub", model.value().get(0).properties().modelMountPath()); - Assertions.assertEquals("xap", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.FREE, model.value().get(0).sku().tier()); - Assertions.assertEquals("qqnobpudcd", model.value().get(0).sku().size()); - Assertions.assertEquals("tqwpwya", model.value().get(0).sku().family()); - Assertions.assertEquals(2036163978, model.value().get(0).sku().capacity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OnlineDeploymentTrackedResourceArmPaginatedResult model = - new OnlineDeploymentTrackedResourceArmPaginatedResult() - .withNextLink("rprsnm") - .withValue( - Arrays - .asList( - new OnlineDeploymentInner() - .withLocation("sqbuc") - .withTags( - mapOf("sdaultxij", "kyexaoguyaipi", "qwazlnqnmcjngzq", "um", "sf", "qxtbjwgnyf")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withKind("lbkpb") - .withProperties( - new OnlineDeploymentProperties() - .withDescription("aqtferr") - .withEnvironmentId("ex") - .withEnvironmentVariables(mapOf()) - .withProperties(mapOf()) - .withAppInsightsEnabled(false) - .withEgressPublicNetworkAccess(EgressPublicNetworkAccessType.ENABLED) - .withInstanceType("jh") - .withModel("vechndbnwiehole") - .withModelMountPath("wiuub")) - .withSku( - new Sku() - .withName("xap") - .withTier(SkuTier.FREE) - .withSize("qqnobpudcd") - .withFamily("tqwpwya") - .withCapacity(2036163978)), - new OnlineDeploymentInner() - .withLocation("fdwfmvigorqj") - .withTags(mapOf("n", "zhraglkafh")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withKind("qryxyn") - .withProperties( - new OnlineDeploymentProperties() - .withDescription("sxwaabzm") - .withEnvironmentId("rygznmmaxriz") - .withEnvironmentVariables(mapOf()) - .withProperties(mapOf()) - .withAppInsightsEnabled(true) - .withEgressPublicNetworkAccess(EgressPublicNetworkAccessType.DISABLED) - .withInstanceType("sovwxznptgoeiyb") - .withModel("pfhvfslk") - .withModelMountPath("tjlrigjksky")) - .withSku( - new Sku() - .withName("gopxlhslnelxie") - .withTier(SkuTier.BASIC) - .withSize("llxecwc") - .withFamily("jphslhcaw") - .withCapacity(224494261)), - new OnlineDeploymentInner() - .withLocation("qnhcvsqltnzoibg") - .withTags(mapOf("qoxwd", "nxfyqonm")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withKind("edexxmlfm") - .withProperties( - new OnlineDeploymentProperties() - .withDescription("ywakoihk") - .withEnvironmentId("mjblmljhlny") - .withEnvironmentVariables(mapOf()) - .withProperties(mapOf()) - .withAppInsightsEnabled(true) - .withEgressPublicNetworkAccess(EgressPublicNetworkAccessType.ENABLED) - .withInstanceType("uawxtzx") - .withModel("mwabzxrvxc") - .withModelMountPath("hsphaivmxyas")) - .withSku( - new Sku() - .withName("qyryuzcbmqqvxm") - .withTier(SkuTier.STANDARD) - .withSize("tayx") - .withFamily("supe") - .withCapacity(2074822274)), - new OnlineDeploymentInner() - .withLocation("bzbkiw") - .withTags( - mapOf( - "ophzfylsgcrp", "n", "fwyfwlwxjwet", "bcunezzceze", "zvaylptrsqqw", "psihcla")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withKind("vwbcblembnkbwv") - .withProperties( - new OnlineDeploymentProperties() - .withDescription("sazgakgacyrcmj") - .withEnvironmentId("spofapvuhry") - .withEnvironmentVariables(mapOf()) - .withProperties(mapOf()) - .withAppInsightsEnabled(false) - .withEgressPublicNetworkAccess(EgressPublicNetworkAccessType.ENABLED) - .withInstanceType("vqihebwtswbzuwf") - .withModel("ragegi") - .withModelMountPath("cjfelisdjubgg")) - .withSku( - new Sku() - .withName("frzgbzjed") - .withTier(SkuTier.PREMIUM) - .withSize("vnlvxbcuiiznktwf") - .withFamily("snvpdibmi") - .withCapacity(1037622433)))); - model = BinaryData.fromObject(model).toObject(OnlineDeploymentTrackedResourceArmPaginatedResult.class); - Assertions.assertEquals("rprsnm", model.nextLink()); - Assertions.assertEquals("sqbuc", model.value().get(0).location()); - Assertions.assertEquals("kyexaoguyaipi", model.value().get(0).tags().get("sdaultxij")); - Assertions - .assertEquals( - ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("lbkpb", model.value().get(0).kind()); - Assertions.assertEquals("aqtferr", model.value().get(0).properties().description()); - Assertions.assertEquals("ex", model.value().get(0).properties().environmentId()); - Assertions.assertEquals(false, model.value().get(0).properties().appInsightsEnabled()); - Assertions - .assertEquals( - EgressPublicNetworkAccessType.ENABLED, model.value().get(0).properties().egressPublicNetworkAccess()); - Assertions.assertEquals("jh", model.value().get(0).properties().instanceType()); - Assertions.assertEquals("vechndbnwiehole", model.value().get(0).properties().model()); - Assertions.assertEquals("wiuub", model.value().get(0).properties().modelMountPath()); - Assertions.assertEquals("xap", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.FREE, model.value().get(0).sku().tier()); - Assertions.assertEquals("qqnobpudcd", model.value().get(0).sku().size()); - Assertions.assertEquals("tqwpwya", model.value().get(0).sku().family()); - Assertions.assertEquals(2036163978, model.value().get(0).sku().capacity()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsDeleteMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsDeleteMockTests.java deleted file mode 100644 index aba6309a97e8c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsDeleteMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OnlineDeploymentsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .onlineDeployments() - .delete("mbhdo", "m", "ngkqlgxzduvxd", "xexatmdmnrs", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsGetLogsWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsGetLogsWithResponseMockTests.java deleted file mode 100644 index 260040167db7f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsGetLogsWithResponseMockTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ContainerType; -import com.azure.resourcemanager.machinelearning.models.DeploymentLogs; -import com.azure.resourcemanager.machinelearning.models.DeploymentLogsRequest; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OnlineDeploymentsGetLogsWithResponseMockTests { - @Test - public void testGetLogsWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"content\":\"exvtemasp\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DeploymentLogs response = - manager - .onlineDeployments() - .getLogsWithResponse( - "qtlfoz", - "umrtgjqg", - "cant", - "syxzxjmkanbc", - new DeploymentLogsRequest().withContainerType(ContainerType.INFERENCE_SERVER).withTail(129296832), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("exvtemasp", response.content()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsListSkusMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsListSkusMockTests.java deleted file mode 100644 index 3ee3e1add3d89..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineDeploymentsListSkusMockTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.SkuResource; -import com.azure.resourcemanager.machinelearning.models.SkuScaleType; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OnlineDeploymentsListSkusMockTests { - @Test - public void testListSkus() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"capacity\":{\"default\":535751545,\"maximum\":1856017180,\"minimum\":1547287008,\"scaleType\":\"Automatic\"},\"resourceType\":\"iv\",\"sku\":{\"name\":\"jybsrwz\",\"tier\":\"Free\"}}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .onlineDeployments() - .listSkus("anydsc", "k", "w", "pwjc", 1694569219, "aahntofelfh", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(535751545, response.iterator().next().capacity().defaultProperty()); - Assertions.assertEquals(1856017180, response.iterator().next().capacity().maximum()); - Assertions.assertEquals(1547287008, response.iterator().next().capacity().minimum()); - Assertions.assertEquals(SkuScaleType.AUTOMATIC, response.iterator().next().capacity().scaleType()); - Assertions.assertEquals("jybsrwz", response.iterator().next().sku().name()); - Assertions.assertEquals(SkuTier.FREE, response.iterator().next().sku().tier()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointTrackedResourceArmPaginatedResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointTrackedResourceArmPaginatedResultTests.java deleted file mode 100644 index b5c43b64a29e2..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointTrackedResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.OnlineEndpointInner; -import com.azure.resourcemanager.machinelearning.models.EndpointAuthMode; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.OnlineEndpointProperties; -import com.azure.resourcemanager.machinelearning.models.OnlineEndpointTrackedResourceArmPaginatedResult; -import com.azure.resourcemanager.machinelearning.models.PublicNetworkAccessType; -import com.azure.resourcemanager.machinelearning.models.Sku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class OnlineEndpointTrackedResourceArmPaginatedResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OnlineEndpointTrackedResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"nextLink\":\"hxgsrboldfor\",\"value\":[{\"identity\":{\"principalId\":\"1f6aefd4-b02f-4a33-a590-718f0cb48b50\",\"tenantId\":\"57f14320-4135-4edf-99b3-3048e39f355a\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"kind\":\"fhfovv\",\"properties\":{\"compute\":\"qpbtuodxes\",\"provisioningState\":\"Creating\",\"publicNetworkAccess\":\"Enabled\",\"traffic\":{},\"authMode\":\"AADToken\",\"description\":\"umuaslzkwrrwoycq\",\"properties\":{},\"scoringUri\":\"hahnomdrkywuhps\",\"swaggerUri\":\"uurutlwexxwlalni\"},\"sku\":{\"name\":\"zsrzpgepq\",\"tier\":\"Free\",\"size\":\"wwpgdakchzyvlixq\",\"family\":\"kcxk\",\"capacity\":330254773},\"location\":\"xmysuxswqrntv\",\"tags\":{\"pwcyyufmhr\":\"jpsttexoq\",\"wmqs\":\"nc\"},\"id\":\"kcdqzhlct\",\"name\":\"dunqnd\",\"type\":\"fpch\"},{\"identity\":{\"principalId\":\"a4151eb7-8663-4b97-8345-804b77541a0a\",\"tenantId\":\"7879de7c-a628-4534-a453-c05523e5b09d\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"kind\":\"cgegydcwbo\",\"properties\":{\"compute\":\"umvq\",\"provisioningState\":\"Succeeded\",\"publicNetworkAccess\":\"Disabled\",\"traffic\":{},\"authMode\":\"AMLToken\",\"description\":\"iouaubrjt\",\"properties\":{},\"scoringUri\":\"fuojrngif\",\"swaggerUri\":\"z\"},\"sku\":{\"name\":\"sccbiuimzd\",\"tier\":\"Premium\",\"size\":\"fqwmkyoquf\",\"family\":\"ruzslzoj\",\"capacity\":617076882},\"location\":\"fnmdxotn\",\"tags\":{\"i\":\"gugey\"},\"id\":\"grkyuizabsnmfpph\",\"name\":\"jee\",\"type\":\"yhyhsgzfczb\"},{\"identity\":{\"principalId\":\"ccf81f2a-7aba-4873-b90b-315fea316226\",\"tenantId\":\"eba5c18a-712b-44fe-9aa8-0765f707c485\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"kind\":\"glqgleoh\",\"properties\":{\"compute\":\"etnluankrrfx\",\"provisioningState\":\"Succeeded\",\"publicNetworkAccess\":\"Enabled\",\"traffic\":{},\"authMode\":\"Key\",\"description\":\"acvbmqz\",\"properties\":{},\"scoringUri\":\"lajrnwxacevehj\",\"swaggerUri\":\"yxoaf\"},\"sku\":{\"name\":\"oqltfae\",\"tier\":\"Standard\",\"size\":\"mfgvxirpghriypo\",\"family\":\"yhlqhykprlpyznu\",\"capacity\":184808617},\"location\":\"smexiitdf\",\"tags\":{\"nnust\":\"yasiibmiy\",\"nmgixh\":\"nlj\",\"oudorhcgyyp\":\"mavmq\",\"hu\":\"otwypundmb\"},\"id\":\"cmjkavlgorbmftpm\",\"name\":\"tzfjltf\",\"type\":\"nzcyjtotp\"}]}") - .toObject(OnlineEndpointTrackedResourceArmPaginatedResult.class); - Assertions.assertEquals("hxgsrboldfor", model.nextLink()); - Assertions.assertEquals("xmysuxswqrntv", model.value().get(0).location()); - Assertions.assertEquals("jpsttexoq", model.value().get(0).tags().get("pwcyyufmhr")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("fhfovv", model.value().get(0).kind()); - Assertions.assertEquals(EndpointAuthMode.AADTOKEN, model.value().get(0).properties().authMode()); - Assertions.assertEquals("umuaslzkwrrwoycq", model.value().get(0).properties().description()); - Assertions.assertEquals("qpbtuodxes", model.value().get(0).properties().compute()); - Assertions - .assertEquals(PublicNetworkAccessType.ENABLED, model.value().get(0).properties().publicNetworkAccess()); - Assertions.assertEquals("zsrzpgepq", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.FREE, model.value().get(0).sku().tier()); - Assertions.assertEquals("wwpgdakchzyvlixq", model.value().get(0).sku().size()); - Assertions.assertEquals("kcxk", model.value().get(0).sku().family()); - Assertions.assertEquals(330254773, model.value().get(0).sku().capacity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OnlineEndpointTrackedResourceArmPaginatedResult model = - new OnlineEndpointTrackedResourceArmPaginatedResult() - .withNextLink("hxgsrboldfor") - .withValue( - Arrays - .asList( - new OnlineEndpointInner() - .withLocation("xmysuxswqrntv") - .withTags(mapOf("pwcyyufmhr", "jpsttexoq", "wmqs", "nc")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withKind("fhfovv") - .withProperties( - new OnlineEndpointProperties() - .withAuthMode(EndpointAuthMode.AADTOKEN) - .withDescription("umuaslzkwrrwoycq") - .withProperties(mapOf()) - .withCompute("qpbtuodxes") - .withPublicNetworkAccess(PublicNetworkAccessType.ENABLED) - .withTraffic(mapOf())) - .withSku( - new Sku() - .withName("zsrzpgepq") - .withTier(SkuTier.FREE) - .withSize("wwpgdakchzyvlixq") - .withFamily("kcxk") - .withCapacity(330254773)), - new OnlineEndpointInner() - .withLocation("fnmdxotn") - .withTags(mapOf("i", "gugey")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withKind("cgegydcwbo") - .withProperties( - new OnlineEndpointProperties() - .withAuthMode(EndpointAuthMode.AMLTOKEN) - .withDescription("iouaubrjt") - .withProperties(mapOf()) - .withCompute("umvq") - .withPublicNetworkAccess(PublicNetworkAccessType.DISABLED) - .withTraffic(mapOf())) - .withSku( - new Sku() - .withName("sccbiuimzd") - .withTier(SkuTier.PREMIUM) - .withSize("fqwmkyoquf") - .withFamily("ruzslzoj") - .withCapacity(617076882)), - new OnlineEndpointInner() - .withLocation("smexiitdf") - .withTags( - mapOf( - "nnust", - "yasiibmiy", - "nmgixh", - "nlj", - "oudorhcgyyp", - "mavmq", - "hu", - "otwypundmb")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withKind("glqgleoh") - .withProperties( - new OnlineEndpointProperties() - .withAuthMode(EndpointAuthMode.KEY) - .withDescription("acvbmqz") - .withProperties(mapOf()) - .withCompute("etnluankrrfx") - .withPublicNetworkAccess(PublicNetworkAccessType.ENABLED) - .withTraffic(mapOf())) - .withSku( - new Sku() - .withName("oqltfae") - .withTier(SkuTier.STANDARD) - .withSize("mfgvxirpghriypo") - .withFamily("yhlqhykprlpyznu") - .withCapacity(184808617)))); - model = BinaryData.fromObject(model).toObject(OnlineEndpointTrackedResourceArmPaginatedResult.class); - Assertions.assertEquals("hxgsrboldfor", model.nextLink()); - Assertions.assertEquals("xmysuxswqrntv", model.value().get(0).location()); - Assertions.assertEquals("jpsttexoq", model.value().get(0).tags().get("pwcyyufmhr")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("fhfovv", model.value().get(0).kind()); - Assertions.assertEquals(EndpointAuthMode.AADTOKEN, model.value().get(0).properties().authMode()); - Assertions.assertEquals("umuaslzkwrrwoycq", model.value().get(0).properties().description()); - Assertions.assertEquals("qpbtuodxes", model.value().get(0).properties().compute()); - Assertions - .assertEquals(PublicNetworkAccessType.ENABLED, model.value().get(0).properties().publicNetworkAccess()); - Assertions.assertEquals("zsrzpgepq", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.FREE, model.value().get(0).sku().tier()); - Assertions.assertEquals("wwpgdakchzyvlixq", model.value().get(0).sku().size()); - Assertions.assertEquals("kcxk", model.value().get(0).sku().family()); - Assertions.assertEquals(330254773, model.value().get(0).sku().capacity()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsDeleteMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsDeleteMockTests.java deleted file mode 100644 index ebc153d904fdb..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineEndpointsDeleteMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OnlineEndpointsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.onlineEndpoints().delete("cbnygd", "c", "xwbpwyykdig", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineRequestSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineRequestSettingsTests.java deleted file mode 100644 index 29e7ab16920cd..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineRequestSettingsTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.OnlineRequestSettings; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class OnlineRequestSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OnlineRequestSettings model = - BinaryData - .fromString( - "{\"maxConcurrentRequestsPerInstance\":1659306080,\"maxQueueWait\":\"PT185H26M24S\",\"requestTimeout\":\"PT152H42M33S\"}") - .toObject(OnlineRequestSettings.class); - Assertions.assertEquals(1659306080, model.maxConcurrentRequestsPerInstance()); - Assertions.assertEquals(Duration.parse("PT185H26M24S"), model.maxQueueWait()); - Assertions.assertEquals(Duration.parse("PT152H42M33S"), model.requestTimeout()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OnlineRequestSettings model = - new OnlineRequestSettings() - .withMaxConcurrentRequestsPerInstance(1659306080) - .withMaxQueueWait(Duration.parse("PT185H26M24S")) - .withRequestTimeout(Duration.parse("PT152H42M33S")); - model = BinaryData.fromObject(model).toObject(OnlineRequestSettings.class); - Assertions.assertEquals(1659306080, model.maxConcurrentRequestsPerInstance()); - Assertions.assertEquals(Duration.parse("PT185H26M24S"), model.maxQueueWait()); - Assertions.assertEquals(Duration.parse("PT152H42M33S"), model.requestTimeout()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineScaleSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineScaleSettingsTests.java deleted file mode 100644 index e77786ec9dac2..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OnlineScaleSettingsTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.OnlineScaleSettings; - -public final class OnlineScaleSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OnlineScaleSettings model = - BinaryData.fromString("{\"scaleType\":\"OnlineScaleSettings\"}").toObject(OnlineScaleSettings.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OnlineScaleSettings model = new OnlineScaleSettings(); - model = BinaryData.fromObject(model).toObject(OnlineScaleSettings.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OperationsListMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OperationsListMockTests.java deleted file mode 100644 index 2e2d86093d611..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OperationsListMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.AmlOperation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"name\":\"injdllwktlepo\",\"display\":{\"provider\":\"vqxuajgcqw\",\"resource\":\"ynkgfcfd\",\"operation\":\"wsikxxtclhuulr\",\"description\":\"byokvjgbzsxe\"},\"isDataAction\":false}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("injdllwktlepo", response.iterator().next().name()); - Assertions.assertEquals("vqxuajgcqw", response.iterator().next().display().provider()); - Assertions.assertEquals("ynkgfcfd", response.iterator().next().display().resource()); - Assertions.assertEquals("wsikxxtclhuulr", response.iterator().next().display().operation()); - Assertions.assertEquals("byokvjgbzsxe", response.iterator().next().display().description()); - Assertions.assertEquals(false, response.iterator().next().isDataAction()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OutputPathAssetReferenceTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OutputPathAssetReferenceTests.java deleted file mode 100644 index 693f796d85b9d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/OutputPathAssetReferenceTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.OutputPathAssetReference; -import org.junit.jupiter.api.Assertions; - -public final class OutputPathAssetReferenceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OutputPathAssetReference model = - BinaryData - .fromString("{\"referenceType\":\"OutputPath\",\"jobId\":\"h\",\"path\":\"mexznlwkb\"}") - .toObject(OutputPathAssetReference.class); - Assertions.assertEquals("h", model.jobId()); - Assertions.assertEquals("mexznlwkb", model.path()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OutputPathAssetReference model = new OutputPathAssetReference().withJobId("h").withPath("mexznlwkb"); - model = BinaryData.fromObject(model).toObject(OutputPathAssetReference.class); - Assertions.assertEquals("h", model.jobId()); - Assertions.assertEquals("mexznlwkb", model.path()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PaginatedComputeResourcesListTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PaginatedComputeResourcesListTests.java deleted file mode 100644 index 547ba53df3c1d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PaginatedComputeResourcesListTests.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.ComputeResourceInner; -import com.azure.resourcemanager.machinelearning.models.Compute; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.PaginatedComputeResourcesList; -import com.azure.resourcemanager.machinelearning.models.Sku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PaginatedComputeResourcesListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PaginatedComputeResourcesList model = - BinaryData - .fromString( - "{\"value\":[{\"identity\":{\"principalId\":\"6e82368f-483c-407c-b3d6-2d64ef6e71aa\",\"tenantId\":\"821c3424-4690-42c4-a22b-b51baca687f1\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"location\":\"unmmq\",\"tags\":{\"ocukoklyax\":\"xzko\"},\"sku\":{\"name\":\"onuq\",\"tier\":\"Basic\",\"size\":\"beypewrmjmw\",\"family\":\"jektcxsenh\",\"capacity\":2036309182},\"properties\":{\"computeType\":\"Compute\",\"computeLocation\":\"rzpwvlqdqgbiq\",\"provisioningState\":\"Deleting\",\"description\":\"kaet\",\"createdOn\":\"2021-03-20T05:01:22Z\",\"modifiedOn\":\"2021-02-19T02:27:03Z\",\"resourceId\":\"ivfsnk\",\"provisioningErrors\":[],\"isAttachedCompute\":false,\"disableLocalAuth\":false},\"id\":\"hjfbebrjcxe\",\"name\":\"fuwutttxf\",\"type\":\"jrbirphxepcyv\"}],\"nextLink\":\"fnljky\"}") - .toObject(PaginatedComputeResourcesList.class); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("unmmq", model.value().get(0).location()); - Assertions.assertEquals("xzko", model.value().get(0).tags().get("ocukoklyax")); - Assertions.assertEquals("onuq", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.BASIC, model.value().get(0).sku().tier()); - Assertions.assertEquals("beypewrmjmw", model.value().get(0).sku().size()); - Assertions.assertEquals("jektcxsenh", model.value().get(0).sku().family()); - Assertions.assertEquals(2036309182, model.value().get(0).sku().capacity()); - Assertions.assertEquals("rzpwvlqdqgbiq", model.value().get(0).properties().computeLocation()); - Assertions.assertEquals("kaet", model.value().get(0).properties().description()); - Assertions.assertEquals("ivfsnk", model.value().get(0).properties().resourceId()); - Assertions.assertEquals(false, model.value().get(0).properties().disableLocalAuth()); - Assertions.assertEquals("fnljky", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PaginatedComputeResourcesList model = - new PaginatedComputeResourcesList() - .withValue( - Arrays - .asList( - new ComputeResourceInner() - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withLocation("unmmq") - .withTags(mapOf("ocukoklyax", "xzko")) - .withSku( - new Sku() - .withName("onuq") - .withTier(SkuTier.BASIC) - .withSize("beypewrmjmw") - .withFamily("jektcxsenh") - .withCapacity(2036309182)) - .withProperties( - new Compute() - .withComputeLocation("rzpwvlqdqgbiq") - .withDescription("kaet") - .withResourceId("ivfsnk") - .withDisableLocalAuth(false)))) - .withNextLink("fnljky"); - model = BinaryData.fromObject(model).toObject(PaginatedComputeResourcesList.class); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("unmmq", model.value().get(0).location()); - Assertions.assertEquals("xzko", model.value().get(0).tags().get("ocukoklyax")); - Assertions.assertEquals("onuq", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.BASIC, model.value().get(0).sku().tier()); - Assertions.assertEquals("beypewrmjmw", model.value().get(0).sku().size()); - Assertions.assertEquals("jektcxsenh", model.value().get(0).sku().family()); - Assertions.assertEquals(2036309182, model.value().get(0).sku().capacity()); - Assertions.assertEquals("rzpwvlqdqgbiq", model.value().get(0).properties().computeLocation()); - Assertions.assertEquals("kaet", model.value().get(0).properties().description()); - Assertions.assertEquals("ivfsnk", model.value().get(0).properties().resourceId()); - Assertions.assertEquals(false, model.value().get(0).properties().disableLocalAuth()); - Assertions.assertEquals("fnljky", model.nextLink()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialBatchDeploymentPartialMinimalTrackedResourceWithPropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialBatchDeploymentPartialMinimalTrackedResourceWithPropertiesTests.java deleted file mode 100644 index c4a98b0fb36c6..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialBatchDeploymentPartialMinimalTrackedResourceWithPropertiesTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.PartialBatchDeployment; -import com.azure.resourcemanager.machinelearning.models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PartialBatchDeploymentPartialMinimalTrackedResourceWithPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties model = - BinaryData - .fromString( - "{\"properties\":{\"description\":\"frvtpuqu\"},\"tags\":{\"doaon\":\"lgkfbt\",\"ed\":\"bjcntujitc\"}}") - .toObject(PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties.class); - Assertions.assertEquals("frvtpuqu", model.properties().description()); - Assertions.assertEquals("lgkfbt", model.tags().get("doaon")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties model = - new PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties() - .withProperties(new PartialBatchDeployment().withDescription("frvtpuqu")) - .withTags(mapOf("doaon", "lgkfbt", "ed", "bjcntujitc")); - model = - BinaryData - .fromObject(model) - .toObject(PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties.class); - Assertions.assertEquals("frvtpuqu", model.properties().description()); - Assertions.assertEquals("lgkfbt", model.tags().get("doaon")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialBatchDeploymentTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialBatchDeploymentTests.java deleted file mode 100644 index bc27fbcb76184..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialBatchDeploymentTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.PartialBatchDeployment; -import org.junit.jupiter.api.Assertions; - -public final class PartialBatchDeploymentTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PartialBatchDeployment model = - BinaryData.fromString("{\"description\":\"wwa\"}").toObject(PartialBatchDeployment.class); - Assertions.assertEquals("wwa", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PartialBatchDeployment model = new PartialBatchDeployment().withDescription("wwa"); - model = BinaryData.fromObject(model).toObject(PartialBatchDeployment.class); - Assertions.assertEquals("wwa", model.description()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialManagedServiceIdentityTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialManagedServiceIdentityTests.java deleted file mode 100644 index 939e861d2bb59..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialManagedServiceIdentityTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.PartialManagedServiceIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PartialManagedServiceIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PartialManagedServiceIdentity model = - BinaryData - .fromString("{\"type\":\"None\",\"userAssignedIdentities\":{\"dtmhrkwofyyvoqa\":\"dataibahwflus\"}}") - .toObject(PartialManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PartialManagedServiceIdentity model = - new PartialManagedServiceIdentity() - .withType(ManagedServiceIdentityType.NONE) - .withUserAssignedIdentities(mapOf("dtmhrkwofyyvoqa", "dataibahwflus")); - model = BinaryData.fromObject(model).toObject(PartialManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.type()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialMinimalTrackedResourceTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialMinimalTrackedResourceTests.java deleted file mode 100644 index 7c2893c3737ba..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialMinimalTrackedResourceTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.PartialMinimalTrackedResource; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PartialMinimalTrackedResourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PartialMinimalTrackedResource model = - BinaryData - .fromString("{\"tags\":{\"wbwo\":\"expbtg\",\"kcnqxwbpo\":\"nwashrtd\",\"aasipqi\":\"ulpiuj\"}}") - .toObject(PartialMinimalTrackedResource.class); - Assertions.assertEquals("expbtg", model.tags().get("wbwo")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PartialMinimalTrackedResource model = - new PartialMinimalTrackedResource() - .withTags(mapOf("wbwo", "expbtg", "kcnqxwbpo", "nwashrtd", "aasipqi", "ulpiuj")); - model = BinaryData.fromObject(model).toObject(PartialMinimalTrackedResource.class); - Assertions.assertEquals("expbtg", model.tags().get("wbwo")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialMinimalTrackedResourceWithIdentityTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialMinimalTrackedResourceWithIdentityTests.java deleted file mode 100644 index 6c42e362c03d4..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialMinimalTrackedResourceWithIdentityTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.PartialManagedServiceIdentity; -import com.azure.resourcemanager.machinelearning.models.PartialMinimalTrackedResourceWithIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PartialMinimalTrackedResourceWithIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PartialMinimalTrackedResourceWithIdentity model = - BinaryData - .fromString( - "{\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"opkwhojv\":\"datamg\",\"mocmbqfqvmk\":\"dataajqgxy\",\"helxprglya\":\"dataxozap\"}},\"tags\":{\"uejrjxgc\":\"ckcb\",\"i\":\"qibrhosxsdqrhzoy\"}}") - .toObject(PartialMinimalTrackedResourceWithIdentity.class); - Assertions.assertEquals("ckcb", model.tags().get("uejrjxgc")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.identity().type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PartialMinimalTrackedResourceWithIdentity model = - new PartialMinimalTrackedResourceWithIdentity() - .withTags(mapOf("uejrjxgc", "ckcb", "i", "qibrhosxsdqrhzoy")) - .withIdentity( - new PartialManagedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf("opkwhojv", "datamg", "mocmbqfqvmk", "dataajqgxy", "helxprglya", "dataxozap"))); - model = BinaryData.fromObject(model).toObject(PartialMinimalTrackedResourceWithIdentity.class); - Assertions.assertEquals("ckcb", model.tags().get("uejrjxgc")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.identity().type()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialMinimalTrackedResourceWithSkuTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialMinimalTrackedResourceWithSkuTests.java deleted file mode 100644 index dfc67b508652f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialMinimalTrackedResourceWithSkuTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.PartialMinimalTrackedResourceWithSku; -import com.azure.resourcemanager.machinelearning.models.PartialSku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PartialMinimalTrackedResourceWithSkuTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PartialMinimalTrackedResourceWithSku model = - BinaryData - .fromString( - "{\"sku\":{\"capacity\":1978421071,\"family\":\"noamldsehaohdj\",\"name\":\"flzokxco\",\"size\":\"e\",\"tier\":\"Premium\"},\"tags\":{\"ftgz\":\"agltsxoa\"}}") - .toObject(PartialMinimalTrackedResourceWithSku.class); - Assertions.assertEquals("agltsxoa", model.tags().get("ftgz")); - Assertions.assertEquals(1978421071, model.sku().capacity()); - Assertions.assertEquals("noamldsehaohdj", model.sku().family()); - Assertions.assertEquals("flzokxco", model.sku().name()); - Assertions.assertEquals("e", model.sku().size()); - Assertions.assertEquals(SkuTier.PREMIUM, model.sku().tier()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PartialMinimalTrackedResourceWithSku model = - new PartialMinimalTrackedResourceWithSku() - .withTags(mapOf("ftgz", "agltsxoa")) - .withSku( - new PartialSku() - .withCapacity(1978421071) - .withFamily("noamldsehaohdj") - .withName("flzokxco") - .withSize("e") - .withTier(SkuTier.PREMIUM)); - model = BinaryData.fromObject(model).toObject(PartialMinimalTrackedResourceWithSku.class); - Assertions.assertEquals("agltsxoa", model.tags().get("ftgz")); - Assertions.assertEquals(1978421071, model.sku().capacity()); - Assertions.assertEquals("noamldsehaohdj", model.sku().family()); - Assertions.assertEquals("flzokxco", model.sku().name()); - Assertions.assertEquals("e", model.sku().size()); - Assertions.assertEquals(SkuTier.PREMIUM, model.sku().tier()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialSkuTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialSkuTests.java deleted file mode 100644 index 14f1c95632e06..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PartialSkuTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.PartialSku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import org.junit.jupiter.api.Assertions; - -public final class PartialSkuTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PartialSku model = - BinaryData - .fromString( - "{\"capacity\":1425632159,\"family\":\"swvefloccsrmoz\",\"name\":\"m\",\"size\":\"g\",\"tier\":\"Free\"}") - .toObject(PartialSku.class); - Assertions.assertEquals(1425632159, model.capacity()); - Assertions.assertEquals("swvefloccsrmoz", model.family()); - Assertions.assertEquals("m", model.name()); - Assertions.assertEquals("g", model.size()); - Assertions.assertEquals(SkuTier.FREE, model.tier()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PartialSku model = - new PartialSku() - .withCapacity(1425632159) - .withFamily("swvefloccsrmoz") - .withName("m") - .withSize("g") - .withTier(SkuTier.FREE); - model = BinaryData.fromObject(model).toObject(PartialSku.class); - Assertions.assertEquals(1425632159, model.capacity()); - Assertions.assertEquals("swvefloccsrmoz", model.family()); - Assertions.assertEquals("m", model.name()); - Assertions.assertEquals("g", model.size()); - Assertions.assertEquals(SkuTier.FREE, model.tier()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PasswordTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PasswordTests.java deleted file mode 100644 index 71ac532ecdcb1..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PasswordTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.Password; - -public final class PasswordTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Password model = - BinaryData.fromString("{\"name\":\"pgvdf\",\"value\":\"otkftutqxlngx\"}").toObject(Password.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Password model = new Password(); - model = BinaryData.fromObject(model).toObject(Password.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PersonalComputeInstanceSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PersonalComputeInstanceSettingsTests.java deleted file mode 100644 index ecc30fc061030..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PersonalComputeInstanceSettingsTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AssignedUser; -import com.azure.resourcemanager.machinelearning.models.PersonalComputeInstanceSettings; -import org.junit.jupiter.api.Assertions; - -public final class PersonalComputeInstanceSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PersonalComputeInstanceSettings model = - BinaryData - .fromString("{\"assignedUser\":{\"objectId\":\"emc\",\"tenantId\":\"jk\"}}") - .toObject(PersonalComputeInstanceSettings.class); - Assertions.assertEquals("emc", model.assignedUser().objectId()); - Assertions.assertEquals("jk", model.assignedUser().tenantId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PersonalComputeInstanceSettings model = - new PersonalComputeInstanceSettings() - .withAssignedUser(new AssignedUser().withObjectId("emc").withTenantId("jk")); - model = BinaryData.fromObject(model).toObject(PersonalComputeInstanceSettings.class); - Assertions.assertEquals("emc", model.assignedUser().objectId()); - Assertions.assertEquals("jk", model.assignedUser().tenantId()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PipelineJobTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PipelineJobTests.java deleted file mode 100644 index 9e4a3e6734b4c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PipelineJobTests.java +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.IdentityConfiguration; -import com.azure.resourcemanager.machinelearning.models.JobInput; -import com.azure.resourcemanager.machinelearning.models.JobOutput; -import com.azure.resourcemanager.machinelearning.models.JobService; -import com.azure.resourcemanager.machinelearning.models.PipelineJob; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PipelineJobTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PipelineJob model = - BinaryData - .fromString( - "{\"jobType\":\"Pipeline\",\"inputs\":{\"erufgjblcdrmy\":{\"jobInputType\":\"JobInput\",\"description\":\"khup\"},\"lugekdfqnhtt\":{\"jobInputType\":\"JobInput\",\"description\":\"emftzgyyky\"},\"kmhmnulwempdc\":{\"jobInputType\":\"JobInput\",\"description\":\"owrczfjjnnuxxr\"},\"sulwzpflusn\":{\"jobInputType\":\"JobInput\",\"description\":\"rhjul\"}},\"jobs\":{\"iyrgkoek\":\"datahhgzotf\"},\"outputs\":{\"pcqydeykvsk\":{\"jobOutputType\":\"JobOutput\",\"description\":\"xyxhighctxbxmo\"},\"boohxbms\":{\"jobOutputType\":\"JobOutput\",\"description\":\"zdfrjeizikgq\"},\"qaeo\":{\"jobOutputType\":\"JobOutput\",\"description\":\"cqsxrmdvewu\"}},\"settings\":\"datajh\",\"sourceJobId\":\"jkbvhhdaurgho\",\"componentId\":\"aexbkhxjxjo\",\"computeId\":\"lqxr\",\"displayName\":\"knkob\",\"experimentName\":\"tmbozomtzamicbig\",\"identity\":{\"identityType\":\"IdentityConfiguration\"},\"isArchived\":true,\"services\":{\"sotirei\":{\"endpoint\":\"znuxkeuairaabmdl\",\"errorMessage\":\"bedpfixlhupmomih\",\"jobServiceType\":\"dnpxpkcdpr\",\"port\":656606105,\"properties\":{\"ghflrufssjyghsf\":\"yi\",\"fgvqcpdw\":\"rkbhammgmqfm\",\"dcdjhunh\":\"gquxweysland\"},\"status\":\"cgawnrrnquo\"}},\"status\":\"Finalizing\",\"description\":\"bfsx\",\"properties\":{\"mxcjzlquzexokjx\":\"yilbvz\"},\"tags\":{\"bwmvogljsvl\":\"vbzinz\",\"nwcehaqidoyzl\":\"gi\",\"pepiaeapfs\":\"giomqo\",\"pqqncju\":\"rgdtpeqnacyheqw\"}}") - .toObject(PipelineJob.class); - Assertions.assertEquals("bfsx", model.description()); - Assertions.assertEquals("yilbvz", model.properties().get("mxcjzlquzexokjx")); - Assertions.assertEquals("vbzinz", model.tags().get("bwmvogljsvl")); - Assertions.assertEquals("aexbkhxjxjo", model.componentId()); - Assertions.assertEquals("lqxr", model.computeId()); - Assertions.assertEquals("knkob", model.displayName()); - Assertions.assertEquals("tmbozomtzamicbig", model.experimentName()); - Assertions.assertEquals(true, model.isArchived()); - Assertions.assertEquals("znuxkeuairaabmdl", model.services().get("sotirei").endpoint()); - Assertions.assertEquals("dnpxpkcdpr", model.services().get("sotirei").jobServiceType()); - Assertions.assertEquals(656606105, model.services().get("sotirei").port()); - Assertions.assertEquals("yi", model.services().get("sotirei").properties().get("ghflrufssjyghsf")); - Assertions.assertEquals("khup", model.inputs().get("erufgjblcdrmy").description()); - Assertions.assertEquals("xyxhighctxbxmo", model.outputs().get("pcqydeykvsk").description()); - Assertions.assertEquals("jkbvhhdaurgho", model.sourceJobId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PipelineJob model = - new PipelineJob() - .withDescription("bfsx") - .withProperties(mapOf("mxcjzlquzexokjx", "yilbvz")) - .withTags( - mapOf( - "bwmvogljsvl", - "vbzinz", - "nwcehaqidoyzl", - "gi", - "pepiaeapfs", - "giomqo", - "pqqncju", - "rgdtpeqnacyheqw")) - .withComponentId("aexbkhxjxjo") - .withComputeId("lqxr") - .withDisplayName("knkob") - .withExperimentName("tmbozomtzamicbig") - .withIdentity(new IdentityConfiguration()) - .withIsArchived(true) - .withServices( - mapOf( - "sotirei", - new JobService() - .withEndpoint("znuxkeuairaabmdl") - .withJobServiceType("dnpxpkcdpr") - .withPort(656606105) - .withProperties( - mapOf( - "ghflrufssjyghsf", "yi", "fgvqcpdw", "rkbhammgmqfm", "dcdjhunh", "gquxweysland")))) - .withInputs( - mapOf( - "erufgjblcdrmy", - new JobInput().withDescription("khup"), - "lugekdfqnhtt", - new JobInput().withDescription("emftzgyyky"), - "kmhmnulwempdc", - new JobInput().withDescription("owrczfjjnnuxxr"), - "sulwzpflusn", - new JobInput().withDescription("rhjul"))) - .withJobs(mapOf("iyrgkoek", "datahhgzotf")) - .withOutputs( - mapOf( - "pcqydeykvsk", - new JobOutput().withDescription("xyxhighctxbxmo"), - "boohxbms", - new JobOutput().withDescription("zdfrjeizikgq"), - "qaeo", - new JobOutput().withDescription("cqsxrmdvewu"))) - .withSettings("datajh") - .withSourceJobId("jkbvhhdaurgho"); - model = BinaryData.fromObject(model).toObject(PipelineJob.class); - Assertions.assertEquals("bfsx", model.description()); - Assertions.assertEquals("yilbvz", model.properties().get("mxcjzlquzexokjx")); - Assertions.assertEquals("vbzinz", model.tags().get("bwmvogljsvl")); - Assertions.assertEquals("aexbkhxjxjo", model.componentId()); - Assertions.assertEquals("lqxr", model.computeId()); - Assertions.assertEquals("knkob", model.displayName()); - Assertions.assertEquals("tmbozomtzamicbig", model.experimentName()); - Assertions.assertEquals(true, model.isArchived()); - Assertions.assertEquals("znuxkeuairaabmdl", model.services().get("sotirei").endpoint()); - Assertions.assertEquals("dnpxpkcdpr", model.services().get("sotirei").jobServiceType()); - Assertions.assertEquals(656606105, model.services().get("sotirei").port()); - Assertions.assertEquals("yi", model.services().get("sotirei").properties().get("ghflrufssjyghsf")); - Assertions.assertEquals("khup", model.inputs().get("erufgjblcdrmy").description()); - Assertions.assertEquals("xyxhighctxbxmo", model.outputs().get("pcqydeykvsk").description()); - Assertions.assertEquals("jkbvhhdaurgho", model.sourceJobId()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionInnerTests.java deleted file mode 100644 index 6e4b39e897f0e..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionInnerTests.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpoint; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.machinelearning.models.PrivateLinkServiceConnectionState; -import com.azure.resourcemanager.machinelearning.models.Sku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import com.azure.resourcemanager.machinelearning.models.UserAssignedIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionInner model = - BinaryData - .fromString( - "{\"properties\":{\"privateEndpoint\":{\"id\":\"pikxwczbyscnpqxu\",\"subnetArmId\":\"vyq\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"ybrk\",\"actionsRequired\":\"dumjgrtfwvuk\"},\"provisioningState\":\"Deleting\"},\"identity\":{\"principalId\":\"ab4618d0-89cc-42a6-8af9-01fb81852cef\",\"tenantId\":\"33dab1a2-cc10-43fe-bcce-1e2e3342c542\",\"type\":\"None\",\"userAssignedIdentities\":{\"jcny\":{\"principalId\":\"73635982-b45d-422a-a162-47fa604aa819\",\"clientId\":\"cb770753-bd37-4dd1-b217-83ceefddad2d\"},\"kryhtnapczwlokj\":{\"principalId\":\"fb641d5f-adfd-43a0-bbd2-8d16389dbfff\",\"clientId\":\"f16c80f3-21be-4d6c-96a3-e663540b9fad\"},\"kkvnipjox\":{\"principalId\":\"15196c0f-16a1-4607-bd2c-7b17b17dcafa\",\"clientId\":\"3a992dc1-89b1-4e46-adcb-e1f376ec6fd6\"}}},\"location\":\"nchgej\",\"tags\":{\"ahuxinpm\":\"dmailzydehojw\",\"vcputegj\":\"njaqwixjspro\",\"uuvmkjozkrwfnd\":\"wmfdatscmdvpjhul\"},\"sku\":{\"name\":\"djpslw\",\"tier\":\"Premium\",\"size\":\"vwryoqpso\",\"family\":\"ctazakljlahbcryf\",\"capacity\":1389039399},\"id\":\"osygex\",\"name\":\"aojakhmsbzjhcrz\",\"type\":\"vdphlxaolthqtr\"}") - .toObject(PrivateEndpointConnectionInner.class); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.identity().type()); - Assertions.assertEquals("nchgej", model.location()); - Assertions.assertEquals("dmailzydehojw", model.tags().get("ahuxinpm")); - Assertions.assertEquals("djpslw", model.sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.sku().tier()); - Assertions.assertEquals("vwryoqpso", model.sku().size()); - Assertions.assertEquals("ctazakljlahbcryf", model.sku().family()); - Assertions.assertEquals(1389039399, model.sku().capacity()); - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.APPROVED, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("ybrk", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("dumjgrtfwvuk", model.privateLinkServiceConnectionState().actionsRequired()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionInner model = - new PrivateEndpointConnectionInner() - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.NONE) - .withUserAssignedIdentities( - mapOf( - "jcny", - new UserAssignedIdentity(), - "kryhtnapczwlokj", - new UserAssignedIdentity(), - "kkvnipjox", - new UserAssignedIdentity()))) - .withLocation("nchgej") - .withTags( - mapOf( - "ahuxinpm", "dmailzydehojw", "vcputegj", "njaqwixjspro", "uuvmkjozkrwfnd", "wmfdatscmdvpjhul")) - .withSku( - new Sku() - .withName("djpslw") - .withTier(SkuTier.PREMIUM) - .withSize("vwryoqpso") - .withFamily("ctazakljlahbcryf") - .withCapacity(1389039399)) - .withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("ybrk") - .withActionsRequired("dumjgrtfwvuk")); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionInner.class); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.identity().type()); - Assertions.assertEquals("nchgej", model.location()); - Assertions.assertEquals("dmailzydehojw", model.tags().get("ahuxinpm")); - Assertions.assertEquals("djpslw", model.sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.sku().tier()); - Assertions.assertEquals("vwryoqpso", model.sku().size()); - Assertions.assertEquals("ctazakljlahbcryf", model.sku().family()); - Assertions.assertEquals(1389039399, model.sku().capacity()); - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.APPROVED, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("ybrk", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("dumjgrtfwvuk", model.privateLinkServiceConnectionState().actionsRequired()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionListResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionListResultTests.java deleted file mode 100644 index 225154582dcf3..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionListResultTests.java +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpointConnectionListResult; -import com.azure.resourcemanager.machinelearning.models.Sku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\"},\"identity\":{\"principalId\":\"a16b0819-56bd-4218-8f63-1a6e43318690\",\"tenantId\":\"e99cad70-8299-4702-98fd-698d21448ff7\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{}},\"location\":\"k\",\"tags\":{\"kphywpnvjto\":\"dhbt\"},\"sku\":{\"name\":\"ermclfplphoxuscr\",\"tier\":\"Basic\",\"size\":\"ye\",\"family\":\"bjtazqugxywpmu\",\"capacity\":737814385},\"id\":\"zwfqkqujidsuyon\",\"name\":\"bglaocqxtccm\",\"type\":\"yudxytlmoy\"},{\"properties\":{\"provisioningState\":\"Creating\"},\"identity\":{\"principalId\":\"170fc112-1b20-4f58-819c-51041af9f532\",\"tenantId\":\"7ad71cc8-ee0b-4afa-8b0e-bab53c22c7f4\",\"type\":\"None\",\"userAssignedIdentities\":{}},\"location\":\"txhdzh\",\"tags\":{\"sbkyvpycanuzbp\":\"jbhckfrlhr\"},\"sku\":{\"name\":\"afkuwb\",\"tier\":\"Basic\",\"size\":\"bmehh\",\"family\":\"yvjusrtslhsp\",\"capacity\":1857421626},\"id\":\"maofmxagkv\",\"name\":\"melmqkrha\",\"type\":\"vljua\"},{\"properties\":{\"provisioningState\":\"Deleting\"},\"identity\":{\"principalId\":\"7ee1c31e-ec49-456e-8ea8-78f4129f7b6f\",\"tenantId\":\"0b889b39-707f-4b57-839f-013c448bcd09\",\"type\":\"None\",\"userAssignedIdentities\":{}},\"location\":\"alaexqpvfadmwsrc\",\"tags\":{\"zlfmisgwbnbbeld\":\"xpvgo\",\"ali\":\"wkz\"},\"sku\":{\"name\":\"rqhakauha\",\"tier\":\"Standard\",\"size\":\"wxosowzxcug\",\"family\":\"jooxdjebw\",\"capacity\":741000017},\"id\":\"wfvovbv\",\"name\":\"euecivyhzceuoj\",\"type\":\"jrwjueiotwm\"},{\"properties\":{\"provisioningState\":\"Creating\"},\"identity\":{\"principalId\":\"f58ea4b5-f02e-496b-a143-d4e796072a44\",\"tenantId\":\"ccb2ecc9-f620-4ad9-9e68-75414abeb40c\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{}},\"location\":\"rjaw\",\"tags\":{\"fbkp\":\"gxhnisk\",\"lwn\":\"cg\"},\"sku\":{\"name\":\"hjdauwhvylwz\",\"tier\":\"Standard\",\"size\":\"xujznbmpowu\",\"family\":\"rzqlveu\",\"capacity\":1056372950},\"id\":\"j\",\"name\":\"khfxobbcswsrt\",\"type\":\"riplrbpbewtg\"}]}") - .toObject(PrivateEndpointConnectionListResult.class); - Assertions - .assertEquals( - ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("k", model.value().get(0).location()); - Assertions.assertEquals("dhbt", model.value().get(0).tags().get("kphywpnvjto")); - Assertions.assertEquals("ermclfplphoxuscr", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.BASIC, model.value().get(0).sku().tier()); - Assertions.assertEquals("ye", model.value().get(0).sku().size()); - Assertions.assertEquals("bjtazqugxywpmu", model.value().get(0).sku().family()); - Assertions.assertEquals(737814385, model.value().get(0).sku().capacity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionListResult model = - new PrivateEndpointConnectionListResult() - .withValue( - Arrays - .asList( - new PrivateEndpointConnectionInner() - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withLocation("k") - .withTags(mapOf("kphywpnvjto", "dhbt")) - .withSku( - new Sku() - .withName("ermclfplphoxuscr") - .withTier(SkuTier.BASIC) - .withSize("ye") - .withFamily("bjtazqugxywpmu") - .withCapacity(737814385)), - new PrivateEndpointConnectionInner() - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.NONE) - .withUserAssignedIdentities(mapOf())) - .withLocation("txhdzh") - .withTags(mapOf("sbkyvpycanuzbp", "jbhckfrlhr")) - .withSku( - new Sku() - .withName("afkuwb") - .withTier(SkuTier.BASIC) - .withSize("bmehh") - .withFamily("yvjusrtslhsp") - .withCapacity(1857421626)), - new PrivateEndpointConnectionInner() - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.NONE) - .withUserAssignedIdentities(mapOf())) - .withLocation("alaexqpvfadmwsrc") - .withTags(mapOf("zlfmisgwbnbbeld", "xpvgo", "ali", "wkz")) - .withSku( - new Sku() - .withName("rqhakauha") - .withTier(SkuTier.STANDARD) - .withSize("wxosowzxcug") - .withFamily("jooxdjebw") - .withCapacity(741000017)), - new PrivateEndpointConnectionInner() - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withLocation("rjaw") - .withTags(mapOf("fbkp", "gxhnisk", "lwn", "cg")) - .withSku( - new Sku() - .withName("hjdauwhvylwz") - .withTier(SkuTier.STANDARD) - .withSize("xujznbmpowu") - .withFamily("rzqlveu") - .withCapacity(1056372950)))); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionListResult.class); - Assertions - .assertEquals( - ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("k", model.value().get(0).location()); - Assertions.assertEquals("dhbt", model.value().get(0).tags().get("kphywpnvjto")); - Assertions.assertEquals("ermclfplphoxuscr", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.BASIC, model.value().get(0).sku().tier()); - Assertions.assertEquals("ye", model.value().get(0).sku().size()); - Assertions.assertEquals("bjtazqugxywpmu", model.value().get(0).sku().family()); - Assertions.assertEquals(737814385, model.value().get(0).sku().capacity()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionPropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionPropertiesTests.java deleted file mode 100644 index 2c41aa44579b6..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionPropertiesTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.PrivateEndpointConnectionProperties; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpoint; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.machinelearning.models.PrivateLinkServiceConnectionState; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionProperties model = - BinaryData - .fromString( - "{\"privateEndpoint\":{\"id\":\"bpf\",\"subnetArmId\":\"s\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"v\",\"actionsRequired\":\"jrwzox\"},\"provisioningState\":\"Creating\"}") - .toObject(PrivateEndpointConnectionProperties.class); - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.PENDING, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("v", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("jrwzox", model.privateLinkServiceConnectionState().actionsRequired()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionProperties model = - new PrivateEndpointConnectionProperties() - .withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.PENDING) - .withDescription("v") - .withActionsRequired("jrwzox")); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionProperties.class); - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.PENDING, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("v", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("jrwzox", model.privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsCreateOrUpdateWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 6ce45394fe2b4..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpoint; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpointConnection; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.machinelearning.models.PrivateLinkServiceConnectionState; -import com.azure.resourcemanager.machinelearning.models.Sku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"privateEndpoint\":{\"id\":\"k\",\"subnetArmId\":\"zkdtzxsoed\"},\"privateLinkServiceConnectionState\":{\"status\":\"Timeout\",\"description\":\"li\",\"actionsRequired\":\"zomucmqgisnionet\"},\"provisioningState\":\"Succeeded\"},\"identity\":{\"principalId\":\"6990e6f7-106a-433c-997d-a718208f7ce7\",\"tenantId\":\"38771c9c-5b53-4d64-924e-98d9bc7791cc\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"location\":\"kgtlzl\",\"tags\":{\"zkbnbmxl\":\"lxcznn\",\"g\":\"mwt\",\"ahfsgb\":\"qzusitoq\"},\"sku\":{\"name\":\"lreesrfwsszvlcwl\",\"tier\":\"Basic\",\"size\":\"ntfxxcrqmipfjwfo\",\"family\":\"izmshxxba\",\"capacity\":1165412558},\"id\":\"ulnvgskj\",\"name\":\"o\",\"type\":\"jdzjsjzn\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateEndpointConnection response = - manager - .privateEndpointConnections() - .define("dpwrp") - .withExistingWorkspace("ycpawm", "jp") - .withRegion("qp") - .withTags(mapOf("qgcnbhcbmjk", "zihqod", "n", "ti")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withSku( - new Sku() - .withName("ntsxjmfmeftvh") - .withTier(SkuTier.FREE) - .withSize("gjrhs") - .withFamily("w") - .withCapacity(2051010260)) - .withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) - .withDescription("eyam") - .withActionsRequired("idmdiawpzxkzrntm")) - .create(); - - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.identity().type()); - Assertions.assertEquals("kgtlzl", response.location()); - Assertions.assertEquals("lxcznn", response.tags().get("zkbnbmxl")); - Assertions.assertEquals("lreesrfwsszvlcwl", response.sku().name()); - Assertions.assertEquals(SkuTier.BASIC, response.sku().tier()); - Assertions.assertEquals("ntfxxcrqmipfjwfo", response.sku().size()); - Assertions.assertEquals("izmshxxba", response.sku().family()); - Assertions.assertEquals(1165412558, response.sku().capacity()); - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.TIMEOUT, response.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("li", response.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("zomucmqgisnionet", response.privateLinkServiceConnectionState().actionsRequired()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsDeleteWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsDeleteWithResponseMockTests.java deleted file mode 100644 index 65d4a6a1878a5..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .privateEndpointConnections() - .deleteWithResponse("yuqh", "lmcskyk", "fuofixcnpcfykkp", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java deleted file mode 100644 index 92b171c50ec4d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpointConnection; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"privateEndpoint\":{\"id\":\"wzlzklasl\",\"subnetArmId\":\"ciz\"},\"privateLinkServiceConnectionState\":{\"status\":\"Timeout\",\"description\":\"arwp\",\"actionsRequired\":\"saudoejtighsx\"},\"provisioningState\":\"Creating\"},\"identity\":{\"principalId\":\"77a4ccdb-fb26-4f04-884f-577353706d15\",\"tenantId\":\"82e5dd6c-ed00-424d-b9d3-56306a3b5e26\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{}},\"location\":\"ahovuuw\",\"tags\":{\"jnhj\":\"e\",\"fbbcngkegxcypxbb\":\"oti\",\"qlf\":\"etwilyrzoxpd\"},\"sku\":{\"name\":\"lqownkiua\",\"tier\":\"Free\",\"size\":\"ahwkxjjm\",\"family\":\"nlmsoo\",\"capacity\":1046371938},\"id\":\"ecdh\",\"name\":\"yswcrptveajczx\",\"type\":\"lgsrgkrfizrpywlp\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateEndpointConnection response = - manager - .privateEndpointConnections() - .getWithResponse("bkbdhlltqstqkqs", "gxiynecovagzk", "eubanlxunpqcc", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, response.identity().type()); - Assertions.assertEquals("ahovuuw", response.location()); - Assertions.assertEquals("e", response.tags().get("jnhj")); - Assertions.assertEquals("lqownkiua", response.sku().name()); - Assertions.assertEquals(SkuTier.FREE, response.sku().tier()); - Assertions.assertEquals("ahwkxjjm", response.sku().size()); - Assertions.assertEquals("nlmsoo", response.sku().family()); - Assertions.assertEquals(1046371938, response.sku().capacity()); - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.TIMEOUT, response.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("arwp", response.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("saudoejtighsx", response.privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsListMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsListMockTests.java deleted file mode 100644 index 499e64fc382e4..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointConnectionsListMockTests.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpointConnection; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"m\",\"subnetArmId\":\"wrjlvzkl\"},\"privateLinkServiceConnectionState\":{\"status\":\"Timeout\",\"description\":\"ikyjtkakvlb\",\"actionsRequired\":\"hjvpzaptu\"},\"provisioningState\":\"Deleting\"},\"identity\":{\"principalId\":\"a1ace026-f3aa-406c-8a65-a498830c671a\",\"tenantId\":\"c3c04e1d-18fa-479e-90c4-b10480fc598c\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"location\":\"wfgcdiykkcxwn\",\"tags\":{\"qohhihra\":\"qynvavitmdm\",\"rhlhpvzadbwenni\":\"quddrwjclj\",\"viqlluk\":\"afhxrzfrmvztiuc\"},\"sku\":{\"name\":\"rcqxgcbvzarmqc\",\"tier\":\"Premium\",\"size\":\"stsinvag\",\"family\":\"jyhdrxb\",\"capacity\":1587779031},\"id\":\"ehqwhitxnmxgn\",\"name\":\"guzbuw\",\"type\":\"orbalkj\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.privateEndpointConnections().list("ti", "zkaugpucdocfqpl", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.iterator().next().identity().type()); - Assertions.assertEquals("wfgcdiykkcxwn", response.iterator().next().location()); - Assertions.assertEquals("qynvavitmdm", response.iterator().next().tags().get("qohhihra")); - Assertions.assertEquals("rcqxgcbvzarmqc", response.iterator().next().sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, response.iterator().next().sku().tier()); - Assertions.assertEquals("stsinvag", response.iterator().next().sku().size()); - Assertions.assertEquals("jyhdrxb", response.iterator().next().sku().family()); - Assertions.assertEquals(1587779031, response.iterator().next().sku().capacity()); - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.TIMEOUT, - response.iterator().next().privateLinkServiceConnectionState().status()); - Assertions - .assertEquals("ikyjtkakvlb", response.iterator().next().privateLinkServiceConnectionState().description()); - Assertions - .assertEquals( - "hjvpzaptu", response.iterator().next().privateLinkServiceConnectionState().actionsRequired()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointTests.java deleted file mode 100644 index aa276bedb6103..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateEndpointTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpoint; - -public final class PrivateEndpointTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpoint model = - BinaryData.fromString("{\"id\":\"elluwfziton\",\"subnetArmId\":\"qfpjk\"}").toObject(PrivateEndpoint.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpoint model = new PrivateEndpoint(); - model = BinaryData.fromObject(model).toObject(PrivateEndpoint.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkResourceListResultInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkResourceListResultInnerTests.java deleted file mode 100644 index 5ac2e05981140..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkResourceListResultInnerTests.java +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.PrivateLinkResourceListResultInner; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.PrivateLinkResource; -import com.azure.resourcemanager.machinelearning.models.Sku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkResourceListResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceListResultInner model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"groupId\":\"c\",\"requiredMembers\":[],\"requiredZoneNames\":[]},\"identity\":{\"principalId\":\"7350756a-3e63-4658-9b36-a4c2e5f3a6d9\",\"tenantId\":\"02570bb2-e352-4d93-9bd1-d3451723dd5b\",\"type\":\"None\",\"userAssignedIdentities\":{}},\"location\":\"jkbegibtnmxiebww\",\"tags\":{\"tzjuzgwyzmhtxo\":\"ayqcgw\",\"nftguvriuhpr\":\"gmtsavjcbpwxqpsr\"},\"sku\":{\"name\":\"dyvxqtayriww\",\"tier\":\"Premium\",\"size\":\"bexrmcq\",\"family\":\"ycnojvknmefqsg\",\"capacity\":488274582},\"id\":\"apj\",\"name\":\"zhpvgqzcjrvxd\",\"type\":\"zlmwlxkvugfhz\"},{\"properties\":{\"groupId\":\"wjvzunluthnn\",\"requiredMembers\":[],\"requiredZoneNames\":[]},\"identity\":{\"principalId\":\"6cd9bb2d-0450-4976-a3e0-e2008cd6e042\",\"tenantId\":\"9dd771d6-e628-44bb-a9c6-f9185d3fbc61\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{}},\"location\":\"pjzu\",\"tags\":{\"kzbbtd\":\"xdult\",\"bsjyofdx\":\"umveekgpwozuhkf\",\"oekqvk\":\"uusdttouwa\",\"vbxwyjsflhh\":\"lns\"},\"sku\":{\"name\":\"aln\",\"tier\":\"Premium\",\"size\":\"sxyawjoyaqcs\",\"family\":\"jpkiidzyexznelix\",\"capacity\":705550222},\"id\":\"tfolhbnx\",\"name\":\"nalaulppg\",\"type\":\"dtpnapnyiropuhp\"},{\"properties\":{\"groupId\":\"pgylg\",\"requiredMembers\":[],\"requiredZoneNames\":[]},\"identity\":{\"principalId\":\"87b8d495-467b-4407-881f-0443f65da17d\",\"tenantId\":\"79df8e42-2e01-42d2-92af-39e2c1627e59\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"location\":\"v\",\"tags\":{\"rmgucnap\":\"ynqwwncwzzhxgk\",\"oellwp\":\"t\",\"qrhhu\":\"fdygpfqbuaceopz\"},\"sku\":{\"name\":\"pppcqeqxo\",\"tier\":\"Standard\",\"size\":\"hzxct\",\"family\":\"gbkdmoizpos\",\"capacity\":1176728044},\"id\":\"cfbu\",\"name\":\"rmfqjhhkxbpvj\",\"type\":\"mjh\"}]}") - .toObject(PrivateLinkResourceListResultInner.class); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.value().get(0).identity().type()); - Assertions.assertEquals("jkbegibtnmxiebww", model.value().get(0).location()); - Assertions.assertEquals("ayqcgw", model.value().get(0).tags().get("tzjuzgwyzmhtxo")); - Assertions.assertEquals("dyvxqtayriww", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.value().get(0).sku().tier()); - Assertions.assertEquals("bexrmcq", model.value().get(0).sku().size()); - Assertions.assertEquals("ycnojvknmefqsg", model.value().get(0).sku().family()); - Assertions.assertEquals(488274582, model.value().get(0).sku().capacity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceListResultInner model = - new PrivateLinkResourceListResultInner() - .withValue( - Arrays - .asList( - new PrivateLinkResource() - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.NONE) - .withUserAssignedIdentities(mapOf())) - .withLocation("jkbegibtnmxiebww") - .withTags(mapOf("tzjuzgwyzmhtxo", "ayqcgw", "nftguvriuhpr", "gmtsavjcbpwxqpsr")) - .withSku( - new Sku() - .withName("dyvxqtayriww") - .withTier(SkuTier.PREMIUM) - .withSize("bexrmcq") - .withFamily("ycnojvknmefqsg") - .withCapacity(488274582)) - .withRequiredZoneNames(Arrays.asList()), - new PrivateLinkResource() - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withLocation("pjzu") - .withTags( - mapOf( - "kzbbtd", - "xdult", - "bsjyofdx", - "umveekgpwozuhkf", - "oekqvk", - "uusdttouwa", - "vbxwyjsflhh", - "lns")) - .withSku( - new Sku() - .withName("aln") - .withTier(SkuTier.PREMIUM) - .withSize("sxyawjoyaqcs") - .withFamily("jpkiidzyexznelix") - .withCapacity(705550222)) - .withRequiredZoneNames(Arrays.asList()), - new PrivateLinkResource() - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withLocation("v") - .withTags( - mapOf("rmgucnap", "ynqwwncwzzhxgk", "oellwp", "t", "qrhhu", "fdygpfqbuaceopz")) - .withSku( - new Sku() - .withName("pppcqeqxo") - .withTier(SkuTier.STANDARD) - .withSize("hzxct") - .withFamily("gbkdmoizpos") - .withCapacity(1176728044)) - .withRequiredZoneNames(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceListResultInner.class); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.value().get(0).identity().type()); - Assertions.assertEquals("jkbegibtnmxiebww", model.value().get(0).location()); - Assertions.assertEquals("ayqcgw", model.value().get(0).tags().get("tzjuzgwyzmhtxo")); - Assertions.assertEquals("dyvxqtayriww", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.value().get(0).sku().tier()); - Assertions.assertEquals("bexrmcq", model.value().get(0).sku().size()); - Assertions.assertEquals("ycnojvknmefqsg", model.value().get(0).sku().family()); - Assertions.assertEquals(488274582, model.value().get(0).sku().capacity()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkResourcePropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkResourcePropertiesTests.java deleted file mode 100644 index 2a47ff8596969..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkResourcePropertiesTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.PrivateLinkResourceProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkResourcePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceProperties model = - BinaryData - .fromString( - "{\"groupId\":\"ifthnz\",\"requiredMembers\":[\"sl\",\"nayqi\",\"ynduha\",\"hqlkthumaqo\"],\"requiredZoneNames\":[\"ycduier\",\"gccymvaolpssl\"]}") - .toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("ycduier", model.requiredZoneNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceProperties model = - new PrivateLinkResourceProperties().withRequiredZoneNames(Arrays.asList("ycduier", "gccymvaolpssl")); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("ycduier", model.requiredZoneNames().get(0)); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkResourceTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkResourceTests.java deleted file mode 100644 index b69f2148738bf..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkResourceTests.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.PrivateLinkResource; -import com.azure.resourcemanager.machinelearning.models.Sku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import com.azure.resourcemanager.machinelearning.models.UserAssignedIdentity; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkResourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResource model = - BinaryData - .fromString( - "{\"properties\":{\"groupId\":\"yngudivk\",\"requiredMembers\":[\"wbxqzvszjfau\",\"j\"],\"requiredZoneNames\":[\"xivetvt\",\"qaqtdoqmcbxvwvxy\"]},\"identity\":{\"principalId\":\"5fc3592b-d219-44be-b65a-2e2b3de76d9f\",\"tenantId\":\"712bd8ad-1151-45f2-bf61-d3e7de7dee99\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"blytk\":{\"principalId\":\"a95d1cdd-f7ed-4f87-a472-8a4bf616620d\",\"clientId\":\"f6f8621d-afad-499a-badb-6ecb26a9f3bb\"},\"pe\":{\"principalId\":\"fca7d1ee-b91d-42ac-9117-8d0ab41ca837\",\"clientId\":\"02cc4e93-4a44-44b6-a4b9-9f73d769c0c8\"},\"fbkrvrnsvs\":{\"principalId\":\"6434654b-4b63-4930-a988-6c07d2c784db\",\"clientId\":\"52f29274-c586-42d1-b67f-e1d18d5fb113\"}}},\"location\":\"johxcrsb\",\"tags\":{\"wbhsqfsub\":\"asrru\",\"rxbpyb\":\"gjb\",\"twss\":\"rfbjf\"},\"sku\":{\"name\":\"ftpvjzbexil\",\"tier\":\"Basic\",\"size\":\"qqnvwpmq\",\"family\":\"ruoujmk\",\"capacity\":1426920839},\"id\":\"qytjrybnwjewgd\",\"name\":\"jervnaenqpehi\",\"type\":\"doy\"}") - .toObject(PrivateLinkResource.class); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("johxcrsb", model.location()); - Assertions.assertEquals("asrru", model.tags().get("wbhsqfsub")); - Assertions.assertEquals("ftpvjzbexil", model.sku().name()); - Assertions.assertEquals(SkuTier.BASIC, model.sku().tier()); - Assertions.assertEquals("qqnvwpmq", model.sku().size()); - Assertions.assertEquals("ruoujmk", model.sku().family()); - Assertions.assertEquals(1426920839, model.sku().capacity()); - Assertions.assertEquals("xivetvt", model.requiredZoneNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResource model = - new PrivateLinkResource() - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf( - "blytk", - new UserAssignedIdentity(), - "pe", - new UserAssignedIdentity(), - "fbkrvrnsvs", - new UserAssignedIdentity()))) - .withLocation("johxcrsb") - .withTags(mapOf("wbhsqfsub", "asrru", "rxbpyb", "gjb", "twss", "rfbjf")) - .withSku( - new Sku() - .withName("ftpvjzbexil") - .withTier(SkuTier.BASIC) - .withSize("qqnvwpmq") - .withFamily("ruoujmk") - .withCapacity(1426920839)) - .withRequiredZoneNames(Arrays.asList("xivetvt", "qaqtdoqmcbxvwvxy")); - model = BinaryData.fromObject(model).toObject(PrivateLinkResource.class); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("johxcrsb", model.location()); - Assertions.assertEquals("asrru", model.tags().get("wbhsqfsub")); - Assertions.assertEquals("ftpvjzbexil", model.sku().name()); - Assertions.assertEquals(SkuTier.BASIC, model.sku().tier()); - Assertions.assertEquals("qqnvwpmq", model.sku().size()); - Assertions.assertEquals("ruoujmk", model.sku().family()); - Assertions.assertEquals(1426920839, model.sku().capacity()); - Assertions.assertEquals("xivetvt", model.requiredZoneNames().get(0)); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkResourcesListWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkResourcesListWithResponseMockTests.java deleted file mode 100644 index 8cd519e982946..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkResourcesListWithResponseMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.PrivateLinkResourceListResult; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateLinkResourcesListWithResponseMockTests { - @Test - public void testListWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"location\":\"c\",\"tags\":{\"m\":\"fshksnyzmspamwb\",\"qdktwtkvihlp\":\"nlslcef\",\"zhwv\":\"liwoyngu\"},\"id\":\"p\",\"name\":\"mhjhaus\",\"type\":\"b\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateLinkResourceListResult response = - manager - .privateLinkResources() - .listWithResponse("hxqqmqip", "y", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("c", response.value().get(0).location()); - Assertions.assertEquals("fshksnyzmspamwb", response.value().get(0).tags().get("m")); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkServiceConnectionStateTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkServiceConnectionStateTests.java deleted file mode 100644 index 49d48777e4404..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PrivateLinkServiceConnectionStateTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.machinelearning.models.PrivateLinkServiceConnectionState; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkServiceConnectionStateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkServiceConnectionState model = - BinaryData - .fromString( - "{\"status\":\"Disconnected\",\"description\":\"fpdvhpfxxypi\",\"actionsRequired\":\"nmayhuybb\"}") - .toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.DISCONNECTED, model.status()); - Assertions.assertEquals("fpdvhpfxxypi", model.description()); - Assertions.assertEquals("nmayhuybb", model.actionsRequired()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkServiceConnectionState model = - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.DISCONNECTED) - .withDescription("fpdvhpfxxypi") - .withActionsRequired("nmayhuybb"); - model = BinaryData.fromObject(model).toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.DISCONNECTED, model.status()); - Assertions.assertEquals("fpdvhpfxxypi", model.description()); - Assertions.assertEquals("nmayhuybb", model.actionsRequired()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ProbeSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ProbeSettingsTests.java deleted file mode 100644 index a2503cf5c9cbd..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ProbeSettingsTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ProbeSettings; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class ProbeSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProbeSettings model = - BinaryData - .fromString( - "{\"failureThreshold\":1906628483,\"initialDelay\":\"PT113H32M27S\",\"period\":\"PT148H10M\",\"successThreshold\":619019093,\"timeout\":\"PT78H24M37S\"}") - .toObject(ProbeSettings.class); - Assertions.assertEquals(1906628483, model.failureThreshold()); - Assertions.assertEquals(Duration.parse("PT113H32M27S"), model.initialDelay()); - Assertions.assertEquals(Duration.parse("PT148H10M"), model.period()); - Assertions.assertEquals(619019093, model.successThreshold()); - Assertions.assertEquals(Duration.parse("PT78H24M37S"), model.timeout()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProbeSettings model = - new ProbeSettings() - .withFailureThreshold(1906628483) - .withInitialDelay(Duration.parse("PT113H32M27S")) - .withPeriod(Duration.parse("PT148H10M")) - .withSuccessThreshold(619019093) - .withTimeout(Duration.parse("PT78H24M37S")); - model = BinaryData.fromObject(model).toObject(ProbeSettings.class); - Assertions.assertEquals(1906628483, model.failureThreshold()); - Assertions.assertEquals(Duration.parse("PT113H32M27S"), model.initialDelay()); - Assertions.assertEquals(Duration.parse("PT148H10M"), model.period()); - Assertions.assertEquals(619019093, model.successThreshold()); - Assertions.assertEquals(Duration.parse("PT78H24M37S"), model.timeout()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PyTorchTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PyTorchTests.java deleted file mode 100644 index 4400de400ecd2..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/PyTorchTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.PyTorch; -import org.junit.jupiter.api.Assertions; - -public final class PyTorchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PyTorch model = - BinaryData - .fromString("{\"distributionType\":\"PyTorch\",\"processCountPerInstance\":1314386445}") - .toObject(PyTorch.class); - Assertions.assertEquals(1314386445, model.processCountPerInstance()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PyTorch model = new PyTorch().withProcessCountPerInstance(1314386445); - model = BinaryData.fromObject(model).toObject(PyTorch.class); - Assertions.assertEquals(1314386445, model.processCountPerInstance()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/QuotaBasePropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/QuotaBasePropertiesTests.java deleted file mode 100644 index a68e619c802bd..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/QuotaBasePropertiesTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.QuotaBaseProperties; -import com.azure.resourcemanager.machinelearning.models.QuotaUnit; -import org.junit.jupiter.api.Assertions; - -public final class QuotaBasePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QuotaBaseProperties model = - BinaryData - .fromString( - "{\"id\":\"ozmyzydagfu\",\"type\":\"bezy\",\"limit\":1156651479695546396,\"unit\":\"Count\"}") - .toObject(QuotaBaseProperties.class); - Assertions.assertEquals("ozmyzydagfu", model.id()); - Assertions.assertEquals("bezy", model.type()); - Assertions.assertEquals(1156651479695546396L, model.limit()); - Assertions.assertEquals(QuotaUnit.COUNT, model.unit()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuotaBaseProperties model = - new QuotaBaseProperties() - .withId("ozmyzydagfu") - .withType("bezy") - .withLimit(1156651479695546396L) - .withUnit(QuotaUnit.COUNT); - model = BinaryData.fromObject(model).toObject(QuotaBaseProperties.class); - Assertions.assertEquals("ozmyzydagfu", model.id()); - Assertions.assertEquals("bezy", model.type()); - Assertions.assertEquals(1156651479695546396L, model.limit()); - Assertions.assertEquals(QuotaUnit.COUNT, model.unit()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/QuotaUpdateParametersTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/QuotaUpdateParametersTests.java deleted file mode 100644 index cdd5e013b5a5d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/QuotaUpdateParametersTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.QuotaBaseProperties; -import com.azure.resourcemanager.machinelearning.models.QuotaUnit; -import com.azure.resourcemanager.machinelearning.models.QuotaUpdateParameters; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class QuotaUpdateParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QuotaUpdateParameters model = - BinaryData - .fromString( - "{\"value\":[{\"id\":\"oaeupfhyhltrpmo\",\"type\":\"mcmatuokthfuiu\",\"limit\":6209557393905029674,\"unit\":\"Count\"}],\"location\":\"kvxod\"}") - .toObject(QuotaUpdateParameters.class); - Assertions.assertEquals("oaeupfhyhltrpmo", model.value().get(0).id()); - Assertions.assertEquals("mcmatuokthfuiu", model.value().get(0).type()); - Assertions.assertEquals(6209557393905029674L, model.value().get(0).limit()); - Assertions.assertEquals(QuotaUnit.COUNT, model.value().get(0).unit()); - Assertions.assertEquals("kvxod", model.location()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuotaUpdateParameters model = - new QuotaUpdateParameters() - .withValue( - Arrays - .asList( - new QuotaBaseProperties() - .withId("oaeupfhyhltrpmo") - .withType("mcmatuokthfuiu") - .withLimit(6209557393905029674L) - .withUnit(QuotaUnit.COUNT))) - .withLocation("kvxod"); - model = BinaryData.fromObject(model).toObject(QuotaUpdateParameters.class); - Assertions.assertEquals("oaeupfhyhltrpmo", model.value().get(0).id()); - Assertions.assertEquals("mcmatuokthfuiu", model.value().get(0).type()); - Assertions.assertEquals(6209557393905029674L, model.value().get(0).limit()); - Assertions.assertEquals(QuotaUnit.COUNT, model.value().get(0).unit()); - Assertions.assertEquals("kvxod", model.location()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/QuotasListMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/QuotasListMockTests.java deleted file mode 100644 index 64b726ec63d5f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/QuotasListMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ResourceQuota; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class QuotasListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"id\":\"txop\",\"amlWorkspaceLocation\":\"hpadkmdzg\",\"type\":\"zxvctkbbxuharls\",\"name\":{\"value\":\"ccla\",\"localizedValue\":\"oyn\"},\"limit\":3258721915949075156,\"unit\":\"Count\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.quotas().list("drhutfdo", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/QuotasUpdateWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/QuotasUpdateWithResponseMockTests.java deleted file mode 100644 index 331408e61af21..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/QuotasUpdateWithResponseMockTests.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.QuotaBaseProperties; -import com.azure.resourcemanager.machinelearning.models.QuotaUnit; -import com.azure.resourcemanager.machinelearning.models.QuotaUpdateParameters; -import com.azure.resourcemanager.machinelearning.models.UpdateWorkspaceQuotasResult; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class QuotasUpdateWithResponseMockTests { - @Test - public void testUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"id\":\"ud\",\"type\":\"ckaprhknqiijge\",\"limit\":564973110703252614,\"unit\":\"Count\",\"status\":\"InvalidVMFamilyName\"},{\"id\":\"qih\",\"type\":\"yowltj\",\"limit\":818494289048822861,\"unit\":\"Count\",\"status\":\"OperationNotEnabledForRegion\"},{\"id\":\"ieproqksmfxm\",\"type\":\"prstvkitbfj\",\"limit\":2706549674295489273,\"unit\":\"Count\",\"status\":\"Success\"}],\"nextLink\":\"acqoccqrqxwetj\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - UpdateWorkspaceQuotasResult response = - manager - .quotas() - .updateWithResponse( - "aaneakhtmhobcya", - new QuotaUpdateParameters() - .withValue( - Arrays - .asList( - new QuotaBaseProperties() - .withId("qtvkh") - .withType("oog") - .withLimit(8839691341349880163L) - .withUnit(QuotaUnit.COUNT), - new QuotaBaseProperties() - .withId("qymhcctopuow") - .withType("nskby") - .withLimit(4791092419176992520L) - .withUnit(QuotaUnit.COUNT), - new QuotaBaseProperties() - .withId("gx") - .withType("ajpxecxqnwhscoza") - .withLimit(5738000548376016022L) - .withUnit(QuotaUnit.COUNT))) - .withLocation("pknpwirfljfewxq"), - com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RandomSamplingAlgorithmTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RandomSamplingAlgorithmTests.java deleted file mode 100644 index fc93ee725ae10..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RandomSamplingAlgorithmTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.RandomSamplingAlgorithm; -import com.azure.resourcemanager.machinelearning.models.RandomSamplingAlgorithmRule; -import org.junit.jupiter.api.Assertions; - -public final class RandomSamplingAlgorithmTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RandomSamplingAlgorithm model = - BinaryData - .fromString("{\"samplingAlgorithmType\":\"Random\",\"rule\":\"Random\",\"seed\":1677252615}") - .toObject(RandomSamplingAlgorithm.class); - Assertions.assertEquals(RandomSamplingAlgorithmRule.RANDOM, model.rule()); - Assertions.assertEquals(1677252615, model.seed()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RandomSamplingAlgorithm model = - new RandomSamplingAlgorithm().withRule(RandomSamplingAlgorithmRule.RANDOM).withSeed(1677252615); - model = BinaryData.fromObject(model).toObject(RandomSamplingAlgorithm.class); - Assertions.assertEquals(RandomSamplingAlgorithmRule.RANDOM, model.rule()); - Assertions.assertEquals(1677252615, model.seed()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RecurrenceScheduleTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RecurrenceScheduleTests.java deleted file mode 100644 index f20c15c87d6fa..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RecurrenceScheduleTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.RecurrenceSchedule; -import com.azure.resourcemanager.machinelearning.models.WeekDay; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class RecurrenceScheduleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RecurrenceSchedule model = - BinaryData - .fromString( - "{\"hours\":[2030386405,1910653936,488610875,1439896312],\"minutes\":[1083020573],\"monthDays\":[1541422170,1378797079,254990993],\"weekDays\":[\"Friday\",\"Saturday\",\"Saturday\"]}") - .toObject(RecurrenceSchedule.class); - Assertions.assertEquals(2030386405, model.hours().get(0)); - Assertions.assertEquals(1083020573, model.minutes().get(0)); - Assertions.assertEquals(1541422170, model.monthDays().get(0)); - Assertions.assertEquals(WeekDay.FRIDAY, model.weekDays().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RecurrenceSchedule model = - new RecurrenceSchedule() - .withHours(Arrays.asList(2030386405, 1910653936, 488610875, 1439896312)) - .withMinutes(Arrays.asList(1083020573)) - .withMonthDays(Arrays.asList(1541422170, 1378797079, 254990993)) - .withWeekDays(Arrays.asList(WeekDay.FRIDAY, WeekDay.SATURDAY, WeekDay.SATURDAY)); - model = BinaryData.fromObject(model).toObject(RecurrenceSchedule.class); - Assertions.assertEquals(2030386405, model.hours().get(0)); - Assertions.assertEquals(1083020573, model.minutes().get(0)); - Assertions.assertEquals(1541422170, model.monthDays().get(0)); - Assertions.assertEquals(WeekDay.FRIDAY, model.weekDays().get(0)); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RecurrenceTriggerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RecurrenceTriggerTests.java deleted file mode 100644 index f2509ff03af75..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RecurrenceTriggerTests.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.RecurrenceFrequency; -import com.azure.resourcemanager.machinelearning.models.RecurrenceSchedule; -import com.azure.resourcemanager.machinelearning.models.RecurrenceTrigger; -import com.azure.resourcemanager.machinelearning.models.WeekDay; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class RecurrenceTriggerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RecurrenceTrigger model = - BinaryData - .fromString( - "{\"triggerType\":\"Recurrence\",\"frequency\":\"Hour\",\"interval\":712298972,\"schedule\":{\"hours\":[2143245313,620966114],\"minutes\":[41999694,2076319922],\"monthDays\":[2043297749,1561277343,1217879659,986610623],\"weekDays\":[\"Wednesday\",\"Monday\"]},\"endTime\":\"rlktgjcsggu\",\"startTime\":\"eml\",\"timeZone\":\"waeeczgfb\"}") - .toObject(RecurrenceTrigger.class); - Assertions.assertEquals("rlktgjcsggu", model.endTime()); - Assertions.assertEquals("eml", model.startTime()); - Assertions.assertEquals("waeeczgfb", model.timeZone()); - Assertions.assertEquals(RecurrenceFrequency.HOUR, model.frequency()); - Assertions.assertEquals(712298972, model.interval()); - Assertions.assertEquals(2143245313, model.schedule().hours().get(0)); - Assertions.assertEquals(41999694, model.schedule().minutes().get(0)); - Assertions.assertEquals(2043297749, model.schedule().monthDays().get(0)); - Assertions.assertEquals(WeekDay.WEDNESDAY, model.schedule().weekDays().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RecurrenceTrigger model = - new RecurrenceTrigger() - .withEndTime("rlktgjcsggu") - .withStartTime("eml") - .withTimeZone("waeeczgfb") - .withFrequency(RecurrenceFrequency.HOUR) - .withInterval(712298972) - .withSchedule( - new RecurrenceSchedule() - .withHours(Arrays.asList(2143245313, 620966114)) - .withMinutes(Arrays.asList(41999694, 2076319922)) - .withMonthDays(Arrays.asList(2043297749, 1561277343, 1217879659, 986610623)) - .withWeekDays(Arrays.asList(WeekDay.WEDNESDAY, WeekDay.MONDAY))); - model = BinaryData.fromObject(model).toObject(RecurrenceTrigger.class); - Assertions.assertEquals("rlktgjcsggu", model.endTime()); - Assertions.assertEquals("eml", model.startTime()); - Assertions.assertEquals("waeeczgfb", model.timeZone()); - Assertions.assertEquals(RecurrenceFrequency.HOUR, model.frequency()); - Assertions.assertEquals(712298972, model.interval()); - Assertions.assertEquals(2143245313, model.schedule().hours().get(0)); - Assertions.assertEquals(41999694, model.schedule().minutes().get(0)); - Assertions.assertEquals(2043297749, model.schedule().monthDays().get(0)); - Assertions.assertEquals(WeekDay.WEDNESDAY, model.schedule().weekDays().get(0)); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RegressionTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RegressionTests.java deleted file mode 100644 index 4151764643b30..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RegressionTests.java +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.BlockedTransformers; -import com.azure.resourcemanager.machinelearning.models.FeaturizationMode; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.LogVerbosity; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import com.azure.resourcemanager.machinelearning.models.NCrossValidations; -import com.azure.resourcemanager.machinelearning.models.Regression; -import com.azure.resourcemanager.machinelearning.models.RegressionModels; -import com.azure.resourcemanager.machinelearning.models.RegressionPrimaryMetrics; -import com.azure.resourcemanager.machinelearning.models.RegressionTrainingSettings; -import com.azure.resourcemanager.machinelearning.models.StackEnsembleSettings; -import com.azure.resourcemanager.machinelearning.models.StackMetaLearnerType; -import com.azure.resourcemanager.machinelearning.models.TableVerticalFeaturizationSettings; -import com.azure.resourcemanager.machinelearning.models.TableVerticalLimitSettings; -import java.time.Duration; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class RegressionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Regression model = - BinaryData - .fromString( - "{\"taskType\":\"Regression\",\"primaryMetric\":\"NormalizedRootMeanSquaredError\",\"trainingSettings\":{\"allowedTrainingAlgorithms\":[\"ElasticNet\"],\"blockedTrainingAlgorithms\":[\"ExtremeRandomTrees\",\"ElasticNet\"],\"enableDnnTraining\":false,\"enableModelExplainability\":false,\"enableOnnxCompatibleModels\":false,\"enableStackEnsemble\":true,\"enableVoteEnsemble\":false,\"ensembleModelDownloadTimeout\":\"PT84H43M30S\",\"stackEnsembleSettings\":{\"stackMetaLearnerKWargs\":\"datavsi\",\"stackMetaLearnerTrainPercentage\":29.842412252567886,\"stackMetaLearnerType\":\"LightGBMRegressor\"}},\"cvSplitColumnNames\":[\"zydisnuep\",\"wyj\",\"nldpxottd\"],\"featurizationSettings\":{\"blockedTransformers\":[\"CountVectorizer\",\"WoETargetEncoder\"],\"columnNameAndTypes\":{\"vcjwqwoqsratj\":\"zjihweebiphr\",\"jhfrzgdkkagv\":\"dhzybsp\"},\"enableDnnFeaturization\":true,\"mode\":\"Custom\",\"transformerParams\":{\"mo\":[]},\"datasetLanguage\":\"mzhwilzzhni\"},\"limitSettings\":{\"enableEarlyTermination\":true,\"exitScore\":3.9502204468192637,\"maxConcurrentTrials\":2133816848,\"maxCoresPerTrial\":444992966,\"maxTrials\":1238035913,\"timeout\":\"PT160H46M45S\",\"trialTimeout\":\"PT11H57M31S\"},\"nCrossValidations\":{\"mode\":\"NCrossValidations\"},\"testData\":{\"jobInputType\":\"mltable\",\"mode\":\"EvalDownload\",\"uri\":\"bkut\",\"description\":\"mltwjfluxynbpvzl\"},\"testDataSize\":9.59052197916832,\"validationData\":{\"jobInputType\":\"mltable\",\"mode\":\"EvalMount\",\"uri\":\"njc\",\"description\":\"mocgjshg\"},\"validationDataSize\":1.3885888922809064,\"weightColumnName\":\"wvixq\",\"logVerbosity\":\"Error\",\"targetColumnName\":\"jkyb\",\"trainingData\":{\"jobInputType\":\"mltable\",\"mode\":\"ReadWriteMount\",\"uri\":\"clrvtzqnrbctbh\",\"description\":\"hxpcvrdnyeita\"}}") - .toObject(Regression.class); - Assertions.assertEquals(LogVerbosity.ERROR, model.logVerbosity()); - Assertions.assertEquals("jkyb", model.targetColumnName()); - Assertions.assertEquals("hxpcvrdnyeita", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_WRITE_MOUNT, model.trainingData().mode()); - Assertions.assertEquals("clrvtzqnrbctbh", model.trainingData().uri()); - Assertions.assertEquals(RegressionPrimaryMetrics.NORMALIZED_ROOT_MEAN_SQUARED_ERROR, model.primaryMetric()); - Assertions.assertEquals(false, model.trainingSettings().enableDnnTraining()); - Assertions.assertEquals(false, model.trainingSettings().enableModelExplainability()); - Assertions.assertEquals(false, model.trainingSettings().enableOnnxCompatibleModels()); - Assertions.assertEquals(true, model.trainingSettings().enableStackEnsemble()); - Assertions.assertEquals(false, model.trainingSettings().enableVoteEnsemble()); - Assertions.assertEquals(Duration.parse("PT84H43M30S"), model.trainingSettings().ensembleModelDownloadTimeout()); - Assertions - .assertEquals( - 29.842412252567886D, - model.trainingSettings().stackEnsembleSettings().stackMetaLearnerTrainPercentage()); - Assertions - .assertEquals( - StackMetaLearnerType.LIGHT_GBMREGRESSOR, - model.trainingSettings().stackEnsembleSettings().stackMetaLearnerType()); - Assertions - .assertEquals(RegressionModels.ELASTIC_NET, model.trainingSettings().allowedTrainingAlgorithms().get(0)); - Assertions - .assertEquals( - RegressionModels.EXTREME_RANDOM_TREES, model.trainingSettings().blockedTrainingAlgorithms().get(0)); - Assertions.assertEquals("zydisnuep", model.cvSplitColumnNames().get(0)); - Assertions.assertEquals("mzhwilzzhni", model.featurizationSettings().datasetLanguage()); - Assertions - .assertEquals( - BlockedTransformers.COUNT_VECTORIZER, model.featurizationSettings().blockedTransformers().get(0)); - Assertions - .assertEquals("zjihweebiphr", model.featurizationSettings().columnNameAndTypes().get("vcjwqwoqsratj")); - Assertions.assertEquals(true, model.featurizationSettings().enableDnnFeaturization()); - Assertions.assertEquals(FeaturizationMode.CUSTOM, model.featurizationSettings().mode()); - Assertions.assertEquals(true, model.limitSettings().enableEarlyTermination()); - Assertions.assertEquals(3.9502204468192637D, model.limitSettings().exitScore()); - Assertions.assertEquals(2133816848, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(444992966, model.limitSettings().maxCoresPerTrial()); - Assertions.assertEquals(1238035913, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT160H46M45S"), model.limitSettings().timeout()); - Assertions.assertEquals(Duration.parse("PT11H57M31S"), model.limitSettings().trialTimeout()); - Assertions.assertEquals("mltwjfluxynbpvzl", model.testData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_DOWNLOAD, model.testData().mode()); - Assertions.assertEquals("bkut", model.testData().uri()); - Assertions.assertEquals(9.59052197916832D, model.testDataSize()); - Assertions.assertEquals("mocgjshg", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_MOUNT, model.validationData().mode()); - Assertions.assertEquals("njc", model.validationData().uri()); - Assertions.assertEquals(1.3885888922809064D, model.validationDataSize()); - Assertions.assertEquals("wvixq", model.weightColumnName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Regression model = - new Regression() - .withLogVerbosity(LogVerbosity.ERROR) - .withTargetColumnName("jkyb") - .withTrainingData( - new MLTableJobInput() - .withDescription("hxpcvrdnyeita") - .withMode(InputDeliveryMode.READ_WRITE_MOUNT) - .withUri("clrvtzqnrbctbh")) - .withPrimaryMetric(RegressionPrimaryMetrics.NORMALIZED_ROOT_MEAN_SQUARED_ERROR) - .withTrainingSettings( - new RegressionTrainingSettings() - .withEnableDnnTraining(false) - .withEnableModelExplainability(false) - .withEnableOnnxCompatibleModels(false) - .withEnableStackEnsemble(true) - .withEnableVoteEnsemble(false) - .withEnsembleModelDownloadTimeout(Duration.parse("PT84H43M30S")) - .withStackEnsembleSettings( - new StackEnsembleSettings() - .withStackMetaLearnerKWargs("datavsi") - .withStackMetaLearnerTrainPercentage(29.842412252567886D) - .withStackMetaLearnerType(StackMetaLearnerType.LIGHT_GBMREGRESSOR)) - .withAllowedTrainingAlgorithms(Arrays.asList(RegressionModels.ELASTIC_NET)) - .withBlockedTrainingAlgorithms( - Arrays.asList(RegressionModels.EXTREME_RANDOM_TREES, RegressionModels.ELASTIC_NET))) - .withCvSplitColumnNames(Arrays.asList("zydisnuep", "wyj", "nldpxottd")) - .withFeaturizationSettings( - new TableVerticalFeaturizationSettings() - .withDatasetLanguage("mzhwilzzhni") - .withBlockedTransformers( - Arrays.asList(BlockedTransformers.COUNT_VECTORIZER, BlockedTransformers.WO_ETARGET_ENCODER)) - .withColumnNameAndTypes(mapOf("vcjwqwoqsratj", "zjihweebiphr", "jhfrzgdkkagv", "dhzybsp")) - .withEnableDnnFeaturization(true) - .withMode(FeaturizationMode.CUSTOM) - .withTransformerParams(mapOf("mo", Arrays.asList()))) - .withLimitSettings( - new TableVerticalLimitSettings() - .withEnableEarlyTermination(true) - .withExitScore(3.9502204468192637D) - .withMaxConcurrentTrials(2133816848) - .withMaxCoresPerTrial(444992966) - .withMaxTrials(1238035913) - .withTimeout(Duration.parse("PT160H46M45S")) - .withTrialTimeout(Duration.parse("PT11H57M31S"))) - .withNCrossValidations(new NCrossValidations()) - .withTestData( - new MLTableJobInput() - .withDescription("mltwjfluxynbpvzl") - .withMode(InputDeliveryMode.EVAL_DOWNLOAD) - .withUri("bkut")) - .withTestDataSize(9.59052197916832D) - .withValidationData( - new MLTableJobInput() - .withDescription("mocgjshg") - .withMode(InputDeliveryMode.EVAL_MOUNT) - .withUri("njc")) - .withValidationDataSize(1.3885888922809064D) - .withWeightColumnName("wvixq"); - model = BinaryData.fromObject(model).toObject(Regression.class); - Assertions.assertEquals(LogVerbosity.ERROR, model.logVerbosity()); - Assertions.assertEquals("jkyb", model.targetColumnName()); - Assertions.assertEquals("hxpcvrdnyeita", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_WRITE_MOUNT, model.trainingData().mode()); - Assertions.assertEquals("clrvtzqnrbctbh", model.trainingData().uri()); - Assertions.assertEquals(RegressionPrimaryMetrics.NORMALIZED_ROOT_MEAN_SQUARED_ERROR, model.primaryMetric()); - Assertions.assertEquals(false, model.trainingSettings().enableDnnTraining()); - Assertions.assertEquals(false, model.trainingSettings().enableModelExplainability()); - Assertions.assertEquals(false, model.trainingSettings().enableOnnxCompatibleModels()); - Assertions.assertEquals(true, model.trainingSettings().enableStackEnsemble()); - Assertions.assertEquals(false, model.trainingSettings().enableVoteEnsemble()); - Assertions.assertEquals(Duration.parse("PT84H43M30S"), model.trainingSettings().ensembleModelDownloadTimeout()); - Assertions - .assertEquals( - 29.842412252567886D, - model.trainingSettings().stackEnsembleSettings().stackMetaLearnerTrainPercentage()); - Assertions - .assertEquals( - StackMetaLearnerType.LIGHT_GBMREGRESSOR, - model.trainingSettings().stackEnsembleSettings().stackMetaLearnerType()); - Assertions - .assertEquals(RegressionModels.ELASTIC_NET, model.trainingSettings().allowedTrainingAlgorithms().get(0)); - Assertions - .assertEquals( - RegressionModels.EXTREME_RANDOM_TREES, model.trainingSettings().blockedTrainingAlgorithms().get(0)); - Assertions.assertEquals("zydisnuep", model.cvSplitColumnNames().get(0)); - Assertions.assertEquals("mzhwilzzhni", model.featurizationSettings().datasetLanguage()); - Assertions - .assertEquals( - BlockedTransformers.COUNT_VECTORIZER, model.featurizationSettings().blockedTransformers().get(0)); - Assertions - .assertEquals("zjihweebiphr", model.featurizationSettings().columnNameAndTypes().get("vcjwqwoqsratj")); - Assertions.assertEquals(true, model.featurizationSettings().enableDnnFeaturization()); - Assertions.assertEquals(FeaturizationMode.CUSTOM, model.featurizationSettings().mode()); - Assertions.assertEquals(true, model.limitSettings().enableEarlyTermination()); - Assertions.assertEquals(3.9502204468192637D, model.limitSettings().exitScore()); - Assertions.assertEquals(2133816848, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(444992966, model.limitSettings().maxCoresPerTrial()); - Assertions.assertEquals(1238035913, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT160H46M45S"), model.limitSettings().timeout()); - Assertions.assertEquals(Duration.parse("PT11H57M31S"), model.limitSettings().trialTimeout()); - Assertions.assertEquals("mltwjfluxynbpvzl", model.testData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_DOWNLOAD, model.testData().mode()); - Assertions.assertEquals("bkut", model.testData().uri()); - Assertions.assertEquals(9.59052197916832D, model.testDataSize()); - Assertions.assertEquals("mocgjshg", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_MOUNT, model.validationData().mode()); - Assertions.assertEquals("njc", model.validationData().uri()); - Assertions.assertEquals(1.3885888922809064D, model.validationDataSize()); - Assertions.assertEquals("wvixq", model.weightColumnName()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RegressionTrainingSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RegressionTrainingSettingsTests.java deleted file mode 100644 index 272e375c9c596..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RegressionTrainingSettingsTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.RegressionModels; -import com.azure.resourcemanager.machinelearning.models.RegressionTrainingSettings; -import com.azure.resourcemanager.machinelearning.models.StackEnsembleSettings; -import com.azure.resourcemanager.machinelearning.models.StackMetaLearnerType; -import java.time.Duration; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class RegressionTrainingSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RegressionTrainingSettings model = - BinaryData - .fromString( - "{\"allowedTrainingAlgorithms\":[\"LightGBM\"],\"blockedTrainingAlgorithms\":[\"DecisionTree\"],\"enableDnnTraining\":true,\"enableModelExplainability\":false,\"enableOnnxCompatibleModels\":true,\"enableStackEnsemble\":true,\"enableVoteEnsemble\":true,\"ensembleModelDownloadTimeout\":\"PT173H34M23S\",\"stackEnsembleSettings\":{\"stackMetaLearnerKWargs\":\"datakiceevsaaxwsp\",\"stackMetaLearnerTrainPercentage\":33.77569584333657,\"stackMetaLearnerType\":\"LightGBMRegressor\"}}") - .toObject(RegressionTrainingSettings.class); - Assertions.assertEquals(true, model.enableDnnTraining()); - Assertions.assertEquals(false, model.enableModelExplainability()); - Assertions.assertEquals(true, model.enableOnnxCompatibleModels()); - Assertions.assertEquals(true, model.enableStackEnsemble()); - Assertions.assertEquals(true, model.enableVoteEnsemble()); - Assertions.assertEquals(Duration.parse("PT173H34M23S"), model.ensembleModelDownloadTimeout()); - Assertions.assertEquals(33.77569584333657D, model.stackEnsembleSettings().stackMetaLearnerTrainPercentage()); - Assertions - .assertEquals( - StackMetaLearnerType.LIGHT_GBMREGRESSOR, model.stackEnsembleSettings().stackMetaLearnerType()); - Assertions.assertEquals(RegressionModels.LIGHT_GBM, model.allowedTrainingAlgorithms().get(0)); - Assertions.assertEquals(RegressionModels.DECISION_TREE, model.blockedTrainingAlgorithms().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RegressionTrainingSettings model = - new RegressionTrainingSettings() - .withEnableDnnTraining(true) - .withEnableModelExplainability(false) - .withEnableOnnxCompatibleModels(true) - .withEnableStackEnsemble(true) - .withEnableVoteEnsemble(true) - .withEnsembleModelDownloadTimeout(Duration.parse("PT173H34M23S")) - .withStackEnsembleSettings( - new StackEnsembleSettings() - .withStackMetaLearnerKWargs("datakiceevsaaxwsp") - .withStackMetaLearnerTrainPercentage(33.77569584333657D) - .withStackMetaLearnerType(StackMetaLearnerType.LIGHT_GBMREGRESSOR)) - .withAllowedTrainingAlgorithms(Arrays.asList(RegressionModels.LIGHT_GBM)) - .withBlockedTrainingAlgorithms(Arrays.asList(RegressionModels.DECISION_TREE)); - model = BinaryData.fromObject(model).toObject(RegressionTrainingSettings.class); - Assertions.assertEquals(true, model.enableDnnTraining()); - Assertions.assertEquals(false, model.enableModelExplainability()); - Assertions.assertEquals(true, model.enableOnnxCompatibleModels()); - Assertions.assertEquals(true, model.enableStackEnsemble()); - Assertions.assertEquals(true, model.enableVoteEnsemble()); - Assertions.assertEquals(Duration.parse("PT173H34M23S"), model.ensembleModelDownloadTimeout()); - Assertions.assertEquals(33.77569584333657D, model.stackEnsembleSettings().stackMetaLearnerTrainPercentage()); - Assertions - .assertEquals( - StackMetaLearnerType.LIGHT_GBMREGRESSOR, model.stackEnsembleSettings().stackMetaLearnerType()); - Assertions.assertEquals(RegressionModels.LIGHT_GBM, model.allowedTrainingAlgorithms().get(0)); - Assertions.assertEquals(RegressionModels.DECISION_TREE, model.blockedTrainingAlgorithms().get(0)); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ResourceBaseTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ResourceBaseTests.java deleted file mode 100644 index 8057b8532d54c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ResourceBaseTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ResourceBase; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ResourceBaseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceBase model = - BinaryData - .fromString( - "{\"description\":\"ss\",\"properties\":{\"uyowqkdwy\":\"twbdsrezpdrhn\"},\"tags\":{\"rcgp\":\"ib\",\"ejzanlfz\":\"kpzi\",\"zonokixrjqci\":\"iavrm\"}}") - .toObject(ResourceBase.class); - Assertions.assertEquals("ss", model.description()); - Assertions.assertEquals("twbdsrezpdrhn", model.properties().get("uyowqkdwy")); - Assertions.assertEquals("ib", model.tags().get("rcgp")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceBase model = - new ResourceBase() - .withDescription("ss") - .withProperties(mapOf("uyowqkdwy", "twbdsrezpdrhn")) - .withTags(mapOf("rcgp", "ib", "ejzanlfz", "kpzi", "zonokixrjqci", "iavrm")); - model = BinaryData.fromObject(model).toObject(ResourceBase.class); - Assertions.assertEquals("ss", model.description()); - Assertions.assertEquals("twbdsrezpdrhn", model.properties().get("uyowqkdwy")); - Assertions.assertEquals("ib", model.tags().get("rcgp")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ResourceConfigurationTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ResourceConfigurationTests.java deleted file mode 100644 index c0c0860a0d4e1..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ResourceConfigurationTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ResourceConfiguration; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ResourceConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceConfiguration model = - BinaryData - .fromString( - "{\"instanceCount\":1364369199,\"instanceType\":\"kgjubgdknnqvsazn\",\"properties\":{\"mkycgra\":\"dataorudsgsa\"}}") - .toObject(ResourceConfiguration.class); - Assertions.assertEquals(1364369199, model.instanceCount()); - Assertions.assertEquals("kgjubgdknnqvsazn", model.instanceType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceConfiguration model = - new ResourceConfiguration() - .withInstanceCount(1364369199) - .withInstanceType("kgjubgdknnqvsazn") - .withProperties(mapOf("mkycgra", "dataorudsgsa")); - model = BinaryData.fromObject(model).toObject(ResourceConfiguration.class); - Assertions.assertEquals(1364369199, model.instanceCount()); - Assertions.assertEquals("kgjubgdknnqvsazn", model.instanceType()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ResourceIdTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ResourceIdTests.java deleted file mode 100644 index fbe206f907162..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ResourceIdTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ResourceId; -import org.junit.jupiter.api.Assertions; - -public final class ResourceIdTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceId model = BinaryData.fromString("{\"id\":\"gwgcl\"}").toObject(ResourceId.class); - Assertions.assertEquals("gwgcl", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceId model = new ResourceId().withId("gwgcl"); - model = BinaryData.fromObject(model).toObject(ResourceId.class); - Assertions.assertEquals("gwgcl", model.id()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ResourceNameTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ResourceNameTests.java deleted file mode 100644 index 8a124e6a5b09d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ResourceNameTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ResourceName; - -public final class ResourceNameTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceName model = - BinaryData - .fromString("{\"value\":\"yqzrnkcqvyxlw\",\"localizedValue\":\"lsicohoqqnwv\"}") - .toObject(ResourceName.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceName model = new ResourceName(); - model = BinaryData.fromObject(model).toObject(ResourceName.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ResourceQuotaInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ResourceQuotaInnerTests.java deleted file mode 100644 index 55f5b24d6e2e6..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ResourceQuotaInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.ResourceQuotaInner; - -public final class ResourceQuotaInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceQuotaInner model = - BinaryData - .fromString( - "{\"id\":\"bkh\",\"amlWorkspaceLocation\":\"deyeamdphagalpbu\",\"type\":\"gipwhonowkg\",\"name\":{\"value\":\"ankixzbinjeput\",\"localizedValue\":\"rywn\"},\"limit\":4868014576917618697,\"unit\":\"Count\"}") - .toObject(ResourceQuotaInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceQuotaInner model = new ResourceQuotaInner(); - model = BinaryData.fromObject(model).toObject(ResourceQuotaInner.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RouteTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RouteTests.java deleted file mode 100644 index 89d8b35868a43..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/RouteTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.Route; -import org.junit.jupiter.api.Assertions; - -public final class RouteTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Route model = BinaryData.fromString("{\"path\":\"iykzkdncjdx\",\"port\":1933240221}").toObject(Route.class); - Assertions.assertEquals("iykzkdncjdx", model.path()); - Assertions.assertEquals(1933240221, model.port()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Route model = new Route().withPath("iykzkdncjdx").withPort(1933240221); - model = BinaryData.fromObject(model).toObject(Route.class); - Assertions.assertEquals("iykzkdncjdx", model.path()); - Assertions.assertEquals(1933240221, model.port()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SamplingAlgorithmTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SamplingAlgorithmTests.java deleted file mode 100644 index d126766fe08cb..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SamplingAlgorithmTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.SamplingAlgorithm; - -public final class SamplingAlgorithmTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SamplingAlgorithm model = - BinaryData - .fromString("{\"samplingAlgorithmType\":\"SamplingAlgorithm\"}") - .toObject(SamplingAlgorithm.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SamplingAlgorithm model = new SamplingAlgorithm(); - model = BinaryData.fromObject(model).toObject(SamplingAlgorithm.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScaleSettingsInformationTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScaleSettingsInformationTests.java deleted file mode 100644 index 3dfb52853552c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScaleSettingsInformationTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ScaleSettings; -import com.azure.resourcemanager.machinelearning.models.ScaleSettingsInformation; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class ScaleSettingsInformationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScaleSettingsInformation model = - BinaryData - .fromString( - "{\"scaleSettings\":{\"maxNodeCount\":2089644825,\"minNodeCount\":582953019,\"nodeIdleTimeBeforeScaleDown\":\"PT83H47M42S\"}}") - .toObject(ScaleSettingsInformation.class); - Assertions.assertEquals(2089644825, model.scaleSettings().maxNodeCount()); - Assertions.assertEquals(582953019, model.scaleSettings().minNodeCount()); - Assertions.assertEquals(Duration.parse("PT83H47M42S"), model.scaleSettings().nodeIdleTimeBeforeScaleDown()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScaleSettingsInformation model = - new ScaleSettingsInformation() - .withScaleSettings( - new ScaleSettings() - .withMaxNodeCount(2089644825) - .withMinNodeCount(582953019) - .withNodeIdleTimeBeforeScaleDown(Duration.parse("PT83H47M42S"))); - model = BinaryData.fromObject(model).toObject(ScaleSettingsInformation.class); - Assertions.assertEquals(2089644825, model.scaleSettings().maxNodeCount()); - Assertions.assertEquals(582953019, model.scaleSettings().minNodeCount()); - Assertions.assertEquals(Duration.parse("PT83H47M42S"), model.scaleSettings().nodeIdleTimeBeforeScaleDown()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScaleSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScaleSettingsTests.java deleted file mode 100644 index dc8082b7e78f1..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScaleSettingsTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ScaleSettings; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class ScaleSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScaleSettings model = - BinaryData - .fromString( - "{\"maxNodeCount\":978941807,\"minNodeCount\":1532421493,\"nodeIdleTimeBeforeScaleDown\":\"PT119H2M26S\"}") - .toObject(ScaleSettings.class); - Assertions.assertEquals(978941807, model.maxNodeCount()); - Assertions.assertEquals(1532421493, model.minNodeCount()); - Assertions.assertEquals(Duration.parse("PT119H2M26S"), model.nodeIdleTimeBeforeScaleDown()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScaleSettings model = - new ScaleSettings() - .withMaxNodeCount(978941807) - .withMinNodeCount(1532421493) - .withNodeIdleTimeBeforeScaleDown(Duration.parse("PT119H2M26S")); - model = BinaryData.fromObject(model).toObject(ScaleSettings.class); - Assertions.assertEquals(978941807, model.maxNodeCount()); - Assertions.assertEquals(1532421493, model.minNodeCount()); - Assertions.assertEquals(Duration.parse("PT119H2M26S"), model.nodeIdleTimeBeforeScaleDown()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScheduleActionBaseTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScheduleActionBaseTests.java deleted file mode 100644 index 025be761cf92f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScheduleActionBaseTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ScheduleActionBase; - -public final class ScheduleActionBaseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScheduleActionBase model = - BinaryData.fromString("{\"actionType\":\"ScheduleActionBase\"}").toObject(ScheduleActionBase.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScheduleActionBase model = new ScheduleActionBase(); - model = BinaryData.fromObject(model).toObject(ScheduleActionBase.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScheduleBaseTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScheduleBaseTests.java deleted file mode 100644 index 6b09e4895f95f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScheduleBaseTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ScheduleBase; -import com.azure.resourcemanager.machinelearning.models.ScheduleProvisioningState; -import com.azure.resourcemanager.machinelearning.models.ScheduleStatus; -import org.junit.jupiter.api.Assertions; - -public final class ScheduleBaseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScheduleBase model = - BinaryData - .fromString("{\"id\":\"piudeugfsxzecpa\",\"provisioningStatus\":\"Completed\",\"status\":\"Disabled\"}") - .toObject(ScheduleBase.class); - Assertions.assertEquals("piudeugfsxzecpa", model.id()); - Assertions.assertEquals(ScheduleProvisioningState.COMPLETED, model.provisioningStatus()); - Assertions.assertEquals(ScheduleStatus.DISABLED, model.status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScheduleBase model = - new ScheduleBase() - .withId("piudeugfsxzecpa") - .withProvisioningStatus(ScheduleProvisioningState.COMPLETED) - .withStatus(ScheduleStatus.DISABLED); - model = BinaryData.fromObject(model).toObject(ScheduleBase.class); - Assertions.assertEquals("piudeugfsxzecpa", model.id()); - Assertions.assertEquals(ScheduleProvisioningState.COMPLETED, model.provisioningStatus()); - Assertions.assertEquals(ScheduleStatus.DISABLED, model.status()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScheduleInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScheduleInnerTests.java deleted file mode 100644 index 9351a842ad4ec..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScheduleInnerTests.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.ScheduleInner; -import com.azure.resourcemanager.machinelearning.models.ScheduleActionBase; -import com.azure.resourcemanager.machinelearning.models.ScheduleProperties; -import com.azure.resourcemanager.machinelearning.models.TriggerBase; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ScheduleInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScheduleInner model = - BinaryData - .fromString( - "{\"properties\":{\"action\":{\"actionType\":\"ScheduleActionBase\"},\"displayName\":\"quvre\",\"isEnabled\":true,\"provisioningState\":\"Succeeded\",\"trigger\":{\"triggerType\":\"TriggerBase\",\"endTime\":\"vsujztczytqjtwh\",\"startTime\":\"unfprnjletlxs\",\"timeZone\":\"pddouifamowaziyn\"},\"description\":\"lqwzdvpiwhxqsz\",\"properties\":{\"m\":\"aajquhuxylrj\",\"kfkyjp\":\"ygjbmzyospspsh\",\"pssdfppyogtie\":\"sp\"},\"tags\":{\"munjdxvglnkvx\":\"tvczkcnyxr\",\"khpzvuqdflv\":\"xpaglqivbgkc\",\"xtiv\":\"niypfpubcpzg\",\"nidibgqjxg\":\"j\"}},\"id\":\"r\",\"name\":\"govfgpikqmhhaow\",\"type\":\"rmzvupo\"}") - .toObject(ScheduleInner.class); - Assertions.assertEquals("lqwzdvpiwhxqsz", model.properties().description()); - Assertions.assertEquals("aajquhuxylrj", model.properties().properties().get("m")); - Assertions.assertEquals("tvczkcnyxr", model.properties().tags().get("munjdxvglnkvx")); - Assertions.assertEquals("quvre", model.properties().displayName()); - Assertions.assertEquals(true, model.properties().isEnabled()); - Assertions.assertEquals("vsujztczytqjtwh", model.properties().trigger().endTime()); - Assertions.assertEquals("unfprnjletlxs", model.properties().trigger().startTime()); - Assertions.assertEquals("pddouifamowaziyn", model.properties().trigger().timeZone()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScheduleInner model = - new ScheduleInner() - .withProperties( - new ScheduleProperties() - .withDescription("lqwzdvpiwhxqsz") - .withProperties(mapOf("m", "aajquhuxylrj", "kfkyjp", "ygjbmzyospspsh", "pssdfppyogtie", "sp")) - .withTags( - mapOf( - "munjdxvglnkvx", - "tvczkcnyxr", - "khpzvuqdflv", - "xpaglqivbgkc", - "xtiv", - "niypfpubcpzg", - "nidibgqjxg", - "j")) - .withAction(new ScheduleActionBase()) - .withDisplayName("quvre") - .withIsEnabled(true) - .withTrigger( - new TriggerBase() - .withEndTime("vsujztczytqjtwh") - .withStartTime("unfprnjletlxs") - .withTimeZone("pddouifamowaziyn"))); - model = BinaryData.fromObject(model).toObject(ScheduleInner.class); - Assertions.assertEquals("lqwzdvpiwhxqsz", model.properties().description()); - Assertions.assertEquals("aajquhuxylrj", model.properties().properties().get("m")); - Assertions.assertEquals("tvczkcnyxr", model.properties().tags().get("munjdxvglnkvx")); - Assertions.assertEquals("quvre", model.properties().displayName()); - Assertions.assertEquals(true, model.properties().isEnabled()); - Assertions.assertEquals("vsujztczytqjtwh", model.properties().trigger().endTime()); - Assertions.assertEquals("unfprnjletlxs", model.properties().trigger().startTime()); - Assertions.assertEquals("pddouifamowaziyn", model.properties().trigger().timeZone()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SchedulePropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SchedulePropertiesTests.java deleted file mode 100644 index bba0061655f32..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SchedulePropertiesTests.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ScheduleActionBase; -import com.azure.resourcemanager.machinelearning.models.ScheduleProperties; -import com.azure.resourcemanager.machinelearning.models.TriggerBase; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SchedulePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScheduleProperties model = - BinaryData - .fromString( - "{\"action\":{\"actionType\":\"ScheduleActionBase\"},\"displayName\":\"zdfuydzvkfvxcnqm\",\"isEnabled\":false,\"provisioningState\":\"Creating\",\"trigger\":{\"triggerType\":\"TriggerBase\",\"endTime\":\"kmvkhl\",\"startTime\":\"dhbemzqkzszu\",\"timeZone\":\"wtglxx\"},\"description\":\"jfpgpicrmn\",\"properties\":{\"vpqcb\":\"gmqgjs\",\"s\":\"rmbodt\"},\"tags\":{\"xousxauzl\":\"vriibakclacjfr\",\"wohqfzizvu\":\"vsg\",\"vmribiat\":\"mmkjsvthnwpztek\"}}") - .toObject(ScheduleProperties.class); - Assertions.assertEquals("jfpgpicrmn", model.description()); - Assertions.assertEquals("gmqgjs", model.properties().get("vpqcb")); - Assertions.assertEquals("vriibakclacjfr", model.tags().get("xousxauzl")); - Assertions.assertEquals("zdfuydzvkfvxcnqm", model.displayName()); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals("kmvkhl", model.trigger().endTime()); - Assertions.assertEquals("dhbemzqkzszu", model.trigger().startTime()); - Assertions.assertEquals("wtglxx", model.trigger().timeZone()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScheduleProperties model = - new ScheduleProperties() - .withDescription("jfpgpicrmn") - .withProperties(mapOf("vpqcb", "gmqgjs", "s", "rmbodt")) - .withTags(mapOf("xousxauzl", "vriibakclacjfr", "wohqfzizvu", "vsg", "vmribiat", "mmkjsvthnwpztek")) - .withAction(new ScheduleActionBase()) - .withDisplayName("zdfuydzvkfvxcnqm") - .withIsEnabled(false) - .withTrigger( - new TriggerBase().withEndTime("kmvkhl").withStartTime("dhbemzqkzszu").withTimeZone("wtglxx")); - model = BinaryData.fromObject(model).toObject(ScheduleProperties.class); - Assertions.assertEquals("jfpgpicrmn", model.description()); - Assertions.assertEquals("gmqgjs", model.properties().get("vpqcb")); - Assertions.assertEquals("vriibakclacjfr", model.tags().get("xousxauzl")); - Assertions.assertEquals("zdfuydzvkfvxcnqm", model.displayName()); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals("kmvkhl", model.trigger().endTime()); - Assertions.assertEquals("dhbemzqkzszu", model.trigger().startTime()); - Assertions.assertEquals("wtglxx", model.trigger().timeZone()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScheduleResourceArmPaginatedResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScheduleResourceArmPaginatedResultTests.java deleted file mode 100644 index 3c9894e04bbb2..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScheduleResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.ScheduleInner; -import com.azure.resourcemanager.machinelearning.models.ScheduleProperties; -import com.azure.resourcemanager.machinelearning.models.ScheduleResourceArmPaginatedResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ScheduleResourceArmPaginatedResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScheduleResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"nextLink\":\"bmhyreeudz\",\"value\":[{\"properties\":{\"displayName\":\"pdqmjxlyyzglgouw\",\"isEnabled\":false,\"provisioningState\":\"Updating\",\"description\":\"uojqt\",\"properties\":{},\"tags\":{}},\"id\":\"kjeytunl\",\"name\":\"fjkwrusnkq\",\"type\":\"hsyrqunj\"},{\"properties\":{\"displayName\":\"denxau\",\"isEnabled\":true,\"provisioningState\":\"Creating\",\"description\":\"kifmjn\",\"properties\":{},\"tags\":{}},\"id\":\"qabpxuckpggqow\",\"name\":\"yirdhlisngwflqq\",\"type\":\"pizruwnpqxpxiw\"},{\"properties\":{\"displayName\":\"ngjsaasi\",\"isEnabled\":true,\"provisioningState\":\"Failed\",\"description\":\"jvkviirhgfgrws\",\"properties\":{},\"tags\":{}},\"id\":\"atzv\",\"name\":\"bglbyvict\",\"type\":\"tbrxkjz\"},{\"properties\":{\"displayName\":\"gxffmshkwf\",\"isEnabled\":false,\"provisioningState\":\"Creating\",\"description\":\"wopdbydpiz\",\"properties\":{},\"tags\":{}},\"id\":\"napxbiygnug\",\"name\":\"knfsmfcttuxuuyil\",\"type\":\"lq\"}]}") - .toObject(ScheduleResourceArmPaginatedResult.class); - Assertions.assertEquals("bmhyreeudz", model.nextLink()); - Assertions.assertEquals("uojqt", model.value().get(0).properties().description()); - Assertions.assertEquals("pdqmjxlyyzglgouw", model.value().get(0).properties().displayName()); - Assertions.assertEquals(false, model.value().get(0).properties().isEnabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScheduleResourceArmPaginatedResult model = - new ScheduleResourceArmPaginatedResult() - .withNextLink("bmhyreeudz") - .withValue( - Arrays - .asList( - new ScheduleInner() - .withProperties( - new ScheduleProperties() - .withDescription("uojqt") - .withProperties(mapOf()) - .withTags(mapOf()) - .withDisplayName("pdqmjxlyyzglgouw") - .withIsEnabled(false)), - new ScheduleInner() - .withProperties( - new ScheduleProperties() - .withDescription("kifmjn") - .withProperties(mapOf()) - .withTags(mapOf()) - .withDisplayName("denxau") - .withIsEnabled(true)), - new ScheduleInner() - .withProperties( - new ScheduleProperties() - .withDescription("jvkviirhgfgrws") - .withProperties(mapOf()) - .withTags(mapOf()) - .withDisplayName("ngjsaasi") - .withIsEnabled(true)), - new ScheduleInner() - .withProperties( - new ScheduleProperties() - .withDescription("wopdbydpiz") - .withProperties(mapOf()) - .withTags(mapOf()) - .withDisplayName("gxffmshkwf") - .withIsEnabled(false)))); - model = BinaryData.fromObject(model).toObject(ScheduleResourceArmPaginatedResult.class); - Assertions.assertEquals("bmhyreeudz", model.nextLink()); - Assertions.assertEquals("uojqt", model.value().get(0).properties().description()); - Assertions.assertEquals("pdqmjxlyyzglgouw", model.value().get(0).properties().displayName()); - Assertions.assertEquals(false, model.value().get(0).properties().isEnabled()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SchedulesCreateOrUpdateMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SchedulesCreateOrUpdateMockTests.java deleted file mode 100644 index 4923d8a4a1d9b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SchedulesCreateOrUpdateMockTests.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.Schedule; -import com.azure.resourcemanager.machinelearning.models.ScheduleActionBase; -import com.azure.resourcemanager.machinelearning.models.ScheduleProperties; -import com.azure.resourcemanager.machinelearning.models.TriggerBase; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SchedulesCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"action\":{\"actionType\":\"ScheduleActionBase\"},\"displayName\":\"j\",\"isEnabled\":false,\"provisioningState\":\"Succeeded\",\"trigger\":{\"triggerType\":\"TriggerBase\",\"endTime\":\"nxqpwnikxkcajgrb\",\"startTime\":\"tsvgoocqs\",\"timeZone\":\"mzlpcx\"},\"description\":\"mhxxrqicfzfvwjd\",\"properties\":{\"dkjrzfwkyluobdx\":\"vpyeyoafinmpnqu\",\"p\":\"hqdcclcvqsr\"},\"tags\":{\"fxl\":\"cvwbz\",\"iywqnpfydrfbgcny\":\"ymfjxl\",\"styygjq\":\"byxmkhmqyncgaull\"}},\"id\":\"lmwqg\",\"name\":\"hmqmiwxzf\",\"type\":\"vzucqfgufjnb\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Schedule response = - manager - .schedules() - .define("xaravwwuasnjeglh") - .withExistingWorkspace("zyq", "brnxhjtlxfikj") - .withProperties( - new ScheduleProperties() - .withDescription("fhjxsawo") - .withProperties(mapOf("qkmwzrdqyoybmrno", "ffhx", "qphkv", "ocjnzdaiovrbhr")) - .withTags(mapOf("yp", "adcrxyl", "iwhjdfrwpsshrmn", "tyzvelffohu", "ogkscxj", "cclpct")) - .withAction(new ScheduleActionBase()) - .withDisplayName("xbozpcjcnwjz") - .withIsEnabled(false) - .withTrigger(new TriggerBase().withEndTime("nw").withStartTime("svoqiza").withTimeZone("sdso"))) - .create(); - - Assertions.assertEquals("mhxxrqicfzfvwjd", response.properties().description()); - Assertions.assertEquals("vpyeyoafinmpnqu", response.properties().properties().get("dkjrzfwkyluobdx")); - Assertions.assertEquals("cvwbz", response.properties().tags().get("fxl")); - Assertions.assertEquals("j", response.properties().displayName()); - Assertions.assertEquals(false, response.properties().isEnabled()); - Assertions.assertEquals("nxqpwnikxkcajgrb", response.properties().trigger().endTime()); - Assertions.assertEquals("tsvgoocqs", response.properties().trigger().startTime()); - Assertions.assertEquals("mzlpcx", response.properties().trigger().timeZone()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SchedulesDeleteMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SchedulesDeleteMockTests.java deleted file mode 100644 index 830834e918e31..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SchedulesDeleteMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SchedulesDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.schedules().delete("yuveoxmpz", "wahdrdvhaztkxbi", "zfgxmbry", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SchedulesGetWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SchedulesGetWithResponseMockTests.java deleted file mode 100644 index bd976d8ce7f14..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SchedulesGetWithResponseMockTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.Schedule; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SchedulesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"action\":{\"actionType\":\"ScheduleActionBase\"},\"displayName\":\"qwdr\",\"isEnabled\":true,\"provisioningState\":\"Canceled\",\"trigger\":{\"triggerType\":\"TriggerBase\",\"endTime\":\"glmrcokzze\",\"startTime\":\"kounzsiy\",\"timeZone\":\"uby\"},\"description\":\"popikzeb\",\"properties\":{\"czygpmgfjcu\":\"fywtkqowsdlk\",\"otuzbybwjmtftc\":\"ojhhylxdevfiyy\"},\"tags\":{\"aqpibjg\":\"nirupkqnst\",\"bmsennqfabqcama\":\"vswmehfxrtt\"}},\"id\":\"ctcxs\",\"name\":\"mbzdxmsyn\",\"type\":\"kdnnyufxuzms\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Schedule response = - manager.schedules().getWithResponse("mw", "bios", "qsykq", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("popikzeb", response.properties().description()); - Assertions.assertEquals("fywtkqowsdlk", response.properties().properties().get("czygpmgfjcu")); - Assertions.assertEquals("nirupkqnst", response.properties().tags().get("aqpibjg")); - Assertions.assertEquals("qwdr", response.properties().displayName()); - Assertions.assertEquals(true, response.properties().isEnabled()); - Assertions.assertEquals("glmrcokzze", response.properties().trigger().endTime()); - Assertions.assertEquals("kounzsiy", response.properties().trigger().startTime()); - Assertions.assertEquals("uby", response.properties().trigger().timeZone()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SchedulesListMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SchedulesListMockTests.java deleted file mode 100644 index 4d28e762a5387..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SchedulesListMockTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.Schedule; -import com.azure.resourcemanager.machinelearning.models.ScheduleListViewType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SchedulesListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"action\":{\"actionType\":\"ScheduleActionBase\"},\"displayName\":\"ygnbknhjgclxaxwc\",\"isEnabled\":false,\"provisioningState\":\"Failed\",\"trigger\":{\"triggerType\":\"TriggerBase\",\"endTime\":\"dzkucszghdoaqip\",\"startTime\":\"xclfrs\",\"timeZone\":\"rnmuvwvpuofddtbf\"},\"description\":\"kjcnginxdvmaoyq\",\"properties\":{\"txoqxtdn\":\"gyxzmxynofxl\"},\"tags\":{\"nivdqtkyk\":\"sjirkrpskcjhmmof\"}},\"id\":\"xnlsf\",\"name\":\"nyscaccpt\",\"type\":\"zetxygxxiceecvj\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .schedules() - .list("jezbfsjwfczgl", "vbgukbs", "bw", ScheduleListViewType.ALL, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("kjcnginxdvmaoyq", response.iterator().next().properties().description()); - Assertions.assertEquals("gyxzmxynofxl", response.iterator().next().properties().properties().get("txoqxtdn")); - Assertions.assertEquals("sjirkrpskcjhmmof", response.iterator().next().properties().tags().get("nivdqtkyk")); - Assertions.assertEquals("ygnbknhjgclxaxwc", response.iterator().next().properties().displayName()); - Assertions.assertEquals(false, response.iterator().next().properties().isEnabled()); - Assertions.assertEquals("dzkucszghdoaqip", response.iterator().next().properties().trigger().endTime()); - Assertions.assertEquals("xclfrs", response.iterator().next().properties().trigger().startTime()); - Assertions.assertEquals("rnmuvwvpuofddtbf", response.iterator().next().properties().trigger().timeZone()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScriptReferenceTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScriptReferenceTests.java deleted file mode 100644 index 6146bafa97fcf..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScriptReferenceTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ScriptReference; -import org.junit.jupiter.api.Assertions; - -public final class ScriptReferenceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScriptReference model = - BinaryData - .fromString( - "{\"scriptSource\":\"z\",\"scriptData\":\"blkujrllfojuidjp\",\"scriptArguments\":\"yjucejikzoeo\",\"timeout\":\"tzejetjklnt\"}") - .toObject(ScriptReference.class); - Assertions.assertEquals("z", model.scriptSource()); - Assertions.assertEquals("blkujrllfojuidjp", model.scriptData()); - Assertions.assertEquals("yjucejikzoeo", model.scriptArguments()); - Assertions.assertEquals("tzejetjklnt", model.timeout()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScriptReference model = - new ScriptReference() - .withScriptSource("z") - .withScriptData("blkujrllfojuidjp") - .withScriptArguments("yjucejikzoeo") - .withTimeout("tzejetjklnt"); - model = BinaryData.fromObject(model).toObject(ScriptReference.class); - Assertions.assertEquals("z", model.scriptSource()); - Assertions.assertEquals("blkujrllfojuidjp", model.scriptData()); - Assertions.assertEquals("yjucejikzoeo", model.scriptArguments()); - Assertions.assertEquals("tzejetjklnt", model.timeout()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScriptsToExecuteTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScriptsToExecuteTests.java deleted file mode 100644 index 73a18add9a8a3..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ScriptsToExecuteTests.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ScriptReference; -import com.azure.resourcemanager.machinelearning.models.ScriptsToExecute; -import org.junit.jupiter.api.Assertions; - -public final class ScriptsToExecuteTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScriptsToExecute model = - BinaryData - .fromString( - "{\"startupScript\":{\"scriptSource\":\"rvkmjcwmjvlgfggc\",\"scriptData\":\"yylizrz\",\"scriptArguments\":\"psfxsf\",\"timeout\":\"tl\"},\"creationScript\":{\"scriptSource\":\"vagbwidqlvhukove\",\"scriptData\":\"i\",\"scriptArguments\":\"vjfn\",\"timeout\":\"mvl\"}}") - .toObject(ScriptsToExecute.class); - Assertions.assertEquals("rvkmjcwmjvlgfggc", model.startupScript().scriptSource()); - Assertions.assertEquals("yylizrz", model.startupScript().scriptData()); - Assertions.assertEquals("psfxsf", model.startupScript().scriptArguments()); - Assertions.assertEquals("tl", model.startupScript().timeout()); - Assertions.assertEquals("vagbwidqlvhukove", model.creationScript().scriptSource()); - Assertions.assertEquals("i", model.creationScript().scriptData()); - Assertions.assertEquals("vjfn", model.creationScript().scriptArguments()); - Assertions.assertEquals("mvl", model.creationScript().timeout()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScriptsToExecute model = - new ScriptsToExecute() - .withStartupScript( - new ScriptReference() - .withScriptSource("rvkmjcwmjvlgfggc") - .withScriptData("yylizrz") - .withScriptArguments("psfxsf") - .withTimeout("tl")) - .withCreationScript( - new ScriptReference() - .withScriptSource("vagbwidqlvhukove") - .withScriptData("i") - .withScriptArguments("vjfn") - .withTimeout("mvl")); - model = BinaryData.fromObject(model).toObject(ScriptsToExecute.class); - Assertions.assertEquals("rvkmjcwmjvlgfggc", model.startupScript().scriptSource()); - Assertions.assertEquals("yylizrz", model.startupScript().scriptData()); - Assertions.assertEquals("psfxsf", model.startupScript().scriptArguments()); - Assertions.assertEquals("tl", model.startupScript().timeout()); - Assertions.assertEquals("vagbwidqlvhukove", model.creationScript().scriptSource()); - Assertions.assertEquals("i", model.creationScript().scriptData()); - Assertions.assertEquals("vjfn", model.creationScript().scriptArguments()); - Assertions.assertEquals("mvl", model.creationScript().timeout()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SeasonalityTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SeasonalityTests.java deleted file mode 100644 index 93d8e50a1bf87..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SeasonalityTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.Seasonality; - -public final class SeasonalityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Seasonality model = BinaryData.fromString("{\"mode\":\"Seasonality\"}").toObject(Seasonality.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Seasonality model = new Seasonality(); - model = BinaryData.fromObject(model).toObject(Seasonality.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ServiceManagedResourcesSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ServiceManagedResourcesSettingsTests.java deleted file mode 100644 index a89f03acf4af5..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/ServiceManagedResourcesSettingsTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.CosmosDbSettings; -import com.azure.resourcemanager.machinelearning.models.ServiceManagedResourcesSettings; -import org.junit.jupiter.api.Assertions; - -public final class ServiceManagedResourcesSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServiceManagedResourcesSettings model = - BinaryData - .fromString("{\"cosmosDb\":{\"collectionsThroughput\":775754231}}") - .toObject(ServiceManagedResourcesSettings.class); - Assertions.assertEquals(775754231, model.cosmosDb().collectionsThroughput()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServiceManagedResourcesSettings model = - new ServiceManagedResourcesSettings() - .withCosmosDb(new CosmosDbSettings().withCollectionsThroughput(775754231)); - model = BinaryData.fromObject(model).toObject(ServiceManagedResourcesSettings.class); - Assertions.assertEquals(775754231, model.cosmosDb().collectionsThroughput()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SetupScriptsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SetupScriptsTests.java deleted file mode 100644 index 1cf13f62bed67..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SetupScriptsTests.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ScriptReference; -import com.azure.resourcemanager.machinelearning.models.ScriptsToExecute; -import com.azure.resourcemanager.machinelearning.models.SetupScripts; -import org.junit.jupiter.api.Assertions; - -public final class SetupScriptsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SetupScripts model = - BinaryData - .fromString( - "{\"scripts\":{\"startupScript\":{\"scriptSource\":\"otjewlpxuzzjgnre\",\"scriptData\":\"yhqotoihiqakydi\",\"scriptArguments\":\"brkwpzdqt\",\"timeout\":\"cspodaqax\"},\"creationScript\":{\"scriptSource\":\"ietgbebjfu\",\"scriptData\":\"moichdlpnfpubntn\",\"scriptArguments\":\"tzviqsowsaaelcat\",\"timeout\":\"ju\"}}}") - .toObject(SetupScripts.class); - Assertions.assertEquals("otjewlpxuzzjgnre", model.scripts().startupScript().scriptSource()); - Assertions.assertEquals("yhqotoihiqakydi", model.scripts().startupScript().scriptData()); - Assertions.assertEquals("brkwpzdqt", model.scripts().startupScript().scriptArguments()); - Assertions.assertEquals("cspodaqax", model.scripts().startupScript().timeout()); - Assertions.assertEquals("ietgbebjfu", model.scripts().creationScript().scriptSource()); - Assertions.assertEquals("moichdlpnfpubntn", model.scripts().creationScript().scriptData()); - Assertions.assertEquals("tzviqsowsaaelcat", model.scripts().creationScript().scriptArguments()); - Assertions.assertEquals("ju", model.scripts().creationScript().timeout()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SetupScripts model = - new SetupScripts() - .withScripts( - new ScriptsToExecute() - .withStartupScript( - new ScriptReference() - .withScriptSource("otjewlpxuzzjgnre") - .withScriptData("yhqotoihiqakydi") - .withScriptArguments("brkwpzdqt") - .withTimeout("cspodaqax")) - .withCreationScript( - new ScriptReference() - .withScriptSource("ietgbebjfu") - .withScriptData("moichdlpnfpubntn") - .withScriptArguments("tzviqsowsaaelcat") - .withTimeout("ju"))); - model = BinaryData.fromObject(model).toObject(SetupScripts.class); - Assertions.assertEquals("otjewlpxuzzjgnre", model.scripts().startupScript().scriptSource()); - Assertions.assertEquals("yhqotoihiqakydi", model.scripts().startupScript().scriptData()); - Assertions.assertEquals("brkwpzdqt", model.scripts().startupScript().scriptArguments()); - Assertions.assertEquals("cspodaqax", model.scripts().startupScript().timeout()); - Assertions.assertEquals("ietgbebjfu", model.scripts().creationScript().scriptSource()); - Assertions.assertEquals("moichdlpnfpubntn", model.scripts().creationScript().scriptData()); - Assertions.assertEquals("tzviqsowsaaelcat", model.scripts().creationScript().scriptArguments()); - Assertions.assertEquals("ju", model.scripts().creationScript().timeout()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SharedPrivateLinkResourcePropertyTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SharedPrivateLinkResourcePropertyTests.java deleted file mode 100644 index 42cf41eef25f4..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SharedPrivateLinkResourcePropertyTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.SharedPrivateLinkResourceProperty; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpointServiceConnectionStatus; -import org.junit.jupiter.api.Assertions; - -public final class SharedPrivateLinkResourcePropertyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SharedPrivateLinkResourceProperty model = - BinaryData - .fromString( - "{\"privateLinkResourceId\":\"s\",\"groupId\":\"smjqulngsntnbyb\",\"requestMessage\":\"gc\",\"status\":\"Approved\"}") - .toObject(SharedPrivateLinkResourceProperty.class); - Assertions.assertEquals("s", model.privateLinkResourceId()); - Assertions.assertEquals("smjqulngsntnbyb", model.groupId()); - Assertions.assertEquals("gc", model.requestMessage()); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, model.status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SharedPrivateLinkResourceProperty model = - new SharedPrivateLinkResourceProperty() - .withPrivateLinkResourceId("s") - .withGroupId("smjqulngsntnbyb") - .withRequestMessage("gc") - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED); - model = BinaryData.fromObject(model).toObject(SharedPrivateLinkResourceProperty.class); - Assertions.assertEquals("s", model.privateLinkResourceId()); - Assertions.assertEquals("smjqulngsntnbyb", model.groupId()); - Assertions.assertEquals("gc", model.requestMessage()); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, model.status()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SharedPrivateLinkResourceTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SharedPrivateLinkResourceTests.java deleted file mode 100644 index 30813b7dfc771..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SharedPrivateLinkResourceTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.machinelearning.models.SharedPrivateLinkResource; -import org.junit.jupiter.api.Assertions; - -public final class SharedPrivateLinkResourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SharedPrivateLinkResource model = - BinaryData - .fromString( - "{\"name\":\"bwjzr\",\"properties\":{\"privateLinkResourceId\":\"gxg\",\"groupId\":\"pemvtzfkufubljof\",\"requestMessage\":\"eofjaeqjh\",\"status\":\"Pending\"}}") - .toObject(SharedPrivateLinkResource.class); - Assertions.assertEquals("bwjzr", model.name()); - Assertions.assertEquals("gxg", model.privateLinkResourceId()); - Assertions.assertEquals("pemvtzfkufubljof", model.groupId()); - Assertions.assertEquals("eofjaeqjh", model.requestMessage()); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, model.status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SharedPrivateLinkResource model = - new SharedPrivateLinkResource() - .withName("bwjzr") - .withPrivateLinkResourceId("gxg") - .withGroupId("pemvtzfkufubljof") - .withRequestMessage("eofjaeqjh") - .withStatus(PrivateEndpointServiceConnectionStatus.PENDING); - model = BinaryData.fromObject(model).toObject(SharedPrivateLinkResource.class); - Assertions.assertEquals("bwjzr", model.name()); - Assertions.assertEquals("gxg", model.privateLinkResourceId()); - Assertions.assertEquals("pemvtzfkufubljof", model.groupId()); - Assertions.assertEquals("eofjaeqjh", model.requestMessage()); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, model.status()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SkuCapacityTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SkuCapacityTests.java deleted file mode 100644 index 28a064043258c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SkuCapacityTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.SkuCapacity; -import com.azure.resourcemanager.machinelearning.models.SkuScaleType; -import org.junit.jupiter.api.Assertions; - -public final class SkuCapacityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SkuCapacity model = - BinaryData - .fromString( - "{\"default\":179999920,\"maximum\":2087309055,\"minimum\":498585791,\"scaleType\":\"Automatic\"}") - .toObject(SkuCapacity.class); - Assertions.assertEquals(179999920, model.defaultProperty()); - Assertions.assertEquals(2087309055, model.maximum()); - Assertions.assertEquals(498585791, model.minimum()); - Assertions.assertEquals(SkuScaleType.AUTOMATIC, model.scaleType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuCapacity model = - new SkuCapacity() - .withDefaultProperty(179999920) - .withMaximum(2087309055) - .withMinimum(498585791) - .withScaleType(SkuScaleType.AUTOMATIC); - model = BinaryData.fromObject(model).toObject(SkuCapacity.class); - Assertions.assertEquals(179999920, model.defaultProperty()); - Assertions.assertEquals(2087309055, model.maximum()); - Assertions.assertEquals(498585791, model.minimum()); - Assertions.assertEquals(SkuScaleType.AUTOMATIC, model.scaleType()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SkuResourceArmPaginatedResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SkuResourceArmPaginatedResultTests.java deleted file mode 100644 index 66d1afb25b4f6..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SkuResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.SkuResourceInner; -import com.azure.resourcemanager.machinelearning.models.SkuCapacity; -import com.azure.resourcemanager.machinelearning.models.SkuResourceArmPaginatedResult; -import com.azure.resourcemanager.machinelearning.models.SkuScaleType; -import com.azure.resourcemanager.machinelearning.models.SkuSetting; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SkuResourceArmPaginatedResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SkuResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"nextLink\":\"rmcaykgg\",\"value\":[{\"capacity\":{\"default\":167940342,\"maximum\":1720310055,\"minimum\":150393165,\"scaleType\":\"Manual\"},\"resourceType\":\"d\",\"sku\":{\"name\":\"pfnznthjtwkj\",\"tier\":\"Standard\"}}]}") - .toObject(SkuResourceArmPaginatedResult.class); - Assertions.assertEquals("rmcaykgg", model.nextLink()); - Assertions.assertEquals(167940342, model.value().get(0).capacity().defaultProperty()); - Assertions.assertEquals(1720310055, model.value().get(0).capacity().maximum()); - Assertions.assertEquals(150393165, model.value().get(0).capacity().minimum()); - Assertions.assertEquals(SkuScaleType.MANUAL, model.value().get(0).capacity().scaleType()); - Assertions.assertEquals("pfnznthjtwkj", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.STANDARD, model.value().get(0).sku().tier()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuResourceArmPaginatedResult model = - new SkuResourceArmPaginatedResult() - .withNextLink("rmcaykgg") - .withValue( - Arrays - .asList( - new SkuResourceInner() - .withCapacity( - new SkuCapacity() - .withDefaultProperty(167940342) - .withMaximum(1720310055) - .withMinimum(150393165) - .withScaleType(SkuScaleType.MANUAL)) - .withSku(new SkuSetting().withName("pfnznthjtwkj").withTier(SkuTier.STANDARD)))); - model = BinaryData.fromObject(model).toObject(SkuResourceArmPaginatedResult.class); - Assertions.assertEquals("rmcaykgg", model.nextLink()); - Assertions.assertEquals(167940342, model.value().get(0).capacity().defaultProperty()); - Assertions.assertEquals(1720310055, model.value().get(0).capacity().maximum()); - Assertions.assertEquals(150393165, model.value().get(0).capacity().minimum()); - Assertions.assertEquals(SkuScaleType.MANUAL, model.value().get(0).capacity().scaleType()); - Assertions.assertEquals("pfnznthjtwkj", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.STANDARD, model.value().get(0).sku().tier()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SkuResourceInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SkuResourceInnerTests.java deleted file mode 100644 index c49c4c71bae58..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SkuResourceInnerTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.SkuResourceInner; -import com.azure.resourcemanager.machinelearning.models.SkuCapacity; -import com.azure.resourcemanager.machinelearning.models.SkuScaleType; -import com.azure.resourcemanager.machinelearning.models.SkuSetting; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import org.junit.jupiter.api.Assertions; - -public final class SkuResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SkuResourceInner model = - BinaryData - .fromString( - "{\"capacity\":{\"default\":1475743122,\"maximum\":1335142199,\"minimum\":1634012333,\"scaleType\":\"Manual\"},\"resourceType\":\"cqiosmgbza\",\"sku\":{\"name\":\"xqdlyrtltlapr\",\"tier\":\"Basic\"}}") - .toObject(SkuResourceInner.class); - Assertions.assertEquals(1475743122, model.capacity().defaultProperty()); - Assertions.assertEquals(1335142199, model.capacity().maximum()); - Assertions.assertEquals(1634012333, model.capacity().minimum()); - Assertions.assertEquals(SkuScaleType.MANUAL, model.capacity().scaleType()); - Assertions.assertEquals("xqdlyrtltlapr", model.sku().name()); - Assertions.assertEquals(SkuTier.BASIC, model.sku().tier()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuResourceInner model = - new SkuResourceInner() - .withCapacity( - new SkuCapacity() - .withDefaultProperty(1475743122) - .withMaximum(1335142199) - .withMinimum(1634012333) - .withScaleType(SkuScaleType.MANUAL)) - .withSku(new SkuSetting().withName("xqdlyrtltlapr").withTier(SkuTier.BASIC)); - model = BinaryData.fromObject(model).toObject(SkuResourceInner.class); - Assertions.assertEquals(1475743122, model.capacity().defaultProperty()); - Assertions.assertEquals(1335142199, model.capacity().maximum()); - Assertions.assertEquals(1634012333, model.capacity().minimum()); - Assertions.assertEquals(SkuScaleType.MANUAL, model.capacity().scaleType()); - Assertions.assertEquals("xqdlyrtltlapr", model.sku().name()); - Assertions.assertEquals(SkuTier.BASIC, model.sku().tier()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SkuSettingTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SkuSettingTests.java deleted file mode 100644 index 069d89339005d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SkuSettingTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.SkuSetting; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import org.junit.jupiter.api.Assertions; - -public final class SkuSettingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SkuSetting model = - BinaryData.fromString("{\"name\":\"nnbsoqeqa\",\"tier\":\"Premium\"}").toObject(SkuSetting.class); - Assertions.assertEquals("nnbsoqeqa", model.name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.tier()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuSetting model = new SkuSetting().withName("nnbsoqeqa").withTier(SkuTier.PREMIUM); - model = BinaryData.fromObject(model).toObject(SkuSetting.class); - Assertions.assertEquals("nnbsoqeqa", model.name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.tier()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SkuTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SkuTests.java deleted file mode 100644 index 5f25125dfac70..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SkuTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.Sku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import org.junit.jupiter.api.Assertions; - -public final class SkuTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Sku model = - BinaryData - .fromString( - "{\"name\":\"narxzxtheotus\",\"tier\":\"Free\",\"size\":\"v\",\"family\":\"iqihn\",\"capacity\":1574404612}") - .toObject(Sku.class); - Assertions.assertEquals("narxzxtheotus", model.name()); - Assertions.assertEquals(SkuTier.FREE, model.tier()); - Assertions.assertEquals("v", model.size()); - Assertions.assertEquals("iqihn", model.family()); - Assertions.assertEquals(1574404612, model.capacity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Sku model = - new Sku() - .withName("narxzxtheotus") - .withTier(SkuTier.FREE) - .withSize("v") - .withFamily("iqihn") - .withCapacity(1574404612); - model = BinaryData.fromObject(model).toObject(Sku.class); - Assertions.assertEquals("narxzxtheotus", model.name()); - Assertions.assertEquals(SkuTier.FREE, model.tier()); - Assertions.assertEquals("v", model.size()); - Assertions.assertEquals("iqihn", model.family()); - Assertions.assertEquals(1574404612, model.capacity()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/StackEnsembleSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/StackEnsembleSettingsTests.java deleted file mode 100644 index 3a87f545b8ce1..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/StackEnsembleSettingsTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.StackEnsembleSettings; -import com.azure.resourcemanager.machinelearning.models.StackMetaLearnerType; -import org.junit.jupiter.api.Assertions; - -public final class StackEnsembleSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StackEnsembleSettings model = - BinaryData - .fromString( - "{\"stackMetaLearnerKWargs\":\"datandlqvtwknvgmmbu\",\"stackMetaLearnerTrainPercentage\":7.642157888085865,\"stackMetaLearnerType\":\"LogisticRegression\"}") - .toObject(StackEnsembleSettings.class); - Assertions.assertEquals(7.642157888085865D, model.stackMetaLearnerTrainPercentage()); - Assertions.assertEquals(StackMetaLearnerType.LOGISTIC_REGRESSION, model.stackMetaLearnerType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StackEnsembleSettings model = - new StackEnsembleSettings() - .withStackMetaLearnerKWargs("datandlqvtwknvgmmbu") - .withStackMetaLearnerTrainPercentage(7.642157888085865D) - .withStackMetaLearnerType(StackMetaLearnerType.LOGISTIC_REGRESSION); - model = BinaryData.fromObject(model).toObject(StackEnsembleSettings.class); - Assertions.assertEquals(7.642157888085865D, model.stackMetaLearnerTrainPercentage()); - Assertions.assertEquals(StackMetaLearnerType.LOGISTIC_REGRESSION, model.stackMetaLearnerType()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SweepJobLimitsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SweepJobLimitsTests.java deleted file mode 100644 index b1cd5557ce140..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SweepJobLimitsTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.SweepJobLimits; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class SweepJobLimitsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SweepJobLimits model = - BinaryData - .fromString( - "{\"jobLimitsType\":\"Sweep\",\"maxConcurrentTrials\":1289892692,\"maxTotalTrials\":1229317362,\"trialTimeout\":\"PT17H24M34S\",\"timeout\":\"PT94H24M1S\"}") - .toObject(SweepJobLimits.class); - Assertions.assertEquals(Duration.parse("PT94H24M1S"), model.timeout()); - Assertions.assertEquals(1289892692, model.maxConcurrentTrials()); - Assertions.assertEquals(1229317362, model.maxTotalTrials()); - Assertions.assertEquals(Duration.parse("PT17H24M34S"), model.trialTimeout()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SweepJobLimits model = - new SweepJobLimits() - .withTimeout(Duration.parse("PT94H24M1S")) - .withMaxConcurrentTrials(1289892692) - .withMaxTotalTrials(1229317362) - .withTrialTimeout(Duration.parse("PT17H24M34S")); - model = BinaryData.fromObject(model).toObject(SweepJobLimits.class); - Assertions.assertEquals(Duration.parse("PT94H24M1S"), model.timeout()); - Assertions.assertEquals(1289892692, model.maxConcurrentTrials()); - Assertions.assertEquals(1229317362, model.maxTotalTrials()); - Assertions.assertEquals(Duration.parse("PT17H24M34S"), model.trialTimeout()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SynapseSparkPropertiesTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SynapseSparkPropertiesTests.java deleted file mode 100644 index ac5066baa849e..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SynapseSparkPropertiesTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AutoPauseProperties; -import com.azure.resourcemanager.machinelearning.models.AutoScaleProperties; -import com.azure.resourcemanager.machinelearning.models.SynapseSparkProperties; -import org.junit.jupiter.api.Assertions; - -public final class SynapseSparkPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SynapseSparkProperties model = - BinaryData - .fromString( - "{\"autoScaleProperties\":{\"minNodeCount\":1954145446,\"enabled\":true,\"maxNodeCount\":1674537674},\"autoPauseProperties\":{\"delayInMinutes\":1052407004,\"enabled\":true},\"sparkVersion\":\"ojpslsvjgpliufi\",\"nodeCount\":1125182676,\"nodeSize\":\"xqvapcohh\",\"nodeSizeFamily\":\"cqpqojxcxzrzdc\",\"subscriptionId\":\"zbenribc\",\"resourceGroup\":\"etzqd\",\"workspaceName\":\"jwfljhznamtua\",\"poolName\":\"zwcjjncqtj\"}") - .toObject(SynapseSparkProperties.class); - Assertions.assertEquals(1954145446, model.autoScaleProperties().minNodeCount()); - Assertions.assertEquals(true, model.autoScaleProperties().enabled()); - Assertions.assertEquals(1674537674, model.autoScaleProperties().maxNodeCount()); - Assertions.assertEquals(1052407004, model.autoPauseProperties().delayInMinutes()); - Assertions.assertEquals(true, model.autoPauseProperties().enabled()); - Assertions.assertEquals("ojpslsvjgpliufi", model.sparkVersion()); - Assertions.assertEquals(1125182676, model.nodeCount()); - Assertions.assertEquals("xqvapcohh", model.nodeSize()); - Assertions.assertEquals("cqpqojxcxzrzdc", model.nodeSizeFamily()); - Assertions.assertEquals("zbenribc", model.subscriptionId()); - Assertions.assertEquals("etzqd", model.resourceGroup()); - Assertions.assertEquals("jwfljhznamtua", model.workspaceName()); - Assertions.assertEquals("zwcjjncqtj", model.poolName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SynapseSparkProperties model = - new SynapseSparkProperties() - .withAutoScaleProperties( - new AutoScaleProperties() - .withMinNodeCount(1954145446) - .withEnabled(true) - .withMaxNodeCount(1674537674)) - .withAutoPauseProperties(new AutoPauseProperties().withDelayInMinutes(1052407004).withEnabled(true)) - .withSparkVersion("ojpslsvjgpliufi") - .withNodeCount(1125182676) - .withNodeSize("xqvapcohh") - .withNodeSizeFamily("cqpqojxcxzrzdc") - .withSubscriptionId("zbenribc") - .withResourceGroup("etzqd") - .withWorkspaceName("jwfljhznamtua") - .withPoolName("zwcjjncqtj"); - model = BinaryData.fromObject(model).toObject(SynapseSparkProperties.class); - Assertions.assertEquals(1954145446, model.autoScaleProperties().minNodeCount()); - Assertions.assertEquals(true, model.autoScaleProperties().enabled()); - Assertions.assertEquals(1674537674, model.autoScaleProperties().maxNodeCount()); - Assertions.assertEquals(1052407004, model.autoPauseProperties().delayInMinutes()); - Assertions.assertEquals(true, model.autoPauseProperties().enabled()); - Assertions.assertEquals("ojpslsvjgpliufi", model.sparkVersion()); - Assertions.assertEquals(1125182676, model.nodeCount()); - Assertions.assertEquals("xqvapcohh", model.nodeSize()); - Assertions.assertEquals("cqpqojxcxzrzdc", model.nodeSizeFamily()); - Assertions.assertEquals("zbenribc", model.subscriptionId()); - Assertions.assertEquals("etzqd", model.resourceGroup()); - Assertions.assertEquals("jwfljhznamtua", model.workspaceName()); - Assertions.assertEquals("zwcjjncqtj", model.poolName()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SynapseSparkTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SynapseSparkTests.java deleted file mode 100644 index 35050793a9b8d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SynapseSparkTests.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.AutoPauseProperties; -import com.azure.resourcemanager.machinelearning.models.AutoScaleProperties; -import com.azure.resourcemanager.machinelearning.models.SynapseSpark; -import com.azure.resourcemanager.machinelearning.models.SynapseSparkProperties; -import org.junit.jupiter.api.Assertions; - -public final class SynapseSparkTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SynapseSpark model = - BinaryData - .fromString( - "{\"computeType\":\"SynapseSpark\",\"properties\":{\"autoScaleProperties\":{\"minNodeCount\":1214736566,\"enabled\":false,\"maxNodeCount\":576028683},\"autoPauseProperties\":{\"delayInMinutes\":909175637,\"enabled\":true},\"sparkVersion\":\"pedbwdpyqy\",\"nodeCount\":895891546,\"nodeSize\":\"bmdnafcbqwre\",\"nodeSizeFamily\":\"ela\",\"subscriptionId\":\"cigeleohdbvqvw\",\"resourceGroup\":\"jopwbeonrlkwz\",\"workspaceName\":\"ybxc\",\"poolName\":\"kxcpt\"},\"computeLocation\":\"qfyiaseqchkr\",\"provisioningState\":\"Canceled\",\"description\":\"azisgyk\",\"createdOn\":\"2021-05-23T19:22:14Z\",\"modifiedOn\":\"2021-11-23T05:48:50Z\",\"resourceId\":\"nbwzohmnrxxbso\",\"provisioningErrors\":[],\"isAttachedCompute\":true,\"disableLocalAuth\":false}") - .toObject(SynapseSpark.class); - Assertions.assertEquals("qfyiaseqchkr", model.computeLocation()); - Assertions.assertEquals("azisgyk", model.description()); - Assertions.assertEquals("nbwzohmnrxxbso", model.resourceId()); - Assertions.assertEquals(false, model.disableLocalAuth()); - Assertions.assertEquals(1214736566, model.properties().autoScaleProperties().minNodeCount()); - Assertions.assertEquals(false, model.properties().autoScaleProperties().enabled()); - Assertions.assertEquals(576028683, model.properties().autoScaleProperties().maxNodeCount()); - Assertions.assertEquals(909175637, model.properties().autoPauseProperties().delayInMinutes()); - Assertions.assertEquals(true, model.properties().autoPauseProperties().enabled()); - Assertions.assertEquals("pedbwdpyqy", model.properties().sparkVersion()); - Assertions.assertEquals(895891546, model.properties().nodeCount()); - Assertions.assertEquals("bmdnafcbqwre", model.properties().nodeSize()); - Assertions.assertEquals("ela", model.properties().nodeSizeFamily()); - Assertions.assertEquals("cigeleohdbvqvw", model.properties().subscriptionId()); - Assertions.assertEquals("jopwbeonrlkwz", model.properties().resourceGroup()); - Assertions.assertEquals("ybxc", model.properties().workspaceName()); - Assertions.assertEquals("kxcpt", model.properties().poolName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SynapseSpark model = - new SynapseSpark() - .withComputeLocation("qfyiaseqchkr") - .withDescription("azisgyk") - .withResourceId("nbwzohmnrxxbso") - .withDisableLocalAuth(false) - .withProperties( - new SynapseSparkProperties() - .withAutoScaleProperties( - new AutoScaleProperties() - .withMinNodeCount(1214736566) - .withEnabled(false) - .withMaxNodeCount(576028683)) - .withAutoPauseProperties( - new AutoPauseProperties().withDelayInMinutes(909175637).withEnabled(true)) - .withSparkVersion("pedbwdpyqy") - .withNodeCount(895891546) - .withNodeSize("bmdnafcbqwre") - .withNodeSizeFamily("ela") - .withSubscriptionId("cigeleohdbvqvw") - .withResourceGroup("jopwbeonrlkwz") - .withWorkspaceName("ybxc") - .withPoolName("kxcpt")); - model = BinaryData.fromObject(model).toObject(SynapseSpark.class); - Assertions.assertEquals("qfyiaseqchkr", model.computeLocation()); - Assertions.assertEquals("azisgyk", model.description()); - Assertions.assertEquals("nbwzohmnrxxbso", model.resourceId()); - Assertions.assertEquals(false, model.disableLocalAuth()); - Assertions.assertEquals(1214736566, model.properties().autoScaleProperties().minNodeCount()); - Assertions.assertEquals(false, model.properties().autoScaleProperties().enabled()); - Assertions.assertEquals(576028683, model.properties().autoScaleProperties().maxNodeCount()); - Assertions.assertEquals(909175637, model.properties().autoPauseProperties().delayInMinutes()); - Assertions.assertEquals(true, model.properties().autoPauseProperties().enabled()); - Assertions.assertEquals("pedbwdpyqy", model.properties().sparkVersion()); - Assertions.assertEquals(895891546, model.properties().nodeCount()); - Assertions.assertEquals("bmdnafcbqwre", model.properties().nodeSize()); - Assertions.assertEquals("ela", model.properties().nodeSizeFamily()); - Assertions.assertEquals("cigeleohdbvqvw", model.properties().subscriptionId()); - Assertions.assertEquals("jopwbeonrlkwz", model.properties().resourceGroup()); - Assertions.assertEquals("ybxc", model.properties().workspaceName()); - Assertions.assertEquals("kxcpt", model.properties().poolName()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SystemServiceTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SystemServiceTests.java deleted file mode 100644 index 0680a3ac90f13..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/SystemServiceTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.SystemService; - -public final class SystemServiceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SystemService model = - BinaryData - .fromString( - "{\"systemServiceType\":\"gcgbjb\",\"publicIpAddress\":\"lfgtdysnaquflqbc\",\"version\":\"hamzjrwdkqze\"}") - .toObject(SystemService.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SystemService model = new SystemService(); - model = BinaryData.fromObject(model).toObject(SystemService.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TableVerticalFeaturizationSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TableVerticalFeaturizationSettingsTests.java deleted file mode 100644 index bd094cd3e34b7..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TableVerticalFeaturizationSettingsTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.BlockedTransformers; -import com.azure.resourcemanager.machinelearning.models.ColumnTransformer; -import com.azure.resourcemanager.machinelearning.models.FeaturizationMode; -import com.azure.resourcemanager.machinelearning.models.TableVerticalFeaturizationSettings; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class TableVerticalFeaturizationSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TableVerticalFeaturizationSettings model = - BinaryData - .fromString( - "{\"blockedTransformers\":[\"TextTargetEncoder\"],\"columnNameAndTypes\":{\"qyv\":\"blhtjq\",\"a\":\"eh\"},\"enableDnnFeaturization\":false,\"mode\":\"Auto\",\"transformerParams\":{\"tjvv\":[{\"fields\":[\"usxivzrrryvei\",\"ipsk\"],\"parameters\":\"datazatvfuzka\"}]},\"datasetLanguage\":\"xwigsye\"}") - .toObject(TableVerticalFeaturizationSettings.class); - Assertions.assertEquals("xwigsye", model.datasetLanguage()); - Assertions.assertEquals(BlockedTransformers.TEXT_TARGET_ENCODER, model.blockedTransformers().get(0)); - Assertions.assertEquals("blhtjq", model.columnNameAndTypes().get("qyv")); - Assertions.assertEquals(false, model.enableDnnFeaturization()); - Assertions.assertEquals(FeaturizationMode.AUTO, model.mode()); - Assertions.assertEquals("usxivzrrryvei", model.transformerParams().get("tjvv").get(0).fields().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TableVerticalFeaturizationSettings model = - new TableVerticalFeaturizationSettings() - .withDatasetLanguage("xwigsye") - .withBlockedTransformers(Arrays.asList(BlockedTransformers.TEXT_TARGET_ENCODER)) - .withColumnNameAndTypes(mapOf("qyv", "blhtjq", "a", "eh")) - .withEnableDnnFeaturization(false) - .withMode(FeaturizationMode.AUTO) - .withTransformerParams( - mapOf( - "tjvv", - Arrays - .asList( - new ColumnTransformer() - .withFields(Arrays.asList("usxivzrrryvei", "ipsk")) - .withParameters("datazatvfuzka")))); - model = BinaryData.fromObject(model).toObject(TableVerticalFeaturizationSettings.class); - Assertions.assertEquals("xwigsye", model.datasetLanguage()); - Assertions.assertEquals(BlockedTransformers.TEXT_TARGET_ENCODER, model.blockedTransformers().get(0)); - Assertions.assertEquals("blhtjq", model.columnNameAndTypes().get("qyv")); - Assertions.assertEquals(false, model.enableDnnFeaturization()); - Assertions.assertEquals(FeaturizationMode.AUTO, model.mode()); - Assertions.assertEquals("usxivzrrryvei", model.transformerParams().get("tjvv").get(0).fields().get(0)); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TableVerticalLimitSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TableVerticalLimitSettingsTests.java deleted file mode 100644 index e6eec1743952d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TableVerticalLimitSettingsTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.TableVerticalLimitSettings; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class TableVerticalLimitSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TableVerticalLimitSettings model = - BinaryData - .fromString( - "{\"enableEarlyTermination\":false,\"exitScore\":93.94093189506944,\"maxConcurrentTrials\":976047571,\"maxCoresPerTrial\":1086162181,\"maxTrials\":943881137,\"timeout\":\"PT74H46M4S\",\"trialTimeout\":\"PT5H4M5S\"}") - .toObject(TableVerticalLimitSettings.class); - Assertions.assertEquals(false, model.enableEarlyTermination()); - Assertions.assertEquals(93.94093189506944D, model.exitScore()); - Assertions.assertEquals(976047571, model.maxConcurrentTrials()); - Assertions.assertEquals(1086162181, model.maxCoresPerTrial()); - Assertions.assertEquals(943881137, model.maxTrials()); - Assertions.assertEquals(Duration.parse("PT74H46M4S"), model.timeout()); - Assertions.assertEquals(Duration.parse("PT5H4M5S"), model.trialTimeout()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TableVerticalLimitSettings model = - new TableVerticalLimitSettings() - .withEnableEarlyTermination(false) - .withExitScore(93.94093189506944D) - .withMaxConcurrentTrials(976047571) - .withMaxCoresPerTrial(1086162181) - .withMaxTrials(943881137) - .withTimeout(Duration.parse("PT74H46M4S")) - .withTrialTimeout(Duration.parse("PT5H4M5S")); - model = BinaryData.fromObject(model).toObject(TableVerticalLimitSettings.class); - Assertions.assertEquals(false, model.enableEarlyTermination()); - Assertions.assertEquals(93.94093189506944D, model.exitScore()); - Assertions.assertEquals(976047571, model.maxConcurrentTrials()); - Assertions.assertEquals(1086162181, model.maxCoresPerTrial()); - Assertions.assertEquals(943881137, model.maxTrials()); - Assertions.assertEquals(Duration.parse("PT74H46M4S"), model.timeout()); - Assertions.assertEquals(Duration.parse("PT5H4M5S"), model.trialTimeout()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TableVerticalTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TableVerticalTests.java deleted file mode 100644 index a45b8e331985c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TableVerticalTests.java +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.BlockedTransformers; -import com.azure.resourcemanager.machinelearning.models.FeaturizationMode; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import com.azure.resourcemanager.machinelearning.models.NCrossValidations; -import com.azure.resourcemanager.machinelearning.models.TableVertical; -import com.azure.resourcemanager.machinelearning.models.TableVerticalFeaturizationSettings; -import com.azure.resourcemanager.machinelearning.models.TableVerticalLimitSettings; -import java.time.Duration; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class TableVerticalTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TableVertical model = - BinaryData - .fromString( - "{\"cvSplitColumnNames\":[\"aqkue\",\"tgroesh\"],\"featurizationSettings\":{\"blockedTransformers\":[\"LabelEncoder\",\"CountVectorizer\"],\"columnNameAndTypes\":{\"vjmvqmtdwckygr\":\"qxkfaoytehqp\",\"kb\":\"ejnndljdju\",\"n\":\"req\"},\"enableDnnFeaturization\":true,\"mode\":\"Auto\",\"transformerParams\":{\"egplwr\":[]},\"datasetLanguage\":\"hwddkvbxgkq\"},\"limitSettings\":{\"enableEarlyTermination\":true,\"exitScore\":58.74936526740298,\"maxConcurrentTrials\":1893356146,\"maxCoresPerTrial\":1883292844,\"maxTrials\":501930478,\"timeout\":\"PT193H51M55S\",\"trialTimeout\":\"PT46H37M35S\"},\"nCrossValidations\":{\"mode\":\"NCrossValidations\"},\"testData\":{\"jobInputType\":\"mltable\",\"mode\":\"ReadOnlyMount\",\"uri\":\"poi\",\"description\":\"naz\"},\"testDataSize\":59.15029219925634,\"validationData\":{\"jobInputType\":\"mltable\",\"mode\":\"Direct\",\"uri\":\"qalsxkd\",\"description\":\"qapfgsdpc\"},\"validationDataSize\":60.92552835591164,\"weightColumnName\":\"zhhkuuipldqqc\"}") - .toObject(TableVertical.class); - Assertions.assertEquals("aqkue", model.cvSplitColumnNames().get(0)); - Assertions.assertEquals("hwddkvbxgkq", model.featurizationSettings().datasetLanguage()); - Assertions - .assertEquals( - BlockedTransformers.LABEL_ENCODER, model.featurizationSettings().blockedTransformers().get(0)); - Assertions - .assertEquals("qxkfaoytehqp", model.featurizationSettings().columnNameAndTypes().get("vjmvqmtdwckygr")); - Assertions.assertEquals(true, model.featurizationSettings().enableDnnFeaturization()); - Assertions.assertEquals(FeaturizationMode.AUTO, model.featurizationSettings().mode()); - Assertions.assertEquals(true, model.limitSettings().enableEarlyTermination()); - Assertions.assertEquals(58.74936526740298D, model.limitSettings().exitScore()); - Assertions.assertEquals(1893356146, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(1883292844, model.limitSettings().maxCoresPerTrial()); - Assertions.assertEquals(501930478, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT193H51M55S"), model.limitSettings().timeout()); - Assertions.assertEquals(Duration.parse("PT46H37M35S"), model.limitSettings().trialTimeout()); - Assertions.assertEquals("naz", model.testData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_ONLY_MOUNT, model.testData().mode()); - Assertions.assertEquals("poi", model.testData().uri()); - Assertions.assertEquals(59.15029219925634D, model.testDataSize()); - Assertions.assertEquals("qapfgsdpc", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.validationData().mode()); - Assertions.assertEquals("qalsxkd", model.validationData().uri()); - Assertions.assertEquals(60.92552835591164D, model.validationDataSize()); - Assertions.assertEquals("zhhkuuipldqqc", model.weightColumnName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TableVertical model = - new TableVertical() - .withCvSplitColumnNames(Arrays.asList("aqkue", "tgroesh")) - .withFeaturizationSettings( - new TableVerticalFeaturizationSettings() - .withDatasetLanguage("hwddkvbxgkq") - .withBlockedTransformers( - Arrays.asList(BlockedTransformers.LABEL_ENCODER, BlockedTransformers.COUNT_VECTORIZER)) - .withColumnNameAndTypes(mapOf("vjmvqmtdwckygr", "qxkfaoytehqp", "kb", "ejnndljdju", "n", "req")) - .withEnableDnnFeaturization(true) - .withMode(FeaturizationMode.AUTO) - .withTransformerParams(mapOf("egplwr", Arrays.asList()))) - .withLimitSettings( - new TableVerticalLimitSettings() - .withEnableEarlyTermination(true) - .withExitScore(58.74936526740298D) - .withMaxConcurrentTrials(1893356146) - .withMaxCoresPerTrial(1883292844) - .withMaxTrials(501930478) - .withTimeout(Duration.parse("PT193H51M55S")) - .withTrialTimeout(Duration.parse("PT46H37M35S"))) - .withNCrossValidations(new NCrossValidations()) - .withTestData( - new MLTableJobInput() - .withDescription("naz") - .withMode(InputDeliveryMode.READ_ONLY_MOUNT) - .withUri("poi")) - .withTestDataSize(59.15029219925634D) - .withValidationData( - new MLTableJobInput() - .withDescription("qapfgsdpc") - .withMode(InputDeliveryMode.DIRECT) - .withUri("qalsxkd")) - .withValidationDataSize(60.92552835591164D) - .withWeightColumnName("zhhkuuipldqqc"); - model = BinaryData.fromObject(model).toObject(TableVertical.class); - Assertions.assertEquals("aqkue", model.cvSplitColumnNames().get(0)); - Assertions.assertEquals("hwddkvbxgkq", model.featurizationSettings().datasetLanguage()); - Assertions - .assertEquals( - BlockedTransformers.LABEL_ENCODER, model.featurizationSettings().blockedTransformers().get(0)); - Assertions - .assertEquals("qxkfaoytehqp", model.featurizationSettings().columnNameAndTypes().get("vjmvqmtdwckygr")); - Assertions.assertEquals(true, model.featurizationSettings().enableDnnFeaturization()); - Assertions.assertEquals(FeaturizationMode.AUTO, model.featurizationSettings().mode()); - Assertions.assertEquals(true, model.limitSettings().enableEarlyTermination()); - Assertions.assertEquals(58.74936526740298D, model.limitSettings().exitScore()); - Assertions.assertEquals(1893356146, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(1883292844, model.limitSettings().maxCoresPerTrial()); - Assertions.assertEquals(501930478, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT193H51M55S"), model.limitSettings().timeout()); - Assertions.assertEquals(Duration.parse("PT46H37M35S"), model.limitSettings().trialTimeout()); - Assertions.assertEquals("naz", model.testData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_ONLY_MOUNT, model.testData().mode()); - Assertions.assertEquals("poi", model.testData().uri()); - Assertions.assertEquals(59.15029219925634D, model.testDataSize()); - Assertions.assertEquals("qapfgsdpc", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.validationData().mode()); - Assertions.assertEquals("qalsxkd", model.validationData().uri()); - Assertions.assertEquals(60.92552835591164D, model.validationDataSize()); - Assertions.assertEquals("zhhkuuipldqqc", model.weightColumnName()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TargetLagsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TargetLagsTests.java deleted file mode 100644 index 529ec59a2e017..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TargetLagsTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.TargetLags; - -public final class TargetLagsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TargetLags model = BinaryData.fromString("{\"mode\":\"TargetLags\"}").toObject(TargetLags.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TargetLags model = new TargetLags(); - model = BinaryData.fromObject(model).toObject(TargetLags.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TargetRollingWindowSizeTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TargetRollingWindowSizeTests.java deleted file mode 100644 index c8c6218362872..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TargetRollingWindowSizeTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.TargetRollingWindowSize; - -public final class TargetRollingWindowSizeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TargetRollingWindowSize model = - BinaryData.fromString("{\"mode\":\"TargetRollingWindowSize\"}").toObject(TargetRollingWindowSize.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TargetRollingWindowSize model = new TargetRollingWindowSize(); - model = BinaryData.fromObject(model).toObject(TargetRollingWindowSize.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TargetUtilizationScaleSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TargetUtilizationScaleSettingsTests.java deleted file mode 100644 index 078f8865a89f6..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TargetUtilizationScaleSettingsTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.TargetUtilizationScaleSettings; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class TargetUtilizationScaleSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TargetUtilizationScaleSettings model = - BinaryData - .fromString( - "{\"scaleType\":\"TargetUtilization\",\"maxInstances\":1095681099,\"minInstances\":1317358877,\"pollingInterval\":\"PT10H14M39S\",\"targetUtilizationPercentage\":93995844}") - .toObject(TargetUtilizationScaleSettings.class); - Assertions.assertEquals(1095681099, model.maxInstances()); - Assertions.assertEquals(1317358877, model.minInstances()); - Assertions.assertEquals(Duration.parse("PT10H14M39S"), model.pollingInterval()); - Assertions.assertEquals(93995844, model.targetUtilizationPercentage()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TargetUtilizationScaleSettings model = - new TargetUtilizationScaleSettings() - .withMaxInstances(1095681099) - .withMinInstances(1317358877) - .withPollingInterval(Duration.parse("PT10H14M39S")) - .withTargetUtilizationPercentage(93995844); - model = BinaryData.fromObject(model).toObject(TargetUtilizationScaleSettings.class); - Assertions.assertEquals(1095681099, model.maxInstances()); - Assertions.assertEquals(1317358877, model.minInstances()); - Assertions.assertEquals(Duration.parse("PT10H14M39S"), model.pollingInterval()); - Assertions.assertEquals(93995844, model.targetUtilizationPercentage()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TensorFlowTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TensorFlowTests.java deleted file mode 100644 index 12ea722ac887a..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TensorFlowTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.TensorFlow; -import org.junit.jupiter.api.Assertions; - -public final class TensorFlowTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TensorFlow model = - BinaryData - .fromString( - "{\"distributionType\":\"TensorFlow\",\"parameterServerCount\":1873881024,\"workerCount\":131974478}") - .toObject(TensorFlow.class); - Assertions.assertEquals(1873881024, model.parameterServerCount()); - Assertions.assertEquals(131974478, model.workerCount()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TensorFlow model = new TensorFlow().withParameterServerCount(1873881024).withWorkerCount(131974478); - model = BinaryData.fromObject(model).toObject(TensorFlow.class); - Assertions.assertEquals(1873881024, model.parameterServerCount()); - Assertions.assertEquals(131974478, model.workerCount()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TextClassificationMultilabelTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TextClassificationMultilabelTests.java deleted file mode 100644 index 04eaf93fc5416..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TextClassificationMultilabelTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.LogVerbosity; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import com.azure.resourcemanager.machinelearning.models.NlpVerticalFeaturizationSettings; -import com.azure.resourcemanager.machinelearning.models.NlpVerticalLimitSettings; -import com.azure.resourcemanager.machinelearning.models.TextClassificationMultilabel; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class TextClassificationMultilabelTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TextClassificationMultilabel model = - BinaryData - .fromString( - "{\"taskType\":\"TextClassificationMultilabel\",\"primaryMetric\":\"AveragePrecisionScoreWeighted\",\"featurizationSettings\":{\"datasetLanguage\":\"klt\"},\"limitSettings\":{\"maxConcurrentTrials\":1366135748,\"maxTrials\":1224275689,\"timeout\":\"PT25H21M12S\"},\"validationData\":{\"jobInputType\":\"mltable\",\"mode\":\"EvalDownload\",\"uri\":\"grdcgubsrtmdy\",\"description\":\"erpi\"},\"logVerbosity\":\"Warning\",\"targetColumnName\":\"zgczfcmfpfbode\",\"trainingData\":{\"jobInputType\":\"mltable\",\"mode\":\"Direct\",\"uri\":\"sr\",\"description\":\"tshuvftwaivm\"}}") - .toObject(TextClassificationMultilabel.class); - Assertions.assertEquals(LogVerbosity.WARNING, model.logVerbosity()); - Assertions.assertEquals("zgczfcmfpfbode", model.targetColumnName()); - Assertions.assertEquals("tshuvftwaivm", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.trainingData().mode()); - Assertions.assertEquals("sr", model.trainingData().uri()); - Assertions.assertEquals("klt", model.featurizationSettings().datasetLanguage()); - Assertions.assertEquals(1366135748, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(1224275689, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT25H21M12S"), model.limitSettings().timeout()); - Assertions.assertEquals("erpi", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_DOWNLOAD, model.validationData().mode()); - Assertions.assertEquals("grdcgubsrtmdy", model.validationData().uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TextClassificationMultilabel model = - new TextClassificationMultilabel() - .withLogVerbosity(LogVerbosity.WARNING) - .withTargetColumnName("zgczfcmfpfbode") - .withTrainingData( - new MLTableJobInput() - .withDescription("tshuvftwaivm") - .withMode(InputDeliveryMode.DIRECT) - .withUri("sr")) - .withFeaturizationSettings(new NlpVerticalFeaturizationSettings().withDatasetLanguage("klt")) - .withLimitSettings( - new NlpVerticalLimitSettings() - .withMaxConcurrentTrials(1366135748) - .withMaxTrials(1224275689) - .withTimeout(Duration.parse("PT25H21M12S"))) - .withValidationData( - new MLTableJobInput() - .withDescription("erpi") - .withMode(InputDeliveryMode.EVAL_DOWNLOAD) - .withUri("grdcgubsrtmdy")); - model = BinaryData.fromObject(model).toObject(TextClassificationMultilabel.class); - Assertions.assertEquals(LogVerbosity.WARNING, model.logVerbosity()); - Assertions.assertEquals("zgczfcmfpfbode", model.targetColumnName()); - Assertions.assertEquals("tshuvftwaivm", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.DIRECT, model.trainingData().mode()); - Assertions.assertEquals("sr", model.trainingData().uri()); - Assertions.assertEquals("klt", model.featurizationSettings().datasetLanguage()); - Assertions.assertEquals(1366135748, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(1224275689, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT25H21M12S"), model.limitSettings().timeout()); - Assertions.assertEquals("erpi", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_DOWNLOAD, model.validationData().mode()); - Assertions.assertEquals("grdcgubsrtmdy", model.validationData().uri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TextClassificationTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TextClassificationTests.java deleted file mode 100644 index cc6b6e0733ab8..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TextClassificationTests.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ClassificationPrimaryMetrics; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.LogVerbosity; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import com.azure.resourcemanager.machinelearning.models.NlpVerticalFeaturizationSettings; -import com.azure.resourcemanager.machinelearning.models.NlpVerticalLimitSettings; -import com.azure.resourcemanager.machinelearning.models.TextClassification; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class TextClassificationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TextClassification model = - BinaryData - .fromString( - "{\"taskType\":\"TextClassification\",\"primaryMetric\":\"AveragePrecisionScoreWeighted\",\"featurizationSettings\":{\"datasetLanguage\":\"tsffo\"},\"limitSettings\":{\"maxConcurrentTrials\":650758189,\"maxTrials\":560959800,\"timeout\":\"PT174H2M54S\"},\"validationData\":{\"jobInputType\":\"mltable\",\"mode\":\"ReadOnlyMount\",\"uri\":\"w\",\"description\":\"cgwdfriwgybjp\"},\"logVerbosity\":\"Warning\",\"targetColumnName\":\"scvgl\",\"trainingData\":{\"jobInputType\":\"mltable\",\"mode\":\"EvalMount\",\"uri\":\"dgbyfgwewqkjvxp\",\"description\":\"pxsoohu\"}}") - .toObject(TextClassification.class); - Assertions.assertEquals(LogVerbosity.WARNING, model.logVerbosity()); - Assertions.assertEquals("scvgl", model.targetColumnName()); - Assertions.assertEquals("pxsoohu", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_MOUNT, model.trainingData().mode()); - Assertions.assertEquals("dgbyfgwewqkjvxp", model.trainingData().uri()); - Assertions.assertEquals(ClassificationPrimaryMetrics.AVERAGE_PRECISION_SCORE_WEIGHTED, model.primaryMetric()); - Assertions.assertEquals("tsffo", model.featurizationSettings().datasetLanguage()); - Assertions.assertEquals(650758189, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(560959800, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT174H2M54S"), model.limitSettings().timeout()); - Assertions.assertEquals("cgwdfriwgybjp", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_ONLY_MOUNT, model.validationData().mode()); - Assertions.assertEquals("w", model.validationData().uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TextClassification model = - new TextClassification() - .withLogVerbosity(LogVerbosity.WARNING) - .withTargetColumnName("scvgl") - .withTrainingData( - new MLTableJobInput() - .withDescription("pxsoohu") - .withMode(InputDeliveryMode.EVAL_MOUNT) - .withUri("dgbyfgwewqkjvxp")) - .withPrimaryMetric(ClassificationPrimaryMetrics.AVERAGE_PRECISION_SCORE_WEIGHTED) - .withFeaturizationSettings(new NlpVerticalFeaturizationSettings().withDatasetLanguage("tsffo")) - .withLimitSettings( - new NlpVerticalLimitSettings() - .withMaxConcurrentTrials(650758189) - .withMaxTrials(560959800) - .withTimeout(Duration.parse("PT174H2M54S"))) - .withValidationData( - new MLTableJobInput() - .withDescription("cgwdfriwgybjp") - .withMode(InputDeliveryMode.READ_ONLY_MOUNT) - .withUri("w")); - model = BinaryData.fromObject(model).toObject(TextClassification.class); - Assertions.assertEquals(LogVerbosity.WARNING, model.logVerbosity()); - Assertions.assertEquals("scvgl", model.targetColumnName()); - Assertions.assertEquals("pxsoohu", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_MOUNT, model.trainingData().mode()); - Assertions.assertEquals("dgbyfgwewqkjvxp", model.trainingData().uri()); - Assertions.assertEquals(ClassificationPrimaryMetrics.AVERAGE_PRECISION_SCORE_WEIGHTED, model.primaryMetric()); - Assertions.assertEquals("tsffo", model.featurizationSettings().datasetLanguage()); - Assertions.assertEquals(650758189, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(560959800, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT174H2M54S"), model.limitSettings().timeout()); - Assertions.assertEquals("cgwdfriwgybjp", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_ONLY_MOUNT, model.validationData().mode()); - Assertions.assertEquals("w", model.validationData().uri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TextNerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TextNerTests.java deleted file mode 100644 index 66c830fc80a6d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TextNerTests.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.LogVerbosity; -import com.azure.resourcemanager.machinelearning.models.MLTableJobInput; -import com.azure.resourcemanager.machinelearning.models.NlpVerticalFeaturizationSettings; -import com.azure.resourcemanager.machinelearning.models.NlpVerticalLimitSettings; -import com.azure.resourcemanager.machinelearning.models.TextNer; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class TextNerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TextNer model = - BinaryData - .fromString( - "{\"taskType\":\"TextNER\",\"primaryMetric\":\"PrecisionScoreWeighted\",\"featurizationSettings\":{\"datasetLanguage\":\"zgjypanhxmpdxxz\"},\"limitSettings\":{\"maxConcurrentTrials\":1172972444,\"maxTrials\":1745453139,\"timeout\":\"PT16H13M18S\"},\"validationData\":{\"jobInputType\":\"mltable\",\"mode\":\"ReadWriteMount\",\"uri\":\"lkfhglhrfoxqwec\",\"description\":\"nhpcselqx\"},\"logVerbosity\":\"Critical\",\"targetColumnName\":\"qibukklvzrl\",\"trainingData\":{\"jobInputType\":\"mltable\",\"mode\":\"Download\",\"uri\":\"ccmetjsczivfqb\",\"description\":\"asdsyenzsie\"}}") - .toObject(TextNer.class); - Assertions.assertEquals(LogVerbosity.CRITICAL, model.logVerbosity()); - Assertions.assertEquals("qibukklvzrl", model.targetColumnName()); - Assertions.assertEquals("asdsyenzsie", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.trainingData().mode()); - Assertions.assertEquals("ccmetjsczivfqb", model.trainingData().uri()); - Assertions.assertEquals("zgjypanhxmpdxxz", model.featurizationSettings().datasetLanguage()); - Assertions.assertEquals(1172972444, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(1745453139, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT16H13M18S"), model.limitSettings().timeout()); - Assertions.assertEquals("nhpcselqx", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_WRITE_MOUNT, model.validationData().mode()); - Assertions.assertEquals("lkfhglhrfoxqwec", model.validationData().uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TextNer model = - new TextNer() - .withLogVerbosity(LogVerbosity.CRITICAL) - .withTargetColumnName("qibukklvzrl") - .withTrainingData( - new MLTableJobInput() - .withDescription("asdsyenzsie") - .withMode(InputDeliveryMode.DOWNLOAD) - .withUri("ccmetjsczivfqb")) - .withFeaturizationSettings( - new NlpVerticalFeaturizationSettings().withDatasetLanguage("zgjypanhxmpdxxz")) - .withLimitSettings( - new NlpVerticalLimitSettings() - .withMaxConcurrentTrials(1172972444) - .withMaxTrials(1745453139) - .withTimeout(Duration.parse("PT16H13M18S"))) - .withValidationData( - new MLTableJobInput() - .withDescription("nhpcselqx") - .withMode(InputDeliveryMode.READ_WRITE_MOUNT) - .withUri("lkfhglhrfoxqwec")); - model = BinaryData.fromObject(model).toObject(TextNer.class); - Assertions.assertEquals(LogVerbosity.CRITICAL, model.logVerbosity()); - Assertions.assertEquals("qibukklvzrl", model.targetColumnName()); - Assertions.assertEquals("asdsyenzsie", model.trainingData().description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.trainingData().mode()); - Assertions.assertEquals("ccmetjsczivfqb", model.trainingData().uri()); - Assertions.assertEquals("zgjypanhxmpdxxz", model.featurizationSettings().datasetLanguage()); - Assertions.assertEquals(1172972444, model.limitSettings().maxConcurrentTrials()); - Assertions.assertEquals(1745453139, model.limitSettings().maxTrials()); - Assertions.assertEquals(Duration.parse("PT16H13M18S"), model.limitSettings().timeout()); - Assertions.assertEquals("nhpcselqx", model.validationData().description()); - Assertions.assertEquals(InputDeliveryMode.READ_WRITE_MOUNT, model.validationData().mode()); - Assertions.assertEquals("lkfhglhrfoxqwec", model.validationData().uri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TrainingSettingsTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TrainingSettingsTests.java deleted file mode 100644 index c92f459fe17f0..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TrainingSettingsTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.StackEnsembleSettings; -import com.azure.resourcemanager.machinelearning.models.StackMetaLearnerType; -import com.azure.resourcemanager.machinelearning.models.TrainingSettings; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class TrainingSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TrainingSettings model = - BinaryData - .fromString( - "{\"enableDnnTraining\":false,\"enableModelExplainability\":false,\"enableOnnxCompatibleModels\":true,\"enableStackEnsemble\":false,\"enableVoteEnsemble\":false,\"ensembleModelDownloadTimeout\":\"PT109H29M10S\",\"stackEnsembleSettings\":{\"stackMetaLearnerKWargs\":\"datajtasbvwispk\",\"stackMetaLearnerTrainPercentage\":99.23936213293845,\"stackMetaLearnerType\":\"LogisticRegressionCV\"}}") - .toObject(TrainingSettings.class); - Assertions.assertEquals(false, model.enableDnnTraining()); - Assertions.assertEquals(false, model.enableModelExplainability()); - Assertions.assertEquals(true, model.enableOnnxCompatibleModels()); - Assertions.assertEquals(false, model.enableStackEnsemble()); - Assertions.assertEquals(false, model.enableVoteEnsemble()); - Assertions.assertEquals(Duration.parse("PT109H29M10S"), model.ensembleModelDownloadTimeout()); - Assertions.assertEquals(99.23936213293845D, model.stackEnsembleSettings().stackMetaLearnerTrainPercentage()); - Assertions - .assertEquals( - StackMetaLearnerType.LOGISTIC_REGRESSION_CV, model.stackEnsembleSettings().stackMetaLearnerType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TrainingSettings model = - new TrainingSettings() - .withEnableDnnTraining(false) - .withEnableModelExplainability(false) - .withEnableOnnxCompatibleModels(true) - .withEnableStackEnsemble(false) - .withEnableVoteEnsemble(false) - .withEnsembleModelDownloadTimeout(Duration.parse("PT109H29M10S")) - .withStackEnsembleSettings( - new StackEnsembleSettings() - .withStackMetaLearnerKWargs("datajtasbvwispk") - .withStackMetaLearnerTrainPercentage(99.23936213293845D) - .withStackMetaLearnerType(StackMetaLearnerType.LOGISTIC_REGRESSION_CV)); - model = BinaryData.fromObject(model).toObject(TrainingSettings.class); - Assertions.assertEquals(false, model.enableDnnTraining()); - Assertions.assertEquals(false, model.enableModelExplainability()); - Assertions.assertEquals(true, model.enableOnnxCompatibleModels()); - Assertions.assertEquals(false, model.enableStackEnsemble()); - Assertions.assertEquals(false, model.enableVoteEnsemble()); - Assertions.assertEquals(Duration.parse("PT109H29M10S"), model.ensembleModelDownloadTimeout()); - Assertions.assertEquals(99.23936213293845D, model.stackEnsembleSettings().stackMetaLearnerTrainPercentage()); - Assertions - .assertEquals( - StackMetaLearnerType.LOGISTIC_REGRESSION_CV, model.stackEnsembleSettings().stackMetaLearnerType()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TriggerBaseTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TriggerBaseTests.java deleted file mode 100644 index 5983c0e76c29c..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TriggerBaseTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.TriggerBase; -import org.junit.jupiter.api.Assertions; - -public final class TriggerBaseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TriggerBase model = - BinaryData - .fromString( - "{\"triggerType\":\"TriggerBase\",\"endTime\":\"plucfotangcfhnyk\",\"startTime\":\"ugswvx\",\"timeZone\":\"mzqwmvtxnjmxmcu\"}") - .toObject(TriggerBase.class); - Assertions.assertEquals("plucfotangcfhnyk", model.endTime()); - Assertions.assertEquals("ugswvx", model.startTime()); - Assertions.assertEquals("mzqwmvtxnjmxmcu", model.timeZone()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TriggerBase model = - new TriggerBase().withEndTime("plucfotangcfhnyk").withStartTime("ugswvx").withTimeZone("mzqwmvtxnjmxmcu"); - model = BinaryData.fromObject(model).toObject(TriggerBase.class); - Assertions.assertEquals("plucfotangcfhnyk", model.endTime()); - Assertions.assertEquals("ugswvx", model.startTime()); - Assertions.assertEquals("mzqwmvtxnjmxmcu", model.timeZone()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TritonModelJobInputTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TritonModelJobInputTests.java deleted file mode 100644 index e2370f8f1842e..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TritonModelJobInputTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.TritonModelJobInput; -import org.junit.jupiter.api.Assertions; - -public final class TritonModelJobInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TritonModelJobInput model = - BinaryData - .fromString( - "{\"jobInputType\":\"triton_model\",\"mode\":\"Download\",\"uri\":\"plhyvd\",\"description\":\"lyzkxitds\"}") - .toObject(TritonModelJobInput.class); - Assertions.assertEquals("lyzkxitds", model.description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.mode()); - Assertions.assertEquals("plhyvd", model.uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TritonModelJobInput model = - new TritonModelJobInput() - .withDescription("lyzkxitds") - .withMode(InputDeliveryMode.DOWNLOAD) - .withUri("plhyvd"); - model = BinaryData.fromObject(model).toObject(TritonModelJobInput.class); - Assertions.assertEquals("lyzkxitds", model.description()); - Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.mode()); - Assertions.assertEquals("plhyvd", model.uri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TritonModelJobOutputTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TritonModelJobOutputTests.java deleted file mode 100644 index 55fbe2e470fec..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TritonModelJobOutputTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.OutputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.TritonModelJobOutput; -import org.junit.jupiter.api.Assertions; - -public final class TritonModelJobOutputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TritonModelJobOutput model = - BinaryData - .fromString( - "{\"jobOutputType\":\"triton_model\",\"mode\":\"ReadWriteMount\",\"uri\":\"vkolrupjovmo\",\"description\":\"ayeb\"}") - .toObject(TritonModelJobOutput.class); - Assertions.assertEquals("ayeb", model.description()); - Assertions.assertEquals(OutputDeliveryMode.READ_WRITE_MOUNT, model.mode()); - Assertions.assertEquals("vkolrupjovmo", model.uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TritonModelJobOutput model = - new TritonModelJobOutput() - .withDescription("ayeb") - .withMode(OutputDeliveryMode.READ_WRITE_MOUNT) - .withUri("vkolrupjovmo"); - model = BinaryData.fromObject(model).toObject(TritonModelJobOutput.class); - Assertions.assertEquals("ayeb", model.description()); - Assertions.assertEquals(OutputDeliveryMode.READ_WRITE_MOUNT, model.mode()); - Assertions.assertEquals("vkolrupjovmo", model.uri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TruncationSelectionPolicyTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TruncationSelectionPolicyTests.java deleted file mode 100644 index 904af93fa3557..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/TruncationSelectionPolicyTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.TruncationSelectionPolicy; -import org.junit.jupiter.api.Assertions; - -public final class TruncationSelectionPolicyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TruncationSelectionPolicy model = - BinaryData - .fromString( - "{\"policyType\":\"TruncationSelection\",\"truncationPercentage\":1106944697,\"delayEvaluation\":674073421,\"evaluationInterval\":1924509674}") - .toObject(TruncationSelectionPolicy.class); - Assertions.assertEquals(674073421, model.delayEvaluation()); - Assertions.assertEquals(1924509674, model.evaluationInterval()); - Assertions.assertEquals(1106944697, model.truncationPercentage()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TruncationSelectionPolicy model = - new TruncationSelectionPolicy() - .withDelayEvaluation(674073421) - .withEvaluationInterval(1924509674) - .withTruncationPercentage(1106944697); - model = BinaryData.fromObject(model).toObject(TruncationSelectionPolicy.class); - Assertions.assertEquals(674073421, model.delayEvaluation()); - Assertions.assertEquals(1924509674, model.evaluationInterval()); - Assertions.assertEquals(1106944697, model.truncationPercentage()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UpdateWorkspaceQuotasResultInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UpdateWorkspaceQuotasResultInnerTests.java deleted file mode 100644 index acdc83131e6c3..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UpdateWorkspaceQuotasResultInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.UpdateWorkspaceQuotasResultInner; - -public final class UpdateWorkspaceQuotasResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdateWorkspaceQuotasResultInner model = - BinaryData - .fromString( - "{\"value\":[{\"id\":\"dxwzywqsmbsurexi\",\"type\":\"ryocfsfksymdd\",\"limit\":2863300785135771862,\"unit\":\"Count\",\"status\":\"OperationNotSupportedForSku\"},{\"id\":\"qyud\",\"type\":\"rrqnbpoczvyifqrv\",\"limit\":4225896230813201107,\"unit\":\"Count\",\"status\":\"Undefined\"},{\"id\":\"vvdfwatkpnpul\",\"type\":\"xbczwtruwiqz\",\"limit\":535203573928767895,\"unit\":\"Count\",\"status\":\"InvalidVMFamilyName\"},{\"id\":\"okacspk\",\"type\":\"hzdobpxjmflbvvnc\",\"limit\":5158769929678256713,\"unit\":\"Count\",\"status\":\"Failure\"}],\"nextLink\":\"juqk\"}") - .toObject(UpdateWorkspaceQuotasResultInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateWorkspaceQuotasResultInner model = new UpdateWorkspaceQuotasResultInner(); - model = BinaryData.fromObject(model).toObject(UpdateWorkspaceQuotasResultInner.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UpdateWorkspaceQuotasTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UpdateWorkspaceQuotasTests.java deleted file mode 100644 index 4b480a366fbf9..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UpdateWorkspaceQuotasTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.Status; -import com.azure.resourcemanager.machinelearning.models.UpdateWorkspaceQuotas; -import org.junit.jupiter.api.Assertions; - -public final class UpdateWorkspaceQuotasTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdateWorkspaceQuotas model = - BinaryData - .fromString( - "{\"id\":\"sa\",\"type\":\"wkuofoskghsauu\",\"limit\":6549860277400431394,\"unit\":\"Count\",\"status\":\"Failure\"}") - .toObject(UpdateWorkspaceQuotas.class); - Assertions.assertEquals(6549860277400431394L, model.limit()); - Assertions.assertEquals(Status.FAILURE, model.status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateWorkspaceQuotas model = - new UpdateWorkspaceQuotas().withLimit(6549860277400431394L).withStatus(Status.FAILURE); - model = BinaryData.fromObject(model).toObject(UpdateWorkspaceQuotas.class); - Assertions.assertEquals(6549860277400431394L, model.limit()); - Assertions.assertEquals(Status.FAILURE, model.status()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFileDataVersionTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFileDataVersionTests.java deleted file mode 100644 index d99e7f294cc1b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFileDataVersionTests.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.UriFileDataVersion; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class UriFileDataVersionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UriFileDataVersion model = - BinaryData - .fromString( - "{\"dataType\":\"uri_file\",\"dataUri\":\"zbtz\",\"isAnonymous\":true,\"isArchived\":true,\"description\":\"pfs\",\"properties\":{\"ezacfpztga\":\"pfnocm\",\"ctgkppgkqzkcyzmf\":\"wyqejgaao\"},\"tags\":{\"hlcqvhoe\":\"dyfcix\",\"mkahpqha\":\"goiutgw\",\"mip\":\"yntacihnco\",\"i\":\"mliqmvlb\"}}") - .toObject(UriFileDataVersion.class); - Assertions.assertEquals("pfs", model.description()); - Assertions.assertEquals("pfnocm", model.properties().get("ezacfpztga")); - Assertions.assertEquals("dyfcix", model.tags().get("hlcqvhoe")); - Assertions.assertEquals(true, model.isAnonymous()); - Assertions.assertEquals(true, model.isArchived()); - Assertions.assertEquals("zbtz", model.dataUri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UriFileDataVersion model = - new UriFileDataVersion() - .withDescription("pfs") - .withProperties(mapOf("ezacfpztga", "pfnocm", "ctgkppgkqzkcyzmf", "wyqejgaao")) - .withTags(mapOf("hlcqvhoe", "dyfcix", "mkahpqha", "goiutgw", "mip", "yntacihnco", "i", "mliqmvlb")) - .withIsAnonymous(true) - .withIsArchived(true) - .withDataUri("zbtz"); - model = BinaryData.fromObject(model).toObject(UriFileDataVersion.class); - Assertions.assertEquals("pfs", model.description()); - Assertions.assertEquals("pfnocm", model.properties().get("ezacfpztga")); - Assertions.assertEquals("dyfcix", model.tags().get("hlcqvhoe")); - Assertions.assertEquals(true, model.isAnonymous()); - Assertions.assertEquals(true, model.isArchived()); - Assertions.assertEquals("zbtz", model.dataUri()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFileJobInputTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFileJobInputTests.java deleted file mode 100644 index a0df6aaca2b71..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFileJobInputTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.UriFileJobInput; -import org.junit.jupiter.api.Assertions; - -public final class UriFileJobInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UriFileJobInput model = - BinaryData - .fromString( - "{\"jobInputType\":\"uri_file\",\"mode\":\"ReadOnlyMount\",\"uri\":\"qgrvg\",\"description\":\"mxpu\"}") - .toObject(UriFileJobInput.class); - Assertions.assertEquals("mxpu", model.description()); - Assertions.assertEquals(InputDeliveryMode.READ_ONLY_MOUNT, model.mode()); - Assertions.assertEquals("qgrvg", model.uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UriFileJobInput model = - new UriFileJobInput().withDescription("mxpu").withMode(InputDeliveryMode.READ_ONLY_MOUNT).withUri("qgrvg"); - model = BinaryData.fromObject(model).toObject(UriFileJobInput.class); - Assertions.assertEquals("mxpu", model.description()); - Assertions.assertEquals(InputDeliveryMode.READ_ONLY_MOUNT, model.mode()); - Assertions.assertEquals("qgrvg", model.uri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFileJobOutputTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFileJobOutputTests.java deleted file mode 100644 index 60c97ca9dc200..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFileJobOutputTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.OutputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.UriFileJobOutput; -import org.junit.jupiter.api.Assertions; - -public final class UriFileJobOutputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UriFileJobOutput model = - BinaryData - .fromString( - "{\"jobOutputType\":\"uri_file\",\"mode\":\"Upload\",\"uri\":\"dfj\",\"description\":\"esocwiqbuou\"}") - .toObject(UriFileJobOutput.class); - Assertions.assertEquals("esocwiqbuou", model.description()); - Assertions.assertEquals(OutputDeliveryMode.UPLOAD, model.mode()); - Assertions.assertEquals("dfj", model.uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UriFileJobOutput model = - new UriFileJobOutput().withDescription("esocwiqbuou").withMode(OutputDeliveryMode.UPLOAD).withUri("dfj"); - model = BinaryData.fromObject(model).toObject(UriFileJobOutput.class); - Assertions.assertEquals("esocwiqbuou", model.description()); - Assertions.assertEquals(OutputDeliveryMode.UPLOAD, model.mode()); - Assertions.assertEquals("dfj", model.uri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFolderDataVersionTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFolderDataVersionTests.java deleted file mode 100644 index 6d354ce0c424a..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFolderDataVersionTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.UriFolderDataVersion; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class UriFolderDataVersionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UriFolderDataVersion model = - BinaryData - .fromString( - "{\"dataType\":\"uri_folder\",\"dataUri\":\"mpyzgleo\",\"isAnonymous\":true,\"isArchived\":false,\"description\":\"wwzvdaj\",\"properties\":{\"fmaciqgjjrlhiq\":\"n\",\"jtt\":\"wixvtbouguxtndop\",\"bkixvvlwyn\":\"asualapdlndbea\",\"qvzfj\":\"bb\"},\"tags\":{\"mphfkyezolgjzm\":\"ugzfeuzjl\"}}") - .toObject(UriFolderDataVersion.class); - Assertions.assertEquals("wwzvdaj", model.description()); - Assertions.assertEquals("n", model.properties().get("fmaciqgjjrlhiq")); - Assertions.assertEquals("ugzfeuzjl", model.tags().get("mphfkyezolgjzm")); - Assertions.assertEquals(true, model.isAnonymous()); - Assertions.assertEquals(false, model.isArchived()); - Assertions.assertEquals("mpyzgleo", model.dataUri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UriFolderDataVersion model = - new UriFolderDataVersion() - .withDescription("wwzvdaj") - .withProperties( - mapOf( - "fmaciqgjjrlhiq", - "n", - "jtt", - "wixvtbouguxtndop", - "bkixvvlwyn", - "asualapdlndbea", - "qvzfj", - "bb")) - .withTags(mapOf("mphfkyezolgjzm", "ugzfeuzjl")) - .withIsAnonymous(true) - .withIsArchived(false) - .withDataUri("mpyzgleo"); - model = BinaryData.fromObject(model).toObject(UriFolderDataVersion.class); - Assertions.assertEquals("wwzvdaj", model.description()); - Assertions.assertEquals("n", model.properties().get("fmaciqgjjrlhiq")); - Assertions.assertEquals("ugzfeuzjl", model.tags().get("mphfkyezolgjzm")); - Assertions.assertEquals(true, model.isAnonymous()); - Assertions.assertEquals(false, model.isArchived()); - Assertions.assertEquals("mpyzgleo", model.dataUri()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFolderJobInputTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFolderJobInputTests.java deleted file mode 100644 index b1e8226f6f181..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFolderJobInputTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.UriFolderJobInput; -import org.junit.jupiter.api.Assertions; - -public final class UriFolderJobInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UriFolderJobInput model = - BinaryData - .fromString( - "{\"jobInputType\":\"uri_folder\",\"mode\":\"EvalMount\",\"uri\":\"ydoccnxshanzb\",\"description\":\"adh\"}") - .toObject(UriFolderJobInput.class); - Assertions.assertEquals("adh", model.description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_MOUNT, model.mode()); - Assertions.assertEquals("ydoccnxshanzb", model.uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UriFolderJobInput model = - new UriFolderJobInput() - .withDescription("adh") - .withMode(InputDeliveryMode.EVAL_MOUNT) - .withUri("ydoccnxshanzb"); - model = BinaryData.fromObject(model).toObject(UriFolderJobInput.class); - Assertions.assertEquals("adh", model.description()); - Assertions.assertEquals(InputDeliveryMode.EVAL_MOUNT, model.mode()); - Assertions.assertEquals("ydoccnxshanzb", model.uri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFolderJobOutputTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFolderJobOutputTests.java deleted file mode 100644 index 7511a7ec6d454..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UriFolderJobOutputTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.OutputDeliveryMode; -import com.azure.resourcemanager.machinelearning.models.UriFolderJobOutput; -import org.junit.jupiter.api.Assertions; - -public final class UriFolderJobOutputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UriFolderJobOutput model = - BinaryData - .fromString( - "{\"jobOutputType\":\"uri_folder\",\"mode\":\"ReadWriteMount\",\"uri\":\"caatsdohzniucbda\",\"description\":\"b\"}") - .toObject(UriFolderJobOutput.class); - Assertions.assertEquals("b", model.description()); - Assertions.assertEquals(OutputDeliveryMode.READ_WRITE_MOUNT, model.mode()); - Assertions.assertEquals("caatsdohzniucbda", model.uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UriFolderJobOutput model = - new UriFolderJobOutput() - .withDescription("b") - .withMode(OutputDeliveryMode.READ_WRITE_MOUNT) - .withUri("caatsdohzniucbda"); - model = BinaryData.fromObject(model).toObject(UriFolderJobOutput.class); - Assertions.assertEquals("b", model.description()); - Assertions.assertEquals(OutputDeliveryMode.READ_WRITE_MOUNT, model.mode()); - Assertions.assertEquals("caatsdohzniucbda", model.uri()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UsageInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UsageInnerTests.java deleted file mode 100644 index dc5abc4da1a03..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UsageInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.UsageInner; - -public final class UsageInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UsageInner model = - BinaryData - .fromString( - "{\"id\":\"al\",\"amlWorkspaceLocation\":\"wsubisnja\",\"type\":\"mngnzscxaqw\",\"unit\":\"Count\",\"currentValue\":8284849522775064668,\"limit\":4293534997392812714,\"name\":{\"value\":\"kvlrxnj\",\"localizedValue\":\"seiphe\"}}") - .toObject(UsageInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UsageInner model = new UsageInner(); - model = BinaryData.fromObject(model).toObject(UsageInner.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UsageNameTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UsageNameTests.java deleted file mode 100644 index 51468bd4dbf33..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UsageNameTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.UsageName; - -public final class UsageNameTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UsageName model = - BinaryData.fromString("{\"value\":\"lokeyy\",\"localizedValue\":\"nj\"}").toObject(UsageName.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UsageName model = new UsageName(); - model = BinaryData.fromObject(model).toObject(UsageName.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UsagesListMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UsagesListMockTests.java deleted file mode 100644 index 11d6eafc68b83..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UsagesListMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.Usage; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class UsagesListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"id\":\"dxku\",\"amlWorkspaceLocation\":\"kczynuhhoqeqsh\",\"type\":\"ljqkxyrqolnthbb\",\"unit\":\"Count\",\"currentValue\":6327166092096941565,\"limit\":45876676244603547,\"name\":{\"value\":\"kjthfce\",\"localizedValue\":\"ncjmlfuyf\"}}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.usages().list("aaxoialahfxwcc", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UserAssignedIdentityTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UserAssignedIdentityTests.java deleted file mode 100644 index 9233f673cb974..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UserAssignedIdentityTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.UserAssignedIdentity; - -public final class UserAssignedIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserAssignedIdentity model = - BinaryData - .fromString( - "{\"principalId\":\"482ca507-d71f-4817-b618-8233dec4afc2\",\"clientId\":\"08c17000-9968-4d5e-b89a-5cd50023b58b\"}") - .toObject(UserAssignedIdentity.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserAssignedIdentity model = new UserAssignedIdentity(); - model = BinaryData.fromObject(model).toObject(UserAssignedIdentity.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UserIdentityTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UserIdentityTests.java deleted file mode 100644 index a6544cd230123..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/UserIdentityTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.UserIdentity; - -public final class UserIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserIdentity model = BinaryData.fromString("{\"identityType\":\"UserIdentity\"}").toObject(UserIdentity.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserIdentity model = new UserIdentity(); - model = BinaryData.fromObject(model).toObject(UserIdentity.class); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/VirtualMachineImageTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/VirtualMachineImageTests.java deleted file mode 100644 index d5961556e5fd4..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/VirtualMachineImageTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.VirtualMachineImage; -import org.junit.jupiter.api.Assertions; - -public final class VirtualMachineImageTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualMachineImage model = - BinaryData.fromString("{\"id\":\"vbopfppdbwnu\"}").toObject(VirtualMachineImage.class); - Assertions.assertEquals("vbopfppdbwnu", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualMachineImage model = new VirtualMachineImage().withId("vbopfppdbwnu"); - model = BinaryData.fromObject(model).toObject(VirtualMachineImage.class); - Assertions.assertEquals("vbopfppdbwnu", model.id()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/VirtualMachineSizeListResultInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/VirtualMachineSizeListResultInnerTests.java deleted file mode 100644 index 9f29c5acc8d01..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/VirtualMachineSizeListResultInnerTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.VirtualMachineSizeListResultInner; -import com.azure.resourcemanager.machinelearning.models.BillingCurrency; -import com.azure.resourcemanager.machinelearning.models.EstimatedVMPrices; -import com.azure.resourcemanager.machinelearning.models.UnitOfMeasure; -import com.azure.resourcemanager.machinelearning.models.VirtualMachineSize; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class VirtualMachineSizeListResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualMachineSizeListResultInner model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"tgrhpdjpjumas\",\"family\":\"zj\",\"vCPUs\":1063088657,\"gpus\":973371108,\"osVhdSizeMB\":1267309720,\"maxResourceVolumeMB\":285130790,\"memoryGB\":62.19358841158077,\"lowPriorityCapable\":false,\"premiumIO\":false,\"estimatedVMPrices\":{\"billingCurrency\":\"USD\",\"unitOfMeasure\":\"OneHour\",\"values\":[]},\"supportedComputeTypes\":[\"dgwdslfhot\",\"mcy\",\"pwlbjnpg\"]},{\"name\":\"ftadehxnltyfs\",\"family\":\"pusuesn\",\"vCPUs\":1828932864,\"gpus\":317621756,\"osVhdSizeMB\":600821678,\"maxResourceVolumeMB\":1696341054,\"memoryGB\":51.36310108881028,\"lowPriorityCapable\":false,\"premiumIO\":true,\"estimatedVMPrices\":{\"billingCurrency\":\"USD\",\"unitOfMeasure\":\"OneHour\",\"values\":[]},\"supportedComputeTypes\":[\"udwxdndnvowguj\",\"ugw\"]},{\"name\":\"cglhslazjdyggdt\",\"family\":\"xhbkuofq\",\"vCPUs\":358956997,\"gpus\":1965159297,\"osVhdSizeMB\":1807410645,\"maxResourceVolumeMB\":1520793095,\"memoryGB\":45.72291424975317,\"lowPriorityCapable\":false,\"premiumIO\":false,\"estimatedVMPrices\":{\"billingCurrency\":\"USD\",\"unitOfMeasure\":\"OneHour\",\"values\":[]},\"supportedComputeTypes\":[\"bvyvdcsity\"]}]}") - .toObject(VirtualMachineSizeListResultInner.class); - Assertions.assertEquals(BillingCurrency.USD, model.value().get(0).estimatedVMPrices().billingCurrency()); - Assertions.assertEquals(UnitOfMeasure.ONE_HOUR, model.value().get(0).estimatedVMPrices().unitOfMeasure()); - Assertions.assertEquals("dgwdslfhot", model.value().get(0).supportedComputeTypes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualMachineSizeListResultInner model = - new VirtualMachineSizeListResultInner() - .withValue( - Arrays - .asList( - new VirtualMachineSize() - .withEstimatedVMPrices( - new EstimatedVMPrices() - .withBillingCurrency(BillingCurrency.USD) - .withUnitOfMeasure(UnitOfMeasure.ONE_HOUR) - .withValues(Arrays.asList())) - .withSupportedComputeTypes(Arrays.asList("dgwdslfhot", "mcy", "pwlbjnpg")), - new VirtualMachineSize() - .withEstimatedVMPrices( - new EstimatedVMPrices() - .withBillingCurrency(BillingCurrency.USD) - .withUnitOfMeasure(UnitOfMeasure.ONE_HOUR) - .withValues(Arrays.asList())) - .withSupportedComputeTypes(Arrays.asList("udwxdndnvowguj", "ugw")), - new VirtualMachineSize() - .withEstimatedVMPrices( - new EstimatedVMPrices() - .withBillingCurrency(BillingCurrency.USD) - .withUnitOfMeasure(UnitOfMeasure.ONE_HOUR) - .withValues(Arrays.asList())) - .withSupportedComputeTypes(Arrays.asList("bvyvdcsity")))); - model = BinaryData.fromObject(model).toObject(VirtualMachineSizeListResultInner.class); - Assertions.assertEquals(BillingCurrency.USD, model.value().get(0).estimatedVMPrices().billingCurrency()); - Assertions.assertEquals(UnitOfMeasure.ONE_HOUR, model.value().get(0).estimatedVMPrices().unitOfMeasure()); - Assertions.assertEquals("dgwdslfhot", model.value().get(0).supportedComputeTypes().get(0)); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/VirtualMachineSizeTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/VirtualMachineSizeTests.java deleted file mode 100644 index cf90d3601f44b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/VirtualMachineSizeTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.BillingCurrency; -import com.azure.resourcemanager.machinelearning.models.EstimatedVMPrice; -import com.azure.resourcemanager.machinelearning.models.EstimatedVMPrices; -import com.azure.resourcemanager.machinelearning.models.UnitOfMeasure; -import com.azure.resourcemanager.machinelearning.models.VMPriceOSType; -import com.azure.resourcemanager.machinelearning.models.VMTier; -import com.azure.resourcemanager.machinelearning.models.VirtualMachineSize; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class VirtualMachineSizeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualMachineSize model = - BinaryData - .fromString( - "{\"name\":\"aamdect\",\"family\":\"f\",\"vCPUs\":1860942440,\"gpus\":993666965,\"osVhdSizeMB\":230831104,\"maxResourceVolumeMB\":796129419,\"memoryGB\":78.8172659538708,\"lowPriorityCapable\":true,\"premiumIO\":false,\"estimatedVMPrices\":{\"billingCurrency\":\"USD\",\"unitOfMeasure\":\"OneHour\",\"values\":[{\"retailPrice\":43.63741417101916,\"osType\":\"Linux\",\"vmTier\":\"Standard\"},{\"retailPrice\":10.488278430863074,\"osType\":\"Windows\",\"vmTier\":\"LowPriority\"},{\"retailPrice\":12.69677181728943,\"osType\":\"Windows\",\"vmTier\":\"Standard\"},{\"retailPrice\":38.22056349066922,\"osType\":\"Linux\",\"vmTier\":\"LowPriority\"}]},\"supportedComputeTypes\":[\"pkc\",\"t\",\"pngjcrcczsqpjhvm\"]}") - .toObject(VirtualMachineSize.class); - Assertions.assertEquals(BillingCurrency.USD, model.estimatedVMPrices().billingCurrency()); - Assertions.assertEquals(UnitOfMeasure.ONE_HOUR, model.estimatedVMPrices().unitOfMeasure()); - Assertions.assertEquals(43.63741417101916, model.estimatedVMPrices().values().get(0).retailPrice()); - Assertions.assertEquals(VMPriceOSType.LINUX, model.estimatedVMPrices().values().get(0).osType()); - Assertions.assertEquals(VMTier.STANDARD, model.estimatedVMPrices().values().get(0).vmTier()); - Assertions.assertEquals("pkc", model.supportedComputeTypes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualMachineSize model = - new VirtualMachineSize() - .withEstimatedVMPrices( - new EstimatedVMPrices() - .withBillingCurrency(BillingCurrency.USD) - .withUnitOfMeasure(UnitOfMeasure.ONE_HOUR) - .withValues( - Arrays - .asList( - new EstimatedVMPrice() - .withRetailPrice(43.63741417101916) - .withOsType(VMPriceOSType.LINUX) - .withVmTier(VMTier.STANDARD), - new EstimatedVMPrice() - .withRetailPrice(10.488278430863074) - .withOsType(VMPriceOSType.WINDOWS) - .withVmTier(VMTier.LOW_PRIORITY), - new EstimatedVMPrice() - .withRetailPrice(12.69677181728943) - .withOsType(VMPriceOSType.WINDOWS) - .withVmTier(VMTier.STANDARD), - new EstimatedVMPrice() - .withRetailPrice(38.22056349066922) - .withOsType(VMPriceOSType.LINUX) - .withVmTier(VMTier.LOW_PRIORITY)))) - .withSupportedComputeTypes(Arrays.asList("pkc", "t", "pngjcrcczsqpjhvm")); - model = BinaryData.fromObject(model).toObject(VirtualMachineSize.class); - Assertions.assertEquals(BillingCurrency.USD, model.estimatedVMPrices().billingCurrency()); - Assertions.assertEquals(UnitOfMeasure.ONE_HOUR, model.estimatedVMPrices().unitOfMeasure()); - Assertions.assertEquals(43.63741417101916, model.estimatedVMPrices().values().get(0).retailPrice()); - Assertions.assertEquals(VMPriceOSType.LINUX, model.estimatedVMPrices().values().get(0).osType()); - Assertions.assertEquals(VMTier.STANDARD, model.estimatedVMPrices().values().get(0).vmTier()); - Assertions.assertEquals("pkc", model.supportedComputeTypes().get(0)); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/VirtualMachineSizesListWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/VirtualMachineSizesListWithResponseMockTests.java deleted file mode 100644 index 8669b4c6f1477..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/VirtualMachineSizesListWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.VirtualMachineSizeListResult; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class VirtualMachineSizesListWithResponseMockTests { - @Test - public void testListWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"name\":\"mq\",\"family\":\"uiocuselqkrsazr\",\"vCPUs\":907855670,\"gpus\":162147994,\"osVhdSizeMB\":1160671233,\"maxResourceVolumeMB\":1893332175,\"memoryGB\":44.634673287925494,\"lowPriorityCapable\":false,\"premiumIO\":true,\"supportedComputeTypes\":[\"mw\",\"mdlgy\",\"ixokwtjawhv\",\"gnqfqqdlcvmyol\"]},{\"name\":\"ymjc\",\"family\":\"vsnvlaq\",\"vCPUs\":4380351,\"gpus\":1268203688,\"osVhdSizeMB\":1622025421,\"maxResourceVolumeMB\":2099242028,\"memoryGB\":84.58306289880801,\"lowPriorityCapable\":true,\"premiumIO\":true,\"supportedComputeTypes\":[\"thymgobl\",\"msn\",\"gwi\"]}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - VirtualMachineSizeListResult response = - manager.virtualMachineSizes().listWithResponse("bpfiddhlrufz", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("mw", response.value().get(0).supportedComputeTypes().get(0)); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionManagedIdentityTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionManagedIdentityTests.java deleted file mode 100644 index 2222100f20485..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionManagedIdentityTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.WorkspaceConnectionManagedIdentity; -import org.junit.jupiter.api.Assertions; - -public final class WorkspaceConnectionManagedIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkspaceConnectionManagedIdentity model = - BinaryData - .fromString("{\"resourceId\":\"ivensrpmeyyvpk\",\"clientId\":\"tlbijpzg\"}") - .toObject(WorkspaceConnectionManagedIdentity.class); - Assertions.assertEquals("ivensrpmeyyvpk", model.resourceId()); - Assertions.assertEquals("tlbijpzg", model.clientId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkspaceConnectionManagedIdentity model = - new WorkspaceConnectionManagedIdentity().withResourceId("ivensrpmeyyvpk").withClientId("tlbijpzg"); - model = BinaryData.fromObject(model).toObject(WorkspaceConnectionManagedIdentity.class); - Assertions.assertEquals("ivensrpmeyyvpk", model.resourceId()); - Assertions.assertEquals("tlbijpzg", model.clientId()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionPersonalAccessTokenTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionPersonalAccessTokenTests.java deleted file mode 100644 index 67d94947eea1b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionPersonalAccessTokenTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.WorkspaceConnectionPersonalAccessToken; -import org.junit.jupiter.api.Assertions; - -public final class WorkspaceConnectionPersonalAccessTokenTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkspaceConnectionPersonalAccessToken model = - BinaryData.fromString("{\"pat\":\"phuuuerctato\"}").toObject(WorkspaceConnectionPersonalAccessToken.class); - Assertions.assertEquals("phuuuerctato", model.pat()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkspaceConnectionPersonalAccessToken model = - new WorkspaceConnectionPersonalAccessToken().withPat("phuuuerctato"); - model = BinaryData.fromObject(model).toObject(WorkspaceConnectionPersonalAccessToken.class); - Assertions.assertEquals("phuuuerctato", model.pat()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResultTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResultTests.java deleted file mode 100644 index a275c7a557c9d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResultTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.WorkspaceConnectionPropertiesV2BasicResourceInner; -import com.azure.resourcemanager.machinelearning.models.ConnectionCategory; -import com.azure.resourcemanager.machinelearning.models.ValueFormat; -import com.azure.resourcemanager.machinelearning.models.WorkspaceConnectionPropertiesV2; -import com.azure.resourcemanager.machinelearning.models.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"authType\":\"WorkspaceConnectionPropertiesV2\",\"category\":\"PythonFeed\",\"target\":\"yqsemwa\",\"value\":\"ets\",\"valueFormat\":\"JSON\"},\"id\":\"h\",\"name\":\"d\",\"type\":\"lvwiwubmwmbesl\"}],\"nextLink\":\"k\"}") - .toObject(WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult.class); - Assertions.assertEquals(ConnectionCategory.PYTHON_FEED, model.value().get(0).properties().category()); - Assertions.assertEquals("yqsemwa", model.value().get(0).properties().target()); - Assertions.assertEquals("ets", model.value().get(0).properties().value()); - Assertions.assertEquals(ValueFormat.JSON, model.value().get(0).properties().valueFormat()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult model = - new WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult() - .withValue( - Arrays - .asList( - new WorkspaceConnectionPropertiesV2BasicResourceInner() - .withProperties( - new WorkspaceConnectionPropertiesV2() - .withCategory(ConnectionCategory.PYTHON_FEED) - .withTarget("yqsemwa") - .withValue("ets") - .withValueFormat(ValueFormat.JSON)))); - model = - BinaryData.fromObject(model).toObject(WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult.class); - Assertions.assertEquals(ConnectionCategory.PYTHON_FEED, model.value().get(0).properties().category()); - Assertions.assertEquals("yqsemwa", model.value().get(0).properties().target()); - Assertions.assertEquals("ets", model.value().get(0).properties().value()); - Assertions.assertEquals(ValueFormat.JSON, model.value().get(0).properties().valueFormat()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionPropertiesV2BasicResourceInnerTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionPropertiesV2BasicResourceInnerTests.java deleted file mode 100644 index be9c021e2284b..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionPropertiesV2BasicResourceInnerTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.WorkspaceConnectionPropertiesV2BasicResourceInner; -import com.azure.resourcemanager.machinelearning.models.ConnectionCategory; -import com.azure.resourcemanager.machinelearning.models.ValueFormat; -import com.azure.resourcemanager.machinelearning.models.WorkspaceConnectionPropertiesV2; -import org.junit.jupiter.api.Assertions; - -public final class WorkspaceConnectionPropertiesV2BasicResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkspaceConnectionPropertiesV2BasicResourceInner model = - BinaryData - .fromString( - "{\"properties\":{\"authType\":\"WorkspaceConnectionPropertiesV2\",\"category\":\"ContainerRegistry\",\"target\":\"wiydmcwyhzdxssad\",\"value\":\"mnvdfzn\",\"valueFormat\":\"JSON\"},\"id\":\"dvxzbncblylpst\",\"name\":\"bhhxsrzdzuc\",\"type\":\"rsc\"}") - .toObject(WorkspaceConnectionPropertiesV2BasicResourceInner.class); - Assertions.assertEquals(ConnectionCategory.CONTAINER_REGISTRY, model.properties().category()); - Assertions.assertEquals("wiydmcwyhzdxssad", model.properties().target()); - Assertions.assertEquals("mnvdfzn", model.properties().value()); - Assertions.assertEquals(ValueFormat.JSON, model.properties().valueFormat()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkspaceConnectionPropertiesV2BasicResourceInner model = - new WorkspaceConnectionPropertiesV2BasicResourceInner() - .withProperties( - new WorkspaceConnectionPropertiesV2() - .withCategory(ConnectionCategory.CONTAINER_REGISTRY) - .withTarget("wiydmcwyhzdxssad") - .withValue("mnvdfzn") - .withValueFormat(ValueFormat.JSON)); - model = BinaryData.fromObject(model).toObject(WorkspaceConnectionPropertiesV2BasicResourceInner.class); - Assertions.assertEquals(ConnectionCategory.CONTAINER_REGISTRY, model.properties().category()); - Assertions.assertEquals("wiydmcwyhzdxssad", model.properties().target()); - Assertions.assertEquals("mnvdfzn", model.properties().value()); - Assertions.assertEquals(ValueFormat.JSON, model.properties().valueFormat()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionPropertiesV2Tests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionPropertiesV2Tests.java deleted file mode 100644 index 2c2c30c1704ba..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionPropertiesV2Tests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ConnectionCategory; -import com.azure.resourcemanager.machinelearning.models.ValueFormat; -import com.azure.resourcemanager.machinelearning.models.WorkspaceConnectionPropertiesV2; -import org.junit.jupiter.api.Assertions; - -public final class WorkspaceConnectionPropertiesV2Tests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkspaceConnectionPropertiesV2 model = - BinaryData - .fromString( - "{\"authType\":\"WorkspaceConnectionPropertiesV2\",\"category\":\"PythonFeed\",\"target\":\"evfiwjmygt\",\"value\":\"slswtm\",\"valueFormat\":\"JSON\"}") - .toObject(WorkspaceConnectionPropertiesV2.class); - Assertions.assertEquals(ConnectionCategory.PYTHON_FEED, model.category()); - Assertions.assertEquals("evfiwjmygt", model.target()); - Assertions.assertEquals("slswtm", model.value()); - Assertions.assertEquals(ValueFormat.JSON, model.valueFormat()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkspaceConnectionPropertiesV2 model = - new WorkspaceConnectionPropertiesV2() - .withCategory(ConnectionCategory.PYTHON_FEED) - .withTarget("evfiwjmygt") - .withValue("slswtm") - .withValueFormat(ValueFormat.JSON); - model = BinaryData.fromObject(model).toObject(WorkspaceConnectionPropertiesV2.class); - Assertions.assertEquals(ConnectionCategory.PYTHON_FEED, model.category()); - Assertions.assertEquals("evfiwjmygt", model.target()); - Assertions.assertEquals("slswtm", model.value()); - Assertions.assertEquals(ValueFormat.JSON, model.valueFormat()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionSharedAccessSignatureTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionSharedAccessSignatureTests.java deleted file mode 100644 index bdf2992d956de..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionSharedAccessSignatureTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.WorkspaceConnectionSharedAccessSignature; -import org.junit.jupiter.api.Assertions; - -public final class WorkspaceConnectionSharedAccessSignatureTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkspaceConnectionSharedAccessSignature model = - BinaryData - .fromString("{\"sas\":\"uczkgofxyfsruc\"}") - .toObject(WorkspaceConnectionSharedAccessSignature.class); - Assertions.assertEquals("uczkgofxyfsruc", model.sas()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkspaceConnectionSharedAccessSignature model = - new WorkspaceConnectionSharedAccessSignature().withSas("uczkgofxyfsruc"); - model = BinaryData.fromObject(model).toObject(WorkspaceConnectionSharedAccessSignature.class); - Assertions.assertEquals("uczkgofxyfsruc", model.sas()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsCreateWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsCreateWithResponseMockTests.java deleted file mode 100644 index 14485908f4c21..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsCreateWithResponseMockTests.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ConnectionCategory; -import com.azure.resourcemanager.machinelearning.models.ValueFormat; -import com.azure.resourcemanager.machinelearning.models.WorkspaceConnectionPropertiesV2; -import com.azure.resourcemanager.machinelearning.models.WorkspaceConnectionPropertiesV2BasicResource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class WorkspaceConnectionsCreateWithResponseMockTests { - @Test - public void testCreateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"authType\":\"WorkspaceConnectionPropertiesV2\",\"category\":\"ContainerRegistry\",\"target\":\"zuzhasup\",\"value\":\"p\",\"valueFormat\":\"JSON\"},\"id\":\"zvzqazvbkark\",\"name\":\"tgongrua\",\"type\":\"s\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - WorkspaceConnectionPropertiesV2BasicResource response = - manager - .workspaceConnections() - .define("rwqirvtktyhhmvf") - .withExistingWorkspace("ouigdmfivjqte", "dqqigdydkghpc") - .withProperties( - new WorkspaceConnectionPropertiesV2() - .withCategory(ConnectionCategory.PYTHON_FEED) - .withTarget("jajodmkrr") - .withValue("pgqvqo") - .withValueFormat(ValueFormat.JSON)) - .create(); - - Assertions.assertEquals(ConnectionCategory.CONTAINER_REGISTRY, response.properties().category()); - Assertions.assertEquals("zuzhasup", response.properties().target()); - Assertions.assertEquals("p", response.properties().value()); - Assertions.assertEquals(ValueFormat.JSON, response.properties().valueFormat()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsDeleteWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsDeleteWithResponseMockTests.java deleted file mode 100644 index a777528a8091f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class WorkspaceConnectionsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .workspaceConnections() - .deleteWithResponse("paczmuh", "cakznhokhoitwhrj", "dmmazdnc", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsGetWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsGetWithResponseMockTests.java deleted file mode 100644 index 2cf32122e8280..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsGetWithResponseMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ConnectionCategory; -import com.azure.resourcemanager.machinelearning.models.ValueFormat; -import com.azure.resourcemanager.machinelearning.models.WorkspaceConnectionPropertiesV2BasicResource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class WorkspaceConnectionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"authType\":\"WorkspaceConnectionPropertiesV2\",\"category\":\"ContainerRegistry\",\"target\":\"gzhogsmgbvmtd\",\"value\":\"qbe\",\"valueFormat\":\"JSON\"},\"id\":\"veglabtvkbiwzn\",\"name\":\"tfgfic\",\"type\":\"dyhi\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - WorkspaceConnectionPropertiesV2BasicResource response = - manager - .workspaceConnections() - .getWithResponse("ekymffztsilscvqs", "eiihfymko", "ihyeseu", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(ConnectionCategory.CONTAINER_REGISTRY, response.properties().category()); - Assertions.assertEquals("gzhogsmgbvmtd", response.properties().target()); - Assertions.assertEquals("qbe", response.properties().value()); - Assertions.assertEquals(ValueFormat.JSON, response.properties().valueFormat()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsListMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsListMockTests.java deleted file mode 100644 index 741984a8bacd5..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceConnectionsListMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ConnectionCategory; -import com.azure.resourcemanager.machinelearning.models.ValueFormat; -import com.azure.resourcemanager.machinelearning.models.WorkspaceConnectionPropertiesV2BasicResource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class WorkspaceConnectionsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"authType\":\"WorkspaceConnectionPropertiesV2\",\"category\":\"Git\",\"target\":\"wh\",\"value\":\"xsure\",\"valueFormat\":\"JSON\"},\"id\":\"hzzbgullcxiqq\",\"name\":\"jkoxdupna\",\"type\":\"gl\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .workspaceConnections() - .list("idb", "pglhzqp", "zbawkikcdgfh", "ssdpjeyoqxded", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(ConnectionCategory.GIT, response.iterator().next().properties().category()); - Assertions.assertEquals("wh", response.iterator().next().properties().target()); - Assertions.assertEquals("xsure", response.iterator().next().properties().value()); - Assertions.assertEquals(ValueFormat.JSON, response.iterator().next().properties().valueFormat()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceFeaturesListMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceFeaturesListMockTests.java deleted file mode 100644 index 3bcd57ce35a5e..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceFeaturesListMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.AmlUserFeature; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class WorkspaceFeaturesListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"id\":\"kekzouyveww\",\"displayName\":\"rd\",\"description\":\"gldohgcandxfhh\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.workspaceFeatures().list("wbmwdukinhl", "hg", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("kekzouyveww", response.iterator().next().id()); - Assertions.assertEquals("rd", response.iterator().next().displayName()); - Assertions.assertEquals("gldohgcandxfhh", response.iterator().next().description()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspacePropertiesUpdateParametersTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspacePropertiesUpdateParametersTests.java deleted file mode 100644 index e359ec0f65d2d..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspacePropertiesUpdateParametersTests.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.fluent.models.WorkspacePropertiesUpdateParameters; -import com.azure.resourcemanager.machinelearning.models.CosmosDbSettings; -import com.azure.resourcemanager.machinelearning.models.PublicNetworkAccess; -import com.azure.resourcemanager.machinelearning.models.ServiceManagedResourcesSettings; -import org.junit.jupiter.api.Assertions; - -public final class WorkspacePropertiesUpdateParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkspacePropertiesUpdateParameters model = - BinaryData - .fromString( - "{\"description\":\"qfou\",\"friendlyName\":\"mmnkzsmodmgl\",\"imageBuildCompute\":\"gpbkwtmut\",\"serviceManagedResourcesSettings\":{\"cosmosDb\":{\"collectionsThroughput\":289494577}},\"primaryUserAssignedIdentity\":\"pspwgcuertu\",\"publicNetworkAccess\":\"Disabled\",\"applicationInsights\":\"svqwhbmdgbbjfd\",\"containerRegistry\":\"mbmbexppbh\"}") - .toObject(WorkspacePropertiesUpdateParameters.class); - Assertions.assertEquals("qfou", model.description()); - Assertions.assertEquals("mmnkzsmodmgl", model.friendlyName()); - Assertions.assertEquals("gpbkwtmut", model.imageBuildCompute()); - Assertions.assertEquals(289494577, model.serviceManagedResourcesSettings().cosmosDb().collectionsThroughput()); - Assertions.assertEquals("pspwgcuertu", model.primaryUserAssignedIdentity()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); - Assertions.assertEquals("svqwhbmdgbbjfd", model.applicationInsights()); - Assertions.assertEquals("mbmbexppbh", model.containerRegistry()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkspacePropertiesUpdateParameters model = - new WorkspacePropertiesUpdateParameters() - .withDescription("qfou") - .withFriendlyName("mmnkzsmodmgl") - .withImageBuildCompute("gpbkwtmut") - .withServiceManagedResourcesSettings( - new ServiceManagedResourcesSettings() - .withCosmosDb(new CosmosDbSettings().withCollectionsThroughput(289494577))) - .withPrimaryUserAssignedIdentity("pspwgcuertu") - .withPublicNetworkAccess(PublicNetworkAccess.DISABLED) - .withApplicationInsights("svqwhbmdgbbjfd") - .withContainerRegistry("mbmbexppbh"); - model = BinaryData.fromObject(model).toObject(WorkspacePropertiesUpdateParameters.class); - Assertions.assertEquals("qfou", model.description()); - Assertions.assertEquals("mmnkzsmodmgl", model.friendlyName()); - Assertions.assertEquals("gpbkwtmut", model.imageBuildCompute()); - Assertions.assertEquals(289494577, model.serviceManagedResourcesSettings().cosmosDb().collectionsThroughput()); - Assertions.assertEquals("pspwgcuertu", model.primaryUserAssignedIdentity()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); - Assertions.assertEquals("svqwhbmdgbbjfd", model.applicationInsights()); - Assertions.assertEquals("mbmbexppbh", model.containerRegistry()); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceUpdateParametersTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceUpdateParametersTests.java deleted file mode 100644 index 1a2853961942f..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspaceUpdateParametersTests.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity; -import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.machinelearning.models.PublicNetworkAccess; -import com.azure.resourcemanager.machinelearning.models.ServiceManagedResourcesSettings; -import com.azure.resourcemanager.machinelearning.models.Sku; -import com.azure.resourcemanager.machinelearning.models.SkuTier; -import com.azure.resourcemanager.machinelearning.models.UserAssignedIdentity; -import com.azure.resourcemanager.machinelearning.models.WorkspaceUpdateParameters; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class WorkspaceUpdateParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkspaceUpdateParameters model = - BinaryData - .fromString( - "{\"tags\":{\"yqduujit\":\"mgxsab\",\"rwpdappdsbdkvwrw\":\"jczdzevndh\"},\"sku\":{\"name\":\"eusnhutj\",\"tier\":\"Premium\",\"size\":\"rl\",\"family\":\"ugjzzdatqxhocdge\",\"capacity\":1293628182},\"identity\":{\"principalId\":\"1766dab0-b6cc-422f-8a7a-5b439fec6fab\",\"tenantId\":\"31064613-1bc8-43cc-a67e-db3b41e6f75c\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"dvkaozw\":{\"principalId\":\"47285ad5-2fb1-4802-9800-ef15b64c9005\",\"clientId\":\"3461706a-d43b-4f70-a1e5-f37623e988fb\"},\"tyhxhurokft\":{\"principalId\":\"141163eb-a84e-4057-876d-ef2ca332a35a\",\"clientId\":\"61aace7e-3ef4-41e3-a5f3-cb34b3814d76\"},\"lniwpwcukjfkgiaw\":{\"principalId\":\"d961710b-4bea-4db4-ae21-054935aa3b87\",\"clientId\":\"52a95018-46dd-4fa9-860b-f8dafc12a373\"},\"ryplwckbasyypn\":{\"principalId\":\"14d938eb-6659-4bd4-b080-10c086f54a8e\",\"clientId\":\"a92d70a9-dbe7-4b71-a2b5-0096f3797152\"}}},\"properties\":{\"description\":\"sgcbac\",\"friendlyName\":\"ejk\",\"imageBuildCompute\":\"ynqgoulzndlikwyq\",\"serviceManagedResourcesSettings\":{},\"primaryUserAssignedIdentity\":\"ibmadgakeqsrxy\",\"publicNetworkAccess\":\"Disabled\",\"applicationInsights\":\"e\",\"containerRegistry\":\"ytb\"}}") - .toObject(WorkspaceUpdateParameters.class); - Assertions.assertEquals("mgxsab", model.tags().get("yqduujit")); - Assertions.assertEquals("eusnhutj", model.sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.sku().tier()); - Assertions.assertEquals("rl", model.sku().size()); - Assertions.assertEquals("ugjzzdatqxhocdge", model.sku().family()); - Assertions.assertEquals(1293628182, model.sku().capacity()); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("sgcbac", model.description()); - Assertions.assertEquals("ejk", model.friendlyName()); - Assertions.assertEquals("ynqgoulzndlikwyq", model.imageBuildCompute()); - Assertions.assertEquals("ibmadgakeqsrxy", model.primaryUserAssignedIdentity()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); - Assertions.assertEquals("e", model.applicationInsights()); - Assertions.assertEquals("ytb", model.containerRegistry()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkspaceUpdateParameters model = - new WorkspaceUpdateParameters() - .withTags(mapOf("yqduujit", "mgxsab", "rwpdappdsbdkvwrw", "jczdzevndh")) - .withSku( - new Sku() - .withName("eusnhutj") - .withTier(SkuTier.PREMIUM) - .withSize("rl") - .withFamily("ugjzzdatqxhocdge") - .withCapacity(1293628182)) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf( - "dvkaozw", - new UserAssignedIdentity(), - "tyhxhurokft", - new UserAssignedIdentity(), - "lniwpwcukjfkgiaw", - new UserAssignedIdentity(), - "ryplwckbasyypn", - new UserAssignedIdentity()))) - .withDescription("sgcbac") - .withFriendlyName("ejk") - .withImageBuildCompute("ynqgoulzndlikwyq") - .withServiceManagedResourcesSettings(new ServiceManagedResourcesSettings()) - .withPrimaryUserAssignedIdentity("ibmadgakeqsrxy") - .withPublicNetworkAccess(PublicNetworkAccess.DISABLED) - .withApplicationInsights("e") - .withContainerRegistry("ytb"); - model = BinaryData.fromObject(model).toObject(WorkspaceUpdateParameters.class); - Assertions.assertEquals("mgxsab", model.tags().get("yqduujit")); - Assertions.assertEquals("eusnhutj", model.sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.sku().tier()); - Assertions.assertEquals("rl", model.sku().size()); - Assertions.assertEquals("ugjzzdatqxhocdge", model.sku().family()); - Assertions.assertEquals(1293628182, model.sku().capacity()); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("sgcbac", model.description()); - Assertions.assertEquals("ejk", model.friendlyName()); - Assertions.assertEquals("ynqgoulzndlikwyq", model.imageBuildCompute()); - Assertions.assertEquals("ibmadgakeqsrxy", model.primaryUserAssignedIdentity()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); - Assertions.assertEquals("e", model.applicationInsights()); - Assertions.assertEquals("ytb", model.containerRegistry()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesDeleteMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesDeleteMockTests.java deleted file mode 100644 index da29450819255..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesDeleteMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class WorkspacesDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.workspaces().delete("f", "huwzbxpcqzgi", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListOutboundNetworkDependenciesEndpointsWithResponseMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListOutboundNetworkDependenciesEndpointsWithResponseMockTests.java deleted file mode 100644 index e7f07d55c9f21..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesListOutboundNetworkDependenciesEndpointsWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import com.azure.resourcemanager.machinelearning.models.ExternalFqdnResponse; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class WorkspacesListOutboundNetworkDependenciesEndpointsWithResponseMockTests { - @Test - public void testListOutboundNetworkDependenciesEndpointsWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"value\":[{}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ExternalFqdnResponse response = - manager - .workspaces() - .listOutboundNetworkDependenciesEndpointsWithResponse( - "ffffg", "uhznwhvuldbk", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesResyncKeysMockTests.java b/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesResyncKeysMockTests.java deleted file mode 100644 index 3b0b7388c4bda..0000000000000 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/src/test/java/com/azure/resourcemanager/machinelearning/generated/WorkspacesResyncKeysMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.machinelearning.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.machinelearning.MachineLearningManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class WorkspacesResyncKeysMockTests { - @Test - public void testResyncKeys() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MachineLearningManager manager = - MachineLearningManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.workspaces().resyncKeys("ygzqpjoisfmn", "ybdjnxumentq", com.azure.core.util.Context.NONE); - } -}